Conversation
`window.__pascalPerf.history()` returns undo/redo entry counts, whether history is tracking and the refcounted pause depth; `selection()` returns the selection path. Scripted gesture receipts (private bench/next-house, scripts/perf) need both on production builds, where the only store handles are dev-only. Mounted with ?perf only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
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: 2f95f0f7-5d34-41de-919a-b46af5edda24 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This adds two read-only methods to the
?perfscripted probe,window.__pascalPerf. The probe is mounted only when?perfis in the URL.history()returns{ past, future, tracking, pauseDepth }: undo and redo entry counts, whether scene history is recording, and the number of refcounted pause owners (pauseSceneHistoryand leases). A directtemporal.pause()shows astracking: falsewithpauseDepth: 0. That is the signature of the unbalanced item-move pause that building-fidelity A-12 fixes.selection()returns{ buildingId, levelId, zoneId, selectedIds }.Why: the private gesture receipts measure undo entries per gesture and whether history stays paused while an item is carried. Today they can only read those through dev-only store handles, so they cannot run against
next start. This hook lets them. The logic is inlib/perf-probe-state.ts, with unit tests.Nothing changes for the house: this is measurement only.
How to test
bun run --cwd packages/viewer test: 368 pass, 0 fail (3 new inperf-probe-state.test.ts).?perfand run__pascalPerf.history()in the console. Move a wall, then run it again:pastincreases.Checklist
bun check: 2479 files, no fixes.check-typesfor@pascal-app/viewerpasses. The workspace-wide run fails only inapps/editoron the missing optional@webxr/pluginmodule in this local checkout. That failure also happens without this change.mainbranch.🤖 Generated with Claude Code
Note
Low Risk
Read-only instrumentation behind the existing
?perfgate; no changes to scene history, selection, or viewer behavior.Overview
Adds
history()andselection()to the URL-gatedwindow.__pascalPerfprobe so scripted gesture receipts can read undo/redo counts, history tracking/pause state, and the current selection on production builds without dev-only store handles.The logic lives in new
perf-probe-state.ts:history()reportspast,future,tracking, and refcountedpauseDepth(viagetSceneHistoryPauseDepth), distinguishing directtemporal.pause()frompauseSceneHistory;selection()returns building/level/zone IDs and a copiedselectedIdsarray.perf-monitor.tsxwires both into the existing probe object; unit tests cover pause semantics and selection immutability.Normal sessions are unchanged—the probe still mounts only with
?perf.Reviewed by Cursor Bugbot for commit 3314d8f. Bugbot is set up for automated code reviews on this repo. Configure here.