Skip to content

feat(panes): lock a pane against spawned agents and moved tabs - #454

Merged
amirlehmam merged 13 commits into
amirlehmam:masterfrom
mkh63d:feat/pane-lock
Nov 15, 2026
Merged

amirlehmam merged 13 commits into
amirlehmam:masterfrom
mkh63d:feat/pane-lock

Conversation

@mkh63d

@mkh63d mkh63d commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a pane lock. A locked pane cannot receive a spawned agent and cannot receive a moved or dragged tab. Resizing it stays allowed, and so do the + button and closing the pane or its tabs. The lock is saved in session.json and restored. It is switched from the tab-bar context menu, and a padlock shows on a locked pane.

The behaviour was specified up front (scope, decisions and acceptance criteria) and every task was reviewed by a separate reviewer who ran the tests and mutated the code.

Decisions worth knowing:

  • The flag is locked?: true on the split-tree leaf. Unlocking removes the key, so an unlocked tree serializes exactly as before.
  • Spawn into a locked pane fails with -32000. Auto-placement skips locked panes and never creates a new one.
  • layout grid refuses a workspace that contains a locked pane; layout agents keeps working and leaves the anchor's lock alone.
  • Untargeted placements (auto diff tab, wmux new-surface and wmux markdown without --pane, side-panel "open in new tab") skip locked panes (D6).
  • Edge drops still split a locked pane into a new, unlocked pane. Only a drop onto the middle or the tab strip is refused.
  • Out of scope: palette entry to lock, CLI lock verb, keyboard path to lock.

Tasks

Every task was written by a fresh coder and checked by a fresh code-reviewer who ran the tests and mutated the code to prove each acceptance criterion's test fails when the behaviour breaks. Two reviews sent work back (T2 stale split preview, T7 missing three-pane test, T9 double dialog on re-activation); all were fixed in new commits.

Task Scope State
T1 lock state on leaves, store action, preset carry-over done
T2 refuse move-in (store + drag UI) done
T3 refuse agent spawn (single, batch, explicit pane, race) done
T4 layout grid refusal, pane list lock flag done
T5 Lock/Unlock menu item, padlock, 18 locales done
T6 agent and CLI docs, regenerated resources/cli/wmux.js done
T7 auto diff tab and browser "new tab" skip locked panes done
T8 new-surface skips locked panes done
T9 palette "Open Markdown File…" says so when every pane is locked done
T10 agent skill description, context stub and wmux markdown clause mention locks done

Testing

  • Full npx vitest run on the merged branch: 3 files fail, 416 pass (6781 tests pass, 10 fail). The 3 files are dictation-shortcut, pty-manager and shortcut-recorder. They fail the same way on the base commit and do not touch this change. (Earlier runs showed 12 failing files on the base; 9 of them only failed because katex, mermaid and qrcode-generator were missing from node_modules.)
  • tsc (node and renderer) and eslint on the changed files are clean.
  • Manual check in npm run dev: lock and unlock from the tab menu, padlock, drag onto the middle (not-allowed cursor, no preview, also when moving from the edge to the middle), edge split still works, resize still works, lock survives a restart.

Review notes

  • Translations of the three lock strings (surfaceTab.lockPane, surfaceTab.unlockPane, surfaceTab.lockedTooltip) and palette.allPanesLocked in hi, tr, ko, sv, cs, zh-TW and ja were written by a model and need a native speaker's look.
  • Known non-blocking leftovers: the duplicated Pane <id> is locked message string could be a shared helper; layout grid --count 1 on a locked workspace returns success before the lock check (it changes nothing).

🤖 Generated with Claude Code

mkh63d and others added 13 commits November 13, 2026 17:43
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a "Lock pane" / "Unlock pane" item to the tab context menu and a
padlock button in a locked pane's tab bar (aria-label "Unlock pane"),
wired to the setPaneLocked store action. New surfaceTab.lockPane,
unlockPane and lockedTooltip strings in all 18 locales.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d stub

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@amirlehmam
amirlehmam merged commit 427db79 into amirlehmam:master Nov 15, 2026
amirlehmam added a commit that referenced this pull request Nov 15, 2026
…of the global context stub

Follow-up to #454. handleToggleLock wrote to the active workspace while the
lock state was read from the pane's own workspace. The skill description and
the context stub written into ~/.claude/CLAUDE.md go back to their previous
text: the lock paragraph stays in claude-instructions.md, which agents read on
demand, and a spawn into a locked pane already fails with a clear message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants