react-dockable-desktop 7.4.0 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,124 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [7.5.0] — 2026-10-04
10
+
11
+ Toolbar buttons: the library now sizes the icon inside its own buttons, and a toggle that is on
12
+ can be told from one that is off at a glance, on chrome and over panel content alike. No props were
13
+ added or removed; everything new is a CSS custom property.
14
+
15
+ ### Added
16
+
17
+ - **Icon size tokens.** `--rdd-panel-toolbar-icon-size` (`20px`) sizes icons in `RddPanelToolbar`
18
+ buttons and toggles; `--rdd-chrome-icon-size` (`22px`) sizes them in the workspace toolbar and
19
+ the sidebar rail. Icon fonts follow the button's `font-size`; SVG icons follow the token's
20
+ width and height, even when the SVG has its own `width`/`height` attributes. Apps no longer pass
21
+ a size to each icon.
22
+ - **`soft` chip tokens**: `--rdd-panel-toolbar-btn-bg`, `--rdd-panel-toolbar-btn-bg-hover`,
23
+ `--rdd-panel-toolbar-btn-border`.
24
+ - **Workspace toolbar toggle tokens**: `--rdd-toolbar-btn-toggle-active-color` and
25
+ `--rdd-toolbar-btn-toggle-active-border`, so its "on" icon and edge no longer have to follow the
26
+ sidebar tab colour.
27
+
28
+ ### Changed
29
+
30
+ - **Panel toolbar "on" state** is a solid chip with a white icon, the same in every
31
+ `buttonVariant`: in dark the accent mixed 65% with black, in light the plain accent. The icon is
32
+ `--rdd-brand-on-accent` when a brand sets it. It clears WCAG's 3:1 non-text contrast with bright
33
+ and dark accents. Before, it was a 14–15% accent tint.
34
+ - **`buttonVariant="soft"`** is a near-opaque chip (the floating-widget surface) with a hairline
35
+ edge, readable over panel content you don't control. Before, it was a 6% (dark) / 4% (light)
36
+ wash that disappeared over busy content.
37
+ - **Workspace toolbar toggle "on"**: the accent tint goes from 6–8% to 22% (dark) / 16% (light) in
38
+ every skin, with a 1px accent edge and the accent icon.
39
+ - **Icons in toolbar and rail buttons are larger by default**: 20px in panel toolbars and 22px in
40
+ the workspace toolbar and rail, where they used to render at whatever size the app gave them.
41
+
42
+ ### Fixed
43
+
44
+ - **`filled` toggles looked the same on and off**: its resting look used the active colours. It
45
+ now rests on an accent tint with an accent edge, and "on" is the solid chip.
46
+ - **vscode and macos painted a white hover tint in light mode** on panel toolbar buttons; it now
47
+ applies in dark only.
48
+ - **`buttonSize` was documented as the icon size.** It sets the button size; the icon follows
49
+ `--rdd-panel-toolbar-icon-size`.
50
+
51
+ ### Upgrading
52
+
53
+ - Remove per-icon sizes inside toolbar and rail buttons (`size={16}`, `fontSize`, inline
54
+ `width`/`height`): set `--rdd-panel-toolbar-icon-size` / `--rdd-chrome-icon-size` instead. An
55
+ inline `style` size still wins over the tokens.
56
+ - If you added shadows to keep toolbar icons readable over panel content, remove them and use
57
+ `buttonVariant="soft"` or a `frosted`/`solid` toolbar.
58
+ - If you overrode `--rdd-panel-toolbar-btn-active-color` or `-active-bg` to make "on" visible,
59
+ check whether you still need to: the default is visible in every variant now. To restyle it, see
60
+ [Styling toolbar buttons](https://felipecarrillo100.github.io/react-dockable-desktop/guide/panel-overlay#styling-toolbar-buttons).
61
+ - To get the old look back, set the tokens to their previous values, e.g.
62
+ `--rdd-toolbar-btn-toggle-active-bg: color-mix(in srgb, var(--rdd-accent-color) 8%, transparent)`.
63
+
64
+ ### Docs
65
+
66
+ - Panel Overlay guide: new "Styling toolbar buttons" section (what the library owns, icon sizes,
67
+ variants, colour tokens, recipes for your own "on" look); corrected `buttonSize`.
68
+ - Toolbar guide: token table updated for the new toggle defaults and tokens.
69
+ - Sidebar (Modals & Drawers guide): rail icons follow `--rdd-chrome-icon-size`.
70
+
71
+ ### Demo
72
+
73
+ - Spawn Tools → Toolbar Buttons: every `buttonVariant` in every state over light, dark and busy
74
+ content, with icon-size sliders.
75
+
76
+ ## [7.4.1] — 2026-10-01
77
+
78
+ Fixes from a review of 7.4.0. No API changes.
79
+
80
+ ### Fixed
81
+
82
+ - **Restored floating windows kept the wrong stacking order.** After a reload (`initialState` or
83
+ `loadLayout`), focusing a restored window sent it *behind* the others, and a newly floated panel
84
+ opened beneath them: the counter that hands out window z-indexes started from `zIndexBase`
85
+ instead of the highest restored one.
86
+ - **A message placeholder used twice was replaced only once**: `'{n} of {n}'` with the default
87
+ formatter (no `formatMessage` passed) gave `'2 of {n}'`. Every occurrence is replaced now.
88
+ - **The window losing focus mid-drag left the drag half alive.** After an alt-tab during a tab or
89
+ floating-window drag, the next click anywhere docked the panel into the zone it had been over.
90
+ A blur now ends the drag as a `pointercancel` does.
91
+ - **Layout repair on load** also drops a group's panel id that the layout's `panels` doesn't have
92
+ (the group showed an empty body for it), and gives a split whose sizes don't match its children,
93
+ or aren't finite positive numbers, even sizes (a child got `flex-basis: NaN%`).
94
+ - **`RddToolbarSearch` kept searching after it unmounted**: a pending debounce still called
95
+ `onSearch`, and a search in flight never saw its signal abort.
96
+ - **One event subscriber that threw stopped delivery to the rest**, and broke the action that
97
+ published (a `loadLayout`, a close) halfway through. The error is logged and every subscriber
98
+ still runs.
99
+
100
+ ### Tests
101
+
102
+ - `Patch741.test.ts` (stacking order after `initialState` and `loadLayout`, placeholders, layout
103
+ repair, the event bus), `DragBlur.test.tsx` (tab and floating-window drags, with an
104
+ uninterrupted drag as the control), `ToolbarSearchUnmount.test.tsx`. Each was seen failing
105
+ before its fix and with the fix removed.
106
+ - `PackageContents.test.ts` no longer needs a build (CI runs the tests before `npm run build`).
107
+
108
+ ### Docs
109
+
110
+ - `useWorkspaceState`: its reference documentation was attached to the wrong declaration and
111
+ never shown; it is on the hook now, with a warning that a selector must not build a new object
112
+ or array on each call (React stops with "Maximum update depth exceeded").
113
+ - `RddDesktop` has reference documentation; the Toolbar guide is in the docs sidebar.
114
+ - Titles are documented as `string | MessageDescriptor | (() => string)` everywhere (README,
115
+ Workspace, Panel Registry, Modals & Drawers, Panel Overlay, Forms & Panels).
116
+ - README: `RddSidebar` and the toasts follow the workspace direction (since 7.4.0).
117
+ - The CHANGELOG's migration-guide links point at the docs site, so they work from the npm package.
118
+
119
+ ### Repository
120
+
121
+ - **GitHub releases are created automatically**: when CI passes on `main` with a version that has
122
+ no release yet, `.github/workflows/release.yml` tags the commit `vX.Y.Z` and publishes a release
123
+ whose notes are that version's CHANGELOG section (`scripts/release-notes.sh`). npm publishing
124
+ stays manual. Until now only `v4.0.0` had a tag, so the CHANGELOG's compare links were broken;
125
+ `scripts/backfill-releases.sh` tags and releases the earlier versions that a commit identifies.
126
+
9
127
  ## [7.4.0] — 2026-09-30
10
128
 
11
129
  From a consumer's field report: fixed dropdowns inside frosted windows, direction for the sidebar and toasts, translated titles, and a quieter restore.
@@ -151,7 +269,7 @@ Fixes found by a consumer migrating a 30-file app from 6.4.0 with the 7.0.0 migr
151
269
 
152
270
  ## [7.0.0] — 2026-09-25
153
271
 
154
- A clean break: the public API takes the names the Vue and Angular ports of this library use, the workspace becomes a store that is live before anything mounts, and the stylesheet stops styling the host page. Nothing is deprecated first — every old name is gone, so the TypeScript compiler finds every call site. **Migration guide: [docs-site/guide/migration.md](docs-site/guide/migration.md#v6-x-→-v7-0-0)** — written so it can be applied by an automated agent in one pass; this release was accepted by having an agent migrate the four demo apps and a fixture app with the guide alone.
272
+ A clean break: the public API takes the names the Vue and Angular ports of this library use, the workspace becomes a store that is live before anything mounts, and the stylesheet stops styling the host page. Nothing is deprecated first — every old name is gone, so the TypeScript compiler finds every call site. **Migration guide: [docs-site/guide/migration.md](https://felipecarrillo100.github.io/react-dockable-desktop/guide/migration#v6-x-→-v7-0-0)** — written so it can be applied by an automated agent in one pass; this release was accepted by having an agent migrate the four demo apps and a fixture app with the guide alone.
155
273
 
156
274
  ### Breaking
157
275
  - **React 18 or later.** The peer range said 16.8; the library already relied on React 18 APIs.
@@ -522,7 +640,7 @@ All of the above is additive and backward-compatible: every new field is optiona
522
640
  ## [4.0.0] — 2026-06-16
523
641
 
524
642
  ### Breaking Changes
525
- - **`replace-react-contexify` peer dependency removed.** The library no longer requires or uses it. Remove the package and delete its CSS import from your entry file. All existing user code continues to work unchanged. See the [v3→v4 migration guide](docs-site/guide/migration.md).
643
+ - **`replace-react-contexify` peer dependency removed.** The library no longer requires or uses it. Remove the package and delete its CSS import from your entry file. All existing user code continues to work unchanged. See the [v3→v4 migration guide](https://felipecarrillo100.github.io/react-dockable-desktop/guide/migration).
526
644
 
527
645
  ### Added
528
646
  - **Built-in `<ContextMenu>` component** — zero-dependency, portal-rendered context menu styled with design tokens. Supports simple items, separators, sub-menus (one level), checkbox items, icons, and i18n labels. Viewport-clamped, RTL-aware, Esc-to-close.
@@ -604,7 +722,9 @@ All of the above is additive and backward-compatible: every new field is optiona
604
722
 
605
723
  ---
606
724
 
607
- [Unreleased]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.4.0...HEAD
725
+ [Unreleased]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.5.0...HEAD
726
+ [7.5.0]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.4.1...v7.5.0
727
+ [7.4.1]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.4.0...v7.4.1
608
728
  [7.4.0]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.3.0...v7.4.0
609
729
  [7.3.0]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.2.0...v7.3.0
610
730
  [7.2.0]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.1.3...v7.2.0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # React Dockable Desktop
2
2
 
3
- [![npm version](https://img.shields.io/badge/npm-v7.4.0-blue.svg)](https://www.npmjs.com/package/react-dockable-desktop)
3
+ [![npm version](https://img.shields.io/badge/npm-v7.5.0-blue.svg)](https://www.npmjs.com/package/react-dockable-desktop)
4
4
  [![TypeScript](https://img.shields.io/badge/TypeScript-first-3178c6.svg)](https://www.typescriptlang.org/)
5
5
  [![Touch Ready](https://img.shields.io/badge/touch-iPad%20%7C%20Android-success.svg)](#touch--mobile)
6
6
  [![license](https://img.shields.io/badge/license-MIT-green.svg)](#license)
@@ -278,7 +278,7 @@ Lower-level methods (close guards, state providers, split and floating-window ge
278
278
  | `close(options?)` | `(options?: CloseOptions) => void` | Request the container to close; respects dirty state and close guards (`{ force: true }` skips them) |
279
279
  | `minimize()` | `() => void` | Minimize this panel to the taskbar; no effect in a modal or drawer |
280
280
  | `setDirty(dirty, options?)` | `(dirty: boolean, options?: DirtyStateOptions) => void` | Mark unsaved changes; triggers confirmation dialog on close |
281
- | `setTitle(title)` | `(title: string \| MessageDescriptor) => void` | Change the tab/window title dynamically |
281
+ | `setTitle(title)` | `(title: string \| MessageDescriptor \| (() => string)) => void` | Change the tab/window title dynamically |
282
282
  | `setIcon(icon)` | `(icon: ReactNode) => void` | Change the tab, floating title bar and taskbar icon (or a modal's or drawer's header icon); `null` restores the registration's `defaultOptions.icon`. Not saved by `saveLayout()` |
283
283
 
284
284
  ### ContainerType
@@ -361,8 +361,7 @@ Touch support is built in. No extra setup required:
361
361
  The library does **not** auto-detect the workspace's direction — the consuming app owns it. Two things must be wired together:
362
362
 
363
363
  ```tsx
364
- // 1. Keep html[dir] in sync for what sits outside the workspace — RddSidebar and toasts —
365
- // which take their direction from the page.
364
+ // 1. Keep html[dir] in sync for the rest of your page (your own chrome around the desktop).
366
365
  useEffect(() => {
367
366
  document.documentElement.dir = isRtl ? 'rtl' : 'ltr';
368
367
  }, [isRtl]);
@@ -376,7 +375,7 @@ useEffect(() => {
376
375
  >
377
376
  ```
378
377
 
379
- `dir` can be `'ltr'` (default) or `'rtl'`. The workspace's layout, split directions, tab ordering, floating window controls, drop zones and context menus flip automatically; the sidebars and toasts follow `html[dir]` (step 1).
378
+ `dir` can be `'ltr'` (default) or `'rtl'`. The workspace's layout, split directions, tab ordering, floating window controls, drop zones and context menus flip automatically; so do `RddSidebar` (with everything inside it) and the toasts (since 7.4.0). While the workspace is left-to-right those two follow the page's `dir`.
380
379
 
381
380
  Direction is **independent of locale** — you can have Arabic translations with LTR layout, or RTL without locale changes.
382
381