Skip to content

feat: add pane add/remove lifecycle hooks with veto support#101

Merged
ohxyz merged 1 commit into
mainfrom
feat/pane-add-remove-hooks
Jun 26, 2026
Merged

feat: add pane add/remove lifecycle hooks with veto support#101
ohxyz merged 1 commit into
mainfrom
feat/pane-add-remove-hooks

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Adds overridable lifecycle hooks around pane add/remove on the frame, wired through BinaryWindow.

What changed

  • src/frame/pane.js: add onBeforePaneAdd / onPaneAdd / onBeforePaneRemove / onPaneRemove hooks (no-op by default, meant to be overridden). The before* hooks can veto by returning falseaddPane returns null and removePane bails. onPaneRemove fires after update(), when sash.domNode still exists but is detached from the DOM.
  • src/binary-window/binary-window.js: addPane short-circuits to null when the underlying add is vetoed; removePane simplified to always delegate then clean up any minimized sill pot.
  • dev/window/bwin-add-remove-panes.{html,js}: demo the new hooks and default the Sash ID input to bottom-left.

Why

Lets downstream code observe and veto pane add/remove, and run cleanup on removal while the detached node is still reachable.

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.

1 participant