react-dockable-desktop 7.7.1 → 7.7.3

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,87 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [7.7.3] — 2026-10-06
10
+
11
+ Code-health release: the lint gate checks the library again, dead code is checked too, and the
12
+ library is at zero ESLint warnings. No API change and no intended behaviour change; the published
13
+ type declarations are byte-identical to 7.7.2.
14
+
15
+ ### Internal
16
+
17
+ - **`npm run lint` checks something again.** It ran `tsc --noEmit` against a `tsconfig.json` that
18
+ lists no files, so it passed whatever the code contained; that is how a 7.7.2 type error reached
19
+ `main`. It now type-checks the library source (`tsconfig.lib.json`: `src` without its tests) and
20
+ runs ESLint on `src`, tests included, and fails on any error. CI already ran `npm run lint`.
21
+ - **ESLint config for a library.** `react-refresh/only-export-components` is off for `src` (a
22
+ Vite dev-server rule for apps); a leading `_` marks a deliberately unused name; tests may use
23
+ `any`, `@ts-ignore` and module-level counters. `no-explicit-any` and the React Compiler rules
24
+ (`react-hooks/refs`, `globals`, `immutability`, `set-state-in-effect`) are warnings for now: 59
25
+ remain in library code. The 17 errors left were fixed, among them 13 unused imports and
26
+ variables in tests.
27
+ - **CI installs with `npm ci` on Node 24.** `npm ci` failed on Node 20's npm 10, which resolves this
28
+ lockfile's peer dependencies differently; npm 11 and 12 accept it unchanged. Node 20 is past its
29
+ end of life.
30
+ - `recycle_bin/` deleted (7 files, unused since August).
31
+ - **Dead code is checked too.** `npm run lint` also runs [knip](https://knip.dev) (`knip.json`), which
32
+ reports unused files, exports and dependencies across the library, the demos, the tests and the
33
+ scripts. Its first run found little dead code in the library: three default exports nothing
34
+ imports (`DockableDesktopProvider`, `PanelRegistry`, `Sidebar`; the named exports remain) and
35
+ the unused `copyfiles` dev dependency, all removed. The published type declarations are
36
+ byte-identical.
37
+ - **ESLint: zero warnings, and warnings now fail the lint too** (`--max-warnings 0`).
38
+ `no-explicit-any` and the React Compiler rules are errors again. The published type
39
+ declarations are byte-identical.
40
+ - **`any`:** the internal ones got real types (the event bus, the layout parser, the taskbar
41
+ preview, overlay and registry casts). The public ones stay `any` with a reason beside each,
42
+ because `unknown` would break users' code: event payloads, `ComponentType<any>` in the panel
43
+ and overlay registries, overlay `props`, and the dialogs' message `values` (narrowed with the
44
+ title type in 8.0.0).
45
+ - **Refs written during render** (the "latest value" pattern, 16 places) now go through
46
+ `useLatestRef`, which updates the ref in an insertion effect. That runs before every layout
47
+ effect of the commit, so a child's effect never reads the previous value; a test pins it,
48
+ and fails with a layout effect. `panelMount` captures the initial container type with
49
+ `useState` instead of a ref read during render.
50
+ - **Four deliberate patterns** keep a disable comment that gives the reason: two effects that
51
+ must set state (the drawer closing when its tab disappears notifies a controlling parent),
52
+ an unmount cleanup that reads the pending timer, and the panel handle's `[id]` dependency.
53
+
54
+ ## [7.7.2] — 2026-10-05
55
+
56
+ Panels re-render only when something about them changes. Before, focusing one panel or moving a
57
+ window by one pixel re-rendered every open panel: with 100 panels open, 100 re-renders per pointer
58
+ move. Now none.
59
+
60
+ ### Fixed
61
+
62
+ - **Every panel re-rendered on every workspace change.** The desktop rebuilt each open panel's
63
+ element whenever it rendered: on a focus change, on each pointer move of a window drag or resize,
64
+ on a split resize. Each panel is now mounted by its own memoised host that reads only that panel's
65
+ entry, so a panel re-renders when its own title, icon, dirty flag or props change, or when what it
66
+ reads through `usePanel()`, `usePanelSize()` or `useWorkspaceState(selector)` does. A panel that
67
+ shows something it does not subscribe to (a value read from `ws.getOpenPanelIds()` or a module
68
+ variable during render) no longer refreshes on unrelated changes; read it with
69
+ `useWorkspaceState(selector)` instead.
70
+ - **`useWorkspaceState(selector)` re-rendered on every change**, whatever the selector returned, as
71
+ if no selector had been passed. It now re-renders only when the selected value changes, as
72
+ documented. Without a selector it still re-renders on every change.
73
+ - **Each pointer move of a tab drag re-rendered the whole desktop**, to move the ghost tab. Only the
74
+ ghost re-renders now. During a touch drag, moving within the same drop target no longer
75
+ re-renders the desktop either.
76
+ - **Open modals and side panels re-rendered their content on every workspace change**, including
77
+ each pointer move of a window drag behind them: their renderers read the whole state for the
78
+ direction. They now read only the direction, and so do the sidebar, toasts and panel overlay
79
+ widgets.
80
+
81
+ ### Tests
82
+
83
+ - `RenderScope.test.tsx`: with 10 and 100 panels, a focus change and a window move (through the
84
+ API and by dragging the title bar) re-render no panel; a focus change re-renders exactly the two
85
+ panels whose `usePanel().isActive` flips; renaming a panel re-renders that panel only;
86
+ `useWorkspaceState(selector)` re-renders only when its value changes; a window move re-renders no
87
+ open modal's content; a tab-drag move moves the ghost without re-rendering the desktop. Each was seen failing on 7.7.1, and again with the memo,
88
+ the selector hook, the modal renderer's selector or the ghost's own store broken.
89
+
9
90
  ## [7.7.1] — 2026-10-05
10
91
 
11
92
  Two workspaces on one page no longer break each other. Several providers on one page were documented
@@ -937,7 +1018,9 @@ All of the above is additive and backward-compatible: every new field is optiona
937
1018
 
938
1019
  ---
939
1020
 
940
- [Unreleased]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.7.1...HEAD
1021
+ [Unreleased]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.7.3...HEAD
1022
+ [7.7.3]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.7.2...v7.7.3
1023
+ [7.7.2]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.7.1...v7.7.2
941
1024
  [7.7.1]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.7.0...v7.7.1
942
1025
  [7.7.0]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.6.2...v7.7.0
943
1026
  [7.6.2]: https://github.com/felipecarrillo100/react-dockable-desktop/compare/v7.6.1...v7.6.2
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.7.1-blue.svg)](https://www.npmjs.com/package/react-dockable-desktop)
3
+ [![npm version](https://img.shields.io/badge/npm-v7.7.3-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)