Skip to content

Viewer: no selection outlines while walking, project name in preview, show-only scene theme - #983

Merged
wass08 merged 2 commits into
mainfrom
fix/viewer-walkthrough-selection-preview-name
Sep 30, 2026
Merged

wass08 merged 2 commits into
mainfrom
fix/viewer-walkthrough-selection-preview-name

Conversation

@wass08

@wass08 wass08 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Three small viewer fixes/additions:

  1. No selection outlines during walkthrough (live scenes). The default SelectionManager kept routing hover and click through building → level → zone while walking. Pointer lock keeps raycasting from the frozen cursor, so whole levels and zones got outlined. SelectionManager now ignores node enter/leave/click and pointer-missed while walkthroughMode is on, mirroring what GlbScene already does for baked scenes. Door and interactable highlights still work, because FirstPersonControls sets hoveredId itself.
  2. Project name in the editor's Preview. PreviewStage mounted ViewerOverlay without a name, so the header showed "Untitled". Editor gets a projectName prop that is passed through.
  3. showSceneTheme(id | null) on the viewer store. sceneTheme stays the one value every renderer reads. A new savedSceneTheme is the user's pick and the only one persisted. Hosts can open a page in its own theme without overwriting the visitor's saved preference. Community uses this for Halloween contest entries (night).

How to test

  1. Open a live (non-baked) scene in a viewer, enter walkthrough, move and click. There are no building/level/zone outlines, and doors still highlight.
  2. In the editor, click Preview. The top-left header shows the project name.
  3. bun test packages/viewer/src/store/use-viewer.test.ts: a shown theme renders without replacing the saved one, and picking a theme while one is shown saves the pick.

Screenshots / screen recording

Preview header verified locally (shows the project name). I could not drive the walkthrough check under pointer lock from automation, so it still needs a manual pass.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

🤖 Generated with Claude Code

https://claude.ai/code/session_01VMczFMfWJtZDbBdTARy88m


Note

Low Risk
Localized UX and preference-layer changes; walkthrough gating mirrors existing baked-scene behavior and theme persistence is covered by new unit tests.

Overview
Three viewer/editor tweaks: walkthrough no longer drives building/level/zone selection outlines, editor preview shows the host project name, and scene themes can be shown temporarily without overwriting saved preferences.

During walkthroughMode, SelectionManager skips hover, click, and empty-canvas deselect routing so pointer-locked raycasts do not outline whole levels/zones; first-person interactable highlights are unchanged.

Editor accepts optional projectName and passes it through PreviewStage to ViewerOverlay so preview is not stuck on “Untitled”.

The viewer store adds savedSceneTheme (persisted user pick) and showSceneTheme(id | null) to render a temporary theme and restore the saved one when cleared; setSceneTheme updates both. Persistence now writes savedSceneTheme only, with merge logic to hydrate it from legacy sceneTheme.

Reviewed by Cursor Bugbot for commit 55f66e1. Bugbot is set up for automated code reviews on this repo. Configure here.

wass08 and others added 2 commits September 30, 2026 12:12
…t name in editor preview

The default SelectionManager kept routing hover/click through building/level/zone
while walking (pointer lock keeps raycasting from the frozen cursor), outlining
whole levels on live scenes. GlbScene already gates on walkthroughMode; mirror it.

Editor preview mounted ViewerOverlay without a project name, so the header fell
back to 'Untitled'. Add an Editor projectName prop and pass it through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMczFMfWJtZDbBdTARy88m
sceneTheme stays the one value every renderer reads; savedSceneTheme is the
user's pick and the only one persisted. showSceneTheme(id) lets a host open a
page in its own mood (a contest entry at night) and showSceneTheme(null)
returns to the saved theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMczFMfWJtZDbBdTARy88m
@pascal

pascal Bot commented Sep 30, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: a8e120df-764a-4479-ba84-e147504d909e

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 55f66e1. Configure here.

}

const onLeave = (event: NodeEvent) => {
if (useViewer.getState().walkthroughMode) return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Walkthrough leaves leftover hover outlines

Medium Severity

Walkthrough gating ignores enter and leave but never clears an existing hoveredId. OutlinerSync still outlines that id, so a building, level, or zone hovered before Walk can stay outlined for the whole walkthrough unless an interactable overwrites it.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 55f66e1. Configure here.

@wass08
wass08 merged commit b931599 into main Sep 30, 2026
3 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.

1 participant