Skip to content

feat(dashboard): add a setting to apply folder suggestions automatically - #31604

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/25877-folder-suggest-auto-apply
Nov 18, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/25877-folder-suggest-auto-apply

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Changing how a folder is picked (the matcher, the project-directory match, the prompt) or when a suggestion runs.
  • Suggesting a folder for a session the suggester skips today (temporary sessions, sessions already in a folder).
  • Filing a session into a Bot's folder, or into a folder that was hidden while the suggestion ran.
  • A change-card entry for the new setting.

What changed (motivation → approach → change)

Piece What it does Where
Setting Apply folder suggestions automatically (dashboard.folder_suggestions_auto_apply, off by default). It shows under Folder suggestions only while that toggle is on, and GET/PUT /api/dashboard/config reads and writes it. config/sections_dashboard.py, config/loader_builders.py, file_api/dashboard_config.py, settings/ChatPanel.tsx
Filing With it on, the suggester files the session into the folder it picked, then sends its usual card marked applied. dashboard/chat_folder_suggest.py
Card The applied card says "Filed in " and offers Keep it and Undo. Undo moves the session back to the top level the way Move it files it: the card goes once the server has saved the move. If the move fails, the card stays and the app's error banner says "The session was not moved." with the server's reason, even when the user has already switched to another session. The card stays while the session is in that folder and goes once the session moves to another one. chat/FolderSuggestionCard.tsx, chat/page/followupCardActions.ts, chat/page/composerDock.tsx, ChatPage.tsx, store/chat/composerCards.ts, hooks/websocket/composerCards.ts
Strings and generated files Five new catalog keys in every locale, plus the regenerated config-baseline.json, settings registry (docs/settings-registry.generated.json, commandPalette/settingsRegistry.gen.ts) and UI index. locales/en.json and its 11 translations, locales/en-XA.json

The 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_enabled key, its change card and its settings-registry entry untouched. The value is read each time a suggestion runs (KiroCrewConfig.load() in maybe_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 same slot_folder_suggestion frame either way.

Backwards compatibility

Compatible: the new key is optional and defaults to False. The existing folder_suggestions_enabled key, its API field and the card it shows in suggest mode are unchanged. Older clients ignore the frame's new applied field.

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.py
    • Apply mode writes only folder_id into this session's existing record, confirmed written, then sends an applied card.
    • While the write runs the session still reads as unfiled; it shows the folder only after the write commits.
    • A record already filed on disk, a write that does not land, or one that raises leaves the session unfiled, sends no slot update and no card.
    • A session replaced, or a folder deleted, after the first check is caught when the write lands.
    • The write and the sidebar update both happen while the folder store lock is held, so a folder delete cannot land between the check and the filing.
    • A filing whose task is cancelled mid-write keeps that lock until the write finishes.
    • Apply mode never files into a Bot's folder, not even that Bot's own session.
    • It skips a session that was rebound while the pick was being made.
    • Suggest mode files nothing and marks its card as not applied.
  • test/test_dashboard_files_coverage.py: the new key round-trips through the config API, and a non-boolean value is refused with invalid_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: applied is set only when the frame says exactly true.

Determinism: test_chat_folder_suggest.py passed 20 times at -n0, 10 times at -n 4 --dist loadgroup alongside test_dashboard_files_coverage.py and test_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), and FolderSuggestionCard.test.tsx with followupCardActions.undo.test.tsx passed 10 runs in a row.

Manual verification

Ran a Playwright harness against the built SPA with every /api/** call stubbed (no gateway):

  • Turning on the new toggle sends folder_suggestions_auto_apply: true.
  • Turning Folder suggestions off hides the new toggle.
  • The applied card renders in dark and light themes.
  • Undo sends PATCH …/folder with folder_id: "" and clears the card once the server answers. Keep it clears it with no request.
  • When that PATCH fails, the card stays and the app banner shows "The session was not moved." with the server's error.
  • Clicking Undo and then opening another session before a slow PATCH fails still shows that banner, and the card (with Undo) is there again on return.
  • At 320px wide, both buttons stay inside the viewport, with and without the banner.

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):

Settings row: Apply folder suggestions automatically

The applied card above the message box, dark and light:

Applied card, dark

Applied card, light

A failed Undo: the card stays and the app banner says the session was not moved, dark and light:

Undo failed, dark

Undo failed, light

A failed Undo whose answer came back after the user opened another session: the banner still reports it:

Undo failed after switching sessions, dark

320px wide: the card, its buttons and the banner fit inside the viewport, nothing clips

Applied card at 320px, dark

Undo failed at 320px, dark

Undo failed at 320px, light

Related Issues

Closes #25877

Sibling sweep

N/A — a feat PR, so there is no defect to sweep.

Pattern harvest

N/A — a feat PR.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 17:51
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 17:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 18:13
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • _file_into is a second copy of the sidebar move's rules. It imports the private _slot_meta_txn_lock, then re-checks hidden folders and Bot folders and publishes the slot change itself. If the move handler's rules change later, the two paths can file differently; a shared "file slot under lock" helper in chat_folders would keep them in step.
  • The card only reaches clients connected when the filing happens. A session filed with no dashboard open moves with no card and no Undo, so the user has to find it in the sidebar.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • When Undo fails, the existing banner says "The session was not moved." while the card still says "Filed in Releases". The reader asked "which one is true" and only guessed that the undo had failed. For a failed Undo, use a message like "Couldn't undo: the session is still in Releases".
  • The reader could not tell that "Apply folder suggestions automatically" depends on "Folder suggestions" ("isn't indented, so it doesn't look like it depends on it"). Indent it under its parent, as nested child toggles are elsewhere.
  • On phone width (shots 8 and 9), the error text wraps one or two words per line beside "Ask the agent". Put the action below the text at narrow widths.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a — 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 does not.

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 ships

Inventory (7 items) — 7 justified

Intent: 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.

  1. New "Apply folder suggestions automatically" toggle under Folder suggestions, shown only while that toggle is on — justified
  2. New dashboard.folder_suggestions_auto_apply key, off by default, read and written through the dashboard config API — justified
  3. With the toggle on, a newly-titled unfiled session is filed into the picked folder on its own — justified
  4. The suggestion card gets a second form, "Filed in ", with Keep it and Undo — justified
  5. A failed Undo leaves the card in place and shows "The session was not moved." on the app error banner — justified
  6. The slot_folder_suggestion frame carries a new applied field — justified
  7. Five new strings in every locale, plus the regenerated settings registry, UI index and config baseline — justified

[FIRST-PRINCIPLES-REVIEWED] ac2b5a2

Description read

[DESCRIPTION-READ] b9eff0e843ce3ece3f00a6c0bb2d1fc17ee94db93c0184a1d6b10e5e3b79c8c4

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] ac2b5a2

Verdict parsed from the review's SHA-scoped output markers for commit ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ac2b5a2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ac2b5a2ce619d1532f7f5bb80f7378e47d613b4a false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 2b7a808 to 5e7c479 Compare November 6, 2026 23:20
@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 labels Nov 6, 2026
@bolichen97

bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Failed Undo removes the card without reporting failure span=e781628a2d67

fixed in 5e7c479: Undo now awaits useMoveSlotToFolderAsync; the card is cleared only after the server acknowledges the move, and a rejection keeps the card with an ErrorNotice (askAgent on).
Keep and Undo are disabled while the Undo is in flight; a test in FolderSuggestionCard.test.tsx pins the failure path.

@bolichen97

bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Auto-apply reverses a concurrent folder hide span=2d6c11a481fc

Rebutted: disproportionate remedy, as the adjudication already ruled (DOWNGRADE F1). The window needs a third folder write holding the store lock between the visibility check and _unhide_folder.
Every manual move takes the same _unhide_folder path (a move un-hides, chat_folders_records.py), so a hide racing a manual move ends the same way; auto-apply adds no new class.
The outcome is visible and reversible (the folder stays in the sidebar and can be hidden again); no data is lost. A refuse-if-hidden mode on a helper shared with slot_create, resume and Slack bindings is out of this PR's goal.

@github-actions github-actions Bot added 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: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 5e7c479 to 84741fe Compare November 7, 2026 00:53
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 84741fe to 821a30d Compare November 7, 2026 03:11
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 821a30d to 35a5594 Compare November 7, 2026 05:02
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 35a5594 to fe20c18 Compare November 7, 2026 06:17
@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from 9ba87e5 to d8d4edd Compare November 11, 2026 15:24
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Keep the destination folder stable through the filing commit span=2d6c11a481fc

fixed in d8d4edd: _file_into runs the destination re-check, the off-thread update_metadata_if write, its commit-hook publication and the slots push inside one state.hold_folders(...), so _remove, _remove_if_empty and _discard (all mutate_folders, same lock) either commit first and the re-check refuses, or wait until the filing is visible to their sweeps.
The write is awaited through run_to_completion, so a cancelled caller keeps the folder store lock until the worker thread's write finishes, the drain agent_templates already uses inside its hold.
Lock order matches the sidebar move (metadata txn lock, then folder store lock, then transcript lock); nothing that holds the folder store lock takes the metadata txn lock.
Pinned by test_apply_mode_files_while_holding_the_folder_store_lock and test_apply_mode_keeps_the_folder_lock_until_a_cancelled_write_finishes; each goes red with its mechanism removed.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 11, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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):

  • The PR says a failed Undo 'keeps the card and shows the error'. That only holds while the card stays mounted. If the user clicks Undo and switches session before the PATCH settles, and the PATCH then fails, the optimistic move to the top level is rolled back silently: the session jumps back into the (website/src/pages/chat/FolderSuggestionCard.tsx, low)

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 b808420eff · 722 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added 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: checking Automated validation is still running labels Nov 11, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@bolichen97
bolichen97 force-pushed the fix/25877-folder-suggest-auto-apply branch from d8d4edd to c702af8 Compare November 12, 2026 01:13
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 applied field), plus config-baseline.json, the settings registry, the locale catalogs and website/src/test/UseWebSocketCoverage.activity.test.tsx (merged cleanly) since this head was last synced (f859940 -> c6b537e). The same push carries the fix for the red wait-discipline check: the cancelled-write test in test/test_chat_folder_suggest.py now waits on the write's own start signal (await_until) instead of a fixed 10-second wait_for. CI re-running.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Two backend checks can go red on this head for reasons that belong to main, not to this PR: test/test_wait_discipline_ratchet.py::test_the_scan_matches_known_sites (it flags a 10-second wait_for in test/test_update_boot_apply.py) and test/test_updates_handlers_facade.py::test_every_name_served_from_outside_the_family_is_visible_to_type_checkers. Both fail on main itself and are tracked in #35660, with fixes open in #35625 and #35614. This PR touches neither file; it waits for those fixes to land and then re-syncs onto them.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 12, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: awaited Undo with its own inline error state on the card (added for this span in round 0)
resolution: removed the awaited Undo path; Undo moves through the shared fire-and-forget move that Accept already uses

  • Undo failures disappear after switching sessions span=e781628a2d67

removed in 78d41e6: Undo calls moveSlotToFolder(slot, '', { onCommitted: clearFolderSuggestion }), the same useMoveSlotToFolder move as Accept, so the card's undoing/undoError state and inline ErrorNotice are gone.
A failed move rolls the session back to its folder and that hook's reportRollback puts "The session was not moved." plus the server's reason on the app-level banner (rendered through ErrorNotice), which does not depend on the card being mounted.
The card clears only from onCommitted (the mutation's own success handler, which still fires after the card unmounts), so a failed Undo keeps the card and its Undo for a retry.
Pinned by followupCardActions.undo.test.tsx (real hook: success clears the card; failure leaves it, rolls the folder back and sets the error banner); a browser run that clicks Undo and opens another session before a slow failing PATCH shows the banner on the other session.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[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)).

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Undo stalls when the browser reports offline but the local gateway remains reachable span=31ab5f87b1ac

Rebutted: disproportionate remedy, as the adjudication already ruled (DOWNGRADE F1). Undo makes the same moveSlotToFolder(slot, folderId, { onCommitted }) call that Accept already makes on main, through the shared useMoveSlotToFolder hook, which this PR does not change.
The offline pause is that hook's React Query default, shared by Accept, the session menus and drag-to-folder; the fix the finding names changes the network mode of every one of those moves, which is beyond this PR's goal.
Nothing is lost while it is paused: the card and its Undo stay on screen, React Query resumes the paused mutation once the browser is back online, and the mutation's onSuccess then runs onCommitted and clears the card.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Holding this PR's re-sync push while main is red. The PR conflicts with main again, in src/kiro_crew/docs/ui-index.generated.json only. A re-synced commit is ready: it takes main's copy of that file and regenerates it, and it is otherwise byte-identical to this head. It has passed the local gates and both local review lanes.

main's Fast Gate fails right now on docs lint: FAIL: docs not reachable from any index (1) for docs/request-for-change/rfc-app-agent-tools-third-party-grant.md, because #36231 replaced that RFC's index row. Every PR's Source Gates job inherits that failure, so pushing now would only go red on main's failure. #36510 (and #36504) put the row back. Once one of them merges, this branch is rebased onto it and pushed, with the usual Rebased: note.

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

Copy link
Copy Markdown
Contributor Author

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 KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sessions sidebar: add a setting to apply folder suggestions automatically

2 participants