Repository navigation
Add custom panels to the dock - #58
Merged
Merged
Conversation
The file and terminal tabs render DockTabHeader directly and wire their own close, and the file tree's renders DockToolHeader beside a hidden marker for its group's styling. DefaultTab and dockview's fallback to it are gone, so the dock's tests name the tab component of each panel they add, and stand in for a real tab with a stub that looks and drags the same. A file's unsaved changes are found by the dot's label, which replaces the data-dirty attribute that only its test read. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The docks keep the sources that plugins add, and a dock adds a custom panel by its source's id. Every custom panel is one dockview component that looks its source up, so a panel restored before its plugin is enabled shows once the source is added. A header or panel that throws is hidden. A panel's tab and closable are saved with it in the layout. Closing asks the source, removing a source closes its panels without asking, and once every plugin is enabled the panels without a source are closed, in the dock shown and each shown later. addPanel takes the source's id, and a source's id is typed as a custom panel's type. A panel that cannot be closed is no longer asked before its close is refused. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docks.addPanelSources, and opens a panel withdock.addPanel(type, placement). A source has an id, whether its panels are tabs and can be closed, aheaderand apanelcomponent, and optionally aclosethat can refuse.TabPanel,TablessPanelandClosablePanelare gone, since a plugin now chooses both properties. Their rules are checked when an operation runs, and a call that breaks one does nothing.@elsewise/componentshasDockTabHeader(icon, title, a status in the close button's place, close) andDockToolHeader(icon, title). The file, terminal and file tree tabs render them, andDefaultTabis gone.Fixes along the way
dock.closeon a panel that cannot be closed returns false; the types were all that stopped it from closing the file tree.movePanelreads whether the moved panel is a tab from the open panel, not from the object passed in.data-dirtyattribute that only its test read.Not included
Testing
🤖 Generated with Claude Code