Skip to content

refactor(web): pull requests Cmd+F focuses the topbar search directly - #26045

Merged
juliusmarminge merged 1 commit into
mainfrom
effect/split-a3-pr-search-focus-token
Oct 27, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
effect/split-a3-pr-search-focus-token

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

Problem

When the Pull requests header is condensed (scrolled), Cmd/Ctrl+F reached the topbar search through a counter in state. The keydown handler bumped searchFocusToken, passed it to ExpandableSearch as focusToken, and an effect there compared it against an appliedFocusToken ref to focus and select the input. The event became state, and an effect turned it back into an event.

Change

The keydown handler focuses and selects the topbar input directly, through a ref on the topbar search wrapper. The non-condensed branch already does this for the in-flow input. When the topbar search is closed it has no input yet: setSearchOpen(true) mounts one, and the existing open effect focuses it (select on an empty value does nothing). The searchFocusToken state, the focusToken prop, the appliedFocusToken ref and the token effect are removed. The query is scoped to the wrapper around ExpandableSearch, so it can't match the in-flow copy of the search input in the page body.

setSearchOpen(true) still runs on every condensed Cmd+F, as it did before.

What this improves

  • Sync removed: one state-to-effect event relay (state, prop, ref and effect).
  • Renders avoided: Cmd+F with the topbar search already open no longer re-renders the column, because setSearchOpen(true) bails out when the value is unchanged. Before, the token bump caused one re-render per press.
  • No bug fix is claimed, so there is no regression test. No behavior changes: focus and select land in the same input in every case (closed, open, or kept mounted by a value).

Effects

  • apps/web/src/components/pullRequest/PullRequestsColumn.tsx: 5 -> 4. The focus-token effect is removed. The window keydown listener, the IntersectionObserver, the open-focus effect and the condensed-to-in-flow focus handoff stay, because each synchronizes with the DOM.

Verification

  • vp run check:changed: format, lint, knip 1/2, knip 2/2 and typecheck (2 packages) all pass.
  • This file has no tests, and none were added (no bug fix).

Model: Claude Opus 5.5, Claude Code harness.

🤖 Generated with Claude Code

The condensed Pull requests header passed each Cmd/Ctrl+F press down to
ExpandableSearch as a counter in state (searchFocusToken), and an effect in
the child watched that counter to focus and select the input. The keydown
handler already focuses the in-flow input directly; the condensed path now
does the same against the topbar wrapper. When the topbar search is closed,
setSearchOpen(true) mounts the input and the existing open effect focuses it.

Effects: PullRequestsColumn.tsx 5 -> 4 (focus-token effect removed; the
window keydown listener, IntersectionObserver, open-focus and condensed
handoff effects stay because they synchronize with the DOM).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2a4ead2

Macroscope's review found this PR approvable — This localized web refactor removes an intermediate focus-token state relay and scopes direct focus to the condensed topbar search, while preserving the existing focus/select behavior. It introduces no schema, configuration, security, billing, deployment, or static-analysis changes.

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

@github-actions github-actions Bot added the size:S 10-29 changed lines (additions + deletions). label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dc84b09 and 2a4ead2.

Files selected for processing: 1
  • apps/web/src/components/pullRequest/PullRequestsColumn.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

The pull request column now focuses search when it opens. Cmd/Ctrl+F opens condensed search and focuses and selects its input. In-flow search also remains focusable and selectable through the shortcut.

Changes: Pull request search

Layer / File(s) Summary
Search focus and shortcut handling
apps/web/src/components/pullRequest/PullRequestsColumn.tsx
ExpandableSearch no longer uses a focus token or selects text when it opens. Cmd/Ctrl+F opens condensed search and focuses and selects the input in the relevant search container.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to 2a4ea

The search-focus refactor preserves the described open and in-flow focus behavior.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the problem, implementation, effects, and verification. It does not complete the required Scope and approval section, and it does not provide the required before/after UI scre… Add the triaged issue or maintainer approval link and comment, or explain why this focused refactor qualifies for an exemption. Add clear before/after screenshots for the UI change, include a recording if needed to demonstrate the interacti…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: direct Cmd/Ctrl+F focus of the topbar search in the pull requests view.
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.
Full details: Description check

Explanation

The description explains the problem, implementation, effects, and verification. It does not complete the required Scope and approval section, and it does not provide the required before/after UI screenshots or state any manual UI check results.

Resolution

Add the triaged issue or maintainer approval link and comment, or explain why this focused refactor qualifies for an exemption. Add clear before/after screenshots for the UI change, include a recording if needed to demonstrate the interaction, and document any manual checks and observed results.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@juliusmarminge
juliusmarminge merged commit 21762b5 into main Oct 27, 2026
30 checks passed
@juliusmarminge
juliusmarminge deleted the effect/split-a3-pr-search-focus-token branch October 27, 2026 18:19
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 28, 2026
## What's Changed
* fix(mobile): center Android sheets and fit book-mode sheets in the left pane by @PixPMusic in pingdotgg/t3code#18492
* fix(mobile): keep the collapsed Android rail square by @PixPMusic in pingdotgg/t3code#26039
* fix(web): closing the last Browser tab hides the right panel again by @juliusmarminge in pingdotgg/t3code#26058
* refactor(web): pull requests Cmd+F focuses the topbar search directly by @juliusmarminge in pingdotgg/t3code#26045
* refactor(web): install draft model reconciliation at app start by @juliusmarminge in pingdotgg/t3code#26046
* perf(mobile): project favicons mount their image in one commit by @juliusmarminge in pingdotgg/t3code#26047
* refactor(web): the upload queue alone records finished file uploads on drafts by @juliusmarminge in pingdotgg/t3code#26050
* feat(mobile): Usage uses the width on iPad and unfolded phones by @juliusmarminge in pingdotgg/t3code#26061
* fix(gitcafe): PR panel follows renumbered pull requests by @juliusmarminge in pingdotgg/t3code#26079
* chore(infra): bump Alchemy to 2.0.0-beta.84 by @juliusmarminge in pingdotgg/t3code#26057
* refactor(mobile): stop writing the resolved project filter back from an effect by @juliusmarminge in pingdotgg/t3code#26049
* fix(mobile): a pairing link fills the open Add environment form instead of stacking another by @juliusmarminge in pingdotgg/t3code#26052
* fix(mobile): snooze menu times advance with the clock by @juliusmarminge in pingdotgg/t3code#26043
* fix(clients): prompt links find projects cloned from git.cafe by @juliusmarminge in pingdotgg/t3code#26042
* fix(server): retry Codex capacity failures with empty input by @Yash-Singh1 in pingdotgg/t3code#25611
* fix(server): recover handoffs when target context is exhausted by @Yash-Singh1 in pingdotgg/t3code#25610
* fix(web): chips drop their pill and stay readable on every theme by @flamboh in pingdotgg/t3code#25066
* fix(mobile): switching pull request tabs no longer jumps the page by @flamboh in pingdotgg/t3code#26064
* feat(mobile): report crashes to Axiom with symbolicated stacks by @gabrielelpidio in pingdotgg/t3code#19093
* fix(web): chip palette test follows the single design by @juliusmarminge in pingdotgg/t3code#26131
* feat(server): /mcp narrows a client's modes from T3-Mode-Limit by @juliusmarminge in pingdotgg/t3code#16653
* feat(server): t3_thread_launch takes clientRequestId by @juliusmarminge in pingdotgg/t3code#16654
* feat(server): link to another environment by @juliusmarminge in pingdotgg/t3code#16655
* feat(server): agents use linked environments through any T3 tool by @juliusmarminge in pingdotgg/t3code#16684
* feat(server): work a linked environment starts stays within its link by @juliusmarminge in pingdotgg/t3code#16695
* feat(web,mobile): linked environments in Connections by @juliusmarminge in pingdotgg/t3code#16698
* feat(server): delegate_task to a linked environment by @juliusmarminge in pingdotgg/t3code#16719
* feat(server,web,mobile): an agent sets up a link to another environment by @juliusmarminge in pingdotgg/t3code#17129
* feat(server,web,mobile): @-mention a machine, and linked environments become a Labs beta by @juliusmarminge in pingdotgg/t3code#17130
* fix(mobile): dragging a microphone or environment route now saves its new place by @juliusmarminge in pingdotgg/t3code#26096
* feat(web): channel artwork choice on Latest, plus nightly or dev art on any channel by @maria-rcks in pingdotgg/t3code#26138
* feat(mobile): browse ZIP attachments with the shared archive reader by @Bil0000 in pingdotgg/t3code#19463
* fix(server): Claude --settings launch args merge with T3's settings instead of being dropped by @t3dotgg in pingdotgg/t3code#22864
* feat(server,web): see and stop the dev servers a thread started by @t3dotgg in pingdotgg/t3code#22542
* fix(web): composer no longer jumps when a second line is added by @maria-rcks in pingdotgg/t3code#26155
* feat(web,mobile): queued messages show who sent them by @juliusmarminge in pingdotgg/t3code#26159
* fix(preview): agent and browser panel show the same page after a late desktop attach by @t3dotgg in pingdotgg/t3code#22877
* fix(web): pairing, connect, error, and Clerk sign-in surfaces match the app's dialog style by @maria-rcks in pingdotgg/t3code#25281
* fix(server): parallel worktree launches no longer fail on .git/config lock by @juliusmarminge in pingdotgg/t3code#25700
* fix(task-cache): the hook test waits for every flusher it starts by @juliusmarminge in pingdotgg/t3code#26148
* chore(lint): every React effect states its reason at the call site by @juliusmarminge in pingdotgg/t3code#26161
* test(server): the link-card retry test names a new MCP credential by @juliusmarminge in pingdotgg/t3code#26143
* perf(web): stop measuring table cells while replies stream by @t3dotgg in pingdotgg/t3code#26152
* feat(desktop): add a remote server by clicking its t3code://pair link by @t3dotgg in pingdotgg/t3code#24111
* fix(server): agent questions stay answerable after a server restart by @SunkenInTime in pingdotgg/t3code#19229
* chore(lint): the effect lint error walks the alternatives before the suppression by @juliusmarminge in pingdotgg/t3code#26181
* fix(web): settings avatar no longer hugs the modal corner by @t3dotgg in pingdotgg/t3code#26180
* fix(mobile): shared file names can no longer write outside the Android cache by @juliusmarminge in pingdotgg/t3code#26175
* fix(server): repository lookups no longer send GitHub tokens to arbitrary hosts by @juliusmarminge in pingdotgg/t3code#26176
* fix(github): long period runs no longer freeze reference autolinking by @juliusmarminge in pingdotgg/t3code#26177
* fix(mobile): Android diff ellipsis no longer measures text quadratically by @juliusmarminge in pingdotgg/t3code#26174
* fix(server): Codex works again after its app-server is killed by @t3dotgg in pingdotgg/t3code#26188


**Full Changelog**: pingdotgg/t3code@v0.1.4-nightly.20261027.3783...v0.1.4-nightly.20261027.3796

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.4-nightly.20261027.3796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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.

1 participant