Skip to content

Add custom panels to the dock - #58

Merged
Pante merged 4 commits into
mainfrom
feature/custom-dock-components
Nov 26, 2026
Merged

Pante merged 4 commits into
mainfrom
feature/custom-dock-components

Conversation

@Pante

@Pante Pante commented Nov 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Contract. A plugin adds sources of custom panels with docks.addPanelSources, and opens a panel with dock.addPanel(type, placement). A source has an id, whether its panels are tabs and can be closed, a header and a panel component, and optionally a close that can refuse.
  • Narrowed panel types removed. TabPanel, TablessPanel and ClosablePanel are gone, since a plugin now chooses both properties. Their rules are checked when an operation runs, and a call that breaks one does nothing.
  • Header components. @elsewise/components has DockTabHeader (icon, title, a status in the close button's place, close) and DockToolHeader (icon, title). The file, terminal and file tree tabs render them, and DefaultTab is gone.
  • Host. 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.
  • Lifecycle. A panel's two properties are saved with it in the layout. Removing a source closes its panels without asking. Once every plugin is enabled, panels without a source are closed, in the dock shown and each shown later.

Fixes along the way

  • dock.close on a panel that cannot be closed returns false; the types were all that stopped it from closing the file tree.
  • movePanel reads whether the moved panel is a tab from the open panel, not from the object passed in.
  • A file's unsaved changes are announced by the dot's label, which replaces a data-dirty attribute that only its test read.

Not included

  • The overflowing tabs menu shows a custom panel as an empty row.
  • The tool stripe lists only the file tree, so a tabless panel that cannot be closed can be hidden by code but not shown again by the user.
  • A panel's components mount when the panel is added, not when it is first shown.

Testing

  • Typecheck and biome pass.
  • Unit tests pass (417).
  • Browser tests pass (1392, 1 platform skip).
  • Visual tests pass (242) with no existing baseline changed; the header components add 6 new baselines.
  • Tried in the desktop app with a local example plugin that adds a tab panel and a tabless one.

🤖 Generated with Claude Code

Pante and others added 4 commits November 26, 2026 16:09
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>
@claude

claude Bot commented Nov 26, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Pante
Pante added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 22b5ac9 Nov 26, 2026
15 checks passed
@Pante
Pante deleted the feature/custom-dock-components branch November 26, 2026 13:26
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