Repository navigation
Stop the New workspace field reopening after a search - #260
Merged
Merged
Conversation
Before: Space options > New workspace bumped a counter that was never reset. A page search unmounts the notes tree, so clearing the search remounted it, the tree saw the old request again and opened an empty, focused "New workspace name" field. Typing landed there, and clicking away made another workspace. After: the request is a flag that SpaceView clears as soon as the tree opens the field, the same way it already consumes "Open notes" focus requests, so a remount has nothing to replay. A new e2e case makes a workspace, searches, clears the search and checks the field stays closed and typing stays in the search box. Part of #241. Coven-Harness: Claude Code / claude-opus-5-5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coven-Harness: Claude Code / claude-opus-5-5
# Conflicts: # docs/status.md
This branch was successfully 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.
Part of #241 (finding 9: New workspace re-opens after a remount).
Probe
The notes tree comes back with an empty, focused "New workspace name" field. Keystrokes go into it, and clicking away makes another workspace.
The cause:
SpaceViewasked for the field by bumping anewWorkspacecounter that was never reset. A search unmountsNotesTreeView, and when it mounts again its effect sees a non-zero counter and opens the field again.Fix
newWorkspaceis now a flag inSpaceView. The tree callsonNewWorkspaceOpenedonce it has opened the field, andSpaceViewclears the flag, so a later remount has nothing to replay. This is howSpaceViewalready consumes the "Open notes" focus request (focusNode/onFocusApplied), whose comment says search unmounts the tree and must not replay old requests. The field's commit and cancel paths are unchanged. The review suggested clearing the request on commit or cancel instead. Clearing it when the field opens has the same effect, because the tree can only unmount after focus has left the field, and leaving the field already commits or closes it. It also needs one callback instead of two.Regression test
e2e/notes-tree.spec.ts› "a search does not reopen New workspace after one was made" makes a workspace, types in the page search and clears it, then checks that:Strayworkspace on diskOn unmodified
mainit fails at the first of these checks (New workspace namecount was 1, expected 0). It passes with the fix.Ran
pnpm build && pnpm testfrom the worktree root: passed, 0 failures (desktop: 1,437 tests, 1,421 pass, 16 skipped; core, worktree scripts, site and store suites all pass)pnpm exec playwright test e2e/notes-tree.spec.ts e2e/space.spec.ts e2e/notes.spec.ts: 16 passedpnpm exec playwright test e2e/sidebar-workspaces.spec.ts(the other New workspace flow, and Open notes remounts): 2 passeddocs/status.mdgets one line under "On main, unreleased".Coven-Harness: Claude Code / claude-opus-5-5