Skip to content

Add Main Street Tutorial scenario, non-interactive overlays, smoke test, and fix build#465

Merged
SorraTheOrc merged 30 commits into
mainfrom
copilot/cg-0mm5zgb8u02-create-main-street-scenario
May 16, 2026
Merged

Add Main Street Tutorial scenario, non-interactive overlays, smoke test, and fix build#465
SorraTheOrc merged 30 commits into
mainfrom
copilot/cg-0mm5zgb8u02-create-main-street-scenario

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Implements the "Scenario: Tutorial" Game Selector entry for Main Street with non-interactive tutorial overlays, a deterministic headless smoke test, and fixes a pre-existing build failure.

New files

  • MainStreetTutorialScene — subclass of MainStreetScene with scene key 'MainStreetTutorialScene', Easy difficulty hardcoded, auto-shows tutorial overlays on first load, adds [?] Tutorial HUD toggle button
  • MainStreetTutorialOverlayManager — 7-step non-interactive overlay sequence (Welcome → Market → Incidents → Street Grid → Hand → Action Controls → Scoring). Each step renders a green highlight rect around the relevant UI region + a tooltip with Prev/Next/Dismiss navigation. Never blocks gameplay input.
  • tests/main-street/smoke-scenario.test.ts — 8 headless unit tests using canonical seed "smoke-1": run completion, required summary fields, determinism, Easy-difficulty baseline, and 4 regression seeds

Modified files

  • MainStreetScene constructor now accepts Partial<Phaser.Types.Scenes.SettingsConfig> so subclasses can supply a different Phaser scene key without forking the class
  • main.ts — registers MainStreetTutorialScene and adds "Scenario: Tutorial" Game Selector entry
  • docs/main-street/playtest-scenarios.md — adds Scenario 0 "Tutorial Smoke" documenting the smoke-1 seed, expected outcome, and a guide for authoring/updating tutorial copy
  • README.md — adds Tutorial scenario to the example games table and smoke test commands

Build fix

Removed two unused imports (highestUnlockedTier, CARD_TEMPLATE_NAMES) in tests/main-street/meta-progression.test.ts that were emitting TS6133 errors and causing npm run build to exit non-zero.

Copilot AI linked an issue May 12, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add Main Street scenario and tutorial overlay Add Main Street Tutorial scenario, non-interactive overlays, smoke test, and fix build May 12, 2026
Copilot AI requested a review from SorraTheOrc May 12, 2026 09:53
@SorraTheOrc SorraTheOrc marked this pull request as ready for review May 12, 2026 10:57
@SorraTheOrc
Copy link
Copy Markdown
Member

@copilot the CI tests failed. Fix them

…using transient-tagged removal

Replace hudContainer.removeAll(true) in refreshHud() with a targeted loop that
only destroys children tagged with _hudTransient. The four transient HUD elements
(strip, coinText, repText, scoreText) are tagged via the new markHudTransient()
helper. Persistent overlay objects (HelpPanel, SettingsPanel, buttons) are never
tagged and therefore survive every refresh cycle.

Root cause of the pre-existing SidebarOverlay.browser.test.ts failure:
removeAll(true) was destroying helpPanel.container and settingsPanel.container on
every refresh, setting parentContainer to undefined. The assertion
expect(helpParent).toBe(scene.hudContainer) then failed, and Vitest crashed with
RangeError: Invalid string length when trying to serialize the large Phaser
Container object in the failure message.

Agent-Logs-Url: https://github.com/TheWizardsCode/Tableau-Card-Engine/sessions/0c9ef8cd-e9a7-4a48-98de-f8772edae356

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 12, 2026

@copilot the CI tests failed. Fix them

Fixed in commit 3d1ba81.

Root cause: refreshHud() was calling hudContainer.removeAll(true) on every game refresh, which destroyed the persistent HelpPanel.container and SettingsPanel.container that were added to hudContainer during scene creation. After the first refresh, container.parentContainer became undefined, so the assertion expect(helpParent).toBe(scene.hudContainer) failed and Vitest crashed with RangeError: Invalid string length trying to serialize the Phaser Container in the failure message.

The fix replaces removeAll(true) with a targeted loop that only destroys children tagged _hudTransient = true. The four transient HUD elements (background strip, coin/rep/score texts) are now tagged via a new typed markHudTransient<T>() helper. Persistent overlay objects (HelpPanel, SettingsPanel, buttons) are never tagged and therefore survive every HUD refresh.

Map added 14 commits May 15, 2026 23:40
…nk guard to prevent deep-link asset resolution issues
… by hiding svgDom while overlays visible; improve button layout
…e DOM-rendered cards; keep highlight on canvas
…n possible (prevents obscuring Challenges panel); measure tooltip height for accurate placement
…port INCIDENT_QUEUE_SIZE; clamp widths to avoid log overlap
… compute Challenges highlight height from active challenges
…itles); compute Challenges highlight from challengeContainer bounds when available
…ue when available to match actual UI; fallback to layout-derived sizes
…ttings panel; persist tutorialSeen flag in campaign progress; auto-show on first run; allow replay from Settings
@SorraTheOrc SorraTheOrc merged commit eb5ca98 into main May 16, 2026
1 check 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.

Main Street Scenario & Tutorial

2 participants