Skip to content

fix(chat): name why a workspace listing failed - #10844

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/workspace-picker-listing-failure-ux
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/workspace-picker-listing-failure-ux

Conversation

@rnoack1

@rnoack1 rnoack1 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Prerequisites: #10834 and #10842. This unit imports searchErrorCause and RetryControl from the first and useBrowseDirs from the second, so it does not build until both merge. Reviewable now; not mergeable first. The smallest of a set of units split out of a larger file-search timeout change that was too big to review in one piece.

Problem / Motivation

WorkspacePicker is the twin of the project picker: same directory-listing read, same hand-rolled fetch state, same single generic "Unable to list folder" for every failure. A refusal, a timeout and a missing root were indistinguishable, and there was no way to retry.

Why it matters

The two pickers are visibly the same control, so divergent failure behaviour between them is a bug in its own right — the same wedged gateway would produce a named cause and a Retry in one and a bare generic line in the other. Keeping them on one shared hook is what stops that divergence recurring the next time either is touched.

What changed (motivation → approach → change)

  • The listing read moves to the shared useBrowseDirs hook, so it is bounded and has one error shape and one retry entry point.
  • Notices are keyed on the cause via the shared listing key map, reusing strings that already exist — no new copy in any catalog beyond a retry label.
  • Retry is withheld for a refusal and a missing root, matching the project picker: re-asking a refusal returns the same answer.
  • Rows are cleared on a failed drill and held while a retry is in flight, for the same reason as the twin — refetch on a key that never succeeded clears the error, which would otherwise unmount the notice mid-read.

Tests

WorkspacePickerCoverage.test.tsx covers the cause-keyed notices, that a refusal offers no Retry, and the cleared-rows behaviour on a failed drill.

Manual verification

Green with both prerequisites applied locally: tsc -b, eslint --max-warnings 0, the i18n gate suite, and 37 tests in the suite above.

Note for CI: until the prerequisites merge, this branch does not typecheck on main, because the modules it imports do not exist there yet. That is expected for this unit and is not a defect in the diff.

One thing a reviewer should decide before merging this

WorkspacePicker appears to have no production consumer. Searching the tree for references turns up only a prose mention in a comment in MicSourceMenu.tsx and its own test file — no component mounts it. The same search for ProjectPicker returns five non-test consumers, so the query does find them where they exist.

If that is right, this unit changes a component no user can currently reach, and deleting it may be the better disposition than reviewing it. I have not deleted anything here, because that is a scope call for a maintainer rather than something to fold into a failure-UX change.

Pattern harvest

Rule candidate: eslint

Pattern: a rejection from an api.* call discarded by a handler that neither
surfaces nor stores the cause, so the caller renders its empty state as though the
read had succeeded. The instance this PR fixes is
website/src/components/WorkspacePicker.tsx:35 on mainline — a body-less
.catch(() => {}) closing api.browseDirs(path).then(...), which leaves the list
claiming no subdirectories for a directory that was never read.

The retirable rule is narrow and syntactic: flag a .catch on an api.* promise
whose handler binds no rejection parameter, or binds one and never reads it. A
handler that assigns the cause to state or rethrows is not caught. This belongs in
lint rather than a review prompt because the defect is invisible at the call site by
construction — the code reads as though failure were handled.

This is the instance #10842's harvest named as remaining; that PR fixed the
recentProjects sibling in ProjectPicker and left this one to the unit that owns
the surface.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention fork Pull request from a fork (external contributor) labels Sep 14, 2026
@dwu96

dwu96 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

👋 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.

@rnoack1
rnoack1 marked this pull request as ready for review September 15, 2026 00:48
@rnoack1
rnoack1 requested review from a team and krishdhasmana September 15, 2026 00:48
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)

Design-level review of 2df39fae7f5631590ab66fb40b6fc636c38fe1c1 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: BLOCK

WorkspacePicker has no production consumer — this PR invests retry UX, 12 locale strings, and a two-PR dependency stack in unreachable code.

Blockers

Failure UX built on a component nothing mounts.
The description itself states "WorkspacePicker appears to have no production consumer" and asks a maintainer to decide "deleting it may be the better disposition" — and a grep of the base tree confirms it: only its own test file and a prose comment in MicSourceMenu.tsx reference it. Because no component mounts it, the harm this PR fixes ("a refusal, a timeout and a missing root were indistinguishable, and there was no way to retry") can never render for any user; shipping adds a retry state machine, catalog entries in every locale, and a hard dependency on #10834/#10842 — pure maintenance surface with zero reachable benefit. This is exactly the scope call the author deferred; a design gate is the right place to force it, not to wave it through. Fix: get the maintainer's disposition first — delete the component (closing this unit), or name/land the consumer that mounts it, after which this change is sound and should carry a screenshot of the new error/Retry state (the evidence file for this revision lists no rendered evidence).
Clears when: a maintainer either confirms a production consumer mounts WorkspacePicker (with rendered evidence of the new failure state) or deletes the component and closes this PR.

[DESIGN-REVIEWED] 2df39fa

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of 2df39fae7f5631590ab66fb40b6fc636c38fe1c1 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

New failure notices and Retry live in a component nothing mounts — no user can reach them, and nobody has ever seen them rendered.

Watch

[UX-REVIEWED] 2df39fa

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 2df39fae7f5631590ab66fb40b6fc636c38fe1c1 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2df39fa

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🔴 BLOCK

Premise-level review of 2df39fae7f5631590ab66fb40b6fc636c38fe1c1 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: BLOCK

The whole fix lands on a component nothing mounts — the author's own zero-consumer count is right, so shipping nothing here costs nobody anything.

Not justified as shipped

  • Item 1 — zero consumers: the description concedes "WorkspacePicker appears to have no production consumer", and the base tree confirms it, so no user can reach any notice this PR adds.
    Subtraction: defer this unit; the smaller disposition is deleting WorkspacePicker.tsx, its test, and the workspacePicker catalog block, not refining its failure UX.
    Clears when: a production consumer mounting WorkspacePicker exists on the base (then push or rebase), or a maintainer records the keep-the-component decision and overrides this check.
  • Item 5 — undeclared: retry success now moves focus to the path field; only the test mentions it.
  • Item 6 — undeclared: retry no longer overwrites a path typed meanwhile (preserveInput); the description never says so.

What this change ships

Inventory (8 items) — 5 justified

Intent: a FIX — when the workspace picker's folder listing fails, name the cause and offer a retry instead of a silent empty state.

  1. A failed listing shows a cause-named notice instead of "No subdirectories" — zero consumers: nothing mounts WorkspacePicker (grep WorkspacePicker in website/: only its test, a comment, and the capture harness)
  2. Retry offered on timeout/transient failure, withheld for refusal and missing root — justified
  3. Stale rows cleared on a failed drill, held while a retry is in flight — justified
  4. A pending drill keeps the previous listing instead of claiming emptiness — justified
  5. Retry success hands focus back to the path field — undeclared
  6. Retry preserves a path the user typed since — undeclared
  7. "Retry" label added to the 13 locale catalogs — justified
  8. Listing reads become bounded and abortable via the shared hook — justified

Blockers

  • Zero production consumers for the surface this fix improves. Grep count on base: WorkspacePicker appears in website/src/components/WorkspacePicker.tsx (definition), WorkspacePickerCoverage.test.tsx (test), capture/error-notice-surfaces.tsx (screenshot fixture), and one comment in MicSourceMenu.tsx — none is a consumer under lens 5. ProjectPicker, the twin the description compares against, has 5+ non-test consumers, so the search finds them where they exist. The description itself says "deleting it may be the better disposition than reviewing it." Subtraction: defer this unit, or delete the dead component instead.
    Clears when: a production consumer mounting WorkspacePicker exists on the base (push or rebase after), or a maintainer records the decision to keep the component and overrides this check.

[FIRST-PRINCIPLES-REVIEWED] 2df39fa

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed a3f94907f338775e3927c460257aeafcb4f2be65 via the fork AI-review pipeline; updated in place on each push.

Review details

I've verified the state thoroughly. The isolated review commit a3f94907 contains the modified WorkspacePicker.tsx (importing useBrowseDirs, LISTING_FAILURE_KEYS from searchErrorCause, and RetryControl), but none of those three modules exist in that commit's tree or in any accessible ref — git log --all -S "useBrowseDirs" returns nothing, and searchErrorCause.ts is absent from website/src/lib/. The FolderPanel "twin" on main uses react-query (refetch), but that does not let me open the actual useBrowseDirs contract.

Both candidates hinge entirely on the contract of code I cannot open:

  • Candidate 1 requires that retry() can reject (not resolve to ok). The visible code shows retry().then(ok => …) — a Promise<boolean> shape that resolves. Whether it can reject is defined in useBrowseDirs, which I cannot read. The candidate itself concedes "if retry() wraps react-query refetch() it resolves rather than rejects." Establishing input (a) requires assuming unopened code → drop.

  • Candidate 2 requires a listError value absent from LISTING_FAILURE_KEYS. The key expression LISTING_FAILURE_KEYS[listError === false ? 'failed' : listError] is a typed indexed access over a purpose-built failure map; the branch only renders when listError !== false. Confirming an unmapped value requires opening searchErrorCause, which I cannot → drop.

Neither can be grounded to (a)/(b)/(c) from code I actually opened. No Step 2 finding is groundable either — every branch of the visible logic is conditioned on values from the unopened hook. Both die under falsification.

No findings.

[OPUS-REVIEWED] a3f9490

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 20, 2026
Routes the workspace picker listing through the shared bounded hook so a refusal and a timeout read differently instead of collapsing into one generic listing error.
@rnoack1
rnoack1 force-pushed the fix/workspace-picker-listing-failure-ux branch from a3f9490 to 2df39fa Compare September 22, 2026 01:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 22, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: neither prerequisite provides ./useBrowseDirs, so this still won't build after PR #10834 and PR #10842 merge

The description says this unit gets useBrowseDirs from the second prerequisite and that the typecheck failure goes away once both land. Neither prerequisite adds that module at its current head:

  • website/src/components/WorkspacePicker.tsx:8 has import { useBrowseDirs } from './useBrowseDirs', and :37 uses it: const { listError, browse, retry, noteInputEdited } = useBrowseDirs(open, ...). The PR deletes the old inline browse callback, so nothing else in the file does that job.
  • PR #10842 (head e2fb6f3) adds website/src/components/RetryControl.tsx. It has no useBrowseDirs file and no reference to one. Its description says it was narrowed ("No useQuery migration", and "This unit does not touch the listing failure notice").
  • PR #10834 (head 22b5c95) adds website/src/lib/searchErrorCause.ts. It has no useBrowseDirs either.
  • origin/main has none of the three modules. In the mirror we audited, git log --all -S useBrowseDirs finds only this PR's commit, 2df39fa.

What breaks: website/tsconfig.app.json sets "include": ["src"], and build is tsc -p tsconfig.app.json && ... vite build. So WorkspacePicker.tsx gets type-checked even though nothing mounts it. tsc then fails with TS2307 "Cannot find module './useBrowseDirs'", and vite never runs. The red Frontend Lint & Type Check on this head will stay red after both prerequisites merge. WorkspacePickerCoverage.test.tsx imports the real component and has no vi.mock for the hook, so that suite can't resolve either. It also relies on the hook's contract: api.browseDirs gets called with expect.any(AbortSignal), and retry().then(ok => ...) at :146.

Who is affected: no users, because no production component mounts WorkspacePicker. The cost falls on the frontend build and the package build, and on reviewers who assume this becomes mergeable once the stack lands. The local green run in the description must have used a useBrowseDirs that we could not find on any pushed branch.

Smallest fix: add website/src/components/useBrowseDirs.ts to this PR, or push the branch that has it and list that branch as the prerequisite. While you're updating the description, it also credits RetryControl to PR #10834, but PR #10842 is the one that adds it. If a maintainer decides to delete WorkspacePicker instead, as the Design Review and First Principles blocks suggest, none of this matters.

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.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 29, 2026
@cruisercohen cruisercohen added the needs-pr-triage PR scanner: awaiting automated triage label Oct 3, 2026
@dodgeblaster

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: dodgeblaster#b5f0d847]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:

When you've decided the disposition (and landed the prerequisites if keeping it), the pipeline will re-assess on its next cycle.

@dodgeblaster dodgeblaster added needs-author-decision PR blocked on author input and removed needs-pr-triage PR scanner: awaiting automated triage labels Oct 3, 2026

Copy link
Copy Markdown
Contributor

Triage: SUPERSEDED by merged PR #7068. Closing.

I checked this against origin/main a92dde1a6c (merge base c293d24ae5, 2009 commits behind).

This unit was split out of the larger file-search/folder-listing timeout change. That change has since landed as PR #7068 (squash 18243811d6, merged 2026-09-29). It rewrote website/src/components/WorkspacePicker.tsx (+162 lines) and covers everything this PR set out to fix for users:

  • The cause is named: main's WorkspacePicker.tsx:9 imports LISTING_FAILURE_KEYS and searchErrorCause from website/src/lib/searchErrorCause.ts, which now exists on main. NAMED_PATH_KEYS (:20-25) goes further than this PR: it names the path that failed, not just the cause.
  • Retry is withheld for a refusal or a missing root: canRetryBrowse = requestErrorCause === 'timed_out' || requestErrorCause === 'failed' (:176).
  • Retry is inert while the re-ask is in flight: it shows "Retrying…", uses aria-disabled and stays focusable (:237-251).
  • The typed path is preserved: the inputEdits ref (:61-69).
  • Tests: website/src/test/WorkspacePickerCoverage.test.tsx on main covers all of this, e.g. "does not offer Retry for an access-denied listing refusal", "shows the retry in progress and makes the control inert…", and "a keyboard-activated Retry keeps focus…".

Two things in this diff are not on main, and neither is a reason to keep it open:

  1. The useBrowseDirs hook extraction. That module doesn't exist on main, in fix(files): bound the file reads and name why one failed #10834 or fix(dashboard): name a failed recents read in the project picker #10842, or on any pushed ref (the earlier CHANGES_REQUESTED review already noted this). The branch can't build.
  2. Clearing rows on a failed drill. Main deliberately does the opposite: per fix(chat): bound the @-menu file-search fetch so a slow gateway fails visibly #7068, it keeps the stale list on screen and usable.

git merge-tree against main also conflicts in WorkspacePicker.tsx and its test.

If you still want the shared-hook refactor, please open it as a fresh PR on top of current main.

@bolichen97 bolichen97 closed this Oct 5, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 5, 2026
@rnoack1
rnoack1 deleted the fix/workspace-picker-listing-failure-ux branch November 9, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants