Skip to content

fix(3): add fa-craft widget to catalog + jsr goldens - #9

Merged
IstiN merged 7 commits into
mainfrom
fix/3-fa-craft-catalog
Sep 30, 2026
Merged

IstiN merged 7 commits into
mainfrom
fix/3-fa-craft-catalog

Conversation

@vabhzw17eg2qu4m9-bit

@vabhzw17eg2qu4m9-bit vabhzw17eg2qu4m9-bit commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes IstiN/fa_craft#3

Delivered (rework per review)

Widget — reference-style (EXTERNAL), no embedded code. widgets/fa-craft/ is now an overlay exactly like the 2048 / e2e-scratch entries:

  • overlay.json: catalog meta (icon.svg, description, author, tags, minRuntime 0.4.79) + the required source pin {"repo": "IstiN/fa_craft", "commit": "3cc18199603b6d65451027c81f0e411a390e4d90"}.
  • The 16 game modules, the full manifest copy, the entry widget.js and icon.svg are REMOVED from this repo — code lives only in IstiN/fa_craft. dart run bin/fa_widgets.dart fetch materializes the pinned tarball into vendor/external/fa-craft/ (untracked, per the retired-submodule scheme), validation checks the pin marker against the overlay.
  • catalog.json regenerated: source.repo/source.commit pinned, preview.manifest/js → raw.githubusercontent.com/IstiN/fa_craft@3cc1819…/manifest.json + /widget.js, zip fa-craft-0.1.0.zip (sha256 041d3e1a…, byte-stable across rebuilds — verified two identical builds).

Blocks are now visible. The reviewer-visible root cause: the world viewport degraded to a sky fill because the renderer had no voxel host capability (the voxel.* bridge calls could never attach). fa_craft now renders the real world through the production renderer's existing scene3d node — its pure-Dart software meshes path (JsScene3dMeshNode, no host engine needed):

  • per-block checker-tinted faces built from the game's own chunk mesher (world state untouched — these are the production mesher's vertices),
  • player-eye camera + sky-colored background, per frame,
  • whitened highlight shell on the raycast target, computed per render so event-replayed frames (screenshot capture) highlight too.

This is the honest stopgap: real geometry, real renderer nodes, but flat-shaded (no textures/fog) and software-rasterized; the GPU voxel/mesh node upstream to flutter_js_widget_runtime will replace the adapter wholesale. game/* logic untouched apart from computing the raycast target per render.

Goldens — docs/goldens/fa-craft/*.png (7 states), recaptured from the pinned commit through the jsr_widget CLI (js_widget_runtime 0.4.126, --freeze-clock), byte-deterministic: two full captures this session, all 7 PNGs sha-identical run-to-run; catalog zip sha-identical across rebuilds.

file state
01-first-run-world.png spawn horizon: terrain, height steps, sky
02-block-targeted.png look down: checker grid + whitened target highlight
03-block-placed.png break grass+dirt, place dirt back (edits 3)
04-hotbar-switch.png slot 5 selected
05-crafting-open-crafted.png crafting sheet open, bricks crafted
06-health-change.png fall damage 6 → 7/10 hearts
07-saved-world-reload.png seed 777 world: dusk, cube shading, highlight

Regenerating the goldens

From a fa_craft checkout on fix/1-fa-craft-goldens (js_widget_runtime 0.4.126 resolvable; flutter on PATH):

node tools/goldens.js          # capture all 7 states into test/golden/ + print sha256
node tools/goldens.js verify   # drive each state, assert exported state

Test evidence

  • dart run bin/fa_widgets.dart fetch && … validate → 26 widget(s) checked / OK (pin marker == overlay commit).
  • dart analyze clean; dart test 64/64 pass.
  • fa_craft node test/all.js 80/80 (includes scene-adapter ITs: mesh payload identity cached while clean, rebuilt on edits; highlight shell present on target).
  • Catalog zip rebuild determinism: fa-craft-0.1.0.zip sha equal across two catalog builds.

Known issue (upstream, unchanged here)

The HUD root listView + full-bleed stack child crash the production renderer (unbounded sliver height) — worked around in the goldens pipeline only, by unwrapping the single-child listView before the tree reaches the renderer (RENDER_ADAPTER in fa_craft tools/goldens.js; catalog widget.js untouched — the entry now lives in the source repo anyway).

Notes

  • No fork needed — pushed directly (access granted).
  • vendor/external/ + build/ are untracked tooling artifacts, not committed.

Comment thread widgets/fa-craft/game/worldgen.js Outdated
var N = function() { return Facraft.noise; };
var B = function() { return Facraft.blocks; };

var CHUNK_X = 16, CHUNK_Y = 64, CHUNK_Z = 16;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to make reference to your repo as app... not put full code here

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any examples of blocks... texts are squares only

@vabhzw17eg2qu4m9-bit

Copy link
Copy Markdown
Collaborator Author

Acknowledged both threads — rework starting now:

  1. Reference, not embed: converting the fa-craft entry to reference-style (source repo + commit + raw preview URLs, like the 2048 entry) — the 16 game modules come out of this repo.
  2. Blocks visible in examples: agreed — the sky-fill viewport was the disclosed upstream limitation (voxel/mesh node pending). For the example goldens we'll render actual block visuals via existing primitives (per-block boxes at proven object counts) so the states show real blocks, not text squares.
    Updates in this PR shortly.

…aft@3cc1819

The catalog no longer embeds the game: widgets/fa-craft/ is an overlay
(icon.svg, catalog meta, source pin) exactly like the 2048/e2e-scratch
entries; manifest + widget.js + the 16 game modules come from the
pinned upstream commit via 'fa_widgets fetch', and the preview URLs
point at raw.githubusercontent.com/IstiN/fa_craft@3cc1819.

Blocks are now visible in the goldens: fa_craft renders the real world
through the production renderer's scene3d software-mesh node (per-block
checker-tinted faces, raycast target highlight) — all seven example
screenshots recaptured from the pinned commit, byte-deterministic
across runs (frozen clock). catalog.json regenerated; zip sha
041d3e1a… stable across rebuilds.
@vabhzw17eg2qu4m9-bit

Copy link
Copy Markdown
Collaborator Author

Re both review threads (PRRT_kwDOUFUqGM6mx48k, PRRT_kwDOUFUqGM6mx59Y) — rework pushed on fix/3-fa-craft-catalog (7fc9fa6):

1. Reference-style entry — done. widgets/fa-craft/ no longer embeds any game code: the 16 game/* modules, the full manifest copy, the entry widget.js and icon.svg are deleted from this repo. It is now an overlay exactly on the 2048/e2e-scratch pattern: catalog meta + source: {repo: "IstiN/fa_craft", commit: 3cc1819…}, and preview.manifest/js pointing at raw.githubusercontent.com/IstiN/fa_craft@3cc1819…. fa_widgets fetch materializes the pinned tarball; validation passes 26/26 with the pin marker checked against the overlay. Zip sha 041d3e1a… is rebuild-stable (verified two identical builds).

2. Blocks visible — done, via the renderer's existing scene3d software-mesh node. The old viewport was a sky fill because the voxel.* bridge capability doesn't exist in any host. The goldens now show the real world: per-block checker-tinted faces from the game's own chunk mesher, player-eye camera, sky background, and a whitened highlight shell on the raycast target (see 02-block-targeted.png, 07-saved-world-reload.png). No fake imagery — these are the production mesher's vertices drawn by the production renderer; world/logic code untouched apart from computing the raycast target per render. Honest ceiling: it's flat-shaded software rasterization (no textures/fog) — the GPU voxel/mesh node for flutter_js_widget_runtime is the proper replacement and lands upstream; this adapter is built to be swapped wholesale. All 7 goldens recaptured from the pinned commit, byte-identical across two full captures.

@vabhzw17eg2qu4m9-bit

Copy link
Copy Markdown
Collaborator Author

Goldens recaptured with real fonts (same Ahem fix as fa_craft#4 — committed Roboto + FontLoader in the capture harness): docs/goldens/fa-craft/* regenerated from the new pin fa_craft@80047a8575086db7a5741fd826223e9a3f93e2f0; zip sha 7e30f6dc… stable across rebuilds; validate + analyze + dart test 64/64 green. (92cbb9c)

@IstiN
IstiN merged commit ed8ec42 into main Sep 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make PR in Fa Widgets

2 participants