#198

Draft cards in the sidebar, and a mark for sessions with unsent text

Opencalledforthwants to merge intofrom

What changes

Draft cards in the sidebar. Every new-session draft holding text or an image gets a card at the top of Active, newest edit first. Cards show on every device and update live.

  • A card opens the draft's page (/drafts/<id>).
  • Its ✕ or its menu discards the draft behind an undo notice. The draft is only deleted when the notice goes away or the page is hidden. Pending discards flush on pagehide/freeze in the capture phase.
  • A pending discard is cancelled only by a revision from another writer (another device or tab). This page's own late saves never cancel it.
  • Discarding the open draft pushes the blank page, so Back returns to the draft and cancels the discard.
  • The open draft's card is frozen at the state it had when the draft was opened, so typing never re-renders the sidebar.
  • Cards are keyed by the session id minted with the draft, so a send turns the card into the session's row in place. The row slides below the drafts still waiting (layout="position").
  • A draft whose project was removed, whose folder is missing, or that hasn't synced shows that quietly on its card.
  • A draft being sent offers no discard.

Unsent mark. A session whose composer holds unsent text shows a pen. The session on screen doesn't.

Undo notice. Mounted once at the shell, so closing the mobile sidebar sheet doesn't unmount it. The composer and the sidebar footer register as notice anchors: the notice docks above the sidebar footer on wide screens and floats above the composer otherwise. Keyboard discard focuses Undo, Escape dismisses, and focus returns to the restored card, a neighbour, or the list.

Smaller pieces

  • The Fluid dropdown exposes onCloseAutoFocus.
  • New --basis-draft* tokens.
  • The selected draft uses bg-active, like a selected session.
  • Storybook stories for the card states.
  • docs/decisions/composer-drafts.md covers the discard rules and their known limits: an offline discard can win over text appended elsewhere, two tabs count as different writers, and card order mixes local and server clocks.

Verification

  • app-core and web suites, typecheck, lint.
  • New sidebar-drafts.test.tsx and sidebar-draft-card-view.test.tsx, including a render-count check: zero sidebar re-renders per keystroke.
  • Real-app probes against an isolated data copy: open, discard, undo, Back after discard, send from a card, and a remote edit cancelling a discard. Screenshots of the selected draft in the Dark, Black, Neutral Light Soft and Light themes.
  • Three review rounds.

🤖 Generated with Claude Code

Activity

19
greptile-apps[bot]24d ago


[Medium risk] Adds draft cards to the sidebar with discard and undo.

The PR appears safe to merge; no actionable new issue remains.

Summary

Adds sidebar cards for parked drafts, an Undo notice, and a pen mark for sessions with unsent text.

  • The latest changes require an exact revision match before discarding a saved draft.
  • Discards keep this page’s answered save revisions through the Undo window and queued delete.
  • The six earlier threads were rechecked against the current code. No duplicate or new finding was accepted.
  • Review was based on code and tests; no runtime checks were run.

Reviews (10) · Last reviewed commit: "fix(drafts): delete a discarded draft on..."

greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
calledforthreviewed24d ago
calledforthreviewed24d ago
greptile-apps[bot]reviewed24d ago
greptile-apps[bot]reviewed24d ago
calledforthreviewed24d ago
calledforthreviewed24d ago
calledforthreviewed24d ago
calledforthreviewed24d ago