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
19 changes: 12 additions & 7 deletions .changeset/7742-kanban-arm-batch70.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ failure objectui#7664's own first cut shipped at `onCardClick`.
including tests: 0 hits / 0 files each, with `groupBy` (85 hits / 27 files),
`cardTitle` (18/9) and `coverImageField` (17/3) firing as controls on the same
instrument. An author who wrote `allowCollapse: true` validated green and got
a board that never collapsed off that key. Each capability exists on a
*different* channel, and the refusal message names it: a lane's own
`columns[].collapsed` for collapsing, a `templates` component prop for card
templates, a `useColumnWidths` hook option for widths. Wiring a board-level
switch to any of them would be new behaviour and is not ordered here.
`CardTemplate` and `ColumnWidthConfig` stay exported — the prop and the hook
still consume the types.
a board that never collapsed off that key. At this change, each capability
existed on a *different* channel, and the refusal message named it: a lane's
own `columns[].collapsed` for collapsing, a `templates` component prop for
card templates, a `useColumnWidths` hook option for widths. Wiring a
board-level switch to any of them would be new behaviour and is not ordered
here. `CardTemplate` and `ColumnWidthConfig` stay exported — at this change,
the prop and the hook consumed the types.

⚠️ **Dated note, 2026-09-25 — the `useColumnWidths` hook has since been
retired (objectui#8522), so the widths channel named above no longer exists
and `ColumnWidthConfig` has no `plugin-kanban` reader. `CardTemplate` is still
consumed, by the `CardTemplates` component's `templates` prop.**
- **`titleField`** — ⚠️ **not** an inertness retirement, and reading it as one
gets the mechanism backwards. `ObjectKanban` still reads the key and the read
stays, because the **sibling `object-kanban` arm declares it and keeps it**
Expand Down
33 changes: 33 additions & 0 deletions .changeset/8522-retire-use-column-widths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
'@object-ui/plugin-kanban': minor
---

**BREAKING (scored `minor` per this repo's version-alignment convention)** —
`useColumnWidths` is removed from `@object-ui/plugin-kanban`, together with its
`UseColumnWidthsOptions` and `UseColumnWidthsReturn` types (objectui#8522,
maintainer ruling: remove).

The hook kept per-column widths in `localStorage`, and no kanban board read
them: a board sizes its lanes from its own width (`columnInlineStyle` in
`KanbanImpl`, derived on every render), and no kanban component accepts a
per-lane width. The published 17.6.0 entry exports the hook and both types, so
an import of it compiled and ran while changing nothing on screen.

## Migration

- `import { useColumnWidths } from '@object-ui/plugin-kanban'`, and the type
imports `UseColumnWidthsOptions` / `UseColumnWidthsReturn`, no longer resolve.
Delete the import and the call. Nothing replaces the hook, and removing the
call changes no rendered width, because no board ever consumed what it
returned.
- The `localStorage` key `objectui:kanban-column-widths` (and its per-board form,
that key followed by `:` and the `storageKey` you passed) is no longer written
or read by any package. Values already stored in a browser are inert; remove
them if you want the storage back.
- `ColumnWidthConfig` stays exported from `@object-ui/types` and from this
package. This change does not retire it.
- The objectui#7742 entry in this same release (batch #70, the `kanban` arm)
names a `useColumnWidths` hook option as the channel for column widths. That
channel is gone with this change, and no other channel replaces it. This
change adds a dated note to that entry saying so, leaving its declaration
untouched.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ type _RegistryIsReal = Assert<Equal<IsAny<SchemaRegistry>, false>>;
// `Equal` is invariant, so a re-declared twin that drifted by one member
// turns this red. (`KanbanSchema` was the third member of this row until
// objectui#8802 retired it with the bare `kanban` node key; the two that
// remain are consumed by `KanbanImpl`, `CardTemplates` and `useColumnWidths`
// and are NOT retired.)
// remain are consumed by `KanbanImpl` and `CardTemplates` and are NOT
// retired.)
type _ColumnIsTheDeclaredOne = Assert<Equal<KanbanColumn, DeclaredKanbanColumn>>;
type _CardIsTheDeclaredOne = Assert<Equal<KanbanCard, DeclaredKanbanCard>>;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* ObjectUI
* Copyright (c) 2024-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* objectui#8522 — `useColumnWidths` is RETIRED from the package entry.
*
* The hook kept per-column widths in `localStorage` and no board read it: the
* rendered lane width comes from `KanbanImpl`'s `columnInlineStyle`, derived
* from the board's own width on every render. Ruled remove (a published
* capability with zero consumers retires immediately); the hook, its two option
* and return types, and its storage key went with it. ⛔ Resizable lanes are
* not rebuilt to keep it alive; if they are ever wanted, they come back as
* their own feature.
*
* What this pins is the entry's SHAPE, both halves:
*
* - runtime: the hook name is not an own key of the module namespace, with a
* sibling hook exported the same way and the board renderer as firing
* controls on the same probe;
* - compile time: the two type names do not resolve through the entry, with a
* sibling hook's return type resolving through the same type query as the
* control. Compiled by this package's `tsconfig.test.json` (chained off
* `type-check`); an export that comes back fails there with
* "Unused '@ts-expect-error' directive".
*/

import { describe, expect, it } from 'vitest';
import * as entry from '../index';

describe('@object-ui/plugin-kanban entry — useColumnWidths retired (objectui#8522)', () => {
it('no longer exports the hook, while live exports on the same probe still resolve', () => {
const keys = Object.keys(entry);
expect(keys).not.toContain('useColumnWidths');
// Firing controls: a hook exported the same way, and the board renderer.
// Without them an empty or mis-resolved namespace would pass the line above.
expect(typeof (entry as Record<string, unknown>).useCrossSwimlaneMove).toBe('function');
expect(keys).toContain('ObjectKanbanRenderer');
});

it('no longer exports the hook option and return types', () => {
// @ts-expect-error retired with the hook (objectui#8522). If the export
// comes back, tsc fails with "Unused '@ts-expect-error' directive".
type _OptionsRetired = import('../index').UseColumnWidthsOptions;
// @ts-expect-error retired with the hook (objectui#8522), as above.
type _ReturnRetired = import('../index').UseColumnWidthsReturn;
// Control: the same type query resolves a sibling hook's return type, so
// the two errors above are readings of the entry and not of a bad path.
type _SiblingResolves = import('../index').UseCrossSwimlaneMoveReturn;
});
});
2 changes: 0 additions & 2 deletions packages/plugin-kanban/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ export { InlineQuickAdd } from './InlineQuickAdd';
export type { InlineQuickAddProps } from './InlineQuickAdd';
export { CardTemplates } from './CardTemplates';
export type { CardTemplatesProps } from './CardTemplates';
export { useColumnWidths } from './useColumnWidths';
export type { UseColumnWidthsOptions, UseColumnWidthsReturn } from './useColumnWidths';
export { useCrossSwimlaneMove } from './useCrossSwimlaneMove';
export type { Swimlane, CrossSwimlaneMoveEvent, UseCrossSwimlaneOptions, UseCrossSwimlaneMoveReturn } from './useCrossSwimlaneMove';
export { useQuickAddReorder } from './useQuickAddReorder';
Expand Down
125 changes: 0 additions & 125 deletions packages/plugin-kanban/src/useColumnWidths.ts

This file was deleted.

6 changes: 4 additions & 2 deletions packages/types/src/complex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ export interface KanbanColumn {
* documents.
*
* {@link KanbanCard}, {@link KanbanColumn}, {@link CardTemplate} and
* {@link ColumnWidthConfig} are NOT retired — the renderer, the `CardTemplates`
* component and the `useColumnWidths` hook still consume them.
* {@link ColumnWidthConfig} are NOT retired — the renderer and the
* `CardTemplates` component still consume the first three. The one
* `plugin-kanban` reader of {@link ColumnWidthConfig} was removed by
* objectui#8522, whose ruling did not reach the type itself.
*
* Pinned in `./__tests__/bare-kanban-node-key-retired-8802.test.ts`.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/objectql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3727,7 +3727,7 @@ export interface ObjectKanbanSchema extends BaseSchema {
*
* `id` / `title` / `cards` / `limit` / `className` / `collapsed` are exactly
* the lane members the two board implementations read, counted off
* `KanbanImpl`, `KanbanEnhanced`, `useColumnWidths`, `useCrossSwimlaneMove`,
* `KanbanImpl`, `KanbanEnhanced`, `useCrossSwimlaneMove`,
* `useQuickAddReorder` and `bucketCardsIntoColumns`. Their VALUE types come
* from those read sites too — see {@link id} for the one this card had to
* correct.
Expand Down
Loading