Skip to content

Recent sidebar: an unsent new-session draft has no entry point (New session always opens a new one) #1972

Done

Description

@ausyeah

Build: OpenCode (Rune) desktop dev-517, Windows 11, CLI 0.0.0-dev-1379
Sidebar layout: Settings › Experimental › Organize vertical sidebar → Recent (the sidebar shows 已置顶 / 最近)

Steps

  1. Click 新建会话 and type something in the composer.
  2. Without sending, click any session under 最近.
  3. Click 新建会话 again.

Actual

  • Step 3 opens a new, empty draft. The text from step 1 is listed nowhere in the sidebar — this layout has no Drafts section, and there is no open-tab strip either.
  • The text is still on disk: document key opencode.window.<id>.dat:draft:draft:draft_<id> in %APPDATA%\rune-opencode\opencode.sqlite. The tab only comes back by pressing Ctrl+Tab until it cycles around, which no user would discover.
  • From the UI this is indistinguishable from "my draft was deleted".

Expected

  • Give drafts an entry point in this layout, as the Inbox layout does (draft_ids → Drafts group in apps/desktop/src/shell/view/sidebar/inbox.rs), or
  • make 新建会话 reopen the last draft with content (or the existing empty one) instead of calling tabs::draft_id() every time (open_draft_tab, apps/desktop/src/shell/tabs/actions.rs:190).

Notes

  • apps/desktop/src/shell/view/sidebar/recent.rs only partitions sessions; drafts are never drawn there.
  • Drafts are persisted per keystroke (features/restore/src/persist.rs, drafts_now → draft_document), so the content is not lost — only the way back to it is.
  • The official Recent sidebar file (packages/app/src/shell/titlebar/recent-sessions.tsx) also has no drafts list, but there the draft tabs stay visible in the tab strip; in this layout they are invisible.

Activity

  1. Hona commented on Dec 1, 2026

    @Hona
    Member

    Fixed in #1995 (merged to dev as 72e005f1).

    • Both the Recent and Consolidated List sidebars now show a Drafts section above Pinned/Recent whenever a draft is active or holds unsent text/attachments (matching the Inbox sidebar), with each row titled by its first non-empty line, a hover close button, and a right-click Discard draft menu.
    • Clicking New session in session-list layouts now reuses an already-active empty draft and prunes stale empty drafts while keeping every draft with content visible and reachable in Drafts.
    • Keyboard tab navigation (Cmd/Ctrl+1–9, Ctrl+Tab) in Consolidated List now includes drafts at the top in visual order.

    Verified locally with pwsh scripts/guardrails.ps1 (11/11), cargo check -p opencode-desktop (default and --no-default-features --features knobs), and zero clippy diagnostics on modified files; not interactively verified in a GUI window or on macOS/Linux. Please reopen if anything still feels off!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions