Skip to content

fix(web): restore parent queries after nested search - #12873

Closed
saphid wants to merge 3 commits into
pingdotgg:mainfrom
saphid:fix/consistency-search-return
Closed

saphid wants to merge 3 commits into
pingdotgg:mainfrom
saphid:fix/consistency-search-return

Conversation

@saphid

@saphid saphid commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Returning from nested command-palette pickers restores the parent query. Palette-origin file/content search restores its command query and linked-thread context on Escape. Visible Back also focuses the retained input so typing and keyboard navigation can resume.

Fresh invocations, direct intents, successful navigation and closing discard obsolete return state. Snapshots crossing an unmount retain query data rather than old action callbacks. Main's panel sizing is preserved.

Why

Back previously discarded the search that led into a picker. Keeping one parent query per nested level makes the return path useful. Exact highlighted-result restoration is not claimed: the existing first-enabled-result behavior remains. Web and Electron share this path; native palettes retain their existing fresh-open behavior.

The separate proposal #12681 is not included. Tracking: #142.

Verification

Integrated upstream main at 35be904. All 39 CommandPalette logic tests passed. Web typecheck, scoped lint, formatting and contribution whitespace checks passed.

Direct T3 independent review by Codex / GPT-6.1 Sol, high reasoning requested, completed with no actionable findings across the entire four-file contribution. It checked frozen identity, reducers and the input-ref path and inspected parent test receipts; it ran no fresh tests because disk was below the reserve.

UI Changes

Current before/after images and interaction video remain missing. Visible Back followed by typing/arrows/Enter, nested Backspace, child-search Escape, direct intent replacement and close/reopen require an integrated client pass. Source tracing does not prove runtime focus. This PR is not yet proven merge-ready.

Historical September 20 captures show only an earlier theme-picker Backspace return and do not verify the current integration or visible-Back focus repair:

Before: Historical theme-picker return with lost parent query
After: Historical theme-picker return retaining parent query

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included current before/after screenshots for all changed UI
  • I included a video for interaction changes

Implementation, integration and checks: GPT-6 Astra in Codex/T3 Code. Independent source review: GPT-6.1 Sol in Codex/T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 21, 2026
@saphid
saphid marked this pull request as ready for review September 21, 2026 10:24
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 21, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a453b2e

Macroscope's review found this PR approvable — This is a localized command-palette bug fix that restores parent queries and focus across nested navigation while explicitly clearing stale state on fresh interactions. The implementation is covered by focused reducer tests and does not affect schemas, defaults, infrastructure, or sensitive packages.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d964ee3b-ba9c-44a5-bc81-0fd12e34c956

📥 Commits

Reviewing files that changed from the base of the PR and between 912b825 and a453b2e.

📒 Files selected for processing (4)
  • apps/web/src/components/CommandPalette.logic.test.ts
  • apps/web/src/components/CommandPalette.logic.ts
  • apps/web/src/components/CommandPalette.tsx
  • apps/web/src/components/CommandPaletteContent.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The command palette now stores search queries and nested views in reducer-managed state. It restores parent query and linked-thread context when users return from file or content search. Closing the palette and starting fresh navigation clear saved return context.

Changes

Command palette search navigation

Layer / File(s) Summary
Search state and return contracts
apps/web/src/components/CommandPalette.logic.ts
New actions and helpers track parent search context, nested views, queries, and reset behavior.
Palette navigation and search restoration
apps/web/src/components/CommandPalette.tsx, apps/web/src/components/CommandPaletteContent.tsx
The palette uses reducer-managed search state for child searches, Back navigation, restored context, and fresh intents. The content component accepts an input ref and focuses the selected input when the ref changes.
Search return behavior tests
apps/web/src/components/CommandPalette.logic.test.ts
Tests cover query restoration, linked-thread context, and clearing return context on close or fresh navigation.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CommandPalette
  participant reduceCommandPaletteUiState
  participant FilesOrContentOverlay
  participant reduceCommandPaletteSearchState
  CommandPalette->>reduceCommandPaletteUiState: OpenChildSearch with parent context
  CommandPalette->>FilesOrContentOverlay: open file or content search
  FilesOrContentOverlay->>CommandPalette: Escape or Back
  CommandPalette->>reduceCommandPaletteUiState: BackToCommand
  CommandPalette->>reduceCommandPaletteSearchState: initialize query from restored context
Loading

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to a453b

Search restoration uses the expected dialog lifecycle, and no actionable merge-blocking issue remains. Mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a453b

The change preserves navigation context without adding privileges or a new external interface. No authorization bypass was demonstrated, but restored linked-thread results remain actionable and their behavior after environment changes is not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change affects navigation within the current client session and the environment/thread references supplied to the palette. The snapshot carries no credentials or new privilege; downstream data exposure cannot be determined from the inspected navigation path alone.

Trust Boundaries and Controls

  • observed — Same-page event input can supply linked-thread candidates that influence navigation. The chat layout admits authenticated or hosted-static sessions, but the inspected route and layout do not establish per-environment/thread authorization. Preserving a candidate is therefore not evidence that access to its target is authorized or unauthorized.

Resilience and Maintainability Implications

  • observed — Successful file/content selection closes the overlay before invoking the destination action. Combined with reducer cleanup on close, this prevents the return snapshot from being intentionally retained into the successful-navigation path.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring parent queries after nested search.
Description check ✅ Passed The description includes all required sections, explains the change and rationale, documents verification, and identifies the remaining missing current screenshots and interaction video. The incomplet…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp
macroscopeapp Bot dismissed their stale review September 30, 2026 19:38

Dismissing prior approval to re-evaluate a453b2e

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The historical clips show the earlier theme-picker Backspace return. The PR explicitly lacks current proof for visible Back focus and child-search return. Closing under the verification rule. Add current before/after captures and a short recording showing Back followed by typing, arrows and Enter, plus Escape from child search, then request reconsideration.

saphid added a commit to saphid/t3code that referenced this pull request Oct 11, 2026
… there

Back from a nested picker (Backspace or the Back button) and Escape from
file or content search now restore the palette query, and linked-thread
results, that were showing before. Closing the palette, a fresh shortcut,
or a direct intent still starts clean.

Fixes pingdotgg#15936. Replaces pingdotgg#12873.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants