Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .changeset/auto-width-naming-cleanup.md

This file was deleted.

14 changes: 14 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
20 changes: 20 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions packages/stream-adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @pretable/stream-adapter

## 0.13.0

## 0.12.1

## 0.12.0
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-adapter/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @pretable/ui

## 0.13.0

## 0.12.1

## 0.12.0
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down