Skip to content

Feature: dynamic edge-group constraints (mutable minimumSize / maximumSize / initialSize after addEdgeGroup) #1305

@AsafMah

Description

@AsafMah

Feature request

Make the per-edge-group constraints (minimumSize, maximumSize, initialSize, collapsedSize) mutable after addEdgeGroup instead of frozen at creation time.

What works today

api.addEdgeGroup(position, options) accepts options.minimumSize / maximumSize / initialSize / collapsedSize. EdgeGroupView's constructor copies them into private fields:

// node_modules/dockview-core/dist/esm/dockview/dockviewShell.js (v6.4.0)
this._collapsedSize        = options.collapsedSize ?? 35;
this._expandedMaximumSize  = options.maximumSize   ?? Number.POSITIVE_INFINITY;
this._expandedMinimumSize  = options.minimumSize !== undefined
    ? options.minimumSize
    : this._collapsedSize + 50;
this._lastExpandedSize     = options.initialSize   ?? 200;

There's an updateCollapsedSize(newCollapsedSize, newExpandedMinimumSize) (line ~95) but the comment says it's reserved for ShellManager theme / gap recomputation, and it isn't reachable from the public api. The public DockviewApi only exposes addEdgeGroup, getEdgeGroup, setEdgeGroupVisible, isEdgeGroupVisible, removeEdgeGroup (component.api.d.ts:564-582).

So once an edge group is created, its size constraints are immutable for the lifetime of the dockview instance.

Why this is awkward

When an edge group hosts multiple panels as tabs (a common pattern — VS-style activity bar), each panel can have very different layout needs:

  • "Sessions list" — fine at 200px
  • "Log viewer" — wants ≥ 420px to keep timestamp + message readable
  • "Jobs" — fine at 280px

If you set minimumSize: 420 at addEdgeGroup time, the user can't drag the strip narrower even when the active tab is "Sessions" (which doesn't need 420). If you set minimumSize: 200, the user can drag down past Logs's working range and the active "Logs" panel gets squashed.

There's no way to retune the constraints when the active panel changes (onDidActivePanelChange).

Concrete repro / receipt

dafman just shipped an edge-tabs activity rail (commits e39bdc9936bbd3, 2026-05-26). We settled on max(minimumSize over all tabs) per side as a workaround:

// Best we can do today: pin to the largest min across all tabs
// → Sessions (which only needs 200) cannot be dragged narrower than 420
dock.api.addEdgeGroup('left', {
    minimumSize: Math.max(...LEFT_TABS.map(t => t.minimumSize)),  // 420 (from Logs)
    initialSize: 360,
    collapsed:   true,
});

We tried dock.api.getEdgeGroup('left')?.setSize({ width: 200 }) and setConstraints({ ... }) from onDidActivePanelChange; the events fire and the underlying api accepts them, but the outer splitview that owns the edge EdgeGroupView doesn't re-poll its minimumSize getter — so the value reverts on the next sash drag.

Proposed API

A new method on DockviewApi:

setEdgeGroupConstraints(
    position: EdgeGroupPosition,
    constraints: Partial<{
        minimumSize: number;
        maximumSize: number;
        initialSize: number;
        collapsedSize: number;
    }>,
): void;

…or expose a mutator on the existing return type so it can be chained:

const left = dock.api.addEdgeGroup('left', { ... });
left.setConstraints({ minimumSize: 200, initialSize: 360 });

Either way it would need to fire an event the outer splitview subscribes to (_onDidChange) so the new min/max actually take effect on the next layout pass.

Use cases

  1. Tab-aware sidebars (above) — retune constraints when the active panel changes.
  2. Theme / density changes — a "compact" toggle that lowers all min-widths globally.
  3. Initial layout after async data — restore a saved width that was read from disk after addEdgeGroup.

Version

  • dockview-core 6.4.0
  • dockview-vue 6.4.0

Happy to take a stab at a PR if the direction sounds reasonable. Thanks for dockview — it's a great library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions