Skip to content

ui-react: design own-chat deletion and targeted cache retirement #3231

Open

Description

@schlessera

Current state

All interaction choices are resolved, including D1 (2026-11-03, below). Design brief rev 5 is the design of record. blocked stays until #3281 (shared status indicator) and #3455 (the read-only operation lookup D1 requires) are delivered; both are open. #3230 is delivered.

Out of scope

Backend removal, broader authority, automatic expiry, origin-wide storage clearing and independent effect/content erasure.

Context

At source 6fa3ec1305e8b52991252d6a28959a68c56be1c1, clearPrivateDialogue, packages/ui-react/src/voice/conversation-client.ts:533-545, purges at principal boundaries, not per chat. persistent, packages/ui-react/src/root.ts:223-246, owns reloadable answer delivery/local work. createDraftClient, packages/ui-react/src/lib/draft-client.ts:45-57, and createLocalWork, packages/ui-react/src/lib/local-work.ts:227-245, can retain or resend copies after a view closes.

Design of record and D1 — maintainer, 2026-11-03

Design brief rev 5 is the design of record: contract mapping (§1), request and persisted record (§2), operation states O1-O7 on #3281's StatusIndicator (§3), the checking sheet on the real contract (§4), refusal copy (§5), indicator layout and interaction (§6) and browser cases 29-37 with mutations (§7). Rev 4 sections it does not name still apply, and rev 5's cases supersede rev 4 cases 23-28.

D1 — Check now for an unanswered request (O2): A, a true read. The host gains a principal-bound, read-only GET /api/chat-deletions/:operationId that returns the receipt or not_admitted and adds no authority (#3455; the ruling named #3230, which had already closed). In O2, Check now calls only that route. A receipt moves the operation to O4-O7 by its status. not_admitted resolves O2 to "not deleted": the record is removed, the fence lifted and the chat shown again, while chat_retired is still honoured if a delayed request is admitted later. A lost or failed read leaves O2 unchanged. Check now never POSTs, and Retry removal stays limited to O3-O6. Rejected: B, Check now reading only the chat's lifecycle with a "Stop tracking" dismissal; C, an explicit "Send deletion again" next to a lifecycle-only check.

Scope

First supply the interaction design, then implement the own-chat deletion control and targeted invalidation against the host contract. The deletion policy is settled. The maintainer selected all four interaction choices on 2026-11-02: Sessions-only entry, exact-target review/confirmation, compact persistent recovery details and omission on Working rows. Rev 5, with D1 A, is the reviewed design against the actual host contract. Part of #3234.

Acceptance criteria

  • Entry is the exact owned chat's Sessions-row overflow only; do not add a chat-header deletion entry. Record the reviewed 320px/desktop design for exact-target confirmation, busy/unsupported/stale/refused, partial/unknown and completed results. Display independent content/effect/provider/backup exclusions and old-backup/offline limitations without promising erasure.
  • Review shows the exact target/owner and removed/kept scope, initial focus on Cancel and a separate explicit Delete, without typed-title confirmation or speech authority. Stale targets require fresh review and current host admission checks.
  • Omit Delete from Working rows; current host busy-effect refusal remains authoritative, including state changes during review.
  • After a possibly submitted deletion loses its reply, show a checking sheet for at most 10 seconds with Close immediately available and equivalent Escape dismissal. On earlier dismissal or unresolved expiry, carry truthful recovery in the Sessions indicator; never retry deletion or infer success from the timeout. Preserve active-context focus and ignore late responses from a previous principal/view.
  • Keep one compact Sessions-header recovery indicator using ui-kit: add a compact animated status indicator with hover and tap details #3281 outside removable chat rows and across reload until unresolved operations are reconciled. Details list each operation separately with exact principal/operation-bound actions. Recheck on load/reconnect or explicit Check without a polling loop; opening details itself does not initiate a check or effect. Details expose truthful pending/partial/unconfirmed/completed state and safe store categories with explicit authorized Check or Retry. Opening details is not a retry. No surviving deleted title/content in receipts/restored details; unknown host state is not confirmed retirement.
  • Implement rev 5 §2-§6: the principal-scoped content-free operation record written before the POST, states O1-O7 with their StatusIndicator state, label, explanation, facts and action, the §4 checking sheet on chat_retired and history reads (a history 200 never clears the fence), the §5 refusal copy with the record cleared after any 4xx, and the §6 indicator placement, sizing and per-operationId actions.
  • D1 A: Check now in O2 issues exactly one GET /api/chat-deletions/:operationId and no POST. A receipt maps to O4-O7, not_admitted shows "not deleted", removes the record and lifts the fence, and an unreachable or failed read keeps O2. If the host does not answer the route (an older host), Check now stays a lifecycle-only read and O2 stays unconfirmed; it never falls back to a POST.
  • Retire the chat lifetime before queued frames/responses can publish; clear bound timeline/history/voice/drafts/answer caches/object URLs, stop pending autosave/resend/retry and validate lifecycle before render/resend on reload/reconnect. Preserve unrelated chats/accounts/focus/scroll/drafts.
  • Suspended/offline tabs and old clients have truthful limits; server fences remain authority. Enter sends nothing; fresh provider transfer requires a new identity and explicit disclosed Start. Speech never authorizes deletion.
  • Principal revocation/switch and replaced target during review cannot delete/publish another principal/chat. Accessible keyboard/touch interaction and focus recovery follow existing kit patterns.

Verification

Use pinned real offline-browser tabs with actual root stores/transports, seeded Odysseus markers and unrelated controls. Delay history/frames/autosave/answers through deletion, switch chat/principal, reload and disconnect/reconnect. Assert no transient republishing in both DOM and store subscriptions. Mutate targeted invalidation and stale-response gates independently; named assertions must fail and restore. Include no-Start provider-open control and complete browser-global descriptor restoration. Cover rev 5 browser cases 29-37, plus: O2 then Check now answering not_admitted (one GET, zero POSTs, record removed, chat visible again), O2 then Check now returning a pending receipt (moves to O4), and O2 against a host without the route (O2 stays, zero POSTs). Rev 5's four mutations, plus making Check now send a POST, must fail their named cases. Synthetic fixtures do not prove offline physical erasure.

Contract impact

Consume #3230's delivered HTTP/wire capability and #3455's additive read route without inventing authority. Public client/wire changes require same-commit CONTRACT docs/API reports and suitable changeset; any actual legacy break needs breaking treatment under the recorded policy. Interaction approval is required before implementation, not a new ruling on settled deletion scope.

Supplied design to review

Review the current rev-4 compact recovery proposal, together with the initial proposal, rev-2 matrix and rev-3 corrections only where not superseded. Do not request another generic design. Those are review inputs; a designer's recommendations do not replace maintainer acceptance. Read the binding policy records and source anchors below before implementation.

Policy and ownership

Follow-up to #3180 and its binding ruling. Read docs/decisions/chat-history-deletion.md and docs/plans/chat-history-deletion.md now delivered by #3232. Authenticated owners delete only their own chat with exact principal fences; agent/cross-principal deletion is forbidden. Ambient mode needs explicit owner mapping, otherwise refuse. Independent saved content/effects/provider copies/backups remain and are disclosed. Minimized non-content identity/replay fences are permanent; old-backup restoration is accepted. No outside-image ledger, secure-erasure promise, automatic expiry or routine live cutoff. Busy effects refuse with existing stop/reconcile paths. Priority p2 records wanted, unscheduled work under the approved policy; it does not commit a runtime release.

Dependencies

Blocked by #3281
Blocked by #3455

#3230 (the host deletion contract) is delivered on main. #3455 adds the read-only operation lookup that D1 A requires.

Selected interaction rulings — 2026-11-02

Q1 — entry: selected A, Sessions-row overflow only. Put Delete chat… in the owned chat's existing Sessions ⋯ menu, with no second chat-header entry. This keeps chat management together and avoids another control; deleting the open chat requires opening Sessions. Existing owner/capability/busy checks remain authoritative. This approves entry placement, not all other proposed interaction choices.

Q2 — confirmation: selected A, review then explicit confirmation. Show the exact chat target, owner and removed/kept scope in the phone sheet or desktop dialog. Focus Cancel initially; a reflex Enter must not confirm deletion. Require a separate explicit Delete action; do not require typing the chat title. Revalidate exact owner/target/current eligibility at host admission, and require fresh review when the target is stale. Speech cannot open or confirm deletion. This is the less cumbersome phone interaction; the review/host checks still carry the actual authorization.

Q3 — recovery: selected B, compact persistent status indicator in Sessions. Use shared #3281 instead of a mandatory persistent Callout. Place the indicator in the Sessions status area so it survives the retired row disappearing. It remains discoverable/restorable until the exact operation is resolved, with a meaningful glyph/color, state-aware animation, accessible name and hover/focus details; tap/click/keyboard opens persistent details with safe remaining-store categories and Check/Retry where authorized. Opening details does not retry deletion. Only known remaining cleanup may offer Retry under the same host intent; uncertainty offers Check/reconciliation without replaying deletion.

Restore authoritative pending/partial results from the host and preserve the minimal principal-bound reconciliation handle for an unconfirmed submission across reload. Do not infer host retirement from a local protective fence. Honor current ownership/revocation on every read/action and principal switch. The compact presentation saves space but requires opening details for explanations/actions. It does not make partial/unknown into success or suppress required recovery.

The binding docs/decisions/chat-history-deletion.md forbids titles/content in surviving deletion receipts. Correct the supplied proposal's title-bearing restored Callouts accordingly: recovery details after retirement/reload use safe non-content operation facts, never retain/recover a deleted title or transcript for presentation. The current review's exact-target display before deletion remains valid. Unknown local state is distinguished from confirmed host retirement; unrelated principals learn no operation existence/content.

Q4 — Working rows: selected A, omit Delete chat…. Do not add a disabled deletion item to the actively working row's overflow. Once work is no longer active, the applicable owned Sessions date/history row offers the selected deletion entry under current capability/authorization. A stale UI or another entry cannot bypass the host's busy-effect refusal; use the existing explicit stop/reconcile flow separately. This avoids a permanently unusable Working-row item, at the cost of less inline explanation there.

Review rev 2 together with rev 3, not the superseded connection/principal rows. “Nothing was deleted” requires known pre-admission failure or authoritative not-admitted evidence; missing replies/request-local ids alone are not such proof. After possible admission, stop local publication/autosave/resend for the exact old-principal/chat scope and reconcile the host receipt/lifecycle. An unreachable receipt is unconfirmed; never equate a local protective fence with confirmed host retirement. Principal switches expose no prior title/id/outcome to the new principal. Preserve permanent fences, independent-content/effect/provider/backup exclusions, explicit Start, offline/old-client limits and no speech authorization.

#3230 is the actual host-contract dependency; #3281 supplies the shared status component. The proposed receipt lookup/not-admitted classification must be supported by that contract or use truthful unconfirmed fallback; no UI-invented authority or wire schema is approved. The original four product choices, the rev-4 F1/F2 review and D1 (2026-11-03) are complete; rev 5 is the reconciled matrix. These choices accept the stated direction, not every earlier proposal detail or runtime qualification.

2026-11-02 interactive review: recorded Q1 A, Sessions-only deletion entry, and consolidated the supplied rev-2/rev-3 review inputs and remaining choices. Earlier deletion authority is unchanged; no implementation, runtime acceptance, release milestone or broader deletion promise is claimed.

2026-11-02 confirmation ruling: selected Q2 A, exact-target review followed by explicit Delete, initial focus on Cancel and no typed-title requirement. Recovery presentation and Working-row behavior remain open. Existing host authority, stale-target, busy and uncertainty rules are unchanged.

2026-11-02 recovery presentation ruling: selected Q3 B, a persistent/restorable compact Sessions status indicator with hover/tap details and explicit authorized Check/Retry, using #3281. Added that delivery prerequisite and the source-backed requirement to avoid retained deleted titles/content in restored recovery details. Q4 Working-row behavior remains open; no deletion runtime, design acceptance or release is claimed.

Rev-4 checking review — maintainer, 2026-11-02

F2 — selected A: a checking sheet with a 10-second maximum. When a possibly submitted deletion loses its reply, show the checking sheet while reconciling the actual host outcome. Close is available immediately; Escape follows the same dismissal path. If the outcome remains unresolved at the 10-second presentation bound, close the sheet and carry recovery in the Sessions indicator. The user may leave the sheet before that; recovery remains accessible and no unknown result becomes success.

The bound limits the blocking presentation, not the lifetime of deletion, authoritative cleanup, retirement fences or receipt ownership. Closing, expiry or a lost reply never retries deletion, cancels authoritative cleanup or proves completion/non-admission. Preserve the exact principal/operation identity, protective local state and truthful pending/partial/unconfirmed outcome. Focus returns safely to the corresponding indicator when this sheet is dismissed in its active context; a late read/timeout cannot steal focus after navigation or principal change.

This favors direct confirmation when a quick read succeeds, accepting that the sheet may remain visible longer than an immediate move to the indicator. F1 acceptance of the remaining rev-4 direction is recorded below. Rev 5 supplies the #3230/#3281 reconciliation; layout verification is part of implementation.

F1 remaining recovery direction — maintainer, 2026-11-02

Selected A: accept the remaining deletion-recovery direction, subject to host-contract and layout verification.

  • Use one Sessions-header indicator, outside the removable chat rows, to summarize unresolved deletion operations; persistent details list each operation separately and bind every action to its exact principal/operation. It survives row removal and restores unresolved recovery across reload.
  • Keep surviving details to safe non-content operation facts and store categories, never deleted titles/transcripts or other retained chat content. Do not expose a prior owner's operation existence, count or outcome after a principal switch.
  • Check only reads authoritative status. Offer Retry removal only for confirmed remaining cleanup under the same authorized intent; opening details does not check, retry or delete.
  • Recheck on reload/reconnect or explicit Check without a polling loop or automatic deletion replay. Preserve the selected F2 immediately dismissible checking sheet with a 10-second presentation maximum.
  • Keep authoritative not-admitted, locally fenced/unconfirmed, host-retired cleanup incomplete and completed outcomes separate. A missing reply, request-local identifier, unsupported receipt endpoint or elapsed time never establishes retirement, non-admission or completion.

The compact flow is accepted with the tradeoff that detailed outcomes require opening the indicator. Rev 5 supplies the host receipt/lifecycle mapping and the revised state/copy/focus/layout; verification is part of implementation.

Design handoff delivered

Design brief rev 5 answered the former "Focused design revision remaining", reconciled with #3230's delivered contract and #3281's approved R3 specification. With D1 ruled on 2026-11-03 it is the design of record; see "Design of record and D1" above.

2026-11-02 final interaction ruling: selected Q4 A, omission from Working rows. All four product choices are recorded and incorporated into acceptance criteria. Removed needs: decision; the supplied proposal still needs the specific compact-indicator/non-content-recovery design revision, so retain needs: design and the #3230/#3281 blockers. No implementation, complete design acceptance, runtime proof or release is claimed.

2026-11-02 interactive checking ruling: F2 A, up to 10 seconds in a checking sheet with immediate Close/Escape and subsequent Sessions-indicator recovery. The presentation bound does not settle/cancel deletion or clear fences. F1 review remains open. No complete design acceptance, implementation, runtime proof or release commitment is claimed.

2026-11-02 final recovery-direction ruling: F1 A, accept the stated Sessions-header/per-operation/non-content recovery direction with read-only Check and authorized known-cleanup Retry, subject to host-contract and layout verification. All current decisions are answered; remove needs: decision, retain/add needs: design for the exact dependency-backed reconciliation and retain blocked on #3230/#3281. No implementation, runtime proof or release commitment is claimed.

Triage 2026-11-03: folded the maintainer ruling (D1 A, read-only GET /api/chat-deletions/:operationId so Check now is a true read) and design brief rev 5 into the body. The route went to new #3455 because #3230 had closed; swapped the satisfied #3230 blocker for #3455.

Activity

  1. added
    type: featA new capability or a change in user-visible behaviour.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    needs: designBlocked on a design drop or a visual answer.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 1, 2026
  2. added
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    on Nov 1, 2026
  3. schlessera commented on Nov 1, 2026

    @schlessera
    OwnerAuthor

    2026-11-01 readiness reconciliation: approved local-deletion policy delivered by #3232; native membership in epic #3234 verified. Priority p2 means wanted and unscheduled, with no runtime release commitment. The interaction design remains unresolved; retain needs: design and keep agent-ready absent. Existing host-contract dependency remains authoritative. Source applicability and the current specification are folded into the body; no implementation started.

  4. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Design brief: own-chat deletion journey

    Read against a84d9bf:

    Own-chat deletion at 320px: entry, review sheet, busy refusal, results, state copy

    Own-chat deletion at desktop: review dialog while deleting, open chat after deletion in this and another tab

    1. Entry

    There is one entry point: the existing session-row overflow in Sessions. That is the drawer below 1280px and the pane at 1280px and up.

    • SessionOverflow now renders whenever a row has any action, not only handoff.
    • Delete chat… is the last item, after a separator, in red text. Continue on another backend… keeps its place above it.
    • The item is offered only on rows the current principal owns. Agent principals and foreign rows get no item at all, so the menu never reveals whether such a chat exists.
    • When the host's capability says no, the item stays visible but aria-disabled, with its reason printed (same pattern as handoff):
    Case Reason line
    Backend can't remove history not available for this backend
    Ambient auth, no owner mapping owner not set for this brain
    Offline / not connected offline · connect to delete
    Capability not yet known checking who owns this chat…
    Old server without the capability item absent

    The item is never offered in Working or Drafts rows. A Working chat is busy by definition, and a Drafts row has no host chat.

    ┌ Sessions ─────────────────────────┐
    │ [ New conversation ]              │
    │ TODAY                             │
    │ ┌ Harbor permits for Ithaca ┐ [⋯]  │
    │ │ 2h ago · $0.12            │  ┌──────────────────────────┐
    │ └───────────────────────────┘  │ Continue on another…     │
    │                                ├──────────────────────────┤
    │                                │ Delete chat…        (red)│
    │                                └──────────────────────────┘
    

    2. Review: exact target and owner

    On a phone this is a BottomSheet; on desktop it's a modal Dialog (440px). Both use the existing kit primitives.

    Delete this chat?
    ┌──────────────────────────────────────────────┐
    │ Harbor permits for Ithaca                    │
    │ your chat · Odysseus · started Oct 28 ·      │
    │ last active 2h ago                           │
    └──────────────────────────────────────────────┘
    REMOVED FROM THIS BRAIN
    Messages, replies and tool results, the voice transcript, and drafts
    and attachments saved with this chat.
    KEPT
    Notes, files and changes it saved · Inbox, Activity and journal
    records · chats continued from it · what the model provider already
    received · exports and backups.
    Restoring a backup made before now brings this chat back. Devices
    that are offline keep their copy until they reconnect. This can't be
    undone.
    [ Cancel ]                                   [ Delete chat ]  (red)
    
    • Target: the title, or Untitled, plus the owner principal's label and the start and last-active times. These come from the admission snapshot, not from the row text.
    • "your chat": printed only when the server confirms exact ownership. If it can't, the review never opens; the result is a refusal (§3).
    • Live voice open on this chat: the review adds one line, "Live voice for this chat ends."
    • Words not used: "erase", "permanently", "everywhere", "forever". There is also no reclaimed-bytes figure.

    3. Admission outcomes

    All of these appear in the same sheet or dialog, which morphs in place and keeps focus on its first action.

    Outcome Title Body Actions
    Busy task Can't delete yet A task in this chat is still running. Nothing was deleted. Stop it or let it finish, then delete again. Stopping doesn't undo what it already changed. Close · Open task
    Busy, other work Can't delete yet A follow-up is queued / a handoff is being prepared / a shared file is being applied / its history is being archived. Nothing was deleted. Close (· Open task)
    Stale target This chat changed while you were reviewing Nothing was deleted. Review it again to delete the current version. Review again · Close
    Unsupported Couldn't delete this chat This backend can't remove its history yet. Nothing was deleted. Close
    Owner unknown Couldn't delete this chat This brain can't confirm who owns it. Nothing was deleted. Close
    Not allowed Couldn't delete this chat Your account can't delete it. Nothing was deleted. Close
    Connection Couldn't reach the brain Nothing was deleted. Try again when you're connected. Try again · Close
    Signed out or principal switched during review the sheet closes toast in the new context: "You were signed out. Nothing was deleted." (no title) —
    • Open task uses the existing stop/reconcile surface. Deletion never stops anything itself.
    • Review again re-fetches the snapshot. The old confirmation is never reused for the replacement chat.

    4. Deleting and results

    • Pressing Delete chat:
      • The button reads Deleting… (aria-busy). Cancel becomes aria-disabled.
      • The status line reads "Closed. Removing its copies…". Once the server acknowledges retirement, the chat can't be reopened, so offering Cancel would be dishonest.
      • The row leaves the list at retirement, not at completion.
    • Results sit in the Sessions status slot, where the list warning sits now, as a Callout with role="status". They persist until dismissed or superseded:
      • Removed: Deleted "{title}" from this brain. Saved notes, records, provider copies and older backups are kept. · Dismiss
      • Partial / pending: "{title}" is closed, but not fully removed. Still to remove: {store categories}. It can't be opened or continued meanwhile. · Retry removal. The categories are safe names only, for example Claude history, Pi history, saved drafts, chat records. No paths or text.
      • Unknown: "{title}" is closed. Removal unconfirmed. Something stopped before removal was confirmed. It stays closed and can't be opened or continued. Saved effects are not undone. · Check again
    • The chat was open in this tab: Chat becomes an empty new chat, with a notice in the composer notice slot: "Chat deleted from this brain. Live voice for it ended. To talk again, press Start in a new chat." Focus goes to the empty composer. Enter with no text sends nothing, and voice needs a fresh, disclosed Start.
    • Other tabs showing it: the transcript is replaced by "This chat was deleted. Its messages and its unsent draft were cleared from this tab." · New chat. The composer is hidden.
    • Offline tab: it keeps its view until reconnect (disclosed in the review). On reconnect, lifecycle validation runs before any cached message renders, and then the other-tab state shows. Unsent text for that chat is discarded, never resent.

    5. Client retirement order

    This is what the UI must guarantee; it maps to the acceptance criteria.

    1. On acknowledgement or invalidation, advance the chat's lifetime token first. Any queued frame, history chunk, answer delivery or autosave callback checks the token and drops.
    2. Clear the bound projections: timeline, history pages and cursors, voice tails, drafts, answer-delivery records in persistent, local-work entries, handoff summaries. Revoke object URLs.
    3. Stop the pending autosave, resend and retry for that chat (createDraftClient, createLocalWork).
    4. Leave everything else alone: other chats, accounts, drafts, roving-list position, scroll.
    5. clearPrivateDialogue stays the principal boundary and is not reused per chat.

    6. Focus and keyboard

    • Opening: the overflow is a menu button, so ↓ or Enter opens it and focus lands on the first enabled item. Delete chat… opens the review, where initial focus is on Cancel. Enter on open therefore never deletes.
    • Inside the review: Tab cycles Cancel ↔ Delete chat. Escape equals Cancel, except during Deleting…, when Escape does nothing and the status line explains why.
    • Cancel or Close: focus returns to the row's overflow trigger. If the row is gone, focus goes to the list's roving stop.
    • After deletion from the list: focus moves to the next row in the roving order, else the previous row, else New conversation. The result Callout is announced politely; it is not focused.
    • Touch: every action is at least 44px, and the sheet keeps its drag handle. Destructive and safe buttons are equal width and side by side, Cancel on the left.
    • Voice: nothing in the flow takes speech input. A spoken "delete this chat" never opens or confirms the review, and an agent has no tool for it.

    7. Browser scenario matrix

    # Setup Act Assert
    1 Owner, idle chat A, control chat B Delete A A gone from list, DOM and stores; B untouched; focus on next row
    2 Delayed history chunk and answer frame for A Delete, then release the delay No marker from A in DOM or store subscriptions, ever
    3 Pending autosave and resend on A's draft Delete, then release No save or send request for A; B's draft saved normally
    4 A open in tab 1 and tab 2 Delete in tab 1 Tab 1 lands on an empty new chat; tab 2 shows "This chat was deleted"; B's scroll and focus unchanged
    5 Tab 2 offline with A cached Delete in tab 1, reconnect tab 2 A's content never renders after reconnect; unsent text discarded
    6 Reload after delete Load Cached A records are validated and dropped before render
    7 Review open; A replaced or renamed server-side Delete chat "This chat changed…", nothing deleted, no request for the replacement
    8 Review open; principal revoked or switched Delete chat Sheet closes, nothing deleted, no title in the new context
    9 Task running on A Delete chat Busy refusal; Open task leads to the existing stop path; no retirement
    10 Backend unsupported / ambient without mapping Open menu Disabled item with its reason; no request on activation
    11 Server returns partial, then a retry succeeds Retry removal Partial Callout replaced by Removed; A never reopenable meanwhile
    12 Server returns unknown Check again Stays closed; no completed copy until confirmed
    13 Live voice open on A Delete Voice ends; Enter in the new chat sends nothing; no provider open without Start
    14 Speech "delete this chat" — No review opened, no request
    15 Old client build Read A after deletion Server refusal "This chat isn't available."; no cached render
    16 Keyboard only, then touch only Full flow Focus path as in §6; all targets at least 44px; axe clean

    Open questions

    • Q1. A second entry point. Should the open chat's own header also get Delete chat… (in a More menu)? The proposal is Sessions-row only for now, which keeps one placement and no new header control.
    • Q2. Confirmation strength. Is the two-step review with Cancel focused enough, or should deletion require typing the title? The proposal is two-step, since the kit has no type-to-confirm pattern.
    • Q3. Partial-result persistence. Should a pending or partial result also appear in Activity, so it survives closing the tab? The proposal is Sessions-only, plus a retry on next load while the server still reports partial.
    • Q4. Busy Working rows. Should Working rows show a disabled Delete chat… with the reason "running", rather than omitting it? The proposal is to omit it, because the date row reappears when the work ends.

    Design file: Chat Deletion 3231.dc.html. Implementation stays blocked by #3230.

  5. added
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    needs: designBlocked on a design drop or a visual answer.
    and removed
    needs: designBlocked on a design drop or a visual answer.
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 2, 2026
  6. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Design brief rev 2: the four UX choices resolved, plus the consolidated matrix

    The 2026-11-02 triage asked for four UX choices to be resolved and folded into an exact state, focus and copy matrix. This revision makes those calls, records the reason for each, and consolidates the November 2 proposal into one matrix that implementation can follow.

    Not reopened: deletion authority, busy refusal, exclusions and permanent replay fences. #3230 is still the host-contract prerequisite. The mocks in rev 1 still apply.

    Choices

    # Choice Decision Why
    1 Entry point Sessions row overflow only. No chat-header entry. The Sessions row is where chats are already managed (title, last active, cost, handoff). A header control would be new chrome on every chat for a rare destructive act. The open chat is still reachable: its row is the selected row in Sessions.
    2 Confirmation strength Two-step review, initial focus on Cancel. No typed title. The review already shows the exact target, owner and exclusions. Retirement is refused when busy or stale. Enter on open lands on Cancel, so a reflex can't delete. Typing a title adds a text field the kit doesn't own and hurts touch use without adding information.
    3 Partial-result recovery Sessions status slot (persistent Callout), restored on every load while the host reports the chat as retired but not fully removed. Not added to Activity. Recovery belongs with the thing that is missing. The host's per-store receipt is the source of truth, so the Callout comes back after reload or on another device. Activity would make deletion look like agent work.
    4 Working rows Omit Delete chat… from Working rows. The date row's overflow carries it once the work ends. A Working row is busy by definition, so the item would always be disabled. Omitting it avoids a permanently dead item. A user who goes to the date row while work is still running gets the busy refusal with Open task.

    Consolidated state, copy and focus matrix

    State Surface Title / line Body Actions Focus
    Entry available Row ⋯ menu Delete chat… (red, last, after a separator) — — Menu opens on the first enabled item
    Entry unavailable: backend Menu item aria-disabled Delete chat… not available for this backend — Item focusable, announces its reason
    Entry unavailable: ambient, no mapping same same owner not set for this brain — same
    Entry unavailable: offline same same offline · connect to delete — same
    Entry unavailable: checking same same checking who owns this chat… — same
    Foreign / agent principal / old server — item absent — — —
    Review Sheet (phone) / Dialog 440 (desktop) Delete this chat? Target card: {title}, then your chat · {principal} · started {date} · last active {age}. Removed / Kept lists. Backup and offline sentence. "This can't be undone." Live voice adds: "Live voice for this chat ends." [Cancel] [Delete chat] Cancel
    Busy: task same surface, morphs Can't delete yet A task in this chat is still running. Nothing was deleted. Stop it or let it finish, then delete again. Stopping doesn't undo what it already changed. [Close] [Open task] Close
    Busy: other same Can't delete yet A follow-up is queued / a handoff is being prepared / a shared file is being applied / its history is being archived. Nothing was deleted. [Close] (+ [Open task] when one exists) Close
    Stale target same This chat changed while you were reviewing Nothing was deleted. Review it again to delete the current version. [Review again] [Close] Review again
    Refused: unsupported same Couldn't delete this chat This backend can't remove its history yet. Nothing was deleted. [Close] Close
    Refused: owner unknown same Couldn't delete this chat This brain can't confirm who owns it. Nothing was deleted. [Close] Close
    Refused: not allowed same Couldn't delete this chat Your account can't delete it. Nothing was deleted. [Close] Close
    Refused: connection same Couldn't reach the brain Nothing was deleted. Try again when you're connected. [Try again] [Close] Try again
    Principal revoked or switched during review Surface closes Toast in the new context: You were signed out. Nothing was deleted. — — The new context's default
    Deleting (retired, draining) same surface Delete this chat? Status line: Closed. Removing its copies… [Cancel] aria-disabled · [Deleting…] aria-busy Stays on Deleting…; Escape does nothing and the status says why
    Removed Sessions status Callout Deleted "{title}" from this brain. Saved notes, records, provider copies and older backups are kept. [Dismiss] Next row, else previous row, else New conversation; Callout announced politely
    Partial / pending Sessions status Callout, restored on load "{title}" is closed, but not fully removed. Still to remove: {store categories}. It can't be opened or continued meanwhile. [Retry removal] same as Removed
    Unknown Sessions status Callout, restored on load "{title}" is closed. Removal unconfirmed. Something stopped before removal was confirmed. It stays closed and can't be opened or continued. Saved effects are not undone. [Check again] same
    Open in this tab Composer notice slot Chat deleted from this brain. Live voice for it ended. To talk again, press Start in a new chat. — Empty composer; Enter with no text sends nothing
    Open in another tab Transcript replaced This chat was deleted Its messages and its unsent draft were cleared from this tab. [New chat] Unchanged; announced politely
    Offline tab on reconnect same as other tab — Shown before any cached message renders; unsent text is discarded, not resent [New chat] same
    Old client reading a retired chat Server refusal This chat isn't available. — — —

    Accessibility recap

    Browser matrix

    Rev 1's 16 scenarios stand, with two additions for the choices above:

    • 17. Partial result, reload, then a second device: the Callout reappears on both from the host receipt, and Retry removal works from either.
    • 18. Work running, then Working row and date row: the Working row has no Delete item, and the date row's item opens the busy refusal with Open task.

    No open questions remain from rev 1.

  7. added
    needs: designBlocked on a design drop or a visual answer.
    and removed
    needs: designBlocked on a design drop or a visual answer.
    on Nov 2, 2026
  8. 12 remaining items

  9. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-02): F2 A — keep the deletion checking sheet for up to 10 seconds, with Close available immediately. Escape dismisses equivalently. If unresolved at the bound, close the sheet and carry recovery in the Sessions indicator. This can show quick confirmation directly, accepting a potentially longer visible sheet than immediate indicator-only recovery.

    The timeout bounds presentation only. It never retries deletion, cancels host cleanup, clears protective fences or proves success/non-admission. Preserve exact principal/operation identity and truthful unknown/partial state. Dismissal restores focus to the appropriate indicator in the active context; late responses/timeouts cannot steal focus after navigation/principal change.

    Folded the choice into the body and acceptance criteria. Rev 4 is now the current supplied input. F1 remaining interaction-direction review is still open, so retain needs: decision for now, with actual #3230/#3281 prerequisites unchanged. No whole-proposal approval, runtime proof or release commitment is implied.

  10. added
    needs: designBlocked on a design drop or a visual answer.
    and removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 2, 2026
  11. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-02): F1 A — accept the remaining deletion-recovery direction, subject to host-contract and layout verification. One Sessions-header indicator survives removed rows and summarizes unresolved operations; details expose each operation's safe non-content facts and exact actions. No deleted title/content survives in recovery presentation, and another principal sees no prior operation existence/count/outcome.

    Check reads only. Retry removal is available only for confirmed remaining cleanup under the same authorized intent. Opening details triggers neither. Recheck on reload/reconnect or explicit Check, without a polling loop or deletion replay. Keep not-admitted, unconfirmed/local fence, host-retired incomplete cleanup and completed outcomes distinct. The accepted tradeoff is opening details for detailed outcomes. F2's immediately dismissible checking sheet still has a 10-second presentation maximum.

    All current decisions are recorded in the body/acceptance criteria. Remove needs: decision, add needs: design for final #3230/#3281 contract/state/copy/focus/layout reconciliation and retain blocked; no agent-ready while design remains. Unsupported receipt/lifecycle queries cannot authorize unfencing, and missing replies/sign-out alone cannot prove nothing was deleted. Acceptance is of the stated direction, not blanket older-mock approval or runtime proof. Record the choices/alternatives in relevant existing decision guidance during implementation. No release commitment is implied.

  12. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Design brief rev 5: reconciled with the actual #3230 contract and approved #3281

    This answers the "Focused design revision remaining" section of the body. It keeps Q1–Q4, F1 and F2 exactly as selected. It changes only what the real contracts force.

    Sources:

    Rev 4 sections not named below still apply. That covers the entry, the review sheet, the open-tab and other-tab handling, the retirement order, and the principal-switch isolation.

    #3231 rev 5 at 320px: bounded checking, indicator after the row is gone, two operations with per-store facts, refusal before retirement, removed with kept list, other principal

    #3231 rev 5 desktop at 1280px and up: focus tooltip while a request is in flight, details dialog with Retry removal and Check now

    1. What the contract actually gives the UI

    Need in rev 4 Contract reality Consequence
    Read-only receipt lookup by request id None. The only correlation is repeating POST /api/chat-deletions with the same operationId, and that retries cleanup. If the first request never arrived, it would admit the deletion now. A repeat POST is not a read, so it can't be Check now. See D1.
    Not admitted answer None. A received 4xx refusal (unauthorized / unavailable / stale / unsupported / busy) is "before anything is retired". "deleted nothing" is shown only for a received 4xx or a request that was never written. The receipt-based Not deleted. state from rev 3/4 (S4) is removed.
    Retirement signal chat_retired { sessionId?, historyOwnerIds, generation } goes to the same owner's capable clients. The history route answers 404 SESSION_NOT_FOUND only for a retired chat. Both prove the chat is retired. Neither proves that this operation did it or how far cleanup got.
    Cleanup state status: pending · partial · unknown · removed. Per-store map over native · dialogue · tasks · projections · drafts. A host restart resumes cleanup. pending doesn't mean work is running. It never animates (§3).
    Busy kinds A single busy reason One busy message. Open task is shown only when this client's own Working list holds that chat.
    Owner unknown, foreign or absent All return the same 404 unavailable One refusal message that doesn't distinguish them (S4).
    Mid-flight revocation 401 from the guard after the async steps; retirement may already have happened Treated as signed out after submit (rev 3/4): no outcome is claimed, and the operation stays with the old principal.
    Storage failure 500 CHAT_DELETION_FAILED, "never a reported deletion" Shown as unconfirmed, not "deleted nothing".
    Capability server_hello.capabilities.chatDeletion Missing: no menu item. Present but offline: disabled with the reason offline · connect to delete. The rev 1 reasons checking who owns this chat… and owner not set for this brain are dropped, because there is no pre-read; ambient-without-mapping gets the 403 refusal. The reason not available for this backend stays only if the client-visible backend capabilities expose historyRemoval: false; otherwise the 409 handles it.

    2. Request and persisted record

    • Request: { operationId: <client-minted>, target: { sessionId } | { historyOwnerId }, expected: { backendId, generation } }. generation is the one the review showed, or 1 when the host keeps no dialogue for the chat.
    • Persisted record: a principal-scoped local record { operationId, target, expected, requestedAt, device }. It is written before the request is sent, so a reload can still reconcile.
    • What's kept, and what's never shown:
      • The ids are non-content fences, kept only so the client can ask about them again.
      • The record holds no title, excerpt or owner label.
      • Ids are never rendered, put in accessible names or announced.

    3. Operation states → StatusIndicator (#3281 R3)

    # Evidence state · glyph stateLabel Explanation Facts Action
    O1 Request in flight (first send, Check, Retry) active · loading, breathes Asking the brain — Requested —
    O2 Written, no reply (timeout, drop, reload, 401, 500) unknown · unproven Deletion unconfirmed The brain hasn't answered this request. The chat is closed on this device meanwhile. Requested · Last asked Check now
    O3 chat_retired or history 404 seen for the target; no receipt unknown · unproven Closed · removal not confirmed Closed by the brain. Whether its copies are removed isn't known yet. Requested · Closed Retry removal
    O4 Receipt pending queued · later (neutral) Removal not finished Closed by the brain. Some copies aren't confirmed removed yet. The brain also continues when it restarts. Removed · Not yet Retry removal
    O5 Receipt partial failed · stopped Some copies weren't removed Closed by the brain and can't be opened. Some copies are still on this brain. Removed · Not removed Retry removal
    O6 Receipt unknown unknown · unproven Removal not confirmed Closed by the brain. It couldn't confirm every copy was removed. Removed · Not confirmed Retry removal
    O7 Receipt removed success · finished Chat removed from this brain Removing it here doesn't undo what it did or reach copies held elsewhere. Removed · Kept (from retained) Done
    • Retry removal repeats the POST with the same operationId and expected. It's offered only from O3 to O6, where the host has already confirmed retirement. A repeat in that state can only resume cleanup; it can't admit a new deletion.
    • Check now in O2 depends on D1.
    • Facts in human words:
      • The store keys become: native → "{backend} history" (backend label only), dialogue → "conversation record", tasks → "task results", projections → "session list", drafts → "saved drafts".
      • retained becomes: "saved notes and files · effects and audit · provider copies · backups · offline devices".
    • Leaving: O7 stays until details are opened or the next load, and is not restored after a reload. Every other state is restored on load from the record. When the record has a receipt or retirement fact, that comes back too.

    4. Checking sheet (F2) on the real contract

    1. Reply lost: the client fences the chat first (rev 3 §1), then the sheet morphs into Checking whether it was deleted with a breathing loading glyph.
    2. Close: Close and Escape work at once. They close the sheet, the indicator shows O2, and focus goes to the indicator.
    3. What the sheet waits for (at most 10 s):
      • chat_retired for the target → O3.
      • A history read of the target. 404 SESSION_NOT_FOUND → O3. 200 → stays O2, because a live listing doesn't clear the fence (body rule).
      • Nothing sends another POST automatically.
    4. When it resolves:
      • Resolved inside 10 s: the sheet shows that outcome's line for the rest of the window, then closes. Focus goes to the indicator.
      • Unresolved at 10 s: the sheet closes into O2.
    5. Stale timers: if the user has navigated, closed Sessions or switched principal, the timer and any late answer update the record only. They never move focus, open a surface or announce in another principal's context.

    5. Refusals in the review surface (replaces the rev 2 refusal rows)

    HTTP Title Body Actions · focus
    409 busy Can't delete yet Something in this chat is still running or queued. This request deleted nothing. Stop it or let it finish, then delete again. Stopping doesn't undo what it already changed. Close · (Open task, only if this client lists the chat as Working) · focus Close
    409 stale This chat changed while you were reviewing This request deleted nothing. Review it again to delete the current version. Review again · Close · focus Review again
    409 unsupported Couldn't delete this chat This chat's backend can't remove its history yet. This request deleted nothing. Close
    404 unavailable Can't delete this chat from here This request deleted nothing. The chat may already be deleted, or it isn't yours to delete. Close
    403 unauthorized Couldn't delete this chat This sign-in can't delete chats on this brain. This request deleted nothing. Close
    400 INVALID_CHAT_DELETION Couldn't delete this chat Something went wrong with the request. This request deleted nothing. Close (logs a client defect)
    not written (offline, pre-write failure) Couldn't reach the brain Nothing was deleted. Try again when you're connected. Try again · Close
    • After any refusal: the record is removed and the fence is lifted. A 4xx is authoritative proof that nothing was retired.
    • Wording: "This request deleted nothing" replaces "Nothing was deleted" wherever the chat might already have been deleted by another request (404).

    6. Indicator layout and interaction (#3281 R3, no changes to the component)

    • Placement:
      • Below 1280px: in the Sessions drawer header, before ✕.
      • At 1280px and up: in the pane header.
      • Never inside a row.
    • Size: the glyph is 20px inside a 44px native button. Its target touches the ✕ target without overlapping.
    • Summary: label="Chat deletion", or "Chat deletions" when there are 2 or more. The count and priority come from the component (refused › failed › unknown › attention › active › queued › success).
    • Interaction: tooltip on hover (300 ms) or focus. Tap, Enter or Space opens the sheet below 1280px and a dialog at 1280px and up, with initial focus on the heading.
    • Actions: Check now and Retry removal are host-supplied kit Buttons, one per operation, keyed by operationId, never by array index.
    • Updates while a details surface is open: the content updates in place without moving focus, and the component announces once.
    • Reduced motion: O1 shows the static loading glyph. Meaning and names are unchanged.
    • Focus after deletion: goes to the next row, else the previous row, else New conversation (rev 2). The indicator is announced, not focused.

    7. Browser cases (supersede rev 4 cases 23–28; others stand)

    1. Reply dropped, then Close at 2 s: focus goes to the indicator (O2); exactly one POST.
    2. Reply dropped, chat_retired at 3 s: the sheet shows O3 and closes when the window ends; focus goes to the indicator.
    3. Reply dropped, history 200 within 10 s: stays O2, the chat stays fenced, and nothing renders from the chat.
    4. O3, then Retry removal: one POST with the same operationId. The receipt pending → O4, then a second Retry → removed → O7, and the Kept fact lists all 5 retained values.
    5. Reload in O2, O4 or O5: the indicator is restored. The fixture title is absent from the DOM, storage, accessible names and announcements.
    6. Each 4xx reason: the §5 copy shows, the record is cleared and the chat unfenced; no indicator.
    7. 401 after submit: the toast reads "You were signed out." with no outcome. The new principal sees no indicator. Back as the owner: O2 is restored.
    8. Timer fires after a principal switch or navigation: no focus move and no announcement in the new context.
    9. Two operations: each action posts only its own operationId.

    Mutations (each must fail):

    • Treat history 200 as not admitted: case 31.
    • Make Retry available in O2: case 29 (request count).
    • Put the title in the record: case 33.
    • Focus the indicator from a stale timer: case 36.

    Decision needed

    D1. Check now for O2, the request with no reply. The contract has no read-only way to ask about one operation. Options:

    • A. Add GET /api/chat-deletions/:operationId to ui-server: coordinate local chat copies and expose truthful deletion outcomes #3230 (proposed). It would be principal-bound and read-only, return the receipt or not_admitted, and add no new authority. Check now becomes a true read, as F1 requires, and O2 can resolve to "not deleted" honestly.
    • B. Check now reads only the chat's lifecycle (history 404 / chat_retired). O2 resolves only when retirement is seen. If the request never arrived, O2 stays until the user dismisses the record ("Stop tracking"). That keeps the fence, and the chat stays hidden on this device.
    • C. Offer an explicit "Send deletion again" in O2, alongside a lifecycle-only Check now. It repeats the same operationId and expected, and is labelled as a send, not a check. The stale check still guards it. This resolves O2 on today's contract, but it re-admits the deletion on an explicit tap.

    Design file: Chat Deletion 3231 v3.dc.html.

  13. added
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    and removed
    needs: designBlocked on a design drop or a visual answer.
    on Nov 3, 2026
  14. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-03): D1 A. The host gains a principal-bound, read-only GET /api/chat-deletions/:operationId that returns the receipt or not_admitted and adds no authority. Check now in O2 becomes a true read, as F1 requires, and an unanswered request can resolve honestly to "not deleted". Rejected: B (lifecycle-only Check now with "Stop tracking") and C (an explicit "Send deletion again").

    What this means:

  15. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    and removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 3, 2026
  16. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3281, #3455 are closed, so scripts/sync-project.ts is removing the blocked label.

  17. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: featA new capability or a change in user-visible behaviour.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions