Skip to content

Vector Studio: floating panels, a movable Tools panel and panels on either side - #252

Merged
jelveh merged 2 commits into
mainfrom
vsflex-nov26/workspace
Nov 26, 2026
Merged

jelveh merged 2 commits into
mainfrom
vsflex-nov26/workspace

Conversation

@jelveh

@jelveh jelveh commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Makes the Vector Studio workspace rearrangeable, with mouse, touch and stylus alike, and saves the arrangement in workspaces.

Panels

  • Float: drag a dock tab or a strip icon onto the canvas (or pick Float Panel from the panel menu). A floating panel moves by its header, resizes from its bottom edge corner, and stays on screen when the window shrinks or a tablet rotates.
  • Dock: drop a floating panel's header on the dock tabs to dock it as a tab (an insertion mark shows where), or on the icon strip to collapse it to an icon. The drop target highlights while dragging.
  • Reorder: drag a tab along the tab bar.
  • Panel menus now end with Float Panel / Dock as Tab / Collapse to Icon / Close Panel as they apply, so everything is reachable by tapping too. The dock keeps at least one tab.
  • A floating panel that was closed reopens where it was from the Window menu.

Tools panel and sides

  • A grip at the top of the Tools panel: drag to float it anywhere; release near the canvas's left or right edge to dock it there (a mark shows the side).
  • Window > Tools Position (Dock on Left / Dock on Right / Floating) and Window > Panels Position (Dock on Left / Dock on Right).
  • Tool flyouts open toward the canvas when the Tools panel is on the right.
  • Phone layout (≤ 760px) is unchanged.

Saving

  • Workspaces (New Workspace, Manage, built-ins) now capture floating panels, the Tools panel position and the panel side.
  • The arrangement as changed is kept across sessions; Reset or choosing another workspace restores that workspace's own layout.

Implementation

  • src/ui/drag.js: shared pointer-drag helper (per-pointer-type threshold, window listeners so a drag survives its handle moving, swallows the click after a drag).
  • src/ui/dock.js: floating panel windows, drop zones, tab reordering, layout menu items; getLayout/setLayout carry floating.
  • src/features/workspace/window.js: Tools panel grip, positions, panel side, remembered layout, commands.
  • CSS grid areas for the Tools and panel positions, scoped to non-phone widths.
  • touch-action: tabs none; strip icons pan-y (pan-x on phones) so a swipe along the strip still scrolls it.

Testing

  • New tests/workspace-flexible.test.js (menu float/dock, strip tear-off drag, header move, drop on tabs/strip, touch reorder, resize, close/reopen, clamping, Tools grip float/dock, menu commands, workspace capture/apply, persistence across sessions and reset).
  • Updated tests/panel-menus.test.js: every panel now has a menu button (layout items).
  • Full Vector Studio suite: 422 files / 4311 tests pass.
  • Checked in headless Chromium at 1280×800 with touch input (CDP touch drags): strip and tab tear-off, Tools grip dock right, panels left, floating Tools panel, drop on tabs, reload keeps the layout, portrait 800×1280 keeps windows on screen. No console errors.

…ither side

- Any panel can float in its own window: drag a dock tab or a strip icon
  onto the canvas, or pick Float Panel from its panel menu. Floating
  windows move by their header, resize from their corner and stay on
  screen when the window shrinks or the tablet rotates.
- Drop a floating panel's header on the dock tabs to dock it as a tab
  (at the marked position) or on the icon strip to collapse it to an
  icon. Dragging a tab along the tabs reorders them.
- Every panel menu now ends with Float Panel, Dock as Tab, Collapse to
  Icon and Close Panel as they apply, for tapping instead of dragging.
- The Tools panel has a grip: drag it to float the panel anywhere, or
  near the canvas's left or right edge to dock it there. Window > Tools
  Position and Window > Panels Position set the same from the menu.
- Drags use pointer events with a small threshold, so mouse, touch and
  stylus work alike and a tap still opens the panel.
- Workspaces save floating panels, the Tools panel position and the
  panel side. The arrangement as changed is kept across sessions until
  the workspace is reset or another one is chosen.
A focused control's tooltip waits 300 ms before showing; in CI the test
environment can be torn down within that delay, and the late timer threw
'document is not defined' as an unhandled error.
@jelveh
jelveh merged commit 50015a0 into main Nov 26, 2026
3 checks passed
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