Repository navigation
feat(dashboard): add a setting to apply folder suggestions automatically - #31604
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The setting is off by default and additive. The filing re-checks its pick under the same locks the sidebar move uses, and the rendered evidence covers the new toggle and the applied card. Notes
[DESIGN-REVIEWED] ac2b5a2 Description read[DESCRIPTION-READ] ed3a9f140c7cd2553a8e28d2b7cd5baa1484727dda4444a838a10313cfa7e181 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader understood both main controls ("Keep it" and "Undo") and the new toggle correctly, and the screenshots show every new state. Notes
[UX-REVIEWED] ac2b5a2 Description read[DESCRIPTION-READ] 085bcae22308a23ed084a484e0c5824c1f9c018a58b26bdeafb6bc5066208611 That sha256 names everything this verdict read: the PR description, plus the 12 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 new behaviour is behind a flag that is off by default, and each item answers the stated harm of a prompt the user would always accept. What this change shipsInventory (7 items) — 7 justifiedIntent: a user who trusts folder suggestions has each newly-titled session filed into the suggested folder without being asked, and can undo it in one click. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] ac2b5a2 Description read[DESCRIPTION-READ] b9eff0e843ce3ece3f00a6c0bb2d1fc17ee94db93c0184a1d6b10e5e3b79c8c4 That sha256 names the PR description this verdict read. 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: |
2b7a808 to
5e7c479
Compare
|
|
5e7c479 to
84741fe
Compare
84741fe to
821a30d
Compare
821a30d to
35a5594
Compare
35a5594 to
fe20c18
Compare
9ba87e5 to
d8d4edd
Compare
[operator: bolichen97] |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, config-baseline.json, src/kiro_crew/config/loader_builders.py, src/kiro_crew/config/sections_dashboard.py, src/kiro_crew/dashboard/file_api/dashboard_config.py, test/test_dashboard_files_coverage.py and the chat settings panel files (merge conflicts: kept main's new project tags setting beside this PR's toggle, regenerated the baseline and the UI index) since this head was built (eb4a973 -> f859940); CI re-running. [operator: bolichen97] |
Code change approver recommendation: A person should decideWhy: the decider raised 1 possible problem and estimates a 50% chance that this change introduces a defect; a person should check it. The backend auto-filing is carefully built. The pick is re-checked where the write lands under the existing move lock and folder lock, only folder_id is written, a failed filing leaves the session unfiled with no card, and both backend and frontend tests cover the change. One concrete path breaks the PR's own promise that a failed Undo keeps the card and shows the error. If the card unmounts (a session switch) before the PATCH rejects, the async move hook rolls the optimistic move back with no notice (reportRollback is off), and the error goes into dead component state. This is the repo's blocking errors-use-error-notice rule, and the Accept path's hook turns the rollback notice on to avoid exactly this. The fix is small, so I'm requesting changes rather than declining. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
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 |
|
Re-sync budget reset This PR conflicts with main again inside its 48-hour watch window, so its re-sync budget restarts here; re-syncing onto current main now. [operator: bolichen97] |
d8d4edd to
c702af8
Compare
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json (merge conflict: took main's copy and regenerated it), website/src/store/chat/state.ts (merge conflict: kept main's new pending-turn comment beside this PR's [operator: bolichen97] |
|
[operator: bolichen97] Two backend checks can go red on this head for reasons that belong to main, not to this PR: |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json (merge conflict: took main's copy and regenerated it), plus config-baseline.json, website/src/store/chat/state.ts and the locale catalogs (merged cleanly) since this head's CI ran (c6b537e -> de6219e). The new base carries the main-side fixes for every red on c702af8 that was not this PR's: #35625 (the wait-discipline ratchet and updates-facade checks tracked in #35660) and #35695 (the two macOS installer tests tracked in #35693). This PR's own change is unchanged. CI re-running. [operator: bolichen97] |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json (merge conflict: took main's copy and regenerated it), plus config-baseline.json, src/kiro_crew/config/loader_builders.py, the settings registry files, website/src/pages/ChatPage.tsx, website/src/pages/chat/ChatSettings.tsx, website/src/pages/settings/ChatPanel.tsx and the locale catalogs (merged cleanly) since this head went green (de6219e -> ee18fa5). This PR's own change is unchanged. CI re-running. [operator: bolichen97] |
|
Re-sync budget reset This PR conflicts with main again (src/kiro_crew/docs/ui-index.generated.json) inside its 48-hour watch window, so its re-sync budget restarts here; re-syncing onto current main now. [operator: bolichen97] |
|
self-added: yes
[operator: bolichen97] |
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json (merge conflict: took main's copy and regenerated it), plus config-baseline.json, src/kiro_crew/config/sections_dashboard.py, the settings registry files and the locale catalogs (merged cleanly) since this head went green (ee18fa5 -> 27e9359). The same push carries the Undo fix answered in the disposition above. CI re-running. [operator: bolichen97] |
|
[operator: bolichen97] The failed-Undo path this recommendation names (the card unmounts on a session switch before the PATCH rejects, and the rollback is silent) is fixed in 78d41e6: Undo now uses the same move as Move it, which reports a rolled-back move on the app's error banner whether or not the card is on screen, and clears the card only once the server has saved the move. Details are in the disposition above (#31604 (comment)). |
|
self-added: yes
[operator: bolichen97] |
|
[operator: bolichen97] Holding this PR's re-sync push while
|
Folder suggestions could only ask: a card offered the folder and waited for "Move it". A user who accepts nearly every suggestion paid a prompt each time, and one who never answers it kept an unfiled sidebar. Add dashboard.folder_suggestions_auto_apply (off by default), a toggle shown under Folder suggestions only while that is on. With it on, the suggester re-checks its pick under the sidebar move's lock, writes only the session's folder_id into its saved record while that record is still unfiled, shows the placement once the write lands, and sends the usual card marked applied: "Filed in <folder>" with Keep it and Undo, Undo moving the session back to the top level. Read at point of use, so it applies live. Closes #25877
|
Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json (merge conflict: took main's copy; the generator reports it current on the rebased tree) since this head went green (27e9359 -> e6e9fff); CI re-running. Main also changed config-baseline.json, the settings registry files, the dashboard config section and API, the locale catalogs and the chat and settings pages this PR edits; all of those merged without conflict, and this PR's own added and removed lines are unchanged. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head ac2b5a2. The auto-apply filing takes the sidebar move lock and the folder store lock in the same order as the existing hand move. It checks the pick again under the transcript lock and writes only folder_id to an existing record. The session only shows as filed once that write has committed. Undo goes through the existing move hook, which reports a rolled-back move on the app banner, so a failed Undo is visible even after the card unmounts. The new setting is off by default, the config API refuses a value that is not a boolean, and the folder suggestion and dashboard config tests pass locally, so I found no bug that blocks this.
Problem / Motivation
Goal: A user who trusts folder suggestions can have each newly-titled session filed into the suggested folder without being asked, and still sees where it went with a one-click undo.
Folder suggestions (Settings → Chat → Sessions) can only ask. Once a new session has a title, a card above the message box offers a folder and waits for Move it. A user who accepts nearly every suggestion pays that prompt every time. A user who opens many sessions and never answers the card ends up with an unfiled sidebar, even though the suggester picked the right folder.
Why it matters
Each card interrupts the user to get an answer they would give anyway. The people who most need their sessions filed are the ones who dismiss the prompt. The new setting is off by default, so nothing changes for anyone who does not turn it on.
Not a goal
What changed (motivation → approach → change)
dashboard.folder_suggestions_auto_apply, off by default). It shows under Folder suggestions only while that toggle is on, andGET/PUT /api/dashboard/configreads and writes it.config/sections_dashboard.py,config/loader_builders.py,file_api/dashboard_config.py,settings/ChatPanel.tsxapplied.dashboard/chat_folder_suggest.pychat/FolderSuggestionCard.tsx,chat/page/followupCardActions.ts,chat/page/composerDock.tsx,ChatPage.tsx,store/chat/composerCards.ts,hooks/websocket/composerCards.tsconfig-baseline.json, settings registry (docs/settings-registry.generated.json,commandPalette/settingsRegistry.gen.ts) and UI index.locales/en.jsonand its 11 translations,locales/en-XA.jsonThe issue suggested making this a third state on the existing toggle. I made it a toggle that sits under the existing one instead, following the Restore sessions → Restore window pair in the same card. It cannot disagree with its parent: it is hidden while suggestions are off, and the backend ignores it then. It also leaves the shipped
folder_suggestions_enabledkey, its change card and its settings-registry entry untouched. The value is read each time a suggestion runs (KiroCrewConfig.load()inmaybe_suggest_folder), so it applies live and needs no restart or applier.The filing holds the sidebar's move lock and the folder store lock, and checks the pick again under them. A folder delete waits until the filing is done. The session must still be unfiled and still hold the conversation the pick was made for. The folder must still exist, must not be hidden, and must not be a Bot's folder, which the person's own move refuses. It then writes one field, the session's
folder_id, into its saved record, the way channel filing already does (update_metadata_if). That write happens only if, at that moment, the record on disk is still unfiled and every check above still holds. Nothing else in the record is rewritten, so a close saved at the same moment is kept. The folder is written to disk first and shown second: the sidebar moves the session only once the write lands. A write that is refused or fails changes nothing the sidebar can see. The card goes out only after the filing is saved, so a failed filing shows nothing. Users have the sameslot_folder_suggestionframe either way.Backwards compatibility
Compatible: the new key is optional and defaults to
False. The existingfolder_suggestions_enabledkey, its API field and the card it shows in suggest mode are unchanged. Older clients ignore the frame's newappliedfield.Removes nothing: the diff only adds a setting, a filing path and a second form of the existing card.
Tests
test/test_chat_folder_suggest.pyfolder_idinto this session's existing record, confirmed written, then sends an applied card.test/test_dashboard_files_coverage.py: the new key round-trips through the config API, and a non-boolean value is refused withinvalid_folder_suggestions_auto_apply.website/src/test/FolderSuggestionCard.test.tsx: the applied card shows where the session went with no dropdown. Undo files it to the top level and Keep it only dismisses.website/src/test/followupCardActions.undo.test.tsx, through the real move hook: Undo moves the session to the top level and clears the card only after the server answers. A failed move puts the session back in its folder, leaves the card, and puts the error on the app banner, which does not need the card on screen.website/src/test/dashboardSlice.slotPatch.test.ts: an applied card survives the slot update for its own filing and a stale unfiled row, and goes once the session moves to another folder.website/src/test/UseWebSocketCoverage.activity.test.tsx:appliedis set only when the frame says exactlytrue.Determinism:
test_chat_folder_suggest.pypassed 20 times at-n0, 10 times at-n 4 --dist loadgroupalongsidetest_dashboard_files_coverage.pyandtest_slot_sweep_invariant_gates.py(green every time), and in a shuffled order (seed 29975). The five changed frontend test files passed under five shuffled seeds (3001 to 3005, 85 tests each), andFolderSuggestionCard.test.tsxwithfollowupCardActions.undo.test.tsxpassed 10 runs in a row.Manual verification
Ran a Playwright harness against the built SPA with every
/api/**call stubbed (no gateway):folder_suggestions_auto_apply: true.PATCH …/folderwithfolder_id: ""and clears the card once the server answers. Keep it clears it with no request.PATCHfails, the card stays and the app banner shows "The session was not moved." with the server's error.PATCHfails still shows that banner, and the card (with Undo) is there again on return.Still owed: one end-to-end run on a live gateway, where a newly titled session is filed and then undone.
Screenshots / video
The new toggle under Folder suggestions, shown on (dark):
The applied card above the message box, dark and light:
A failed Undo: the card stays and the app banner says the session was not moved, dark and light:
A failed Undo whose answer came back after the user opened another session: the banner still reports it:
320px wide: the card, its buttons and the banner fit inside the viewport, nothing clips
Related Issues
Closes #25877
Sibling sweep
N/A — a
featPR, so there is no defect to sweep.Pattern harvest
N/A — a
featPR.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)