Skip to content

feat(completion): full-height glass panel + liveSolve/review variants + streak/haptics wiring - #1048

Merged
wei18 merged 3 commits into
mainfrom
session/defiant-stork-cq9s
Sep 2, 2026
Merged

wei18 merged 3 commits into
mainfrom
session/defiant-stork-cq9s

Conversation

@wei18

@wei18 wei18 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Rebuilds the shared completion overlay as the G6 full-height Liquid-Glass panel per docs/designs/v3/design.md §3.5/§4.3/§4.4/§6/§6.1.

closes #1023
part of #1014

What changed

Phase A (ea231be):

  • CompletionOverlayScaffold → full-height glass panel (GlassEffectContainer + .glassEffect(.regular)); opaque background deleted — the finished board stays visible behind the glass; accent glow painted BEHIND the glass (§3.5).
  • New pure value types in GameShellUI: CompletionVariant (liveSolve/review), CompletionMotionPlan (M1/M2/M3/M4/M10 table incl. §6 Reduce-Motion fade fallbacks — RM is replace-with-fade, not off), CompletionContext (§3.5's exact 4-row CTA hierarchy incl. the one value-toned "See you tomorrow").
  • All 4 production completion paths in BOTH apps rewired: live overlay = liveSolve; pushed re-view route, Sudoku .completedRedirect, MS .resolved(.completed) = review (no ritual, no rise, no haptic — the "谎报" prohibition).
  • Haptic authority stays on the VM terminal edge (.sudokuWin/.minesweeperWin/.minesweeperExplosion events); the panel never fires haptics; review paths are structurally silent. Existing Sound-section haptics toggle is the only switch (no second setting).
  • Daily "more today?" CTA wiring is real production logic (fetchDailyProgress/onDailyNext closures resolved in each app's composition root).
  • StreakTokens theme group + colorsets (design.md §5.2/§5.3 values); 4 new CTA strings localized ×7 locales.

Phase B (a783d4f):

  • CompletionStreakAdvance (pre→post) + shared CompletionStreakView pips row consuming M3 (0.35s fill + scale bounce) / M4 (numeric slide-replace); visibility gated to liveSolve + success + daily + provider wired — review/practice/loss never show it.
  • makeFetchStreakAdvance providers in both composition roots, computed via the existing DailyStripLogic/week-window machinery (no second streak algorithm).

Docs (131f7b5 + in-B): docs/screen-contracts.md SUD/MS completion-overlay contracts re-anchored to the as-built shape (element inventory, covering behavior, state variants, the #1038 presentation seam #1022's G4 must observe per §4.3).

Design rulings honored

Verification

  • swift test GameShellKit 75/75 · MinesweeperKit 377/377 (full) · SudokuKit green across full + filtered batches (the two documented pre-existing local flakes — swiftpm-testing-helper segfault and the BoardLeaveOrPauseStateTests wall-clock assertion — reproduce on main and pass in isolation).
  • Motion-plan tests: §6 default timings + the 5 explicit RM-fallback assertions + review ⇒ no M10/ritual.
  • 3 named path tests prove each non-live path constructs .review; haptics asserted both directions via FakeSoundPlaying (win = exactly one .success, MS loss = exactly one .error, review = zero events).
  • swiftlint --strict clean on changed files; mise run scan:l10n gate passes (7 locales, fixture in sync).
  • Snapshot churn: old opaque playAgain baseline replaced by 4 CTA-context baselines + 1 streak baseline; MS terminal-overlay baselines re-recorded for the background removal (investigated first — includes one test-harness-only completionHeroSkipsReveal fix).

Outstanding

  • idb interactive pass (board-visible-behind-glass screenshot evidence + iPad review-push spot-check) was interrupted by the usage-limit reset; will be posted as a follow-up PR comment before merge review completes.

🤖 Generated with Claude Code

wei18 and others added 3 commits September 1, 2026 23:21
…#1023 Phase A)

Rebuilds the shared game-completion overlay (CompletionOverlayScaffold) as a
full-height Liquid-Glass panel per docs/designs/v3/design.md §3.5/§4.3/§4.4:
the finished board now stays visible behind the panel instead of an opaque
warm-paper background, with an accent glow painted behind the glass so it
naturally picks up the tint.

New value types in GameShellUI: CompletionVariant (liveSolve vs review),
CompletionMotionPlan (pure M1/M2/M3/M4/M10 animation table incl. Reduce
Motion fallbacks per §6), and CompletionContext (the §3.5 4-row CTA
hierarchy: dailyMoreToday / dailyAllDone / practice / loss). All 4
production completion paths in both apps now pass the correct variant —
only the live overlay plays the win ritual + haptic; the 3 review paths
(pushed re-view route, Sudoku's completedRedirect, MS's
resolved(.completed)) never do, matching the "no false report of a fresh
accomplishment" contract. Haptic authority is unchanged (still fires only
at the VM's terminal-transition edge); the review-variant surfaces hold no
SoundPlaying/HapticPlaying reference at all.

Wires real Daily "more today?" resolution (dailyMoreToday vs dailyAllDone)
at every Daily call site in both apps, via a new fetchDailyProgress
closure mirroring the existing makeDailyReminderPrimer injection shape.

Adds a streak token group (StreakTokens.pipOff) to the Theme protocol +
both apps' palettes + NeutralTheme, ahead of Phase B's streak view.

New/refreshed localized strings (7 locales): "Done", "Next:",
"See you tomorrow", "Try Again".

Co-Authored-By: Claude Fable 5 <[email protected]>
…#1023)

Adds the M3/M4 streak-ritual consumers (design.md §6) Phase A left
unconsumed: a shared CompletionStreakView (pips row + count caption) in
GameShellUI, gated exclusively to (variant == .liveSolve, outcome
success, Daily context) so review/practice/loss paths never show a false
"streak advanced" report. Both apps resolve pre/post streak state via a
new makeFetchStreakAdvance factory that reuses the existing
DailyStripLogic/MinesweeperDailyStripLogic.computeStreak — no second
streak algorithm — and is race-free against the just-finished solve's
async persist by explicitly excluding/including the current puzzleId
from today's completed set rather than depending on write-then-read
timing.

Co-Authored-By: Claude Fable 5 <[email protected]>
…1023

Re-anchors both live completion-overlay screen contracts to the #1023
as-built shape: Liquid-Glass full-height panel (board visible behind),
CompletionContext 4-row CTA hierarchy, streak section, liveSolve/review
state variants, and the #1038 hoisted-presentation seam #1022's G4 must
observe. Element inventories previously documented the pre-#1023
Play-Again/Close-only layout.

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18

wei18 commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

idb interactive acceptance evidence (#1023 criterion: board visible behind the glass)

Fresh builds of both apps from head 131f7b54 (tuist generate + xcodebuild, iPhone 17 Pro sim iOS 26.5 + iPad Pro 11" M5), driven via idb. Screenshots live in the session scratchpad (…/scratchpad/sim-1023/, local — owner can upload any of them on request); the Leader eyeballed the three key frames directly, not thumbnails.

1. liveSolve — Sudoku (the acceptance money shot): PASS. A real practice-Easy board was grid-extracted and solved via 39 correct taps (0 mistakes). Burst capture on the final digit (12-final-t0.png) catches the panel mid-rise (M10) with the solved board fully visible above it and visibly frosted through the rising glass — digit pad and board rows legible through the panel. Settled frames (17-final-settled.png, zoom 17-crop-top.png) confirm the solved board, including highlight cells, stays visible through the full-height glass. Practice CTA context correct ("Play Again" primary + "Close"), Close returns to the Practice hub.

2. liveSolve loss — Minesweeper: PASS. Beginner practice, mine hit (06-ms-boom-settled.png): glass panel with status.error "Boom" hero, "Try Again" primary + "Close", and the mined board visible (blurred) through/around the glass — flagged mines faintly legible behind the frost.

→ This settles the CR MAJOR / sonnet's doubt directly: the flat opaque rectangle in the MS terminal-overlay snapshot is an offline-renderer artifact (headless NSHostingView does not composite Liquid Glass); on a live simulator the real refraction/translucency lands in both apps.

3. review path (seeded -uitest-seed-completed-daily): PASS. Completed-card tap pushes the panel with no rise ritual (fully in place on the first burst frames), no streak replay, correct Daily-all-done CTA ("See you tomorrow" only), Close pops back to the hub (08/09-*.png). The flat background behind the pushed panel is as designed, not a bug — a pushed route has no board behind it to show through (docs/screen-contracts.md SUD-COMPLETION-REVIEW, updated in this PR).

4. iPad regular-width review push: works, layout polish filed as #1049. The push mechanism is correct (detail push, back/Close pop to hub — 20/21-ipad-*.png) but the composition reads as a centered 480pt card in empty space with no chrome. Verified pre-existing: the pre-#1023 opaque scaffold painted the identical full-screen background (no toolbar-hiding code involved); this PR only swapped opaque→glass per D-3.3. Regular-width composition is unruled by design.md §3.5/§4.4 → follow-up #1049.

Not live-verified (covered by tests instead): the daily-win streak pip advance animation (M3/M4) — exercised by CompletionMotionPlanTests + the streak snapshot baseline; a live daily solve was out of scope for this pass. CR MINOR (duplicate test bodies in CompletedRedirectSurfaceTests) deliberately skipped to keep the head SHA stable for T6; can fold into any later touch of that file.

🤖 Generated with Claude Code

@wei18

wei18 commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

T6 ACCEPT — fresh-context acceptance of #1023's criteria against PR head 131f7b54, independent of the dual CR that already passed.

1. Issue #1023 acceptance criteria — mechanically checked, all pass:

  • ✅ swift test GameShellKit full: 75/75 tests, 14 suites, in a throwaway detached worktree at 131f7b54 (no mise trust — swift directly).
  • ✅ swift test MinesweeperKit full (--no-parallel): 377/377 tests, 65 suites.
  • ✅ swift test SudokuKit full (--no-parallel): 449/449 tests, 88 suites — no segfault this run (known local flake per repo memory, avoided via --no-parallel).
  • ✅ Review-variant construction never schedules M10 / fires a haptic — CompletionMotionPlanTests.swift:54 reviewHasNoRiseAndNoRitual() and :64 reviewUnderReduceMotionStillHasNoRitual().
  • ✅ 3 non-live paths each have a path-named test proving .review construction: CompletedRedirectSurfaceTests.swift:54 completedRedirect_constructsReviewVariant(), :64 pushedReviewRoute_constructsReviewVariant() (Sudoku), MinesweeperCompletedRedirectSurfaceTests.swift:44 msResolvedCompleted_constructsReviewVariant() (MS).
  • ✅ Reduce-motion: exactly 5 named assertions matching the M1/M2/M3/M4/M10 fallback table — CompletionMotionPlanTests.swift:27–47 (reduceMotion_M1_accentSeepFallsBackToCrossfade, _M2_heroRevealFallsBackToFadeOnly, _M3_streakPipFallsBackToFillOnly, _M4_streakCounterFallsBackToCrossfade, _M10_panelRiseFallsBackToFadeInPlace).
  • ✅ idb-driven board-visible-behind-glass check — see item 2 below.
  • Haptics both-directions test exists per path (reviewVariantSurfaceHoldsNoAudioOrHapticPlayer in both apps' redirect-surface tests) and ran green in the full suites; not independently re-driven live (out of scope for this pass, already covered by test evidence).

2. idb evidence comment (id 5503492706) — confirmed present, content matches:

  • Read 12-final-t0.png and 17-final-settled.png directly (not thumbnails) from the named local path (…/scratchpad/sim-1023/). Visually confirmed: the solved Sudoku board is legible/blurred through the glass panel in both the mid-rise and settled frames — this is a translucent frosted panel, not a flat opaque rectangle. MS loss claim and review-path no-ritual claim are stated consistently with the rest of the PR's test evidence; pushed-route flat-background rationale matches docs/screen-contracts.md SUD-COMPLETION-REVIEW as updated in this diff.

3. Follow-up issue #1049 — exists, OPEN, scope matches exactly: pre-existing iPad/macOS regular-width centered-card composition for the pushed review route, correctly scoped as unruled by design.md §3.5/§4.4, part of #1014.

4. PR body — closes #1023 + part of #1014 + 🤖 footer present. Docs re-anchor (docs/screen-contracts.md, +85/-… lines) is in the diff.

5. Diff sanity — git diff origin/main...131f7b54 --stat: 51 files changed, 3280 insertions(+), 355 deletions(-) — exact match to the stated scope. No BoardModalOverlayHoist / RootShellView changes present.

No new blockers found. Recommend merge.

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.

feat(completion): full-height glass panel + liveSolve/review variants + streak/haptics wiring

1 participant