Repository navigation
fix(chat): name why an @-mention file search failed - #10838
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
90ffc2d to
41c3f5c
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS No first-time reader has seen these controls: this fork lane has no blind read. Pushing the branch to this repository would run one. Notes
[UX-REVIEWED] 0e5052d Description read[DESCRIPTION-READ] 8488c748e1e1225fa0f00853dc08c0bf133cfc2ce419aa4c9216f433cd1615d0 That sha256 names everything this verdict read: the PR description, plus the 10 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the change reuses the cause classifier, failure-copy map, retryable set and keyboard hand-off already on Notes
[DESIGN-REVIEWED] 0e5052d Description read[DESCRIPTION-READ] ccca72ceab5aaa26c502cf2fdfc18e7bdfee7001b4f11e8966dcfe35f07e3387 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: every item serves the frozen Goal and no default changes. One new component, Notes
What this change shipsInventory (10 items) — 9 justifiedIntent: when an @-mention file search fails, show which failure it was and offer only the action that can recover it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 0e5052d Description read[DESCRIPTION-READ] d89c044f8af1b7ae50f4280e89e5485f078d8f8391411f2de3fe6237bae22f6e That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 0e5052d |
41c3f5c to
714ce12
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
For the record, the code-level lanes are clean: GPT 5.6 and Opus 4.8 both report no blocking findings, and the branch has no merge conflict of its own. The order of operations is the blocker, not the code. When you've addressed these, the pipeline will re-assess on its next cycle. |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes: this branch still fails to type-check after its prerequisites merge
The red type check on main is already covered above in NicholasRBowers's comment, which blames it on PR #10834 not having merged yet. That no longer explains all of it. At its current head (22b5c95), PR #10834 no longer carries two of the three things this PR imports. Its description says so: "The shared retry affordance (RetryControl) and the two keyboard hand-offs on useListKeyboardNav are not in this PR ... each lands with the surface that calls it." This PR is that surface, and it doesn't add them.
Two problems remain even after every open PR that supplies a piece has merged:
website/src/components/FilePickerMenu.tsx:273and:287passonTabToControlandonEnterToControltouseListKeyboardNav. On main and on PR #10834,UseListKeyboardNavOptionshas onlyopen, count, wrap, onChoose, onClose, onAltEnter, releaseKeysWhenEmpty. No open PR head adds either option.FilePickerMenu.tsx:376renders<RetryControl busy={retrying} controlRef={retryRef} ... />. The onlyRetryControl.tsxin any open PR is in PR #10842. Its signature isRetryControl({ busy, cause, label, onRetry }), and it keeps its button ref private, so there is nocontrolRefprop.
A reviewer merged main + PR #10834 + PR #10842 + this PR. The only conflict was in error-code-baseline.json, which the website build doesn't read. They then ran tsc -p tsconfig.app.json, the first step of npm run build. It still exits 2:
FilePickerMenu.tsx(273,5): TS2353 'onTabToControl' does not exist in type 'UseListKeyboardNavOptions'
FilePickerMenu.tsx(376,7): TS2322 ... Property 'controlRef' does not exist on type '... { busy; cause; label; onRetry }'
Impact: the red PR Readiness check blocks a merge today, so main is safe for now. But the plan in the description ("imports searchErrorCause, RetryControl and the useListKeyboardNav hand-offs added there") no longer works. No merge order of today's PRs makes this branch green, and merging it would break the frontend, wheel and desktop builds.
Smallest fix:
- Add
onTabToControl/onEnterToControltoUseListKeyboardNavOptionsand to the hook's key handling, either here or back in PR #10834. - Reconcile with PR #10842's
RetryControl: add acontrolRefprop there, or adapt this caller to the{ busy, cause, label, onRetry }shape. - Update the "Prerequisite: #10834" line in the description so it says which PR supplies each piece.
From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong.
|
Open-PR triage (origin/main This updates bolichen97's CHANGES_REQUESTED from 2026-09-25. The blocker it names still applies, but the prerequisite picture has changed since then:
Smallest way forward: add I found no breaking change and no P0. The only copy change is Automated open-PR audit; reply here if any of this is wrong. |
714ce12 to
0794b28
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. All three items from my review on 5d547fd are fixed at this head.
Head reviewed: b70b7b1. I compared it with 5d547fd directly: the code change since then is the live region in FilePickerMenu.tsx and one new test.
What changed since 5d547fd:
- Open findings: the three UX items this head already fixes are gone from
## Open findings. The list now holds only items that are still open. - Screenshots: all six image URLs now point at this head's SHA, so the body shows the captures that include the hint row. The PNG files did not change, and they don't need to: the new wrapper adds no visible chrome when there are no hints.
- Live region: the hint row is now one region that is always mounted, with
aria-live="polite". Only its children change, so screen readers announce "won't send yet" when a retry starts. The new test checks that the region exists before the retry, that its text changes during the retry, and that it is the same DOM node afterwards. That is the right way to test this, because a live region that mounts together with its text is often not announced.
Why I am not approving yet: CI on this head is still running. Readiness is checking, two backend test shards are in progress, and PR Readiness is pending. I will approve and enable auto-merge once readiness reports passed on this head and no lane blocks.
Should-fix, not blocking. The description already lists these under Open findings:
website/src/hooks/useListKeyboardNav.ts:75and:84: the JSDoc says EMPTY-list path only, but the hook also calls both options on the non-empty path.website/src/components/FilePickerMenu.tsx:190: the comment aboveplaceholderDatadescribes a throttle ladder that nothing there sets.website/src/test/FilePickerMenu.timeout.test.tsx:191: the 429 test waits on the real backoff. Fake timers would make it faster and deterministic.
My changes-requested review on 714ce12 is out of date. Its two code items were fixed on 442263e and are still fixed here.
b70b7b1 to
ddfe477
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Still looks good to ship. Head reviewed: ddfe477.
I compared it with b70b7b1 directly. Both sit on the same base, so this is a content change, not a rebase:
RetryControlno longer takes alabelprop. It readscomponents.filePickerMenu.retryitself, and the @-menu call site drops the prop. The rendered name is unchanged ("Retry: "), andFilePickerMenuis the only caller, so nothing else is affected.- The synonym-drift test now reads both
FilePickerMenu.tsxandRetryControl.tsx, so it still guards against the old "Try again" key after the move.
Why I am not approving yet: CI on this head is not green. Readiness is action required, PR Readiness is failing, the required lanes for this push were cancelled and have not rerun, and backend test shards are still queued or running. I will approve and enable auto-merge once readiness reports passed on this head and no lane blocks.
The three should-fix notes from my last review (the JSDoc on useListKeyboardNav.ts, the placeholderData comment, and the real-backoff 429 test) are unchanged and still non-blocking.
ddfe477 to
9e5ebd1
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed the change since ddfe477 on head 9e5ebd1. This head is a rebase onto current main plus new content:
- A path-scoped refusal in path mode now names the path instead of the project folder (new
search_denied_path*andcheck_path_inside_projectkeys). - The surviving-rows hint warns that Tab does not pick a row only while an enabled Retry button holds Tab (
showing_earlier_results_tab_skips). - The folder hint now names the project button beside the composer.
The new keys exist in all 13 locale files, and four new tests cover these branches. No new findings.
Approval is still held: the readiness label is readiness: action required, PR Readiness is failing, UX Review reports BLOCK on this head, and the backend test shards plus one frontend shard are still running.
9e5ebd1 to
c268767
Compare
c268767 to
c2915fc
Compare
c2915fc to
50ec3f9
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed the change since 9e5ebd1 on head ab54561. This head is a rebase onto current main plus new content:
- Retry is now withheld whenever rows are still on screen, so Tab keeps picking a row in that case. The rows-retained Tab and Enter hand-off in
FilePickerMenuand its four tests are removed, and theshowing_earlier_results*hints go with them in all 13 locale files. The empty-list hand-off inuseListKeyboardNavis unchanged. - The path-mode refusal hint
check_path_inside_projectnow reads "Pick a different path", and the capture script adds a seventh arm that checks this notice does not mention the project folder.
UX Review moved from BLOCK to CONCERNS on this head, so the earlier UX block is cleared. Its remaining notes (the folder hint naming a chip the user cannot pick out, the send-key text in the alert colour) and the First Principles note on the Retry stack are advisory. No new findings from me.
Approval is still held: the readiness label is readiness: checking, PR Readiness is pending, and the frontend shards, type check, desktop builds, integration and E2E lanes are still running on this head. I will re-check once they finish.
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed head 4a111f7 against ab54561. This push rebases onto current main and changes content:
- The send key promise ("Enter sends the message" / "Ctrl+Enter sends the message") moves out of the failure alert into the muted hint row as its own line. It is only shown when no rows are on screen and the keys are released, so it never claims a key that picks a row or that the retry window has swallowed. The eight combined
*_enter_sendskeys are gone in every locale, replaced by two standalone keys. - The path refusal copy no longer needs its own ctrl/enter variants; one
search_denied_pathkey remains. - The failure notice is built once and reused for both the empty and surviving rows branches, which removes the duplicated markup.
- The folder hint now reads "Click the folder name below the message box to change it", and the captures assert the alert carries no send key line.
No new findings on this delta. Approval is still held for maintainer gates, not code: the readiness label is "action required", the PR Readiness status reports one blocking item, and the backend test shards are still running on this head.
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed head 29de45c against 4a111f7 (same base). The change since then: the @-menu now spreads the shared SEARCH_FAILURE_KEYS and overrides only denied and root_missing, the menu's own search_timed_out and search_failed keys are removed from all 13 catalogs, tests and the capture script now expect "Search timed out" and "Search failed", and a new test pins that the menu borrows the shared copy. I checked that no reader of the removed keys remains on this head. No new findings.
Approval is still held on maintainer gates: the readiness label is readiness: action required, PR Readiness reports 1 blocking item, SAST (Semgrep) was cancelled and needs a rerun, and backend test shards are still running. The needs-author-decision label is also still set. Sensitive Change Review, Inclusive Language and PR Hygiene are green on this head.
bolichen97
left a comment
There was a problem hiding this comment.
Thanks for the rebase. Head reviewed: 18291d0d0b7c89ff6587c1a86c7e330075f5c7f5.
What changed since 29de45c: the branch now sits on current main with no conflict, and FilePickerMenu.tsx uses main's OverlayPortal and hoverSelect. The capture script lost a few comments. Range-diff shows no other change to the PR's own hunks. SAST (Semgrep) is green on this head.
Two findings from the GPT and Opus lanes block merge. I read both against the code at this head and agree with each. Both are about where focus goes around Retry, and each fix is a few lines.
-
Escape during a keyboard retry drops focus off the composer (
FilePickerMenu.tsx,closeReturningFocus).RetryControlsetsdisabled={busy}, and a disabled button cannot keep focus. So while the retry runs,document.activeElement === retryRef.currentis false. Escape then closes the menu without returning focus to the anchor, and the next keys go to the page body. Suggestion: keep a local ref that records that Retry took keyboard focus (set it inonTabToControland on press, clear it on settle), and check that ref instead ofactiveElement. -
A successful retry always moves focus to the composer (
onRetry,if (ok) anchorRef.current?.focus()). The menu stays mounted when closed, and a running fetch is not cancelled, so the retry can settle after the user has moved to another field. Focus then jumps back into the chat draft. Suggestion: return focus only when the menu is still open and focus is still on the Retry button or ondocument.body.
A test for each would help: Tab, Enter, Escape while pending leaves focus on the composer; and a retry that settles after focus moved elsewhere does not move it.
Backend and frontend test shards are still running on this head, and readiness is not passed yet, so I am not approving at this head. Once both are fixed and CI is green, I will re-review the new head.
bolichen97
left a comment
There was a problem hiding this comment.
Thanks for the update. Head reviewed: 3bc296e7b0b3389a2cf995012ea8062ea769ad6c.
Both focus points from my last review are fixed. The menu now uses main's emptyActionRef and restoreEmptyFocus from useListKeyboardNav, so Escape during a pending retry no longer drops focus. A retry that settles no longer moves focus to the composer on its own. The PR no longer edits the hook. There is no conflict with main.
One finding from the Opus lane still blocks merge. I read it against this head and agree.
Retry can show rows from an older query. The query keeps placeholderData: prev => prev. If @re returned rows, and then @rele failed with no data of its own, the empty arm shows Retry. Pressing it puts that key back into pending, so react-query serves the @re rows as placeholder data. results.length > 0 then removes the Retry button mid-press. The failure notice renders above rows from the other search, and Enter or Tab during the retry can insert a mention from that stale list.
Suggestion: while retrying (or when isPlaceholderData is true on a key that never succeeded), treat the results as empty, so the failure arm and its Retry stay until the retry settles. A test for this would help: rows for one query, a failure on a longer query, then Retry, and the old rows must not appear.
Test shards are still running and readiness has not passed, so I am not approving at this head. I will review the next head when it lands.
bolichen97
left a comment
There was a problem hiding this comment.
Approving at abe92ab.
This head fixes the last open point, the one the Opus lane raised: a retry on a key that never loaded no longer shows the previous query's placeholder rows. staleRetry = retrying && isPlaceholderData empties the results while that retry runs, so the failure notice and its Retry stay in place until it settles. A new test covers rows for one query, a failure on a longer one, then Retry, and checks that the old rows do not come back.
The two focus points from my earlier review stay fixed through emptyActionRef and restoreEmptyFocus. I read every PR-own hunk across the earlier heads and this delta; the 25 files include tests and locale strings.
No conflict with main. Every AI review lane passes on this head, including the Security Scope rerun, and no check is red. One backend shard and readiness are still running, and auto-merge waits for them.
Replaces the single generic search-failure notice with cause-keyed copy for a timeout, a refusal, a missing root and an unknown error, each spelling the key that actually sends, and keeps stale rows visible rather than blanking them.
Problem / Motivation
Goal: When an
@-mention file search fails, the user can tell which failure it was and take the one action that can actually recover it.The
@-mention file picker rendered a single notice for every failure of/api/file-search: "Couldn't search files. Try again." A timeout, a refusal on a sensitive path, a missing project root and an unknown server error were indistinguishable, so the user could not tell whether waiting, fixing the project setting, or retrying was the right response. There was no Retry control either, and the copy invited a retry even for refusals that answer identically every time.Why it matters
The menu sits in the composer, so a failure here interrupts typing. Telling the user to "try again" when the folder is off limits sends them into a loop that cannot succeed.
The notice also has to be truthful about the keyboard. It promises which key sends the message, and that promise is wrong if the picker is swallowing that key.
Not a goal
FolderPanelandFileBrowserRailkeep their existing notice copy.What changed (motivation → approach → change)
Correction to earlier revisions of this description. They said this unit imported
RetryControland theuseListKeyboardNavhand-offs from a prerequisite, #10834, and that it would not build until that merged. That was wrong on both counts and is withdrawn. #10834 is closed and was never merged, and this diff addsRetryControlitself, so it is in scope here. Verified againstmain:website/src/lib/searchErrorCause.tsis present andwebsite/src/components/RetryControl.tsxis absent. This PR no longer changesuseListKeyboardNav: keyboard reach comes from theemptyActionRefoptionmaingained in #22662.searchErrorCauseis the only piece taken from elsewhere and it is already onmain, so nothing here waits on another PR.Everything this PR ships, and why each piece is here:
FilePickerMenuclassifies the rejection withsearchErrorCauseand selects copy per cause: timed out, failed, no access, project folder not found. Without it the four cases are one message. The timeout and generic arms take their copy fromlib/searchErrorCause.ts'sSEARCH_FAILURE_KEYS, which the map spreads rather than re-spelling, because both surfaces call the same/api/file-searchand a timeout there is one fact. Onlydeniedandroot_missingstay picker-local: those two NAME a root, and the folder tab's own cwd is a different directory from the chat project this menu searches (FolderPanel.tsx:36), so a shipped test requires the panel's refusal copy not to match/project/i. That drops two picker-local keys from 13 catalogs.enter_sends/ctrl_enter_sendspair, picked from the live send-key setting, now sits in the hint row, and is shown only where that key really sends: an empty list with the release gate open. With rows on screen Enter picks the highlighted row, so nothing is claimed there. Ten per-cause suffixed keys collapse into that single pair across 13 catalogs.pendingand dropserror, which would rewrite the notice to the generic copy mid-press.lastCauseRefholds the cause so the text does not change under the user.website/src/components/RetryControl.tsx, new in this PR. The notice needs a real button, offered only for causes where retrying can help (RETRYABLE_SEARCH_CAUSES) and withheld for a refusal or a missing root. It is a component rather than inline markup because it owns the busy state and theonMouseDownpreventDefault that keeps the composer's caret. It reads its own label fromcomponents.filePickerMenu.retryrather than taking one as a prop, so nothing in it is generalized past its single caller.useListKeyboardNavasemptyActionRef, the option the skill and slash pickers already use since feat(dashboard): add retry to skill and slash picker load-failure notices #22662, so this PR adds no hook API. The hook owns where focus goes: pressing Retry, leaving it with Tab, or closing with Escape returns focus to the composer, and focus the user moved elsewhere is never taken back.resultsmemo was never gated onisError— so this PR does not change that behaviour. What it adds is the cause notice above them. The rows stay selectable and Tab still picks one, exactly as in every other list. One exception: while retrying a search that never loaded, rows left over from an earlier, shorter query are hidden, so the notice never sits over another query's results.Click the folder name below the message box to change it, orPick a different pathfor a path-scoped refusal. That wording names what is actually on screen: the composer footer shows the project folder's NAME, and nothing there is labelled "project", so an earlier draft pointing at a "project button" named a control the user cannot pick out. Its nouns are lifted from this repo's owngitPanel.not_a_repository_help, which already names that control for this same action in all 12 languages. Tests cover each hint, the case where none should show, and both arms of each conditional, and the capture harness asserts the hint text per scene.pathModeblames the path, not the project folder. A@../xtoken can be refused for one blocked subpath while the project folder itself is fine, so adeniedcause inpathModeselectsThis path is off limitsrather than the folder copy, and its hint points at the path instead of the folder control. OutsidepathModethe folder copy is unchanged.aria-live="polite"and notrole="status", because this file reserves the status role for the non-failure branch and a shipped test asserts a failure exposes no status role. The margin is applied only when a hint is present, so an empty region has no visual footprint. A test pins the empty case, which is rows surviving a retryable failure: no recovery hint, and no send-key line because Enter picks a row there.website/scripts/capture-file-picker-search-failure.mjs. The harness follows the repo's existingwebsite/scripts/capture-<feature>.mjsconvention. It runs against the real built SPA and asserts each scene as well as photographing it, because an absent button, surviving rows and a withdrawn promise are not things a photograph can evidence on its own.Tab keeps its usual meaning
Retry is offered only when the list is empty, so Tab never competes with picking a row. With rows on screen Tab picks one, as in every other
useListKeyboardNavlist; on an empty list the first Tab reaches Retry, a second returns focus to the composer, and Escape on Retry closes the menu and returns focus there. Enter outside Retry still follows the existingreleaseKeysWhenEmptybehaviour.Earlier revisions offered Retry over surviving rows and took Tab away to reach it. That is withdrawn: three review lanes converged on it, and Design Review named the inconsistency it created, since the second Tab closed the menu to avoid inserting a row the notice called stale while Enter still inserted that same row. Retyping already re-queries while rows are on screen, so nothing is lost.
Backwards compatibility
Removes nothing:
useListKeyboardNavis unchanged, so every other consumer keeps its current key handling. No copy key is deleted; the generic failure string is reworded in place.Tests
website/src/test/FilePickerMenu.timeout.test.tsxandwebsite/src/components/FilePickerMenu.cov80.test.tsxlock in:Manual verification
The seven states below were produced by
website/scripts/capture-file-picker-search-failure.mjs, committed here, against the built SPA; each scene is asserted by that script and a mismatch exits non-zero.All 11 per-language register gates ran as part of the full i18n suite, diff-scoped against this branch's base so the zero-tolerance changed-value arm was armed rather than skipping silently: 1022 tests, 0 violations. That arm was positive-controlled by mutating one of this PR's own new values to the formal address its style doc forbids;
bnStyle.test.tsnamedcomponents.filePickerMenu.check_project_folderby key and failed, so the arm is reading these keys rather than passing blind. Because the latest change DELETES keys from 13 catalogs rather than adding values, the gate that covers it iscatalogParity, so that one was positive-controlled too: re-adding the deleted key tode.jsonalone reddened it with1 stray key(s), e.g. components.filePickerMenu.search_failed. The fulltsc,eslintand vitest runs are CI's on this head.Screenshots / video
Committed under
temp-screenshots/file-picker-search-failure/, pinned to this head.1. Empty list, retryable cause: the notice names the timeout and offers Retry.
2. Empty list, refusal: Retry is withheld, because re-asking returns the same answer.
3. Rows survived the failure: the cause notice sits above them, Retry is withheld, and they stay selectable.
4. Empty list, generic failure: Retry is offered.
5. Empty list, project folder not found: Retry is withheld.
6. Retry in flight: the cause stays put and the button is busy and disabled.
7. Path token refused: the notice blames the path, not the project folder, and Retry is withheld.
Pattern harvest
Rule candidate: review-prompt
Pattern: one generic failure notice standing in for several distinguishable error causes, inviting a retry for causes that answer identically every time.
Open findings
Raised by the review lanes on this head and not fixed by this description. Each needs a code change or a maintainer's decision, not a wording change.
RetryControlkeeps the iconinvisiblewhen idle, which pushes the label off-centre. Fixing it restales screenshots 1, 3 and 4, so it wants doing together with a capture re-run.FilePickerMenu.tsx:175names a throttle ladder nothing there sets. The comment sits aboveplaceholderDataandstaleTime, neither of which configures retry or backoff.FilePickerMenu.timeout.test.tsx:192waits on real backoff. The 429 test allows 4s of wall clock for the shared ladder's 1s plus jitter. Fake timers would make it fast and deterministic.