Skip to content

fix(sidebar): surface unsent drafts in Recent and Consolidated List sidebars - #1995

Merged
Hona merged 1 commit into
devfrom
fix/recent-sidebar-drafts
Dec 1, 2026
Merged

Hona merged 1 commit into
devfrom
fix/recent-sidebar-drafts

Conversation

@Hona

@Hona Hona commented Dec 1, 2026

Copy link
Copy Markdown
Member

Fixes #1972

Summary

  • Surface unsent drafts in Recent and Consolidated List sidebars: Added a Drafts section (reusing inbox::draft_ids and existing localized strings sidebar.inbox.section.drafts, sidebar.inbox.discardDraft, command.session.new) at the top of both Organize::Recent and Organize::Consolidated + Navigation::List in apps/desktop/src/shell/view/sidebar/recent.rs. Each draft row displays its first non-empty line (or "New session"), pencil/shortcut leading icon, hover close button, and right-click Discard draft menu, and suppresses the empty-state message when drafts exist.
  • Avoid invisible empty draft accumulation in session-list layouts: In apps/desktop/src/shell/tabs/actions.rs, open_draft_tab now reuses an already-active empty draft on the active server and prunes stale empty draft tabs when using a session-list layout (Inbox, Organize::Recent, or Consolidated + List), while preserving all drafts with content so users can keep multiple unsent drafts visible and switch between them.
  • Match keyboard navigation order: Included visible draft_ids ahead of pinned and recent sessions in App::nav_order under Consolidated + List so Cmd/Ctrl+1..9 badges and Ctrl+Tab follow the sidebar order.

Verification

  • Passed pwsh scripts/guardrails.ps1 (11/11).
  • Passed cargo check -p opencode-desktop and cargo check -p opencode-desktop --no-default-features --features knobs.
  • Verified zero clippy diagnostics in both modified files (recent.rs and actions.rs).
  • Not interactively run in a GUI window or verified on macOS/Linux/hardware.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit 72e005f into dev Dec 1, 2026
3 checks passed
@Hona
Hona deleted the fix/recent-sidebar-drafts branch December 1, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants