You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7b56b3a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-kanban): a reference swimlane heading reads the target object's nameField (#37067)
Fixes#36930
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 看板按关联字段分泳道时,泳道标题改为和列标题一样,用被关联对象声明的名称字段显示记录;此前两处可能把同一条记录叫成不同的名字。
- 属于看板关联分组(按关联字段分列、分泳道)的收尾,让泳道标题服从"名称字段是唯一主标题"的既有裁决。
- 出错时只是泳道标题显示成别的字段的文字,卡片归属和拖拽不受影响;改动可直接撤回。
- 无。
## What changes
`ObjectKanban` reads the swimlane field's referenced object once per
board (`useSettledSchema`, the hook the column-lane path already uses
for `laneTargetDef`) and hands it to the board as a prop,
`swimlaneTargetDef`. `KanbanBoardCore` forwards it to `KanbanImpl`,
which passes it to `lanesFromRecords` in place of the hard-coded
`undefined`. So a reference swimlane is titled through
`referencedRecordTitle` exactly as a column lane over the same reference
is: the field's `displayField`, then the target's declared `nameField`
(ADR-0079), then the shared ladder.
- No exported type changes. `swimlaneTargetDef` lands on
`KanbanBoardCoreProps` and `KanbanBoardProps`, neither of which the
package index re-exports. `KanbanRendererProps`,
`ObjectKanbanComponentProps` and `KanbanLaneRows` are untouched.
- `effectiveSwimlaneField` moved up next to the lane-target read (same
expression) so the hook can key on it; no other use changed.
- `KanbanRenderer` (the exported React-host component in `index.tsx`) is
not changed. It holds no data source, so it cannot read the target
object; its swimlane heading keeps the field's `displayField`, then the
shared ladder on the expanded record. Its column lanes come from the
host's authored `schema.columns`, so it has no reference column-lane
heading to disagree with. Giving it the target def would need a new
member on the exported `KanbanRendererProps`; that is left out of this
PR.
## Tests
`ObjectKanban.swimlaneNameField-36930.test.tsx` (new): the target
`account` declares `nameField: 'code'` and its expanded records also
carry `name`, which the shared ladder would pick without the target def.
- (a) the swimlane headings read `ZZ-1` / `ZZ-2` (the `code`), not `Acme
Corp`;
- (b) they equal the column-lane headings of a board grouped by the same
lookup.
## Acceptance notes
- The column-lane and swimlane reads are two `useSettledSchema` calls;
when both name the same object the data source is asked twice. Not
changed here.
## Verification
Two-minute check: `cd ui/packages/plugin-kanban && pnpm exec vitest run
--root ../..
packages/plugin-kanban/src/ObjectKanban.swimlaneNameField-36930.test.tsx`.
Expect 2 passed.
Read first: `ui/packages/plugin-kanban/src/ObjectKanban.tsx` (the new
`useSettledSchema` read and the moved `effectiveSwimlaneField`, since a
hook must stay unconditional), then `KanbanImpl.tsx` (the
`lanesFromRecords` call and its memo deps).
<details><summary>plugin-kanban test + type-check (head
9432b64)</summary>
- `vitest run packages/plugin-kanban/`: Test Files 87 passed (87), Tests
571 passed (571).
- `pnpm run type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`):
exit 0 after building the `@object-ui/plugin-kanban` dependency closure;
the new test file is in the test program (`--listFilesOnly` count 1).
</details>
<details><summary>Ablation (one-off, committed fix restored)</summary>
`node scripts/ablation-replace.mjs` replaced `lanesFromRecords(allCards,
swimlaneField, swimlaneTargetDef, swimlaneDisplayField)` with the old
`undefined` argument (anchor 1 to 0, blob e588e6d to c669c032). The new
test went red: 2 failed of 2, received `Acme Corp` / `Globex Inc`
against expected `ZZ-1` / `ZZ-2`. Restore: blob after restore e588e6d
equals HEAD blob, `git diff HEAD` empty.
</details>
<details><summary>Local gates</summary>
The `dispatch-gates --commands` list for this diff was run locally;
every command exited 0. CI runs the full farm.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
fix(plugin-kanban): a reference swimlane heading names its record through the target object's declared `nameField`
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A board whose swimlanes group by a lookup now titles each swimlane the way a column lane over the same reference is titled: the field's `displayField`, then the referenced object's `nameField` (ADR-0079), then the shared title ladder. Before, the swimlane skipped the referenced object's `nameField`, so one record could be named differently in a swimlane heading and in a column heading. `ObjectKanban` reads the referenced object once per board; no exported type changes.
0 commit comments