Skip to content

Unsent composer drafts disappear when switching threads in the real App #921

Closed

Description

@currentbits

Priority: P1. Reproduced/reviewed at commit 6c7a6fbe on 2026-09-05.

Switching from thread A to B and back silently loses A's unsent prompt.

Reproduction

  1. Open a thread in the app and type a prompt without sending it.
  2. Select another thread in the sidebar.
  3. Return to the first thread.
  4. The composer is empty.

Confirmed by mounting the real App with createFakeCoder and navigating A → B → A. This is not merely a Composer-only test.

Cause

App gates visibleDetail to null while the new selection's detail is fetched. ThreadView's no-detail branch omits Composer, unmounting it. Composer keeps draftsRef, attachmentsByThread and pasteCardsByThread in component-local memory, so the draft map is discarded. Existing test/composer.test.tsx:475 assumes one continuously mounted Composer and misses the real lifecycle. Related to closed #12, but the current symptom is lost drafts rather than drafts leaking between threads.

Acceptance

  • An unsent prompt survives A → B → A through the real App, including uncached detail loads.
  • Pending attachments and paste cards remain associated with their source thread.
  • Switching to another main view and back preserves unsent input too.
  • Preserve the stale-detail protection: never show A's transcript under B's selection.
  • Add an App-level regression check; a Composer-only threadId swap is insufficient.

Source: src/App.tsx#L933.

Requested disposition: separate Planboard issue, plan:todo. Scope is the concrete defect above.

Activity

  1. added and removed on Oct 9, 2026
  2. currentbits commented on Oct 9, 2026

    @currentbits
    OwnerAuthor

    Fixed in 0.24.0 (874e8a4): drafts, attachments and paste cards persist per thread in localStorage (src/composerSession.ts), so they survive thread switches and restarts. Closing in the 2026-10-09 board cleanup (#1532).

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions