Repository navigation
feat: add a setting that hides empty session folders in the sidebar - #31417
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the opt-in setting reuses the existing Notes
[DESIGN-REVIEWED] 45442c8 Description read[DESCRIPTION-READ] b5da4a790349478c0a737019db87aea058ed219ec10c2e3e63003722a6faa968 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The toggle is off by default, it reuses the existing What this change shipsInventory (7 items) — 7 justifiedIntent: let a person keep empty session folders out of the sidebar list without deleting them or their settings. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 45442c8 Description read[DESCRIPTION-READ] 7ce911d712bb44f58407c5bd7a42c557416ef5b40a357d57424122305d4bc72f That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read "Hide Empty Folders" correctly, was sure of it and would use it. The screenshots show it off, on, during a drag and after a folder is created. Notes
[UX-REVIEWED] 45442c8 Description read[DESCRIPTION-READ] fe49e3dbb0aa2aa9f8e34b44752ecab680e08ff25aa247ab87c8df8324cfe6ff That sha256 names everything this verdict read: the PR description, plus the 15 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
APPROVE
What it does for users: a new toggle, Settings → Chat → Sessions → "Hide Empty Folders", off by default. With it on, the List view leaves out every folder whose subtree holds no open session. A folder comes back once a session is in it. While a session is dragged, every folder comes back as a one-row drop target. A newly created folder stays shown for the visit.
Checks:
- Default off equals main. DEFAULTS sets hideEmptyFolders false, and loadChatConfig reads anything but a real boolean as false (ChatSettings.tsx). With false, folderIsHidden reduces to the old rule, !!hidden && !active (utils/folderVisibility.ts). The empty-body change in folderBlocks.tsx and the new-folder reveal in folderModal.tsx are both gated on the setting. Board columns are untouched, because the board lane deliberately does not read isFolderHidden.
- A hidden empty folder stays reachable for drag-drop. useFolderVisibility gets hideEmptyFolders && activeDrag?.type !== 'session' (ChatSidebar.tsx). To pass that, the activeDrag state moved above the call. Move to folder menus and the Command Bar folder search still list every folder, and a folder reveal overrides the hide.
- A hidden empty folder stays reachable for creation. A folder made in the create modal is revealed whenever the setting is on (folderModal.tsx). The reveal now adds to the set of folders kept shown for the visit instead of replacing it (reveal.ts), so a second create does not hide the first.
- The UI copy is one sentence, present in all 12 locales, and true.
Evidence:
- ChatSidebar.hideEmptyFolders.test.tsx, folderVisibility.test.ts and ChatSettings.test.tsx: 58 passed.
- Mutation: I removed the drag exception, so empty folders stayed hidden during a session drag. That reddened "draws every folder while a session is dragged".
- CI on this head: 84 success and 9 skipped check-runs, no failures. PR Readiness is success. The Design, First Principles, UX and Opus lanes pass. GPT 6.1 raised one blocking finding, which adjudication downgraded (see follow-up 1). git merge-tree against main exits 0.
- The screenshots (setting off, setting on, mid-drag, the toggle) match the code.
Source-only: the Playwright run in the description. I did not rerun it.
Non-blocking follow-ups:
- The GPT 6.1 finding is real but limited to the opt-in. Starting a session drag draws the empty folders, which shifts the rows. A session released where it was picked up can then land in a folder that slid under the pointer. The undo bar reverses it, and the description says so plainly. A way to reveal drop targets without moving existing rows would close it.
- Only session drags bring empty folders back. A folder drag, used to nest a folder, does not, so an empty hidden folder cannot be a nesting target by drag. The ⋮ Move folder to menu still works.
- The reveal.ts change also applies with the setting off. For folders marked "Hide when empty", earlier reveals in a visit now accumulate instead of being replaced. This is harmless (those folders stay shown a little longer), but the description does not mention it.
5143c26 to
9c531fa
Compare
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts, website/src/pages/ChatSidebar.tsx, website/src/pages/chat-sidebar/folderBlocks.tsx, website/src/pages/chat-sidebar/scope.ts and the 13 website/src/i18n/locales catalogs since this head went green (07ab5da -> 594344f); CI re-running. The branch conflicted with main. The feature-map Session folders row now keeps main's new "Close sessions and delete…" text alongside this PR's Hide Empty Folders text. The find_ui index was regenerated, and the settings registry regenerates byte-identical. The change itself is the same as the reviewed commit. [operator: bolichen97] |
9c531fa to
4d8e578
Compare
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts, website/src/pages/ChatSidebar.tsx, website/src/pages/chat-sidebar/board.ts, website/src/pages/chat-sidebar/folderBlocks.tsx, website/src/pages/chat-sidebar/scope.ts, website/src/pages/chat/ChatSettings.tsx, website/src/pages/settings/ChatPanel.tsx and the 13 website/src/i18n/locales catalogs since this head went green (594344f -> 8544127); CI re-running. The branch conflicted with main: #31407 added the sibling "Include Subfolder Contents in Folder Counts" setting in the same places (the chat config type, its defaults and coercion, [operator: bolichen97] |
|
Rebased to clear a merge conflict in src/kiro_crew/docs/ui-index.generated.json (a6106fc -> 9310d4b, onto 296017c); CI re-running. Only the generated index changed; the rest of the diff is byte-identical to af4ce42, which passed local Opus review. The local gate passed on 9310d4b. [operator: bolichen97] |
|
/ai-review override gpt 9310d4b owner-decision: maintainer ruling: keep the drag behaviour. The setting is opt-in and off by default, and a misplaced drop can be undone by dragging the session back, as the posted disposition explains. |
|
AI-review override not recorded: class |
|
/ai-review override gpt 9310d4b owner-decision: keep the drag behaviour; the setting is opt-in and a misplaced drop can be undone. Decision: #31417 (comment) |
Human judgment recorded@bolichen97 recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Re-sync budget reset The base moved under this PR more times than the re-sync budget allows; a maintainer asked for one more round of re-syncs so it can be rebased and its conflicts resolved. [operator: bolichen97] |
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/pages/chat/ChatSettings.tsx, website/src/pages/ChatSidebar.tsx and the locale catalogs since this head went green (296017c -> 95b9c2b); CI re-running. The conflicts were the Session folders feature-map row, the generated find_ui index (regenerated) and the chat-settings defaults line (both new keys kept). The same push narrows one mechanism of this PR, answered in the disposition below. [operator: bolichen97] |
|
self-added: yes
[operator: bolichen97] |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, website/src/pages/chat/ChatSettings.tsx, docs/feature-map/README.md, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts, website/src/pages/settings/ChatPanel.tsx and the locale catalogs since this head's CI ran (95b9c2b -> 65bdd09); CI re-running. GitHub reported the branch as conflicting, and that head's review lanes had errored on an API rate limit, so it never got a verdict. The [operator: bolichen97] |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates an 18% chance that this change introduces a defect, above the 12% limit for approving on its own. An opt-in setting, off by default and stored as a real boolean only (anything else reads as false), that adds a second reason to the existing folderIsHidden rule. With it off, folderIsHidden behaves as before and reveals still replace each other; the new tests pin both. Every reader of isFolderHidden (sidebar search matching, the hidden-folder rows and count, the root folder lanes, the folder blocks) takes the new reason through the same path Hide when empty uses. The setting is forced off on the board, which matches how renderedLane picks the board lane. Folder creation from the sidebar modal reveals the new folder, and seedCreatedChatFolder puts it in the cache before the reveal looks it up. The drag state goes through one set/reset path, so empty folders come back on a session drag and hide again on end or cancel. Tests cover each behaviour added. The pointer-shift on drag is disclosed, can be undone, and the owner accepted it on an earlier commit. No regressions, data loss or trust-boundary issues found. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts, website/src/pages/chat/ChatSettings.tsx, website/src/pages/settings/ChatPanel.tsx, docs/feature-map/README.md and the locale catalogs since this head's CI ran (65bdd09 -> b152bc2); CI re-running. GitHub reported the branch as conflicting again, in the generated find_ui index only, and that head's review lanes had errored on an API rate limit, so it never got a verdict. The index was rebuilt from the merged tree with [operator: bolichen97] |
|
Re-sync budget reset GitHub reports this branch as conflicting with main again, and the base keeps moving in files this PR touches (the generated find_ui index and settings registry, the chat settings defaults and the locale catalogs). A maintainer asked for this PR to be kept green through its watch window, so the re-sync count restarts here and the branch is rebased to clear the conflict. [operator: bolichen97] |
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts, website/src/pages/ChatSidebar.tsx, website/src/pages/chat-sidebar/scope.ts and the locale catalogs since this head's CI ran (b152bc2 -> 3703c2e); CI re-running. GitHub reported the branch as conflicting again, in two files. In the feature map, main added a Sidebar session search row and reworded Folder search next to this PR's Session folders row: both of main's rows are kept as they are, beside this PR's edited row. The generated find_ui index was taken from main and rebuilt from the merged tree with That head's review lanes errored on an API rate limit and never reached a verdict. Its one test red, [operator: bolichen97] |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 08b10c9. 08b10c9 is a pure rebase of the approved head dae7665 onto 49 newer main commits. Every hunk is identical except the regenerated ui-index digest and counts (setting 322->323). Both generators report the committed files up to date, the PR's tests pass, the two guard mutations turn named tests red, and Opus and GPT both completed real reviews of this head with no findings. The earlier APPROVE carries over. Lead note (c141): the only red tests on this head are Backend Tests (3.12, 8) and Backend Tests (Windows) (8), and Coverage Gate fails closed behind them. Both shards fail on exactly two tests, test/test_mcp_remote_transport.py::TestRewriter::test_a_listed_remote_entry_passes_through_unwrapped and ::test_a_malformed_type_does_not_abort_the_rewrite (assert 0 == 1), and nothing else. Those two fail on main itself (issues #35534 and #35535) and this PR does not touch that code, so they do not count as a red test of this PR. Source for the two names: the check-run annotations of both shards, read at 20:2xZ; the raw job logs returned a GitHub server error twice and were not read. Decisive lines: website/src/utils/folderVisibility.ts:32, website/src/pages/ChatSidebar.tsx:443, website/src/pages/settings/ChatPanel.tsx:1118, src/kiro_crew/docs/ui-index.generated.json
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/pages/chat/ChatSettings.tsx and the locale catalogs since this head's CI ran (3703c2e -> 0feaa8b); CI re-running. GitHub reported the branch as conflicting with main in two files. In The one test red on 08b10c9, two [operator: bolichen97] |
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts and the locale catalogs since this head went green (0feaa8b -> ff344c7); CI re-running. GitHub reported the branch as conflicting with main in one file, the generated find_ui index ( The one red on 2524b52, CodeQL [operator: bolichen97] |
|
Re-sync budget reset GitHub reports this branch as conflicting with main again, in the generated find_ui index ( [operator: bolichen97] |
|
Rebased: main moved in docs/feature-map/README.md, src/kiro_crew/docs/ui-index.generated.json, src/kiro_crew/docs/settings-registry.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts and the locale catalogs since this head went green (ff344c7 -> 51349e1); CI re-running. GitHub reported the branch as conflicting with main in one file, the generated find_ui index ( Every red on 0e484f4 was CI's token hitting GitHub's API rate limit, not a finding. On a Linux host (Ubuntu 24.04), on this change over main at c8f6d62: every local gate passes apart from three reds that are not this change's (the two backend tests that fail the same way on a clean [operator: bolichen97] |
|
Rebased: main moved in docs/request-for-change/README.md, docs/feature-map/README.md and the locale catalogs since this head went green (51349e1 -> a45e97a); CI re-running. The red Fast Gate on 3555744 was main's: its docs lint failed because On a Linux host (Ubuntu 24.04), on this change over main at c22557c: every local gate passes apart from the two backend tests that fail the same way on a clean [operator: bolichen97] |
|
[operator: bolichen97] Rebased onto current main to resolve the merge conflict in |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head 45442c8. The new opt-in setting adds one more reason to the existing folderIsHidden rule, so every reader of that rule (folder blocks, search hits, the hidden-folder count) picks it up the same way. With the setting off, nothing changes, and it is forced off on the board view, which draws every folder anyway. A new folder is in the cache before the reveal looks it up, so it stays visible after it is created. The PR's tests pass on this head. Reverting the hide rule, the drag gate or the reveal pile-up each turns a named test red, so the new tests really check the behaviour. CI is green and I found no wrong behaviour, crash or data loss, so nothing blocks.
Problem / Motivation
Goal: Let a person hide the session folders that hold no sessions from the dashboard sidebar, through a setting that is off by default.
Empty folders stay in the sidebar and push the folders that hold work further down. Closing or cleaning up sessions makes it worse: the sessions go, the folders stay. Today the only ways out are to delete the folders (Clean up empty folders, which also drops their settings), to shrink each one to a single row (Compact Empty Folders), or to use Hide when empty one folder at a time, and only on a folder that has an archived session.
Why it matters
Someone who keeps one folder per project or topic scans past a long tail of empty folders to reach the few with sessions in them. Hiding them keeps the list short without losing the folders or their settings, and the folder is back the moment a session lands in it.
Not a goal
What changed (motivation → approach → change)
A new toggle, Settings → Chat → Sessions → Hide Empty Folders, off by default, keeps empty folders from pushing the ones that hold sessions down the list. With it on, the List view:
The approach reuses the hide the sidebar already has instead of adding a second one. Hide when empty is decided by
folderIsHiddeninutils/folderVisibility.ts, against the set of folders whose subtree holds an open session. The setting is a second reason for that same rule, so a folder with a session in it is never hidden, a folder reveal (the Command Bar's Search Folders, a folder chip in chat) still overrides it, and the Move to folder menus still list every folder.The value is stored as
hideEmptyFoldersin the browser'smc-chat-config(pages/chat/ChatSettings.tsx) and read asfalseunless it is a real boolean; the toggle is inpages/settings/ChatPanel.tsx.useBoardColumns(chat-sidebar/board.ts) reads it next tohideEmptyFolderBody, so flipping it reshapes an open sidebar at once, and hands it on as off while the board is shown, whose columns draw every folder either way.pages/ChatSidebar.tsxhands it touseFolderVisibility(chat-sidebar/folders.ts) switched off while a session drag is in flight, which is why theactiveDragstate now sits above that call;chat-sidebar/folderBlocks.tsxdraws the folders that drag brings back without a body, so the list moves one row per folder under the pointer instead of two. It still moves: a session dropped where it was picked up can land in a folder that slid under it, and the undo bar every drag-move shows puts it back. The create modal (chat-sidebar/folderModal.tsx, reading it throughchat-sidebar/scope.ts) already revealed a new subfolder; it now reveals every new folder while the setting is on, because a new folder is empty and would otherwise vanish as it is made. While the setting is on, a reveal (chat-sidebar/reveal.ts) adds to the folders it keeps shown for the visit instead of replacing them, so creating a second folder does not take the first one away; with it off, a reveal replaces the last one, as it does today.The label and its hint ship in all 12 languages (
i18n/locales/*.json,en-XA.jsonregenerated). The generatedsettingsRegistry.gen.ts,settings-registry.generated.jsonandui-index.generated.jsonare regenerated, and the feature map row for session folders names the toggle.Builds on #17747 by @chenmingwei23.
Backwards compatibility
Compatible:
hideEmptyFoldersis a new optional key in the browser's own chat settings; it defaults tofalseand anything that is not a boolean reads asfalse, so every sidebar renders as it does today until someone turns it on.Removes nothing: no folder, session, setting, key or function is removed. With the opt-in on, an empty folder is only left out of the list: it is still stored, still offered by every Move to folder menu and folder search, and drawn again as soon as a session is in it or one is dragged.
Tests
website/src/test/ChatSidebar.hideEmptyFolders.test.tsx(new) renders the real sidebar with the setting on and pins each row of the table: an empty folder is not drawn and is drawn once a session moves in; every folder is drawn while a session is dragged, the empty one without a body (the real drag handlers, with the DndContext stubbed the wayChatSidebar.dragFreezeOrder.test.tsxdoes), and it goes again after the drop; two folders created one after the other through the real create modal both stay on screen; on the board, a failed create in an empty folder shows its error once; with the setting off an empty folder is drawn with its body, and revealing a second folder hidden by Hide when empty hides the first one again, as it does today. Each assertion was checked to fail with its production change reverted.website/src/test/folderVisibility.test.ts: the existingfolderIsHiddencases pass the now-requiredhideEmptyargument asfalse.website/src/test/ChatSettings.test.tsx:hideEmptyFoldersdefaults off, a stored"yes"reads as off, a storedtruereads as on.--maxWorkers=1, each run in a shuffled order with a printed seed (--sequence.shuffle --sequence.seed=<n>), all green.scripts/run_scoped_tests.pyon a Linux host (Ubuntu 24.04) ran the 739 frontend test files the diff selects (all 17,490 tests pass) and its 1,330 backend test files (64,959 pass). Two backend tests fail there, and fail the same way on a cleanmaincheckout on that host: the Continue with GitHub case oftest/test_find_ui_auto.py(test_find_ui_auto: the Continue with GitHub golden fails wherever the generator runs #32670) andtest/test_host_git_repo_exec_neutralization.py::TestCliUpdate::test_up_to_date_diff_runs_no_textconv_planted_during_the_fetch.Manual verification
Against an isolated gateway on loopback running this change at
a7d3608fb9(backend and built frontend), seeded with therichfixture plus seven folders: two empty ones, Ideas and Old project, and five that hold two sessions each, so the list is taller than the sidebar. Driven by headless Playwright in light and dark, every state asserted before its frame was taken:The same checks against an isolated gateway on a Linux host (Ubuntu 24.04, headless Chromium) running this change on
mainatc8f6d621d6: without it there is no Hide Empty Folders row and an empty folder is drawn; with the change the row is under Compact Empty Folders and off, turning it on leaves the empty folder out while the folder with a session stays, turning it off brings it back, and with it on a folder made through New ▾ → New folder stays drawn although it is empty.Screenshots / video
Sidebar, setting off (today's sidebar): the two empty folders are drawn.
Sidebar, setting on: only the folders that hold sessions are drawn.
Setting on, a folder just created with New ▾ → New folder: the sidebar has scrolled down to Q4 planning and flashes it.
The same folder a few seconds later: the flash is over and the empty folder stays on screen for this visit.
Setting on, while a session is dragged: the empty folders are back as one-row drop targets.
The toggle in Settings → Chat → Sessions:
Related Issues
Closes #16046
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.