Skip to content

feat(view3d): main view on the PuzlWerk viewer behind a flag (A1) - #78

Merged
wstein merged 4 commits into
mainfrom
feat/main-view-a1-flag
Nov 19, 2026
Merged

wstein merged 4 commits into
mainfrom
feat/main-view-a1-flag

Conversation

@wstein

@wstein wstein commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Package A1 of the main-view migration: the main 3D view (view mode) can show the PuzlWerk viewer behind ?viewer=puzlwerk; the default stays the existing view. Refs #29, docs/viewer-migration-inventory.md (G1, G10 for this view).

Changes

  • cubeDisplayCard.tsx imports the pure flag module statically, keeps the direct lazy import of cubeView3D and loads puzlwerkCubeView as a separate lazy import (only with the flag). The default path has no intermediate chunk (review round 1: waterfall fixed).
  • puzlwerkMainView.ts: mainViewerKind (the only flag parser; the dialog choice uses it), shown state (initialCube ?? cube), color frame as hex (U R F D L B).
  • Axis gizmo colors come from the color frame via indicatorColorsFromFrame; a frame change recolors it without rebuilding the stage; data-indicator reports the colors given to the stage.
  • No play, gestures, bars, hint texts or state holder (A2 to A4).

Tests

  • vitest puzlwerkMainView.test.ts, cubeView3DChoice.test.ts: 5 pass; cases ?other=puzlwerk, ?puzlwerk. Mutations: shown state, frame order, !== 'classic', search.includes('puzlwerk'): each fails.
  • e2e main-view-flag.spec.ts: 6 pass (sizes 2, 3, 7, 15 with exact gizmo colors #cf2a3a,#f7f6f1,#1e9e57; recolor on a state with other centers, same canvas; default without viewer request). Mutations: card back to CubeView3D, flag always on, frame not passed, X/Y swap (5 fail), colorKey dropped from the effect deps (1 fails).
  • Full vitest: 47 failed, 2051 passed (the known fixture failures, same as base). typecheck, lint, format:check, typos, git diff --check: 0 findings. e2e viewer-spike, cubeView3D-view: pass locally, 24 of 24 with main-view-flag.
  • Timer test cubeView3D-view.spec.ts:10, 28 runs each, load 5 to 8: base 5 failed, head 8 failed (earlier head run 7; same assertion). Cause not established.
  • Bundle (npm run build), base to head: index 394.32 to 394.96 kB (gzip 136.30 to 136.55), cubeView3D 48.47 to 48.43 kB, cubeView3DChoice 0.89 to 0.86 kB (dialogs only), puzlwerkCubeView 769.61 to 770.24 kB (flag only). index references cubeView3D directly with the same two preloads as base.
  • CI at head: success (test, typos; run 44452838772).

Not verified: real GPU; look acceptance by the owner.

Blocker: none.

No session links.

🤖 Generated with Claude Code

wstein and others added 2 commits November 19, 2026 02:38
Flag parsing (`?viewer=puzlwerk`), the state shown by the static view and the
color frame as hex colors, without importing the viewer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cubeDisplayCard selects the view through MainCubeView: with `?viewer=puzlwerk`
a static PuzlWerk view of the current state (sizes 2-15) with the axis gizmo
colored from the color frame, otherwise the existing view. The viewer is a
dynamic import. Adds an e2e spec for sizes 2, 3, 7 and 15.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@wstein

wstein commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Review: FINDINGS head=14929c19ecc962526c072b5334f903adfc88be8f patch-id=9c1de09039b7e5a3c14238eed2c9744ca68f8e42 pr=78
Round 1, strong tier. Base 876b293 (= main, no merges).
1 medium blocking src/client/cubeDisplayCard.tsx:21: the default path now loads the cubeView3DChoice chunk (preload deps []) and only then cubeView3D; base loaded cubeView3D directly with preloads. One extra serial request on first 3D open, same Suspense fallback, no flicker. Avoidable (import the pure flag module statically and keep the direct lazy cubeView3D); the PR text does not mention it. Fix, or name it with numbers.
2 low nit e2e/main-view-flag.spec.ts:38: gizmo oracle accepts any hex other than the fallback; swapping X/Y in puzlwerkCubeView.tsx:60 survives. Assert #cf2a3a,#f7f6f1,#1e9e57.
3 low nit src/client/view3d/puzlwerkCubeView.tsx:122: recolor on frame change is untested (dropping colorKey survives); named under Not verified.
4 low nit src/client/view3d/cubeView3DChoice.tsx:15: second parser of the same flag beside mainViewerKind; search.includes('puzlwerk') survives the unit test.
5 low nit PR text: "CI result below" has no CI result below.
Checks: typecheck, lint, format:check, typos, build, git diff --check: 0 findings. vitest head 2051 pass/47 fail, base 2048/47, same 47 (LFS). New unit 3/3; base: import fails.
e2e head: main-view-flag 5/5 (base 4 fail, 1 pass), viewer-spike 7/7, cubeView3D-view 11/11. view:10 28 runs each: base 4 fail, head 11 fail, same assertion line 45, load-dependent.
Mutations: unit 10 (8 killed, 1 survivor item 4, 1 equivalent), e2e 7 (5 killed incl. static viewer import and size clip, 2 survivors items 2 and 3).
CI at head: CI success (typos, test; e2e 226 passed). Commits: feat, Co-Authored-By, author = committer = git config, no session links.
Not checked: look acceptance (owner), real GPU, unsupported WebGL in the main view.

wstein and others added 2 commits November 19, 2026 03:38
…the flag once

The card imports the pure flag module statically and keeps the direct lazy
import of cubeView3D; the PuzlWerk view is a separate lazy import. The dialog
choice uses mainViewerKind as its only flag parser.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hange

data-indicator now reports the colors given to the stage. The e2e asserts the
exact X, Y, Z colors of a solved cube and the new colors after a state with
other centers, on the same canvas.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@wstein

wstein commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Review: CLEAR head=ed0412b6cc56fdcbb31220b3b64fa2ceaa4c7991 patch-id=84728d040008d2514f97b47d9a07e125372a45cb pr=78
Round 2 (delta 14929c1..ed0412b), strong tier. Base 876b293 (= main, no merges).
Round 1 item 1 (blocking, waterfall): resolved. Build: index imports cubeView3D directly with the same preload deps as base; same two modulepreload tags in dist/index.html; no viewer code in index (puzlwerkMainView.ts has type-only imports).
Round 1 items 2-5: resolved. Exact gizmo colors; recolor case keeps the same canvas; data-indicator is set only after setOrientationIndicator returns ok; one flag parser.
6 low nit PR text: "CI at head: see checks below" gives no result; CI run 44452838772 is success.
7 low nit commit ed0412b (test) also changes puzlwerkCubeView.tsx (test signal moved into the effect).
Checks: typecheck, lint, format:check, typos, build, git diff --check: 0 findings. vitest head 2051 pass/47 fail, base 2048/47, same 47 (LFS). Unit 5/5.
e2e head: main-view-flag 18/18 (6 x3), viewer-spike 7/7, cubeView3D-view 11/11.
Mutations: unit 3 (all killed: search.includes in both parsers, !== 'classic'); e2e 5 (all killed: X/Y swap 5 fail, colorKey dropped 1, stage rebuilt on frame 1, static viewer import 1, flag inverted 6).
Timer test view:10, 28 runs each, load about 9: base 13 fail, head 10 fail (author 5 vs 8: Fisher p=0.53; mine p=0.59). Same assertion line 45. Cause: the hint is hidden only between the 500 ms and 1000 ms patched timers; toHaveCount(0) polls with backoff and misses that window under load. Not caused by this PR.
Palette: the card always gets the constant STICKER_HEX, so a profile change cannot change the gizmo colors.
CI at head: CI success (typos, test; vitest 2105 passed, e2e 227 passed). Commits: fix/test, Co-Authored-By, author = committer = git config, no session links.
Not checked: look acceptance (owner), real GPU.

wstein commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Cross-project architecture gate — 2026-11-19 (documentation only)

This A1 main-view change is the base of the currently open, non-Draft stack #78 → #79 → #80. Its feature flag keeps the existing view as default, but A2 adds layer play and A3 adds toolbar/interactions; the stack is a main-view integration, not merely the previously authorized read-only inventory or Draft capture-review comparison.

The 2026-11-17 owner decision authorized a Draft M2 migration spike, with separate owner merge/switch-over acceptance and no waiver of the binding Cubistry #21 2×2 Counter M1 acceptance. All five M1 DoD boxes remain unchecked. The 2026-11-18 merge of comparison spike #64 does not by itself authorize the broader A1–A3 main-view merge or make the temporary ?viewer=puzlwerk switch the final architecture.

Before Ready/merge of this stack: record a specific owner decision either accepting complete M1 and separately approving M2, or expressly permitting this bounded, default-off early integration; document owner visual/behavioral acceptance, regression and license/distribution gates. Technical review CLEAR / green CI are not this approval. Final target remains direct @puzlwerk/viewer + shared core-viewer-bridge, with no permanent old/new app switch or duplicate adapter. Preserve existing code, tests, flag and PR status pending a decision.

No implementation, merge, branch or Rust changes were made by this architecture check.

@wstein
wstein merged commit 6095607 into main Nov 19, 2026
2 checks passed
@wstein
wstein deleted the feat/main-view-a1-flag branch November 19, 2026 09:01
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.

1 participant