diff --git a/.changeset/auto-width-naming-cleanup.md b/.changeset/auto-width-naming-cleanup.md deleted file mode 100644 index c57802c77..000000000 --- a/.changeset/auto-width-naming-cleanup.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@pretable/react": minor -"@pretable/core": minor ---- - -`autosizeColumns()` becomes `setAllColumnsAutoWidth(auto)`, and undeclared columns have one default width. - -**The rename.** The grid handle's `autosizeColumns()` never sized anything to content — it put every column into the auto-width set, the mode bit that says "the grid manages this column's width". Nothing in the column-width path measures a cell. It is now `grid.setAllColumnsAutoWidth(auto: boolean)`, symmetric with the per-column `setColumnAutoWidth(columnId, auto)` that shipped alongside the tool panel, and it moves the roster in BOTH directions — `false` freezes every column at the engine's stored width, which the old name could not express. The surface's `autosize?: boolean | AutosizeOptions` prop is likewise `allColumnsAutoWidth?: boolean`, and the `AutosizeOptions` type is gone from both packages: it was a tuning bag (`averageCharWidth`, `cellPaddingPx`, min/max) for a measurement pass that does not exist, so every field was inert. - -**One default width.** A column that declares no `widthPx` was drawn by the renderer at 140px but STORED by the engine at 160px, so turning auto width off on a never-resized column jumped its width 140 → 160 for no reason a user could see. Both numbers now come from one shared constant (140, and 220 for a `wrap: "text"` column) and the engine seeds its stored width through the renderer's own resolver, so the freeze lands on the pixel the column was already drawing. 140 won because it is what undeclared columns have always painted at — no grid repaints as a result of this change. - -**A double-click that does something.** Double-clicking a column's resize handle was wired to a no-op. It now calls `setColumnAutoWidth(columnId, true)`, the pointer shortcut for handing that column's width back to the grid, which is what the docs had claimed all along. It no longer fires `onColumnWidthsChange`: that callback reports the engine's STORED widths, and handing a column to the grid moves none of them — the notification announced a change that had not happened. - -**Fixed: auto width did not survive a controlled `state.columnWidths`.** `setColumnWidth` cleared a column's auto bit unconditionally, and a controlled consumer replays its whole widths map through `setColumnWidth` on every write-back pass. So any re-render of such a consumer silently took every column in the map back out of the auto set — the tool panel's Auto width toggle and the resize handle's double-click both appeared to work and were undone before paint. The bit is now cleared only when the write actually MOVES the stored width, compared across grid-core's own min/max clamping rather than against the requested number. This is a user-visible fix to behavior that shipped with the tool panel's auto-width toggle, not a consequence of the rename. diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index eaeb43a5c..50948d747 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,19 @@ # @pretable/core +## 0.13.0 + +### Minor Changes + +- `autosizeColumns()` becomes `setAllColumnsAutoWidth(auto)`, and undeclared columns have one default width. ([#542](https://github.com/cacheplane/pretable/pull/542)) + + **The rename.** The grid handle's `autosizeColumns()` never sized anything to content — it put every column into the auto-width set, the mode bit that says "the grid manages this column's width". Nothing in the column-width path measures a cell. It is now `grid.setAllColumnsAutoWidth(auto: boolean)`, symmetric with the per-column `setColumnAutoWidth(columnId, auto)` that shipped alongside the tool panel, and it moves the roster in BOTH directions — `false` freezes every column at the engine's stored width, which the old name could not express. The surface's `autosize?: boolean | AutosizeOptions` prop is likewise `allColumnsAutoWidth?: boolean`, and the `AutosizeOptions` type is gone from both packages: it was a tuning bag (`averageCharWidth`, `cellPaddingPx`, min/max) for a measurement pass that does not exist, so every field was inert. + + **One default width.** A column that declares no `widthPx` was drawn by the renderer at 140px but STORED by the engine at 160px, so turning auto width off on a never-resized column jumped its width 140 → 160 for no reason a user could see. Both numbers now come from one shared constant (140, and 220 for a `wrap: "text"` column) and the engine seeds its stored width through the renderer's own resolver, so the freeze lands on the pixel the column was already drawing. 140 won because it is what undeclared columns have always painted at — no grid repaints as a result of this change. + + **A double-click that does something.** Double-clicking a column's resize handle was wired to a no-op. It now calls `setColumnAutoWidth(columnId, true)`, the pointer shortcut for handing that column's width back to the grid, which is what the docs had claimed all along. It no longer fires `onColumnWidthsChange`: that callback reports the engine's STORED widths, and handing a column to the grid moves none of them — the notification announced a change that had not happened. + + **Fixed: auto width did not survive a controlled `state.columnWidths`.** `setColumnWidth` cleared a column's auto bit unconditionally, and a controlled consumer replays its whole widths map through `setColumnWidth` on every write-back pass. So any re-render of such a consumer silently took every column in the map back out of the auto set — the tool panel's Auto width toggle and the resize handle's double-click both appeared to work and were undone before paint. The bit is now cleared only when the write actually MOVES the stored width, compared across grid-core's own min/max clamping rather than against the requested number. This is a user-visible fix to behavior that shipped with the tool panel's auto-width toggle, not a consequence of the rename. + ## 0.12.1 ## 0.12.0 diff --git a/packages/core/package.json b/packages/core/package.json index 46d74260e..ad7b4a74b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@pretable/core", - "version": "0.12.1", + "version": "0.13.0", "description": "Framework-agnostic grid state primitives for Pretable.", "license": "MIT", "repository": { diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index a7ecd4d36..02c53fc11 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,25 @@ # @pretable/react +## 0.13.0 + +### Minor Changes + +- `autosizeColumns()` becomes `setAllColumnsAutoWidth(auto)`, and undeclared columns have one default width. ([#542](https://github.com/cacheplane/pretable/pull/542)) + + **The rename.** The grid handle's `autosizeColumns()` never sized anything to content — it put every column into the auto-width set, the mode bit that says "the grid manages this column's width". Nothing in the column-width path measures a cell. It is now `grid.setAllColumnsAutoWidth(auto: boolean)`, symmetric with the per-column `setColumnAutoWidth(columnId, auto)` that shipped alongside the tool panel, and it moves the roster in BOTH directions — `false` freezes every column at the engine's stored width, which the old name could not express. The surface's `autosize?: boolean | AutosizeOptions` prop is likewise `allColumnsAutoWidth?: boolean`, and the `AutosizeOptions` type is gone from both packages: it was a tuning bag (`averageCharWidth`, `cellPaddingPx`, min/max) for a measurement pass that does not exist, so every field was inert. + + **One default width.** A column that declares no `widthPx` was drawn by the renderer at 140px but STORED by the engine at 160px, so turning auto width off on a never-resized column jumped its width 140 → 160 for no reason a user could see. Both numbers now come from one shared constant (140, and 220 for a `wrap: "text"` column) and the engine seeds its stored width through the renderer's own resolver, so the freeze lands on the pixel the column was already drawing. 140 won because it is what undeclared columns have always painted at — no grid repaints as a result of this change. + + **A double-click that does something.** Double-clicking a column's resize handle was wired to a no-op. It now calls `setColumnAutoWidth(columnId, true)`, the pointer shortcut for handing that column's width back to the grid, which is what the docs had claimed all along. It no longer fires `onColumnWidthsChange`: that callback reports the engine's STORED widths, and handing a column to the grid moves none of them — the notification announced a change that had not happened. + + **Fixed: auto width did not survive a controlled `state.columnWidths`.** `setColumnWidth` cleared a column's auto bit unconditionally, and a controlled consumer replays its whole widths map through `setColumnWidth` on every write-back pass. So any re-render of such a consumer silently took every column in the map back out of the auto set — the tool panel's Auto width toggle and the resize handle's double-click both appeared to work and were undone before paint. The bit is now cleared only when the write actually MOVES the stored width, compared across grid-core's own min/max clamping rather than against the requested number. This is a user-visible fix to behavior that shipped with the tool panel's auto-width toggle, not a consequence of the rename. + +### Patch Changes + +- Updated dependencies [[`d53bc8d`](https://github.com/cacheplane/pretable/commit/d53bc8d8dd64979cfff31f5331306251dddb8972)]: + - @pretable/core@0.13.0 + - @pretable/ui@0.13.0 + ## 0.12.1 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 66f7f20ef..b9f8116e1 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@pretable/react", - "version": "0.12.1", + "version": "0.13.0", "description": "React components and hooks for Pretable.", "license": "MIT", "repository": { diff --git a/packages/stream-adapter/CHANGELOG.md b/packages/stream-adapter/CHANGELOG.md index 226924400..6718a843c 100644 --- a/packages/stream-adapter/CHANGELOG.md +++ b/packages/stream-adapter/CHANGELOG.md @@ -1,5 +1,7 @@ # @pretable/stream-adapter +## 0.13.0 + ## 0.12.1 ## 0.12.0 diff --git a/packages/stream-adapter/package.json b/packages/stream-adapter/package.json index 2a6af296d..26641dd36 100644 --- a/packages/stream-adapter/package.json +++ b/packages/stream-adapter/package.json @@ -1,6 +1,6 @@ { "name": "@pretable/stream-adapter", - "version": "0.12.1", + "version": "0.13.0", "description": "Streaming row adapters for Pretable.", "license": "MIT", "repository": { diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index d815ecfb4..d5993cd14 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,7 @@ # @pretable/ui +## 0.13.0 + ## 0.12.1 ## 0.12.0 diff --git a/packages/ui/package.json b/packages/ui/package.json index 5326257cd..3a9dbe342 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@pretable/ui", - "version": "0.12.1", + "version": "0.13.0", "description": "CSS themes, tokens, and grid styles for Pretable.", "license": "MIT", "repository": {