Skip to content

Add scratchpad tabs to workspace tab strip#727

Closed
jacodv wants to merge 1 commit into
supabitapp:mainfrom
jacodv:scratchpad-tabs
Closed

Add scratchpad tabs to workspace tab strip#727
jacodv wants to merge 1 commit into
supabitapp:mainfrom
jacodv:scratchpad-tabs

Conversation

@jacodv

@jacodv jacodv commented Jul 24, 2026

Copy link
Copy Markdown

Closes #726

Summary

Adds a scratchpad as a new tab kind alongside terminal tabs in the workspace tab strip: a full-pane plain-text editor (NSTextView with undo, find bar, and the standard macOS text features) with no Ghostty surface, split tree, or zmx session. Created from a note button next to "+" in the tab bar, the File menu, or the rebindable New Scratchpad shortcut (default ⌥⌘T).

  • TerminalTabItem.Kind (.terminal / .scratchpad) with kind-aware createTab on TerminalTabManager
  • WorktreeTerminalState owns scratchpadContents, emits surface-less tab projections so the tab-bar row renders, and guards every surface-minting path (focus, split tree) against scratchpad tabs
  • Text persists in the layout snapshot (kind + scratchpadText fields, decodeIfPresent so legacy layouts and future kinds degrade safely); edits ride the existing debounced markLayoutDirty flush
  • WINDOW surface context now goes to the first terminal tab, not blindly to index 0, so scratchpad-first workspaces stay correct
  • New Scratchpad registered in AppShortcuts (rebindable, Ghostty-unbound, conflict-checked)

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

How was this tested?

  • make check passes (format + lint)
  • make test passes (includes new ScratchpadTabTests covering tab creation, surface guards, and snapshot round-tripping)
  • I built and ran the app to confirm the change works

AI tool disclosure (optional)

  • Model(s): Claude Fable 5
  • Harness / tools: Claude Code

Checklist

🤖 Generated with Claude Code

A scratchpad is a new tab kind alongside terminal tabs: a full-pane
plain-text editor (NSTextView with undo, find bar, and the standard
macOS text features) with no Ghostty surface, split tree, or zmx
session. Created from a note.text button next to the "+" in the tab
bar, the File menu, or the rebindable New Scratchpad shortcut.

- TerminalTabItem.Kind (.terminal / .scratchpad) with kind-aware
  createTab on TerminalTabManager
- WorktreeTerminalState owns scratchpadContents, emits surface-less
  tab projections so the tab-bar row renders, and guards every
  surface-minting path (focus, split tree) against scratchpad tabs
- Text persists in the layout snapshot (kind + scratchpadText fields,
  decodeIfPresent so legacy layouts and future kinds degrade safely);
  edits ride the existing debounced markLayoutDirty flush
- WINDOW surface context now goes to the first terminal tab, not
  blindly to index 0, so scratchpad-first workspaces stay correct
- New Scratchpad registered in AppShortcuts (default option-cmd-T,
  rebindable, Ghostty-unbound, conflict-checked)
@github-actions github-actions Bot added the invalid Does not meet the contribution policy; closed automatically after a few days if left inactive. label Jul 24, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. It doesn't meet the contribution policy yet, so I've labeled it invalid. Please address the following, then push an update:

Nothing needs to be redone. A pull request left invalid is closed automatically after a few days of inactivity. See CONTRIBUTING.md for the full flow.

@sbertix

sbertix commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Just a note: the contribution guidelines are clear. Please do not send PRs for issues that have not been marked as ready. I understand that some bugs may require a quick fix, but that is never the case for feature requests.

@sbertix sbertix closed this Jul 24, 2026
@jacodv

jacodv commented Jul 25, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Does not meet the contribution policy; closed automatically after a few days if left inactive.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scratchpad tabs in the workspace tab strip

2 participants