Skip to content

fix(chat): name why a folder read failed, keep the rail mounted - #10839

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/folder-panel-and-rail-failure-notices
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:fix/folder-panel-and-rail-failure-notices

Conversation

@rnoack1

@rnoack1 rnoack1 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Prerequisite: #10834. This unit imports searchErrorCause and its listing key map from there, so it does not build until that PR merges. Reviewable now; not mergeable first. One 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

The folder panel collapsed every read failure into one of two generic notices. A search that timed out, a folder the user has no access to, and a root that no longer exists all rendered as "Unable to list folder" — and a refusal showed no Retry, so it was distinguishable from a transient outage only by the absence of a button.

Separately, a failure to read the project tree unmounted the file rail entirely. The panel disappeared rather than reporting that it could not load, so a recoverable failure looked identical to "this project has no files".

Why it matters

A refusal and an outage need opposite responses, and a notice that names neither leaves the user retrying something that cannot succeed. Inferring the difference from whether a button is present is not a design a user can be expected to read.

The unmounting rail is worse than a wrong message: a transient tree read failure removed a whole navigation surface, with nothing on screen to say it would come back.

What changed (motivation → approach → change)

  • Both folder-panel arms — the search and the listing — now classify through the shared cause map, so a refused listing reads "No access to this folder" and a missing root reads "Folder not found", rather than the generic copy.
  • Retry stays withheld for a refusal and a missing root, deliberately: re-asking a refusal returns the same answer. The change is to name the reason, not to offer a remedy that cannot work.
  • The header Refresh reveals a visible label while a retryable failure is plausible, so the notice's "Refresh to retry" names a control the user can actually find. The label's width is reserved while a read is in flight or has already failed that way, so the control does not grow under a cursor reaching for it.
  • TreeState gains a recoverable member, distinguishing a tree read that failed transiently from a project that genuinely has no directory. On recoverable the rail stays mounted and shows a retryable notice instead of unmounting.
  • useTreeAvailable delegates to useTreeState rather than re-spelling the rule, so the mount policy has one definition.

The TreeState change and the folder panel ship together because they are one concern: the panel reads the same union the rail defines, so separating them would split a discriminated union from its consumer.

Tests

  • FolderPanel.deadline.test.tsx and FolderPanel.search.test.tsx cover each cause notice on both arms, that a refusal offers no Retry, and that the visible Refresh label appears exactly while a retryable failure is plausible and not otherwise.
  • FolderPanel.tree.test.tsx covers the root tree-error notice.
  • FileBrowserRail.test.tsx and FilesHomePanel.test.tsx cover the rail staying mounted on a recoverable tree failure, and that useTreeAvailable follows the same rule.

Manual verification

Green with the prerequisite applied locally: tsc -b, eslint --max-warnings 0, the i18n gate suite, and 115 tests across the six suites above.

Note for CI: until #10834 merges, this branch does not typecheck on main, because the module it imports does not exist there yet. That is expected for this unit and is not a defect in the diff.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention 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 force-pushed the fix/folder-panel-and-rail-failure-notices branch from 480ce58 to 6261c52 Compare September 14, 2026 18:57
@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:49
@rnoack1
rnoack1 requested review from a team and iamwhatever September 15, 2026 00:49
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🔴 BLOCK

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

UX-Verdict: BLOCK

cannot evaluate: missing every screenshot — the image and recording lists are empty, yet the PR ships a capture harness (scenes 01–14) built to produce exactly these frames.

Evidence gaps

  • The four folder-panel failure notices ("Search timed out — Refresh to retry", "Folder listing timed out — Refresh to retry", "No access to this folder", "Folder not found") — close with the harness's stills 01–05.
  • The rail kept mounted with "Couldn't load the file tree — Refresh to retry" (FileBrowserRail, FilesHomePanel, FolderPanel root) and the one-notice-not-two state — stills 07–10, 08, 14.
  • The Refresh control's two forms, idle icon-only vs revealed label — stills 11–12.
  • Lens 13: the Refresh in-place form change (26px icon → icon+label, width reserved mid-flight) needs a recording; the recordings list is empty — close with the harness's own RECORD_VIDEO=1 clip (13-refresh-morph).
  • Stale search rows retained under a failed refetch — still 06.

Suggestions

  • FilesHomePanel's non-recoverable error dropped its labelled Refresh, leaving an icon-only header control as the sole recovery; the attached still 14 should confirm that surface still reads as recoverable-by-something.

[UX-REVIEWED] 8878d94

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

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

Review details

FINDING -- website/scripts/capture-folder-read-failure.mjs:138 -- undeclared "chromium.launch" harness adds subprocess, environment, network, and filesystem behavior -> Fix: remove the capture harness and its entry files from this unit.
[GPT-REVIEWED] 8878d94

@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 8878d94147adf96332a9ea41a017f2673a73e2b0 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

Cannot evaluate: missing screenshots/recording of the reshaped failure notices, the morphing Refresh control, and the rail-kept-mounted states.

Blockers

Required rendered evidence of this revision is absent.
The diff reshapes user-visible surfaces under website/src/pages/chat/ — new cause-keyed notice copy on three panels, a Refresh control that grows from a 26px icon to icon+label with reserved width ("Laid out before it is needed, never animated"), and a rail now kept mounted with an inline notice on recoverable tree failure — but the workflow's evidence list records "attachments downloaded and typed as images: 0 … recordings: 0 … failed for a transport reason: 0", and on a fork PR committed images are not evidence. The PR itself argues these states need photographs (the harness header says the width morph is something "no pair of stills can show") and ships website/scripts/capture-folder-read-failure.mjs to produce exactly them, yet none is attached — so the shape questions (does the reserved invisible span misalign the idle control, do composed "cause — remedy" lines fit the 300px rail, do the notices read correctly in both themes) cannot be answered from the diff.
Fix: run the shipped capture harness and attach its stills (and the refresh-morph clip) as github.com/user-attachments assets in the description.
Clears when: the description carries attachments the evidence workflow downloads and types as images/recordings of this revision's scenes.

Suggestions

  • causeWithEndpointCodes, failureMessage, withRemedy, and RETRYABLE_CAUSES are cross-surface error-classification logic homed in the FileBrowserRail component module; moving them beside searchErrorCause in lib/ keeps component files from becoming the import hub for panel-agnostic rules.

[DESIGN-REVIEWED] 8878d94

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 8878d94147adf96332a9ea41a017f2673a73e2b0 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: CONCERNS

withRemedy is exported with zero consumers outside its own file — the export is speculative surface; everything else in the fix earns its place.

Not justified as shipped

  • Item 9 — zero consumers: withRemedy in FileBrowserRail.tsx is exported, but grepping the diff and base for withRemedy finds one caller — failureMessage, same file; no import site anywhere (FolderPanel imports failureMessage/RETRYABLE_CAUSES/causeWithEndpointCodes, not it).
    Subtraction: delete the export keyword on withRemedy; keep it module-private.
    Clears when: the export is removed, or a counted consumer outside FileBrowserRail.tsx imports it.
  • Item 10 — undeclared, rides along: the ~460-line capture harness (website/capture/folder-read-failure.*, scripts/capture-folder-read-failure.mjs) is never mentioned in the description; it matches the base's established pattern (510 capture-*.mjs siblings counted) and carries no runtime surface.

What this change ships

Inventory (10 items) — 8 justified

Intent: FIX — name why a folder/tree read failed instead of generic copy, and stop a transient tree failure from unmounting the file rail. (More than 10 differences; capped at 10 — dropped: role="status" on two status lines, abort signal on the listing request, both undeclared micro-riders.)

  1. Listing failures read "No access" / "Folder not found" / "timed out" instead of one generic notice — justified
  2. Search failures name their cause the same way; a refusal shows no Retry — justified
  3. Retryable notices append "— Refresh to retry", naming the real control — justified
  4. Header Refresh grows a visible label while a retryable failure is plausible, width pre-reserved — justified
  5. Rail stays mounted on a transient tree failure with a notice (new recoverable state; new tests fail on base) — justified
  6. Files-home labelled Refresh button beside the tree error removed; unretryable causes keep only the header icon — justified
  7. Refresh now refetches the failed search (and tree when recoverable), not just the listing — justified
  8. /api/browse-files 400/403 gain a code, baseline ratchet moves down (documented Track B worklist) — justified
  9. New exported cause/notice helpers from FileBrowserRail — zero consumers: withRemedy has no import site
  10. Non-CI screenshot/assertion harness for the failure states — undeclared, rides along (510 sibling capture scripts)

[FIRST-PRINCIPLES-REVIEWED] 8878d94

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 8878d94

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch from 6261c52 to 2cb1c5a Compare September 16, 2026 07:50
@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 16, 2026
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch from 2cb1c5a to d8b1693 Compare September 16, 2026 09:17
@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 labels Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch from d8b1693 to 445d3e9 Compare September 16, 2026 09:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch from 445d3e9 to 6f430f2 Compare September 16, 2026 11:09
@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 labels Sep 16, 2026
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch 3 times, most recently from 6b8c62c to 90e7d2a Compare September 16, 2026 12:43
@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 labels Sep 16, 2026
Keys the folder panel notices on the cause so a refusal reads differently from a timeout, and adds a recoverable tree state so the file rail stays mounted with a retryable notice instead of unmounting.
@rnoack1
rnoack1 force-pushed the fix/folder-panel-and-rail-failure-notices branch from 90e7d2a to 8878d94 Compare September 16, 2026 14:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@NicholasRBowers NicholasRBowers added needs-pr-triage PR scanner: awaiting automated triage needs-author-decision PR blocked on author input and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 21, 2026
@NicholasRBowers

Copy link
Copy Markdown
Contributor

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

  • The branch cannot build, because it imports a module that exists nowhere yet. Frontend Lint & Type Check fails with TS2307: Cannot find module '../../lib/searchErrorCause' at FileBrowserRail.tsx:12 and FolderPanel.tsx:15, plus TS2554: Expected 0-1 arguments, but got 2 at FolderPanel.tsx:224. I checked: website/src/lib/searchErrorCause is not on main, and this PR does not add it either — it comes from your still-open PR fix(files): bound the file reads and name why one failed #10834 ("fix(files): bound the file reads and name why one failed"). Until that lands there is no tree in which this diff compiles, so nothing here is drivable. Every other red cascades from it: Frontend Tests 1-4, Frontend Coverage Merge, Bundle Size Gate, E2E, Coverage Gate, and both Build Desktop jobs plus Build Wheel, all of which build the frontend.
  • Design Review's BLOCK asks for evidence of a surface that currently cannot be rendered. Its one blocker is "required rendered evidence of this revision is absent" for the new cause-keyed notice copy on three panels and the Refresh control that grows from a 26px icon to icon+label. UX's BLOCK is the same ask from the other side — it wants still 14 to confirm that FilesHomePanel's non-recoverable error still reads as recoverable-by-something after it dropped its labelled Refresh. Neither can be satisfied before the build works.
  • Two reviewers disagree about the capture harness, and that is your call. First Principles flags the ~460-line website/capture/folder-read-failure.* + scripts/capture-folder-read-failure.mjs as undeclared but notes it matches the established pattern (it counted 510 capture-*.mjs siblings on base); GPT's advisory finding at capture-folder-read-failure.mjs:138 says to remove the harness from this unit outright. Declaring it in the description or dropping it is a scope decision, not a defect fix.

Mechanical once #10834 lands and this rebases onto it: PR Hygiene, the four-file conflict (error-code-baseline.json counters, test_browse_files.py, FileBrowserRail.tsx, FilesHomePanel.tsx), Design's suggestion to move causeWithEndpointCodes / failureMessage / withRemedy / RETRYABLE_CAUSES beside searchErrorCause in lib/, and First Principles' ask to drop the unused withRemedy export.

What I need from you: land or close #10834, then re-request triage. When you've addressed this, the pipeline will re-assess on its next cycle.

@bolichen97

Copy link
Copy Markdown
Contributor

Consolidation suggestion: this PR overlaps open PR #7068

@rnoack1, this PR and your PR #7068 change the same surfaces for the same goal: name why a folder or tree read failed, and keep the rail mounted when a tree failure is recoverable. Roughly half of the lines added here also appear verbatim in the PR #7068 diff. Neither thread links the other.

In both: TreeState gains 'recoverable', plus useTreeQuery and useTreeAvailable returning ready || recoverable. Both have the rail tree notice with findReport(errMessage(treeErr)), FolderPanel's failureMessage/listCause/refreshIsNamed and the Refresh label reserve, browseFiles(cwd, signal), not_a_directory/access_denied on api_browse_files, and the search_timed_out/refresh_retries keys.

Only here:

Better in PR #7068:

  • It does not depend on PR fix(files): bound the file reads and name why one failed #10834, because it carries its own lib/searchErrorCause.ts. Against main it conflicts only in error-code-baseline.json and website/src/api/client.ts.
  • It refetches only the active search key (exact: true). Here, FolderPanel.tsx:271 refetches the ['folder-file-search', cwd] prefix, which can re-run every cached search page.
  • Its label reserve does not key on isSearching. Here it does (:300), so the reserve toggles with each keystroke's search.
  • Its bn/hi refresh_retries use করো/करो. The bn string here uses করুন, which main's bnStyle.test.ts FORMAL_IMPERATIVE rejects.

Not portable: the FilesHomePanel redesign. FilesHomePanel.tsx:64 leaves the header RotateCw icon as the only Refresh for a non-recoverable tree error, and merged PR #11644 removed that icon from main. PR #7068 keeps main's labelled Refresh in the error arm (treeFailed = error || recoverable).

Suggestion: make PR #7068 the host and port three things into it:

If you would rather keep the split track, PR #10834 has to land first, and this PR then needs a new Refresh for the non-recoverable arm. Either way, a line here saying which track you are driving would tell reviewers which PR to read.

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.

Copy link
Copy Markdown
Contributor

Closing as SUPERSEDED by merged PR #7068 (squash 18243811d6, 2026-09-29)

@rnoack1, the 2026-09-25 consolidation note on this PR proposed making #7068 the host and porting three items from this branch into it. #7068 has since merged, and all three items are on origin/main (a97659dfc3). I checked each one against the code rather than the PR titles:

This PR's change Where it is on main
searchErrorCause + listing cause map (this PR imported them from #10834) website/src/lib/searchErrorCause.ts (LISTING_FAILURE_KEYS, TREE_FAILURE_KEYS, failureMessage)
Folder-panel search + listing arms classify by cause; Retry withheld for refusal/missing root FolderPanel.tsx:265 listCause, :674 failureMessage(t, LISTING_FAILURE_KEYS, …), :360 namesRefresh over RETRYABLE_SEARCH_CAUSES
Header Refresh shows its label while a retryable failure is plausible, with the width reserved FolderPanel.tsx:364 refreshIsNamed, :382 reserveRefreshLabel, :460
TreeState gains 'recoverable'; the rail stays mounted FileBrowserRail.tsx:92,115. Main goes further: the rail stays mounted for both failure kinds
Cause-keyed tree copy (TREE_FAILURE_KEYS) FileBrowserRail.tsx:645, FilesHomePanel.tsx:160
One-notice rule at the project root FolderPanel.tsx:647 treeRecoverable && !isError, pinned by FolderPanel.tree.test.tsx:292 ("reports ONE failure…")
browse_files returns not_a_directory / access_denied codes, plus the 403 test dashboard/handlers/files.py:2836,2841, test/test_browse_files.py:169-183
search_timed_out / refresh_retries keys en.manual.json:4383,4388 (bn/hi use the informal imperative that bnStyle.test.ts accepts)
FolderPanel.deadline.test.tsx Exists on main

Not carried over: the website/capture/folder-read-failure.* capture harness, which is evidence tooling and outside the PR's stated goal (GPT review asked for it to be removed), and this PR's FilesHomePanel redesign. Main keeps the labelled Refresh in the error arm, as the earlier note recommended.

This branch is also 2,600+ commits behind main, conflicts with it, and still imports a module path from the unmerged #10834. A rebase would reduce to an empty diff plus the harness.

If I missed a behaviour, reopen this PR and name it here. A rebased diff of just that piece would be easy to review.

Open-PR audit against origin/main a97659d. Evidence was checked by reading the diffs and the main tree.

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

4 participants