Skip to content

feat(chat): create a folder from a session's Move to folder menu - #23436

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
constevalsimon:feat/move-to-new-folder
Oct 30, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
constevalsimon:feat/move-to-new-folder

Conversation

@constevalsimon

@constevalsimon constevalsimon commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: file a session into a folder that does not exist yet without leaving its menu.

A session's "Move to folder…" submenu lists only existing folders. To put a session into a new folder you leave the menu, create the folder from the sidebar, then reopen the menu and move the session (#22779).

Why it matters

Sessions get sorted while you work, often into a folder you have just decided you need. Three detours for one move is the friction the issue describes.

Not a goal

  • Changing the sidebar's own New folder flow or its full folder settings modal. The new dialog asks for a name only; color, agent, project directory and tags stay in the folder's settings.
  • Showing "Move to folder…" when no folder exists yet. The session menus hide that submenu with no folders today, and the sidebar's New folder covers the first one.
  • The artifact library's folder pickers, which share the picker list. They do not pass the new prop and are unchanged.
  • Leaving flat view or clearing the sidebar search. The sidebar's create modal exits flat view because a new empty folder would be invisible there; here the visible result is the session's move, which flat view still shows, so the dialog changes neither.
  • Running the create through the sidebar's createFolderMutation. That mutation lives in the sidebar shell, which the header menu's dialog cannot reach. The dialog seeds the cache and refetches through the same shared helper, and like that create it carries no CHAT_FOLDERS_WRITE_KEY: a refetch already in flight when the create lands is cancelled and reissued by the helper's idle-gated invalidateQueries, or, while another folder write is pending, by that write's own settle.

What changed (motivation → approach → change)

  • Goal: one step from the menu to "session is in a new folder".
  • Approach: end the shared folder picker with a "New folder…" action when the caller can create one, and open a small name dialog that creates the folder and then moves the session with the same move the existing entries use. A Radix menu unmounts its content on pick, so the dialog cannot live in the menu; it renders once per chat page beside a context provider, and both the sidebar row menus (dropdown and right-click) and the chat header menu open it through that context.
  • Change:
    • FolderMoveSubmenu.tsx: optional onNewFolder / newFolderLabel props. FolderPickerItems then ends the list with a separator and a "New folder…" item (FolderPlus icon, styled like the Schedule page's cron move menu). The item is gated offline with offlineMenuRow and utils.offline.create_folders, the same as the sidebar's own New folder row: dimmed, named why, refused on select with the submenu left open over OfflineMenuReason. The connection read sits in a small NewFolderEntry component, so callers that render the picker without a store are unaffected.
    • SessionActionsMenu.tsx: passes onNewFolder when the dialog's provider is present. Outside the provider the hook returns null and the entry is left out, so no menu shows an entry that does nothing.
    • hooks/useNewFolderMove.tsx (new): the provider and hook holding which slot the dialog is open for, the same shape as useTagPopover.
    • components/NewFolderMoveDialog.tsx (new), built on the shared Modal:
      • A labelled name field (IME-safe Enter, focused on open), with Create and move / Cancel.
      • When the session is already in a folder (read once when the dialog opens, so the move's optimistic update cannot turn the new folder into its own offered parent), an unticked "Create inside “”" offer: the issue's own nice-to-have. Ticked, the folder is created under the session's current folder and its path is opened with requestSlotFolderOpen, which expands collapsed ancestors and keeps the sidebar's view, search and filters as they are.
      • On submit: api.createChatFolder, seed the ['chat-folders'] cache, then the move, awaited. The dialog closes only once the server has acknowledged the move.
      • One submit at a time: a ref set synchronously guards it, so a second Enter or click that lands before the re-render disables the controls creates nothing.
      • Keyboard focus stays inside the dialog for the whole write: the name field turns read-only rather than disabled, and a click submit moves focus to it, so the page's shortcuts (Settings, session switching) cannot act behind the dialog. After a failure, focus returns to the field, where Enter retries.
      • Create is held until the session list has fully loaded since the last (re)connect, including the partial list a gateway restart sends first. If the session was closed while the dialog was open, nothing is created, a status line says so and Create is held, leaving Cancel; both clear if the session reappears. This is status text, not an ErrorNotice, because nothing failed.
      • A folder-list read failure is shown through ErrorNotice rather than silently dropping the "Create inside" offer, and the offer keeps the parent's name if a refetch briefly lacks it.
      • While either write is in flight every dismissal is refused (Modal's dismissDisabled, Cancel disabled), the pattern the sidebar's folder modal uses, so a write cannot settle into a dialog that was cancelled. A typed name also guards against an accidental backdrop click or Escape. If the page unmounts the dialog mid-write anyway, the settling write touches neither its state nor the provider, so it cannot close a dialog opened since for another session.
      • Failures show in the dialog through ErrorNotice (no hand-off: the typed name is an unsaved draft). A failed create keeps the name. A failed move after a successful create says the folder was created (under the name the server stored, and inside which folder when it was created in one), fixes the name, greys the name field, and turns the button into Retry move, which moves into that folder without creating another. Retry first re-reads the folder list; if that folder was deleted elsewhere in the meantime, it is created again in the same place rather than failing on every retry, and if it was renamed or its parent changed, the notice names it as it is now. A create reply without an id is reported rather than moving the session nowhere. Create is held while the gateway is offline, and a status line in the dialog says why (OfflineReasonRow with the existing "Gateway offline — reconnect to {{action}}" sentence): "create folders" before the create, "move sessions" once the folder exists and only the move is left. The button points at that line with aria-describedby. The closed-session line hides while offline, where the session list cannot say either way.
    • hooks/useMoveSlotToFolder.ts: useMoveSlotToFolderAsync, the same optimistic move and guarded rollback as useMoveSlotToFolder (one shared mutation), returned as a promise that settles with the server's answer. It runs with networkMode: 'always' (as useChatPaneUploads does), so a browser that reports offline while a local gateway is reachable does not pause the move and leave the dialog holding its dismissals. The existing hook keeps React Query's default network mode, so its callers are unchanged.
    • ChatPageFrame.tsx: wraps the page in NewFolderMoveProvider and renders the dialog right inside it, so every surface that can open it has it.
    • api/chatFoldersWrite.ts: seedCreatedChatFolder, the cache seed the sidebar's create mutation already did (only into a list that already loaded, then the idle-gated refetch), moved here so the sidebar and the dialog share it. chat-sidebar/folders.ts calls it; its behaviour is unchanged.
    • i18n: components.sessionActionsMenu.new_folder, a components.newFolderMoveDialog block and the offline verb utils.offline.move_sessions, in all 12 catalogs, following each language's style guide (hi and bn address the reader as तुम / তুমি; fr puts U+202F inside guillemets and before :), plus the regenerated pseudolocale.
    • website/scripts/capture-22779-new-folder-move.mjs: the screenshot harness below.

Backwards compatibility

Compatible: the new props are optional and every existing caller of FolderMoveSubmenu / FolderPickerItems renders as before unless it passes onNewFolder. No route or API changes; the dialog uses the existing POST /api/chat/folders and PATCH /api/chat/slots/<key>/folder.

Removes nothing: the sidebar's cache seed moved into a shared helper with the same behaviour; no route, field, key or function is removed or tightened.

Tests

  • website/src/test/NewFolderMoveDialog.test.tsx (new, 34 tests):
    • Entry: FolderPickerItems ends with "New folder…" below a separator and calls back on select; offline it is aria-disabled, names why, refuses the select and shows the offline reason; with no callback the list is unchanged.
    • Dialog: a trimmed name creates at the top level and moves the session (cache seeded, dialog closed); Enter submits; a blank name does not; a session in a folder is offered it unticked, and ticking it creates inside and opens the path with openFoldersOnly; unticked creates at the top level; offline Create is held with the name kept and the reason shown in the dialog, clearing on reconnect; a failed create keeps the dialog, the name and the session's folder and shows the server's message; a reply without an id is reported and nothing moves; Cancel writes nothing.
    • Write in flight: a move refused after the create reports the folder by name, rolls the session back, and Retry move moves into the same folder with no second create; while the move is pending, Cancel is disabled and Escape is refused, and the dialog closes only when the PATCH resolves; while the move is pending the dialog still offers the folder the session was in, not the one it just created; a create that settles after the dialog was swapped to another session leaves that dialog and its typed name alone.
    • Hardening: a double Enter plus a click before the first create answers creates one folder; the name and parent offer lock while the create is in flight, with focus staying in the field; a click submit keeps focus in the dialog; a retried move into a subfolder opens its path, and the notice uses the name the server stored; a ticked parent offer survives a refetch that briefly lacks the folder; Retry re-creates a folder deleted in the meantime; Create waits for a fully loaded session list after a reconnect or a restart's partial list, and a stale closed-session note clears when the session reappears; a session closed while the dialog was open gets status text, no create and a held Create; a folder-list read failure is shown; a failed move names the parent when the folder was created inside one, and names none when the offer was left unticked; a retried move that fails again names the parent as it was renamed meanwhile; once the folder exists, the offline line says the move is what waits; with the browser reporting offline and the gateway connected, the move still runs and the dialog closes.
    • Each of these tests fails against the dialog without the change it covers (checked by reverting each change in turn).
    • Host: outside the provider the dialog renders nothing and the hook returns null; the provider opens and closes.
    • Seed helper: adds the folder once to a loaded list and leaves an unloaded cache empty.
  • Coverage of the touched files from these tests (lines): NewFolderMoveDialog.tsx 100%, useNewFolderMove.tsx 100%, useMoveSlotToFolder.ts 100%, chatFoldersWrite.ts 100%, FolderMoveSubmenu.tsx 92%.
  • The new file 10 times in a row at one worker: 10/10 green (34 passed each).
  • Related suites locally: the SessionActionsMenu, ChatHeaderMenu, ChatSidebar folder, moveToFolder, FolderMoveSubmenu, chatFoldersWrite and i18n suites. On this 8 GB laptop a few ChatSidebar tests time out at 15 s under parallel load; they pass at one worker, and src/i18n/navLabels.test.tsx times out the same way on an untouched main checkout.
  • The i18n suite with I18N_BASE_REF=origin/main, so the per-language style gates judge the changed values as CI does: all style tests pass (navLabels.test.tsx times out locally, as it does on main).
  • Static checks: tsc -p tsconfig.app.json, eslint on the changed files, lint:i18n, i18n:check, jscpd (0 clones), gen-ui-index --check, the brand-name, focus-cue and feature-map gates, the flake-pattern ratchet, the code-review frontend greps, and the SAST job's Semgrep configs (0 findings) all pass.

Manual verification

The real built SPA with every /api/** call answered by stateful fixtures (capture-22779-new-folder-move.mjs), in dark and light themes. The harness asserts each step:

step result
Right-click a session in "Video Projects" → Move to folder… Submenu ends with a separator and "New folder…" (main: no entry)
New folder… Menu closes, dialog opens with focus in the name field, "Create inside “Video Projects”" offered unticked
Type Storyboards, tick the offer, Create and move One POST /api/chat/folders {name: "Storyboards", parent_id: "f-video"}, one PATCH …/s1/folder {folder_id: "f-new"}; the dialog closes and the session sits in Video Projects › Storyboards
390 px phone, chat header ⋯ → Move to folder… → New folder… The same entry and dialog, 326 px wide inside the viewport
Gateway socket dropped with a name typed Create and move greys out, "Gateway offline — reconnect to create folders" shows in the dialog, and the name stays; after Cancel, the submenu's New folder… is dimmed with "Gateway offline — the dimmed actions need a connection" under it, selecting it opens nothing, and no request is sent
Offer ticked, first PATCH …/folder answered 503 The dialog stays open: "Created “Storyboards” inside “Video Projects”, but the session was not moved into it: Gateway unreachable", button Retry move; the retry sends one more PATCH and no second POST, then closes
Session closed elsewhere while the dialog is open, then Create and move "This session was closed, so there is nothing to move." as status text, not an error, and Create greys out; no request is sent
Create lands, then the server refuses the folder-list re-read (500) and the move (503), socket still up Both are shown: the failed move naming the folder, and the folder-list error; one POST

Screenshots / video

main this branch
before after
dialog (dark) dialog (light)
dialog dark dialog light
after Create and move 390 px phone
moved narrow
move refused after the create offline, name typed
move failed offline dialog
session closed while open (dark) session closed while open (light)
closed dark closed light
folder list refused (dark) folder list refused (light)
folders error dark folders error light
offline submenu move refused (light)
offline submenu move failed light

Related Issues

Closes #22779

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

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of e7ac4ceba30f8972f6202467df325679a72b7bdc via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

No blind reader has seen this change. This fork lane has none, and pushing the branch to this repository would add one. The 14 committed screenshots show every control and state the diff adds: the "New folder…" entry online and offline, the dialog filled, closed-session, offline, move-failed/Retry move and folder-list error, plus narrow width.

Notes

  • When the folder list fails to load, new-folder-move-folders-error shows the raw error ("Folder list unavailable" in attachment-08) and doesn't say what it costs the user. Add the consequence and next step, e.g. "Couldn't load your folders, so “Create inside” isn't available. The new folder will be created at the top level."
  • No screenshot shows the dialog for a session that isn't in a folder, where the "Create inside …" checkbox is left out. A capture of that would confirm the dialog still looks right with just the name field.

[UX-REVIEWED] e7ac4ce

Description read

[DESCRIPTION-READ] b2878d6331f70249da65f12d082af8281300b3203550971ed40b28e5aee73c0e

That sha256 names everything this verdict read: the PR description, plus the 17 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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of e7ac4ceba30f8972f6202467df325679a72b7bdc via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: a real reported friction, solved by an additive menu entry and a dialog hosted by a provider. All 14 committed screenshots of this revision are in the evidence list.

Notes

  • Creating the folder and then moving the session are two separate writes, so a failed move leaves an orphan folder behind until Retry succeeds. That trade-off is reasonable for this goal. A server-side "create and assign" endpoint would make it a single write if this flow grows.

[DESIGN-REVIEWED] e7ac4ce

Description read

[DESCRIPTION-READ] c279c1ad27a8bbbdd6dd2fc91eb2b4f60368db562ca9048e81ee5a7f41e331b1

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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

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

First-Principles-Verdict: PASS

Nothing blocks. The feature closes a linked issue (#22779). The dialog's retry path handles edge cases the Goal never asked for.

Notes

  • Item 5 — oversized: the Goal is "file a session into a folder that does not exist yet", but on retry the dialog re-reads the folder list, picks up renames and re-parents, and re-creates a folder that was "deleted elsewhere in the meantime" (NewFolderMoveDialog.tsx, the if (target) { … api.chatFolders() … } block). Subtraction: delete the re-read block and keep "Retry move" into created.id. If that folder is gone, the move error already says so. Clears when: the mechanism is removed, or a human amends the Goal.
  • Item 6 — oversized: the closed-session hold adds closedHint, sessionListed, the slotsListPartial gate and the session_closed status line, all for a session closed while its own dialog is open. Subtraction: delete them and let the move's rollback and ErrorNotice report the failure.

What this change ships

Inventory (10 items) — 8 justified

Intent: file a session into a brand-new folder from its own menu without three detours. ADDITION.

  1. "New folder…" entry at the end of every session's Move to folder submenu (sidebar dropdown, right-click, chat header) — justified
  2. Name dialog that creates the folder and moves the session in one step — justified
  3. Unticked "Create inside “”" offer when the session is already in a folder — justified
  4. Entry and dialog are dimmed offline and say why — justified
  5. Retry re-reads folders and re-creates a folder deleted elsewhere — oversized: an edge case beyond the Goal
  6. Create is held, with a status line, if the session closed while the dialog was open — oversized: an edge-case state machine
  7. New awaited move hook, useMoveSlotToFolderAsync, with networkMode: 'always' — justified
  8. Folder cache seed moved into seedCreatedChatFolder, shared by sidebar and dialog — justified
  9. New strings in all 12 catalogs — justified
  10. Screenshot evidence and capture script under temp-screenshots/ and website/scripts/ — justified

[FIRST-PRINCIPLES-REVIEWED] e7ac4ce

Description read

[DESCRIPTION-READ] 446c19945a8a2dd2f160412c1b480233df67a1e22f467a72112d6884dad49ad9

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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] e7ac4ce

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] e7ac4ce

@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 Oct 23, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from a76d52e to 885e8ef Compare October 23, 2026 12:01
@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 Oct 23, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 885e8ef to 4d0ac3d Compare October 23, 2026 13:22
@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 Oct 23, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 4d0ac3d to d46e888 Compare October 23, 2026 20:49
@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 Oct 23, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from d46e888 to 908ffd5 Compare October 23, 2026 22:33
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 23, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 908ffd5 to 359566d Compare October 23, 2026 23:53
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 845735b to 9c86f00 Compare October 27, 2026 08:14
@constevalsimon

Copy link
Copy Markdown
Contributor Author

note (non-blocking): 9c86f00 is a same-tree retrigger of 845735b; the tree and parent are identical, no code changed. The Fork GPT 6.1 Review lane on 845735b failed at its first step on a GitHub API error (run 40169518366) and never posted its check-run, so PR Readiness waited on it with no way to finish.

@github-actions github-actions Bot added 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 and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 27, 2026
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 9c86f00 to 54a5f83 Compare October 30, 2026 01:44
@constevalsimon

Copy link
Copy Markdown
Contributor Author

chore (non-blocking): 54a5f83 is 9c86f00 rebased on main to clear the merge conflict, no behaviour change in this PR's code.

#25793 added setMovedSlot to the move mutation's onSuccess in useMoveSlotToFolder.ts, which this PR had split into a shared useMoveSlotMutation. The rebase keeps that onSuccess in the shared mutation, so a move from the New folder dialog marks the session like any other move, and keeps #25793's braced per-call onSuccess. Locally on 54a5f83: the dialog tests (35, ten runs), folderProjectHint.test.tsx and ChatSidebar.moveToFolder.test.tsx, tsc, eslint, the i18n checks, Semgrep, the build and the bundle-size gate pass. The Security Scope Review lane on 9c86f00 never resolved its scope (generate job did not finish), so it re-runs on this push.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@constevalsimon

Copy link
Copy Markdown
Contributor Author

@iamwhatever could you take a look when you have a moment? Every lane is clean on 54a5f83. Opus and GPT have no findings, and UX, Design, First Principles and Security Scope pass. Two things need a maintainer:

  1. Rerun the failed jobs of CI run 40987629698. Frontend Tests (3) failed on one test outside this PR: NavHistoryArrows.test.tsx > NavHistoryArrows — draft guard interplay > asks before the pop when the Back trap could not arm, and a veto keeps the draft (expected "vi.fn()" to be called 1 times, but got 0 times, job). This PR touches neither NavHistoryArrows nor anything that test imports. On this head it passes 5/5 alone and under parallel load. Frontend Coverage Merge, Coverage Gate and PR Readiness are red only because of it. The fork account cannot rerun jobs.
  2. Review, if it looks right to you. The notes on this head repeat earlier rounds. The First Principles retry re-read is deferred to New folder dialog: Retry moves straight into the created folder, without re-reading the folder list #24179 (disposition). The second create UI is answered here. Design's note on the second folder writer is the reason given under ## Not a goal.

Filing a session into a folder that does not exist yet meant leaving the
menu, creating the folder in the sidebar, then reopening the menu to move
the session.

The session menus' "Move to folder…" submenu now ends with "New folder…".
It opens a small dialog that names the folder, creates it, and moves the
session into it in one step. A session already in a folder is offered the
new folder inside that one. The entry is gated offline like the sidebar's
own New folder row, and the dialog says in place why Create is held.

The dialog closes only once the server has acknowledged the move, takes
one submit at a time, keeps keyboard focus inside itself during a write,
and refuses every dismissal while a write is in flight. A refused create
keeps the name; a refused move names the folder it created, and where,
then retries the move alone, re-creating the folder if it was deleted
meanwhile. An awaitable variant of the shared move hook carries the same
optimistic update and rollback.

The dialog renders once per chat page beside its context provider,
because a Radix menu unmounts its content on pick, so both the sidebar
row menus and the chat header menu open the same dialog. The cache seed
the sidebar's create already did moves into a shared helper both use.

Closes kirodotdev#22779
@constevalsimon
constevalsimon force-pushed the feat/move-to-new-folder branch from 54a5f83 to e7ac4ce Compare October 30, 2026 04:48
@constevalsimon

Copy link
Copy Markdown
Contributor Author

note (non-blocking): e7ac4ce is a same-tree retrigger of 54a5f83 (tree and parent identical, no code changed) for the unrelated NavHistoryArrows.test.tsx failure in Frontend Tests (3) described above.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 30, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve at e7ac4ce.

The feature is sound. The picker gains an optional "New folder…" entry, and callers that do not pass onNewFolder are unchanged. The dialog's submit path guards double submits and creates nothing for a closed session. It awaits the same optimistic move with rollback, and after a failed move it retries without creating a second folder. The cache seed is the sidebar's code moved verbatim into seedCreatedChatFolder.

Every item from our r124 review has a disposition: the missing captures were added, the offline reason and the parent name now show in the dialog, and the two deferred notes are tracked in #24179 (remove the retry re-read) and #24178 (submenu width). Both issues are open and assigned, and their bodies cover the items. They still need the deferred-finding label, which the author cannot add. Please also list them under Related Issues in the description; today they are linked only from the disposition comments. Every check on this head is green.

AI findings judged non-blocking:

  • UX: the folder-list error does not state its consequence. This is wording only, and the offer keeps the parent name it last read (L62-L66).
  • UX: no capture of the dialog for a session outside any folder. That dialog is the captured one without the checkbox, and tests pin the path.
  • Design: a failed move leaves the new folder until Retry. The lane calls this reasonable, and the notice says the folder exists.
  • First Principles item 6: the closed-session hold is more than the goal needs. It causes no harm and stops a create for a session that is gone.

— crew-pr-reviewer (r136)

@iamwhatever
iamwhatever enabled auto-merge (squash) October 30, 2026 17:59
@iamwhatever
iamwhatever merged commit 45b66ba into kirodotdev:main Oct 30, 2026
90 of 93 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "New folder…" option to a session's "Move to folder…" menu

3 participants