Repository navigation
refactor(spotlight): consolidate picker state and UI components - #1843
Merged
Merged
Conversation
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.
Problem
Spotlight duplicates route ownership, row/panel presentation and form plumbing. Parallel layer flags and unreachable flows obscure keyboard ownership, while worktree refreshes can reuse pre-mutation requests. Compact model rows also nest variant actions inside selection buttons, and clone forms do not expose their pending state.
Solution
Consolidate Spotlight ownership and reusable UI boundaries in one cleanup:
The original cleanup and component consolidation share the objective of reducing competing Spotlight state and UI owners. Second-pass audit reports explicitly identify findings still left for follow-up; this PR does not claim to fix every issue recorded there.
Potential risks
Verification
GitHub CI passed on
88234504823f79ced784b56c85c00a9d13adc994: frontend run completed 719 test files, 4,952 tests passed, 1 skipped; typed lint and CodeQL analysis also passed. All active PR checks passed; Rust jobs were correctly skipped.Local verification:
pnpm test src/features/SessionCreator/components/WorkItemPickerModal/WorkItemPickerModal.test.ts src/features/SessionCreator/variants/ChatPanel/WorkItemAttachmentControl.test.ts src/scaffold/GlobalSpotlight src/hooks/keyboard— 67 files, 325 tests. Covers root/child keyboard ownership and retargeting, deferred focus, stale responses and worktree invalidation, registered commands, independent row actions, directory hover, organization guide anchors, field labels/help, folder selection/cancellation, native submit and clone busy/concurrency behavior.pnpm typecheck:fast— full project passed; normal commit-hook typecheck also passed.pnpm check:i18n-keys— zero new findings; four unused keys removed consistently across locales.NODE_OPTIONS=--max-old-space-size=6144 pnpm check:typed-lint— 1,086 existing findings, zero new or increased findings. No lint baselines or suppressions changed.git diff --name-only -z origin/develop > /tmp/spotlight-ci-pathsfollowed bynode scripts/ci/run-unit-tests.mjs < /tmp/spotlight-ci-pathsselected 719 files. 717 passed; two consumer suites exposed seven stale wrapper-click assertions. Both corrected suites pass in the 325-test focused rerun above, now activating the shared Button and preserving selection/refresh/focus/disabled assertions.git diff --name-only -z --diff-filter=ACMR origin/develop...HEAD -- '*.ts' '*.tsx' | xargs -0 pnpm exec eslint --max-warnings 0 --report-unused-disable-directives— 105 changed TypeScript files passed.git diff --name-only -z --diff-filter=ACMR origin/develop...HEAD -- '*.ts' '*.tsx' | xargs -0 pnpm exec oxlint -c .oxlintrc.json --max-warnings 0— passed; normal lint-staged hooks also passed.pnpm check:boundaries— 8,263 modules, zero new forbidden edges.pnpm check:test-placement— consistent across 585 directories.git diff --name-only -z --diff-filter=ACMR origin/develop...HEAD -- '*.ts' '*.tsx' | node scripts/ci/check-changed-file-length.cjs— all 86 changed production TypeScript files within 700 lines.git diff origin/develop...HEAD --check— passed.Native UI, real GitHub requests, CPU/RSS measurements and Rust checks were not run for the reasons above; Rust was not changed. The branch starts at the latest fetched develop commit. Both commit author and committer are Chloe-JY.
Audit