Skip to content

ui-react: offer a generic file picker with honest attachment lifecycle states #3155

Closed

Description

@schlessera

Current state

Implementation is complete on main (2026-11-10) through Refs #3155 slices #3590/#3656, #3732, #3758, #3776, #3794 and #3805, all milestone 0.45.0. #3588 and #3589 were delivered before the slices that needed them. Needs a human (handoff):

  1. Android and iOS device evidence for Photo library, Camera and Files.
  2. The reserved visual review, including the draft indicator next to Attach.

The image-policy answers are now recorded below, and all requested changes have their own issues. The original handoff still requires the real-device notes and reserved visual review before closure; filing a change is not implementation or visual proof.

Image-policy decisions — maintainer, 2026-11-11

I1 B — Bounded SVG/BMP conversion. Produce a supported raster/model preview through bounded local conversion, while retaining the byte-identical filesystem original and authorized reference. Content verification, no uploaded-code/external-resource execution, conversion/resource limits and the existing shared image budgets must be proven. Implementation: #3986.

I2 B — Rebuild restored held-message previews. On explicit user send, retrieve the exact authorized originals/metadata and rebuild eligible previews under existing image budgets. Reload alone never sends; immutable snapshot identity, later edits, cancellation, current ownership and uncertain-send recovery remain intact. Implementation: #3987.

I3 B — One combined sent-image attachment. Combine the preview, file details and authorized original access into a single display. The 2026-11-15 maintainer ruling on #3988 now selects one primary preview action, Open original/Download original inside the viewer, 64px phone and 96px desktop thumbnails, and separate displays when exact original/frame identity cannot be matched. Kit presentation/stories are #4015, blocking app integration #3988. Direction is approved; built-story visual acceptance remains reserved here and is not completed by that ruling.

The durable decision record is tracked in #3989. All four follow-ups are native children of #3150; they own the requested changes separately, as the original handoff permits. The original-only SVG/BMP, original-only restored previews and duplicate thumbnail/file-row alternatives were not selected. These are accepted requirements, not claims that the changes are already shipped.

Source baseline: detectKind (packages/ui-server/src/attachments/detect.ts:69), isFramedImage (packages/ui-react/src/lib/image-frames.ts:34), advanceSnapshots (packages/ui-react/src/lib/draft-client.ts:354) and frameFor (same file:378), at main 3c44ac6fc56d27675dadaf38a16254db53c39f69.

All current decision questions are answered. Remove needs: decision; retain needs: human for the exact Android/iPhone source checks and reserved visual review above. No agent-ready label while that prerequisite remains. No new capture, paid call or implementation is authorized by recording these choices.

Out of scope

No broad composer redesign, reader/parser implementation, automatic new-format promises beyond qualified readers or independent fixes to #3045/#2578/#2759/#1245. Do not remove supported composer props or change legacy draft/wire semantics without compatibility treatment. Shared admission/content design remains #3151; server admission and readers remain #3153/#3154.

Context

Part of #3150.

Delivered prerequisites: #3151, #3153, #3154, #3281, #3588 and #3589. These are implementation history, not active dependencies.

Historical pre-delivery source baseline (main a84d9bfbcb4e608b504aa0a9feb1144ad9a0b77e):

addFiles (packages/ui-react/src/components/chat/composer.tsx:378-386) routes non-images to the track queue; hidden pickers at lines 769-771 restrict selection. ComposerView (packages/ui-react/src/components/chat/composer-view.tsx:112-140) renders image/camera/track-specific menu entries. createTrackUploads (packages/ui-react/src/lib/track-uploads.ts:44-77) requires track-only success metadata. The existing D52 staged-track exception is explicitly amended by the shared original-file/durable-draft rulings below; old unacknowledged/legacy bytes must never falsely read as saved.

The interaction proposals in comments are design inputs, not runtime proof or automatically approved visual designs. The November 2 maintainer review now resolves all three behavioral choices and shared Q4 policy. Rev 5 with G1/G2 completes the revised state/copy/layout design for on-demand reads, actual filesystem originals and acknowledged durable drafts; dated readiness lines further down are history, and "Current state" at the top governs.

Selected interaction decisions (maintainer, 2026-11-02)

  1. Desktop A: one unrestricted Files action, Live conversation only when available and non-interactive paste/drop guidance. No desktop Photo library/Camera rows. Phones retain Photo library, Camera and unrestricted Files. Every source feeds the common pipeline; no dedicated Track files entry or extension allowlist.
  2. Limited-content files A: successfully stored/admitted originals are sendable even when the reader is unavailable or an actual read fails. Show the evidence-based limitation, keep the actual original/reference and do not use the proposal's name-and-size-only promise. Not read yet is normal for on-demand PDF/text, not a failed/unreadable state. Real upload/storage/admission failures/refusals still block until retried/removed.
  3. Pending send A: pressing Send while required uploads/admission are pending creates a visible cancellable hold, e.g. Sends when 2 files are ready · Cancel. Bind it to the origin draft and immutable message/file snapshot, never the currently visible session or newer edits. When that snapshot's files are durably admitted, send it once under normal send acceptance/recovery. Do not wait for on-demand PDF/text content reads. A refusal/failure cancels the hold, announces retry/remove and preserves draft content. Do not automatically retry an uncertain send; restoring a draft alone never sends it.

Reject duplicate desktop source shortcuts, blocking solely for content unreadability and requiring a fresh Send click after every pending upload. Preserve the user's later draft edits, exact send acknowledgement/uncertainty semantics and no cross-draft consumption.

Snapshot contract and placement — maintainer, 2026-11-03

Design brief rev 5 is the design of record for multiple snapshots, reconciliation and recovery. Rev 4's indicator matrix, sent-row metas and compatibility parts still apply where rev 5 does not replace them; rev 5's browser cases 19-28 supersede rev 4 cases 7, 9 and 13-16.

G1 — snapshot contract: A, a list in the draft record. Replace #3151's single outgoing? draft field (docs/plans/chat-attachments.md §6.4, on the epic/3150-attachments integration branch) with a list of up to 10 snapshots per chat. Each item is { snapshotId, requestId, text, fileIds, state: held | returned | dispatched, createdAt }; §6.3 refs already key outgoing by draftId:requestId, so ownership needs no new table. The save that creates a snapshot counts every live snapshot for that chat across tabs and devices in the same transaction and refuses the eleventh with 409 DRAFT_OUTGOING_FULL before any send effect; that save is the reservation. Cancel, upload failure, dispatch and a Check showing non-acceptance edit a snapshot in place, so they never need a free slot. A slot is released only on confirmed acceptance, Edit into an empty composer or confirmed Delete…; nothing is evicted, merged or overwritten. An ordinary all-ready Send also creates a dispatched snapshot until acceptance. #3151 owns the design change and #3153 the server contract. Rejected: B, a separate send-intent table.

G2 — snapshot placement: A, outgoing bubbles in the transcript. Each snapshot renders as an outgoing bubble at its send position, in creation order after the last accepted message, with its own StatusIndicator and actions keyed by snapshotId, never list position (rev 5 §2 state table). This replaces rev 4's cards above the composer. Rejected: B, a collapsible "{n} not sent" tray above the composer.

Scope

Implement the generic Files entry and generalized attachment lifecycle after #3151's shared design and the revised interaction design are reviewed. Reuse kit-owned composer/AttachmentRow patterns, existing image transformations and validated-track specialization. Distinguish local selection, upload/admission, acknowledged filesystem retention, capability/readiness, actual on-demand content access and sent ownership. Upload success, saved draft and contents read are different facts.

Acceptance criteria

  • Files has no format allowlist and supports PDF/text/images/validated tracks/unknown binaries and mixed batches. Future readers do not require picker changes. Mobile source shortcuts remain distinct sources feeding the same processing pipeline; desktop uses the selected compact menu.
  • Picker/paste and supported drop route equivalent files consistently using server byte evidence, not MIME/extension alone. Preserve existing image and validated-track processing plus actual original-file retention; no fabricated track/duration/content facts.
  • Support up to 10 independently recoverable held/returned/unconfirmed snapshots combined per chat, with host-authoritative capacity admission shared across tabs/devices. Confirmed accepted sends leave this queue. When full, explain why new sends wait while drafting, recovery and cancellation remain available; reserve capacity before effects and never evict/overwrite unresolved work. Existing aggregate byte/pool limits still apply and can refuse earlier. Preserve each exact snapshot and newer composer revision separately. Reserve capacity before starting a new send; never block Cancel because another recovery card exists, overwrite a card or automatically replay uncertain work. Consume ui-server: admit generic chat files and retain specialized content routing #3153's snapshot list and 409 DRAFT_OUTGOING_FULL (G1 A) rather than any single-slot field, and include every live snapshot in existing aggregate accounting.
  • Apply the selected held-send snapshot/Cancel behavior in empty and mixed drafts. Only required upload/admission readiness blocks; unknown/not-yet-read PDF/text is sendable. A known stored-content limitation is sendable with visible reason; true storage/admission failure cancels/blocks the hold. Later edits stay in their own revision.
  • Session switching, new-chat ownership, same-file reselection, cancellation, offline pause/retry, warm re-auth, accepted/uncertain send and duplicate prevention stay bound to the exact origin draft/reference/snapshot. Resuming or reading another session cannot send its draft. Uncertain sends use the existing explicit recovery controls, not automatic retries.
  • A saved claim requires host acknowledgement of the exact draft revision and all original-file bindings. Acknowledged originals restore across reload/tab close/normal restart; local/in-flight/unknown files use truthful unsaved/recovery copy. Preserve existing leave guards for at-risk work; the obsolete tab-only track exception is not the new generic path's retention promise.
  • Sent attachments use kit AttachmentRow with names/kinds/byte sizes, references and available actions. Not read yet, successful read of a stated scope, partial/truncated read, unavailable reader and failed content read remain distinct. Storage/format recognition alone never yields contents read. Every stored original including images remains authorized filesystem-readable/referenceable under ui-server: admit generic chat files and retain specialized content routing #3153.
  • Propagate the selected count/byte/quota/refusal policy into per-file and aggregate copy without overwhelming rows with internal diagnostics. Preserve upload progress, keyboard Retry/Remove/Cancel, preview cleanup and cancellation of owned work. UI removal changes only the intended reference under the selected protected cleanup policy.
  • Implement rev 5 §1-§4 with G2 A: snapshots render as transcript bubbles at their send position with per-snapshotId indicator and actions; the §2 state table's copy and actions; Edit aria-disabled with its reason unless the composer is empty; Delete… confirmation applies only to returned; the queue-full notice with Show, live clearing when another device frees a slot, and Cancel/Edit/Delete…/Check/Send again still available at 10 of 10; §3 focus and announcement rules with no focus steal on background events and indicator names without message text; §4 session, re-auth and reload behaviour (held snapshots restore as Paused after reload and never send by themselves). The upload-reply-lost path is an idempotent re-upload labelled as an upload, never as Check; removing an unconfirmed upload makes no cleanup claim.
  • Use reviewed 320px and desktop layouts in both themes with long names, mixed statuses, keyboard/focus rules and effective touch targets. Keep template/kit ownership and no fabricated saved/read claims. Do not treat older mocks' eager PDF processing, name/size-only or conditional tab-only retention as current policy.
  • Real offline browser proof covers Files → upload → admitted reference → Send → actual on-demand read → content-dependent reply, plus mixed images/tracks/text, no-reader send, refusal/retry, held-send failure/cancel/newer-edit/session-switch, accepted/uncertain recovery and reload of acknowledged versus unacknowledged data. Prove originals through real reads, not metadata alone. Preserve both backend provider-history guards for affected paths.
  • Use additive supported composer props/metadata evolution where possible, preserve existing consumers or record a separately approved compatibility migration, and update authoritative contracts/API reports/changesets for actual supported changes. Record the three UI choices with the shared policies in the relevant attachment/D52 design record during implementation.

Verification

Focused track/general upload, draft, held-send and UI store tests through bun run test, plus the pinned real browser harness and bun run check:pr --base origin/main. Cover rev 5 browser cases 19-28 and the remaining rev 4 cases. Keep before/after 320px/desktop dark/paper evidence and failing-first/restored mutations: old accept/track-only path breaks PDF flow; blocking known limited-content files breaks the sendable witness; wrong-draft/newer-edit hold consumption fails ownership assertions; and rev 5's five mutations (count only this tab's snapshots, require a slot for Cancel, label the re-upload Check, move focus on a background failure, auto-send a restored hold) each fail their named case. No live provider/keyed backend traffic is required.

Mobile source proof still needs appropriate Android/iOS device/browser evidence for Photo library, Camera and unrestricted Files equivalence; do not claim device capture behavior from desktop-only proof.

Contract impact

Supported composer props, generic attachment metadata and draft/wire evolution follow contract labeling, CONTRACT-prefixed implementation commits, same-commit authoritative docs/API reports and appropriate minor changesets. Preserve supported consumers additively where possible; any additional breaking prop/schema/lifetime change needs a separate prior ruling. The explicit shared original/draft lifetime amendment below is approved; this does not grant arbitrary signature removal. No release commitment is selected.

Selected presentation and remaining design — 2026-11-02

The current interaction review input is rev 4, together with the rev-3 parts it does not replace. Rev 4 supplies the compact indicator, uncertain-outcome and separate-snapshot revisions requested earlier. It remains a review input; the E2 ruling below overrides its single-returned-card restriction. Core behavior selected earlier remains binding; do not repeat those policy questions or request another generic design.

Presentation rulings and remaining choices:

  • D1 — held snapshot placement: A, selected by the maintainer on 2026-11-02. Move the exact held text/file snapshot into a visible outgoing held-message bubble with Cancel; open a separate new composer revision so the user can draft another message. Display that it is waiting for required upload/admission and send that snapshot once ready. Do not wait for on-demand content reads. Cancel/failure preserves the held snapshot and newer revision separately rather than unconditionally concatenating text or combining files. The bubble is a pending state, not a claim that the message was accepted or sent.
  • D2 — draft acknowledgement: maintainer-selected alternative, compact animated color-coded status icon with details on hover/tap. Use the shared component owned by ui-kit: add a compact animated status indicator with hover and tap details #3281, with equivalent keyboard details, meaningful static glyphs and reduced motion. This replaces the persistent status line; details distinguish saving, exact acknowledged saved state, unsaved uploads, offline, refusal and unknown. See the scoped ruling below.
  • D3 — final design reconciliation: delivered by rev 5 and settled by G1/G2 (2026-11-03). Do not ask again about the selected indicator versus a persistent status line.

Required corrections within already selected policy, not new policy branches:

  1. A lost upload response cannot establish “Nothing was stored.” Distinguish known pre-admission refusal from unknown storage/acknowledgement and reconcile authoritative references before retry/copy claims.
  2. A tab closing cannot guarantee “nothing sends” after dispatch may have occurred. Distinguish an undispatched hold from accepted/uncertain send and use the existing explicit recovery without automatic duplicate retry. Restoring an ordinary draft alone never sends it.
  3. Cancel/failure must preserve the held snapshot and newer draft as their own revisions. The proposal's unconditional concatenation/combined-file restoration cannot consume, overwrite or silently merge newer edits, nor exceed the selected count/byte envelope. Specify a recoverable separate snapshot path when a newer revision exists.
  4. Preserve supported composer consumers additively or obtain a separately approved migration; the suggested prop replacement is not blanket approval to break existing callers. Tests must distinguish actual read scope, admission/ack uncertainty and receipt-checked recovery rather than assuming one-message success from reused file references.

Earlier D1/D2 choices are recorded. E2 selects several separate recovery cards with a combined limit of 10 pending/recoverable snapshots per chat. E1 remaining interaction direction is accepted as specified below. D3's reconciliation is delivered by rev 5 with G1/G2 (above). No implementation or release is claimed.

Rev-4 recovery capacity ruling — maintainer, 2026-11-02

E2 — selected B: several separate recovery cards, rather than one slot per chat. A cancelled/failed held snapshot can remain independently recoverable while the user continues composing and sending newer messages, subject to queue admission, existing send/turn semantics and resource limits. Each card preserves its own exact text, files, identity and outcome; do not concatenate snapshots, overwrite a newer revision or treat continued sending as permission to replay an older uncertain send. Show and operate on the exact card, not whichever draft happens to be visible.

Reject rev 4's one-returned-card restriction and its instruction to block a second Cancel. Reserve recovery capacity before starting a new send; cancellation of already admitted work must remain available and preserve its snapshot without needing an extra queue slot. Known acceptance, acknowledged transfer/edit and authorized discard release only the matching ownership under the established rules. Unknown/dispatched sends retain protected references and truthful explicit recovery.

Queue capacity — selected B: 10 pending/recoverable snapshots per chat (maintainer, 2026-11-02). Count held, returned and dispatched-but-unconfirmed snapshots together across that chat, not separately per tab/device. A confirmed accepted send leaves this queue while its conversation-owned original-file references remain protected. Each snapshot retains its independent identity and exact text/file bindings; this count is separate from the existing 10-attachments-per-message limit.

At capacity, refuse/defer admission of a new send with an explanation before it creates effects or consumes a new snapshot slot. Keep drafting, inspecting, reconciling, cancellation and authorized recovery available. Reserve capacity before starting a send, accounting for concurrent tabs/devices; an existing hold can be cancelled into its own recoverable slot even when the queue is full. Never evict an unresolved snapshot or merge/overwrite it to make room. Release only the matching slot after authoritative acceptance, acknowledged transfer back to the composer or authorized discard consistent with existing uncertainty/reference rules.

Keep the queue within existing aggregate draft/attachment storage accounting, per-message envelopes and protected-reference lifetimes. Ten is a maximum count, not guaranteed storage capacity: byte/pool limits may refuse new admission earlier. Adding cards does not multiply allowances or authorize concurrent provider turns or automatic replay. Ten was selected over five for more room during repeated upload/network failures, accepting more recovery-list clutter and retained attachments. E1 remaining interaction direction is accepted below, subject to contract reconciliation and layout verification.

The supplied #3151 design §6.4 currently models a single optional outgoing snapshot per draft. Its contract/ownership design and the #3153/#3155 briefs must be reconciled for multiple independently identified snapshots before implementation. Do not treat the supplied single-slot schema as satisfying this ruling. This selects product behavior, not concrete API names or a new persistence seam. E1 acceptance of the remaining rev-4 direction is recorded below, subject to the named corrections.

E1 remaining interaction direction — maintainer, 2026-11-02

Selected A: accept the remaining attachment interaction direction, incorporating E2 B and the 10-snapshot limit, subject to contract reconciliation and layout verification.

  • Put the compact draft-status icon beside Attach with hover/tap/keyboard details and reduced-motion equivalence. A saved state requires host acknowledgement of the exact text revision and original-file bindings, not an earlier revision or metadata alone.
  • Keep ambiguous upload/send outcomes visibly unconfirmed and reconcile them through the actual supported idempotent/receipt contracts. Never blindly retry an uncertain send or claim nothing was stored/sent from a missing response. A proposed read-only Check needs an actual supported read contract; it must not silently become another upload/send effect.
  • Returned cards keep independent text, files and operation identity. Edit moves only the selected card into an empty composer; a nonempty newer composer keeps Edit unavailable with its reason. Delete… requires explicit confirmation and removes only the authorized unsent snapshot/reference under existing cleanup rules. Dispatched/uncertain sends do not become known-unsent through a UI action.
  • Restore only acknowledged work, never automatically send on reload and preserve accepted-versus-unconfirmed recovery. Keep existing supported composer APIs compatible through additive evolution.

These choices accept the stated interaction direction, not every detail of the supplied rev-4/rev-3 mocks or suggested wire schema. Rev 5 with G1/G2 settles multiple-card storage/ordering/focus, queue capacity/refusal and the contract mapping; responsive layouts are verified in implementation. Do not reopen the settled source menu, sendability, held bubble, indicator or capacity interview.

Design handoff delivered

Design brief rev 5 answered the former "Concrete remaining design handoff" (multiple snapshots, real reconciliation contracts, queue-full and multi-card recovery/reload/auth matrix, browser and mutation cases). With G1/G2 ruled on 2026-11-03 it is the design of record; see "Snapshot contract and placement" above.

Inherited shared policy

Approved shared constraints (maintainer, 2026-11-02; #3153)

  • Admission: separate neutral composer-upload endpoint reusing concrete staging internals, with no operational inbox/queue/triage side effects. Existing share/track callers retain their documented behavior; preserve the settled phone Photo library/Camera/unrestricted Files entry points and common processing pipeline.
  • Actual files: every attachment, including images, has a byte-identical uploaded-original filesystem file and authorized stable reference readable from the agent's execution environment. Inline/base64 context, previews or extracted text alone are insufficient. Preserve specialized processing, taint/recipient/permission rules and honest content-access outcomes; a stored binary is not automatically semantically readable.
  • Ownership/lifetime: originals belong to the exact acknowledged draft revision and, after accepted send, the retained conversation. A saved draft including its file bindings survives reload/tab close and normal host restart. Sending retains originals for later agent reads without consuming newer edits or another draft. No automatic filing into canonical brain content. Unacknowledged/legacy data never falsely reads as saved; unresolved sends protect their files. This explicitly amends D52's tab-only staged-track exception for the new generic path.
  • Per-draft/message envelope: 10 attachments total, 25,000,000 original bytes per file and 50,000,000 original bytes combined, including images. Preserve the 65,536-byte text allowance separately and reconcile the old 8,388,608-byte draft ceiling so an eligible original batch can be saved subject to aggregate admission. Original-byte limits do not relax separate image/provider-frame/track-parser bounds or authorize silent omission.
  • Aggregate storage: a configurable host attachment-pool cap, default 1,073,741,824 bytes (1 GiB), covers draft, sent, pending and grace-period attachments. Account materialized originals/derived attachment storage and in-flight reservations under bounded accounting; do not leave an uncharged derivative or pending-file escape. Preserve the 100-live-draft default and 268,435,456-byte host draft sub-limit. Draft storage is a subset of the attachment pool, not an additional 256 MiB on top. Shared physical storage/reference accounting must be explicit. At capacity refuse new work honestly and preserve existing references; no early purge to make room.
  • Cleanup: never-bound uploads have a one-hour window; formerly referenced originals have seven days from authoritative last-reference removal. Saved draft/chat references, active work and unresolved sends protect files. Revalidate ownership, identity and all references immediately before deletion, coordinating rebinding against unlink. Unknown reference state fails closed. Rebinding cancels collection; a later last-reference removal starts a new seven-day interval. Incidental access/mtime does not reset it. Grace-period storage remains charged. No implied Undo feature or permission to delete unrelated canonical/share data.
  • Design/compatibility: ui-server: design generic attachment intake, routing and content access #3151 must turn these settled constraints into exact reference/route/capability schemas, durable ownership/admission accounting, detection/resource bounds and executable proof briefs. Record choices and rejected alternatives in D52/attachment decision guidance and authoritative contract docs. Concrete names and internal implementation details may be chosen within these constraints; a proposal exceeding them requires a new ruling. No release commitment is made.

Reader/context policy inherited from #3154

Shared bounded local text/PDF extraction is the baseline for both backends. For PDF/text send references and minimal useful metadata; add actual contents on demand at the new provider-history tail only. Keep tools/system/earlier messages unchanged and diagnostics outside provider history. Existing specialized image/track presentation remains intact. Ready to attempt a read is not contents read. #3151 source-qualifies the concrete extractor/runtime/resource/result design; no library is chosen in this review.

2026-11-02 decision review: consolidated desktop menu, sendable limited-content originals and cancellable held-send rulings, plus inherited original/storage/reader policies. Cleared the decision prerequisite while retaining the concrete revised-design prerequisite. No visual approval, implementation, runtime proof or release commitment is claimed.

2026-11-02 revised-design reconciliation: rev 3 has been supplied since the earlier policy review. Recorded its two remaining presentation choices and final acceptance handoff, with required corrections for ambiguous upload/send outcomes, preservation of newer revisions and additive compatibility. Existing core behavioral/original-storage/reader choices remain settled; no new design acceptance or runtime proof is inferred.

2026-11-02 presentation ruling: selected D1 A, the visible held outgoing bubble with Cancel and a separate new composer revision. D2 draft-status presentation and final corrected-design acceptance remain for review. Existing storage/readiness/ownership and uncertain-send rules remain binding.

Compact status presentation ruling — maintainer, 2026-11-02 (#3155)

Use a standardized compact animated status icon, color-coded with meaningful glyphs and details on hover or tap. Provide equivalent keyboard-focus/activation access and a static reduced-motion presentation; only genuine active work animates. Reuse kit semantic colors and distinct shapes, with useful names/details so color/motion are not the only meaning. This replaces the proposed persistent draft-status text line, not the authoritative state behind it. Show success only for host acknowledgement of the exact text revision and original-file bindings; unsaved, offline, refused and unknown outcomes remain distinct, with truthful details and existing recovery/leave guards.

#3281 owns the shared public ui-kit component/design, initially used by #3155. It is a reusable presentational component for scarce-space state displays, not a new storage/state engine or a broad migration. Record the explicit animation instruction as a scoped amendment to D52's static-row rule and the relevant design-kit guidance; do not silently animate every existing tracker/row.

The held outgoing bubble with Cancel is already selected; it leaves a separate new composer revision available. Preserve the exact origin snapshot and newer revision separately on cancellation/failure. Revise the #3155 mocks/state/focus matrix for this indicator and the previously recorded unknown-outcome/compatibility corrections; no old proposal is approved wholesale by this ruling.

2026-11-02 status presentation ruling: selected a standardized animated color-coded icon with hover/tap details and accessible keyboard/reduced-motion equivalents, replacing the persistent draft-status line. Filed shared component #3281 and linked it as a delivery prerequisite. Cleared needs: decision; the concrete revised-design prerequisite remains. No new status component or attachment runtime is implemented by this tracker review.

2026-11-02 interactive recovery ruling: E2 B, multiple separate recovery cards with continued sending subject to bounded admission and existing send/turn rules. Capacity and E1 review remain open. Rev 4 is supplied; the old single-card/block-Cancel direction and shared single-outgoing-slot proposal require reconciliation. No implementation, complete design acceptance, proof or release commitment is claimed.

2026-11-02 interactive queue-capacity ruling: selected B, 10 pending/recoverable snapshots combined per chat rather than five. Confirmed accepted sends leave the queue. Enforce before new-send effects across devices; at capacity preserve drafting, recovery and cancellation plus existing storage/reference guards. E1 review remains open. No implementation, whole-design acceptance, runtime proof or release commitment is claimed.

2026-11-02 final attachment-interaction ruling: E1 A, accept the stated remaining direction with multiple recovery cards and a combined per-chat limit of 10, subject to contract reconciliation and layout verification. All current decision questions are answered; remove needs: decision, add/retain needs: design for the focused multiple-snapshot revision and retain unmet dependencies. This later ruling supersedes only the earlier single-outgoing-slot restriction, not the other approved #3151 recommendations. No implementation, runtime proof or release commitment is claimed.

Triage 2026-11-03: folded the maintainer rulings (G1 A, snapshot list with 409 DRAFT_OUTGOING_FULL in the save transaction; G2 A, transcript bubbles at send position) and design brief rev 5 into the body; replaced the delivered design handoff and superseded readiness lines.

2026-11-14 triage at main faa480e8c864d547cd8b4eb75965b7d609284770: Moved six completed dependencies out of active blocker declarations; the real-device and reserved visual handoff remains needs: human.

2026-11-16 triage: Folded the later I3 design ruling and kit/app split into the current image-policy section. The exact device-source checks and reserved visual review remain needs: human; no new implementation or visual acceptance is claimed.

Activity

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

    @schlessera
    OwnerAuthor

    The phone entry policy is settled: Photo library, Camera and unrestricted Files feed one detection/processing pipeline; there is no dedicated Track files entry. #3151 produces the remaining technical and interaction design. This UI implementation still needs its selected lifecycle policy and reviewed states, so needs: decision and needs: design stay separate from its implementation dependencies.

    Review and complete the generic attachment interaction for brain-kit #3155 under
    #3150, coordinating the existing design-producing spike #3151. Do not create a
    second competing design or reopen the phone source-selection ruling.
    
    Read first: these three issues and the current #3151 prompt/design outputs;
    addFiles at packages/ui-react/src/components/chat/composer.tsx:370-378 and hidden
    pickers at :760-763; ComposerView at
    packages/ui-react/src/components/chat/composer-view.tsx:112-140;
    createTrackUploads at packages/ui-react/src/lib/track-uploads.ts:44-77;
    resolveChatFiles/withTrackFiles at packages/ui-server/src/tracks/read.ts:58-72;
    stageShareAt at packages/ui-server/src/share/staging.ts:298-424.
    Read ROADMAP.md's binding rules, docs/decisions/design-kit/navigation.md D37,
    docs/decisions/design-kit/sessions-and-drafts.md D52 and staged-track amendments,
    docs/decisions/design-kit/components-and-interactions.md's AttachmentRow ruling,
    docs/decisions/geo-operations.md, provider-history.md and example-corpus.md.
    Source navigation was checked at main 286432d97e33a7b1d5faebbdcbfa030f5f9430d4.
    
    Problem: ordinary files currently enter the track-only queue. The user needs to
    choose a PDF/text/unknown file and know whether it uploaded, was processed and
    can actually be read. A successful upload alone is not content access.
    
    Settled: on phones retain Photo library and Camera convenience entries plus
    unrestricted Files (including images and tracks). All feed the same routing;
    preserve existing image processing and validated GPX/KML/GeoJSON behavior.
    No format filter change is required when a future reader is added.
    
    Design:
    1. Reconcile the menu, picker and paste with #3151's selected metadata, ownership
       and content-access outcomes. Mark unresolved route/limit/lifetime choices as
       dependencies; do not invent an API or approve a persisted-draft migration.
    2. Specify selected/uploading/uploaded/processing/readable/partial/unavailable/
       failed states for mixed batches, including wrong/absent MIME, unknown readable
       text and unreadable binary. Give exact retry/remove and error copy.
    3. Define session switch, held send, acknowledgement/uncertain send, duplicate
       prevention, cancellation, offline/auth lock and same-file reselection states.
       Distinguish tab-local bytes from server references on reload/update/close;
       preserve D52 unless a separate amendment is approved.
    4. Draw 320px and desktop in dark/paper, long filenames, keyboard/focus and 44px
       effective targets. Use the existing AttachmentRow for sent files without
       fabricated duration or track facts. Coordinate #3045/#2578/#2759/#1245 rather
       than implementing their independent scope.
    
    Deliverable: one reviewed state/copy/lifecycle specification, ASCII mocks at
    320px and desktop, component mapping and concrete offline browser acceptance
    cases covering a PDF content-dependent reply, mixed image/track/text, refusal,
    retry, session change and disconnect/reload. Fold accepted output into #3155;
    recommendations are not rulings. A simpler layout using existing composition is
    acceptable; dropping generic Files, PDF baseline or preserved image/track paths
    is not. Do not implement, make provider calls or claim runtime proof.
    
  4. schlessera commented on Oct 29, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-10-29): Selected option 1: wait for #3151's shared lifecycle and interaction design before selecting generic attachment retention and UI behavior. Do not independently approve preservation of existing lifetimes as the complete selected strategy or a durable unsent-attachment recovery amendment ahead of that design. Existing D52 rules remain binding until explicitly amended.

    #3151 must specify retention/reference ownership, acknowledgement/uncertain-send/retry behavior, compatibility and reviewed upload/processing/content-access states and layout, then fold them into this brief. Keep #3155 blocked on #3151, #3153 and #3154; retain both needs: decision and needs: design, with no agent-ready. Preserve the settled phone Photo library/Camera/unrestricted Files shortcuts, common pipeline and image/validated-track behavior. Upload success must not imply readable contents or durable saved state. No new retention promise, runtime implementation or release commitment is approved by this deferral.

  5. schlessera commented on Oct 29, 2026

    @schlessera
    OwnerAuthor

    Design brief: generic files, attachment states and lifecycle (interaction layer)

    Proposal, not a ruling. This covers the interaction layer only: menu, per-file states, copy, send gating and reload honesty. It is written for #3151 to adopt. It doesn't compete with the spike's technical design. Values #3151 still owes are marked [#3151]. Phone sources (Photo library, Camera, unrestricted Files) are settled and not reopened. D52 stays binding.

    Sources: ComposerView (composer-view.tsx), createTrackUploads/trackStatus (track-uploads.ts), TrackChip, kit AttachmentRow, at main c77e673.

    #3155 320px: attach sheet, mixed batch, failures, after reload
    #3155 desktop: attach popover and sent attachments

    1. Entry points

    Surface Rows (in order) Change from today
    Phone sheet Live conversation (when offered) · Photo library · Camera · Files · Paste (info row) Track files row removed. Files subtitle: Any file: documents, tracks, images. Sheet subtitle: Live, photos, camera, files, or paste. Live is listed first, per #3045.
    Pointer popover (≥900) Live conversation · Files… · Paste or drop (info row) Recommend dropping Photo library/Camera here (Q1). On desktop they open the same OS file dialog.
    Paste / drop Same add(files) entry as the picker The Paste row subtitle no longer says "images and track files".

    Pickers: Files has no accept. Photo library keeps accept="image/*" and Camera keeps capture. Both are source shortcuts only. All three call one addFiles that never branches on MIME. Routing comes from the server result [#3151].

    2. Pending-file states (generalized TrackChip)

    Images keep their existing 64px thumbnails and client-side transformation. Every other file gets one chip with: status dot, name (wraps with overflow-wrap:anywhere, no truncation), a kind · size · state line, an optional reason line, and Retry/Remove buttons (44px effective). Dot style: dashed = pending, filled teal = readable, hollow amber = partial or unreadable, hollow red with a red border = blocks send.

    State State word Reason line Actions Blocks send
    waiting waiting to upload — Remove holds
    uploading uploading… — Remove (aborts) holds
    paused waiting for connection — Remove holds
    processing checking contents… — Remove holds
    readable readable / track facts (12.4 km · one way) — Remove no
    partial partly readable e.g. 3 of 12 pages have text. Pages without text, like scans, aren't read here. Tracks keep usable sections only Remove no
    unreadable uploaded · can't be read No reader for this file here. Your agent gets its name and size only. / processing failed: Couldn't read this file's contents. Your agent gets its name and size only. Remove no (Q2)
    failed (transit) upload failed The host didn't answer. Retry when connected. Retry · Remove yes
    refused too large / not accepted Files up to [#3151] each. Remove it to send. Remove yes
    • Batch limits (count, total bytes) stay as one aggregate line in the existing red attachErrors banner. Per-file causes stay on their own chips.
    • An upload never reads as success on its own. uploaded only appears together with a content outcome.
    • Accessible name: {name}, {kind}, {size}, {state}. The chip list is aria-live="polite". Only transitions into a terminal state are announced: readable, partial, unreadable, failed.
    • Same-file reselection adds a new chip after the input resets, so the value-reset fix still applies. Removing a chip aborts its upload and revokes its preview.

    3. Send gating and ownership

    • Send while pending → held. The hint line reads Sends when N files are ready · Cancel, the send disc turns amber, and the draft stays editable. This is the existing held-send path, bound to the origin draft id, not the visible session.
    • Any blocking chip → send is disabled with the hint Remove or retry N files to send. Held send isn't offered.
    • Session switch: chips belong to the draft that created them. Uploads keep running in memory while the tab is open. Switching back shows them. Another session can never send them.
    • Acknowledgement: after Send, the chips move into the bubble as AttachmentRow. On uncertain send, the existing recovery reuses the same server references, so a resend never re-uploads and the host dedupes by reference [ui-server: design generic attachment intake, routing and content access #3151].
    • Auth lock: server references survive warm re-auth (like restore() today). Tab-local bytes are paused.

    4. Reload / update / tab close

    • Server references (any state from processing onward) come back as chips with · restored appended, if ui-server: design generic attachment intake, routing and content access #3151 extends D52's staged-track retention to generic references. Until then, only tracks are restored, as today.
    • Tab-local bytes (waiting, uploading, paused, failed) are never called saved. On restore, one amber notice names them: Not kept: {name} was still uploading when this page closed. Choose it again to attach it. With several files: Not kept: 2 files were still uploading… plus a list.
    • No beforeunload prompt is added.

    5. Sent attachments (kit AttachmentRow, kind="doc")

    meta only shows facts that processing reported: PDF · 2.4 MB · contents read, 3 of 12 pages read, contents not read. There's no duration and no track facts unless the track route returned them. Tone: teal = read, amber = partial, neutral = not read.

    6. Component mapping

    • ComposerView: drop onPickTracks, add onPickFiles. Change the menu rows and the sheet subtitle.
    • TrackChip → generalized FileChip over a PendingFile (rename only where needed). The track summary stays a specialization of the readable state.
    • createTrackUploads → generic queue with the same pause, retry, abort and two-at-a-time concurrency. State union: picked|uploading|paused|processing|readable|partial|unreadable|failed|refused.
    • AttachmentRow: no kit change.

    7. Offline browser acceptance cases

    1. A text-bearing PDF goes through Files → upload → readable → send, and the reply quotes content only the PDF contains.
    2. Mixed batch (image + GPX + .txt + unknown binary): one picker pass, four outcomes, send held until all are terminal.
    3. Absent or wrong MIME (.gpx sent as application/octet-stream; a PDF named .txt) routes by bytes [ui-server: design generic attachment intake, routing and content access #3151].
    4. Oversize file → refused chip, send blocked. Removing it unblocks send.
    5. Transit failure → Retry → readable. Offline mid-upload → paused → resumes when back online.
    6. Session switch while processing: the file stays with its origin draft, and sending from the other session doesn't include it.
    7. Reload mid-upload → the "Not kept" notice. Reload after readable → restored, or the notice if ui-server: design generic attachment intake, routing and content access #3151 doesn't extend D52.
    8. Uncertain send → recovery resends the same reference, and the host stores one attachment.
    9. 320px and desktop, both themes, a 120-character filename, keyboard-only Retry and Remove.
      Mutation: restore the old accept/track-only branch; case 1 must fail on the PDF selection assertion.

    Coordinates with #3045 (row order and the Live entry), #2578, #2759 and #1245; doesn't implement their scope.

    Open questions

    • Q1 Desktop popover: offer only Files… (recommended), or keep Photo library/Camera rows as well?
    • Q2 Unreadable files: allow sending them with the visible "can't be read" state (recommended), or block send until they're removed?
    • Q3 Send while pending: held send (recommended), or keep Send disabled until all files are ready?
    • Q4 [ui-server: design generic attachment intake, routing and content access #3151] Per-file and aggregate limits, the reader set behind partial and unreadable, and whether D52 retention extends to generic server references.

    ASCII summary (320px, mixed batch):

    ┌ IMG_2207 ┐
    │ ◌ harbor-permit-2026.pdf                 ✕ │
    │   PDF · 2.4 MB · checking contents…        │
    │ ● odysseus-route.gpx                     ✕ │
    │   GPX track · 84 KB · 12.4 km · one way    │
    │ ○ ledger.dat                             ✕ │
    │   Unknown · 1.1 MB · uploaded · can't be read
    │   No reader for this file here. Your agent │
    │   gets its name and size only.             │
    ├────────────────────────────────────────────┤
    │ What does the permit say about mooring?    │
    │ ⊡  Sends when 1 file is ready · Cancel   ● │
    └────────────────────────────────────────────┘
    
  6. added
    needs: designBlocked on a design drop or a visual answer.
    and removed
    needs: designBlocked on a design drop or a visual answer.
    on Oct 29, 2026
  7. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Design brief rev 2: Q1–Q3 resolved; Q4 stays with #3151

    The 2026-11-02 triage restored needs: design because the October 29 interaction proposal was unapproved. This revision settles its three UX choices and states the reasons, so the proposal can be folded into the brief.

    Q4 is the retention, limit and reader policy owed by #3151, and stays there under needs: decision. Phone sources (Photo library, Camera, unrestricted Files) and the October 29 deferral are not reopened. D52 stays binding.

    Choices

    # Choice Decision Why
    Q1 Desktop attach popover Live conversation · Files… · Paste or drop (info row). No Photo library or Camera rows on pointer screens. On desktop both rows open the same OS file dialog as Files…, so they would be three entries for one action. The maintainer's three-source ruling is phone-specific, and phones keep all three. If a desktop has a camera, the OS dialog still offers it.
    Q2 Unreadable files Sendable, with the visible state "uploaded · can't be read" and the reason "Your agent gets its name and size only." The file did upload. Blocking would force removal of a file the user may want recorded in the chat. Honesty comes from the chip and from the sent AttachmentRow meta (contents not read), not from blocking. Refused and failed still block (existing table).
    Q3 Send while files are pending Held send, bound to the origin draft: "Sends when N files are ready · Cancel". This matches the existing held-send path users already know from tracks. Typing and pressing Send is the natural act, and a disabled Send while a 40 MB PDF processes reads as broken. Cancel returns the draft to editable without sending.

    Folded copy and behaviour

    • Q2:
      • The unreadable chip keeps a hollow amber dot (no red border) and Remove only.
      • The send hint stays normal.
      • In the sent bubble, the AttachmentRow meta reads {KIND} · {size} · contents not read in neutral tone.
    • Q3:
      • While held, the send disc is amber and its accessible name is "Send when 2 files are ready".
      • Cancel is a TextButton in the hint line.
      • If a held file becomes refused or failed, the hold is cancelled and the hint switches to "Remove or retry 1 file to send". This is announced politely; the draft text is untouched.
    • Q1: the popover stays a kit menu. Files… opens the input without an accept attribute, and the Paste or drop row is non-interactive text, as today.

    Browser cases added

    • 10. Desktop popover lists exactly Live, Files… and Paste/drop. The Files… input has no accept.
    • 11. An unreadable file plus text, then Send: it sends, and the bubble meta reads contents not read.
    • 12. Held send, then one file turns refused: the hold is cancelled, the hint changes, nothing is sent and the draft text is unchanged.
    • Mutation: block send on unreadable files; case 11 must fail.

    Still open, owned by #3151 (Q4): per-file and batch limits, the reader set behind partial and unreadable, and whether D52 retention extends to generic server references. Those sit behind the [#3151] placeholders in the proposal. needs: decision remains for them.

  8. 114 remaining items

  9. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Handoff (2026-11-10): implementation is complete on main; what remains needs a human.

    Merged Refs #3155 slices, all milestone 0.45.0:

    What a human still needs to do before this closes:

    1. Device evidence (Verification). Photo library, Camera and unrestricted Files on a real Android phone and a real iPhone, each in its default browser. For each source, pick a file, see its chip, send, and see it in the sent row. Record the device, OS and browser version, plus a screenshot or short note per source. Desktop-only proof does not count here.

    2. Visual review (reserved). Look at the composer at 320 px and desktop, in dark and paper, covering:

      • the draft indicator next to Attach;
      • the held/returned bubbles;
      • the queue-full notice;
      • the preparing preview… chip.

      Say whether the placement is accepted, or what to change.

    3. Confirm or change three conservative choices CONTRACT: feat(ui-react): upload every image as its original, with a frame that names it (#3155) #3805 made where the rulings were silent:

      • SVG and BMP are kept as originals with no inline frame.
      • A held snapshot restored after a reload sends its images as originals without frames, because it only knows their file ids.
      • A sent image shows both as the bubble thumbnail and as a row in the sent-file list.

      Each is a small follow-up if changed. A reply on this issue is enough.

    Completion evidence: the device notes from item 1, an accept or change list for items 2 and 3, and an issue filed for any requested change. Once all three are in, this can close.

  10. added
    needs: humanWaiting on an action only a human can perform. State the required action in the issue.
    and removed
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 10, 2026
  11. added
    priority: p1Scheduled into the current or next milestone.
    and removed
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    on Nov 11, 2026
  12. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    2026-11-11 triage: the final implementation handoff still contains three unruled image choices (SVG/BMP previews, restored held-image previews, and duplicate thumbnail/file-row presentation). Added explicit I1–I3 options to the current body and brought them to the maintainer interactively. They remain open decisions; device evidence and the reserved visual review remain separate human prerequisites. No new policy, device proof or implementation is claimed.

  13. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Decisions (maintainer, 2026-11-11): I1 B, I2 B, I3 B.

    The body is the selected specification; the original-only/two-display alternatives are no longer pending. Filed #3989 for the durable decision record and attached all follow-ups to #3150. These changes are not claimed delivered. Remove needs: decision. Retain needs: human for the still-unrecorded Android/iPhone source checks and reserved visual review, so agent-ready remains absent.

  14. removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 11, 2026
  15. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-23): approved for 0.45.0 without the reserved device evidence (Android/iOS Photo library, Camera, Files) and without the reserved visual review. Follow-up issues will be filed if and when problems surface.

    The implementation is complete on main through the slices listed in the body. The image follow-ups ruled on 2026-11-11 (I1–I3: #3986, #3987, #3988 and their kit/docs tasks) stay separate issues in epic #3150 and are not part of this closure. Removing needs: human and closing as delivered in 0.45.0.

  16. removed
    needs: humanWaiting on an action only a human can perform. State the required action in the issue.
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.contractTouches the integration contract: CONTRACT: commit, contract doc updated in the same commit.priority: p1Scheduled into the current or next milestone.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions