Skip to content

Improve UI test coverage, fix scene transition bug, add cloud session setup#69

Merged
vicplusplus merged 9 commits intomainfrom
claude/nav-coverage-and-scene-fix
Apr 8, 2026
Merged

Improve UI test coverage, fix scene transition bug, add cloud session setup#69
vicplusplus merged 9 commits intomainfrom
claude/nav-coverage-and-scene-fix

Conversation

@vicplusplus
Copy link
Copy Markdown
Owner

@vicplusplus vicplusplus commented Apr 8, 2026

Summary

  • Overhaul NavigationCoverageTests with state-based validation. Each scene declares its possible UI states (loading, playing, modal-open, etc.) with expected navigable and background buttons. Per-state tests verify visible buttons match exactly; per-scene tests verify every UXML button is navigable in at least one state. Adding a button to UXML without wiring it into a state declaration fails the test.

  • Add CSS resolution smoke tests. Verifies that every CSS hidden class (screen--hidden, modal--hidden, lb--hidden, victory--hidden) actually resolves to display: none in each document that uses it. Would have caught the bug from Fix empty modal blocking game loading screen #67. Also tests responsive CSS selectors (leaderboard compact mode).

  • Fix leaderboard back button returning to stale game scene. Victory → Leaderboard was using SceneNav.Push, stacking Leaderboard on top of the finished Game scene. Changed to SceneNav.Replace so Leaderboard takes Game's stack position. Replaced the Reset("MainMenu") workaround in OnBack() with a proper Pop().

  • Add SceneNavStack with unit tests. Extracts pure stack logic from SceneNav into a testable domain class. 15 EditMode tests model every real user flow through the scene graph, including a regression test for the stale-game-scene bug.

  • Auto-generate missing .meta files in pre-commit hook. Instead of just erroring, the hook now generates and stages .meta files for new assets automatically.

  • Add SessionStart hook for cloud sessions. Installs .NET SDK, restores CSharpier, and configures git hooks path. Runs asynchronously so it doesn't block session startup.

Test plan

  • Run NavigationCoverageTests — 18 state tests + 6 coverage tests
  • Run CSSResolutionTests — 12 CSS resolution + responsive tests
  • Run SceneNavStackTests — 15 scene transition flow tests
  • MainMenu → Leaderboard → Back returns to MainMenu
  • MainMenu → SizeSelect → Game → Victory → View Leaderboard → Back returns to SizeSelect
  • MainMenu → Continue → Victory → View Leaderboard → Back returns to MainMenu
  • New cloud session has dotnet, CSharpier, and git hooks configured

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM

claude added 8 commits April 8, 2026 19:09
Replace button-existence checks with state-based navigation coverage
that validates every UXML button is keyboard-navigable in the correct
UI state. Each scene declares its possible states (loading, playing,
modal-open, etc.) with expected navigable and background buttons.

Per-state tests verify:
- Every navigable button exists and is visible
- Every background button exists and is visible
- No other visible button is uncovered

Per-scene tests verify:
- Every named Button in the UXML is navigable in at least one state

Adding a button to UXML without wiring it into a state declaration
now fails the test. This would have caught the screen--hidden CSS bug
where the leave-modal was visible during loading.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
VictoryController.OnViewLeaderboard() was using SceneNav.Push, which
stacked Leaderboard on top of the finished Game scene. Popping
Leaderboard returned to the dead post-victory Game scene, softlocking.

Fix: Use SceneNav.Replace so Leaderboard takes Game's position in the
stack. Popping now returns to the scene that launched Game (Size Select
or MainMenu). Leaderboard.OnBack() can now use a simple Pop() instead
of the Reset("MainMenu") workaround that was force-reloading MainMenu.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
Extract pure stack logic from SceneNav into SceneNavStack (Domain layer)
so transition sequences can be unit-tested without loading real scenes.
SceneNav delegates to SceneNavStack for all stack operations.

Tests cover every real user flow through the scene graph: Play, Continue,
Quick Reset, Victory → Menu, Victory → Leaderboard → Back, and nested
Replay paths. Includes a regression test documenting the Push-vs-Replace
bug that caused the stale game scene softlock.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
CSSResolutionTests verifies that every CSS hidden class (screen--hidden,
modal--hidden, lb--hidden, victory--hidden) actually resolves to
display:none in each UXML document that uses it. This catches the exact
class of bug where a hidden class is used in a document that doesn't
import the stylesheet defining it.

Also tests responsive CSS selectors: leaderboard compact mode hides
inline fav/play buttons when lb-screen--compact is applied, and
documents the compact width threshold across standard aspect ratios.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
Add .meta files for SceneNavStack.cs, SceneNavStackTests.cs, and
CSSResolutionTests.cs. Update pre-commit hook to auto-generate and
stage missing .meta files instead of just erroring.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
Installs .NET SDK 10.0, restores CSharpier via dotnet tool restore,
and configures git hooks path. Runs only in remote (cloud) sessions.
Ensures formatting checks and meta file generation work from first
commit in any new session.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
Runs dotnet/CSharpier install in background while the session starts,
reducing startup latency. The container state is cached after install
completes so subsequent sessions are instant.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
@vicplusplus vicplusplus changed the title Overhaul navigation coverage tests and fix scene transition bug Improve UI test coverage, fix scene transition bug, add cloud session setup Apr 8, 2026
UIState was private but used as a parameter in public test methods,
causing CS0051. Changed to public.

https://claude.ai/code/session_01E9ALXb2KD15KiKgivSPZjM
@vicplusplus vicplusplus merged commit 66e21ba into main Apr 8, 2026
4 checks passed
@vicplusplus vicplusplus deleted the claude/nav-coverage-and-scene-fix branch April 8, 2026 21:29
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.

2 participants