Skip to content

Commit 6cfa758

Browse files
fix(components)!: NavigationOverlay drops its unused comments prop (#37275)
Fixes #36410 repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no skill, docs page or README names the NavigationOverlay comments prop; the changeset carries the FROM-TO line ## 维护者速读 - 用户能看到什么变化:用户无感;只是记录侧边抽屉组件删掉了一个早已没人传入的评论按钮入口。 - 为什么做:收尾「评论通知直达评论」这张卡的第二项清理,上一项已在之前的合并里完成。 - 出错会怎样:只有自己写代码向抽屉传评论按钮的集成方会编译报错,删掉该参数即可;可直接撤回。 - 要你做什么:无 ## What changes Item 2 of the card, the last open item (item 1 landed earlier; see the card's release comment). - `@object-ui/components` `NavigationOverlay` drops its `comments` prop: the `NavigationOverlayProps.comments` declaration, its destructure, and the pass-through into the drawer's `RecordTopBar`. - `RecordTopBar` keeps its own `comments` slot. It is still filled by the record page: `ui/packages/app-shell/src/views/RecordDetailView.tsx` passes `comments={phoneCommentsButton}` on the phone bar and `comments={shellActions ? undefined : commentsButton}` on the desktop bar. - Changeset `.changeset/36410-navigation-overlay-comments-prop.md`: `@object-ui/components` patch, BREAKING banner, ADR-0087 disposition `not-required (runtime-export-retired @object-ui/components#NavigationOverlayProps.comments)`, and the FROM-TO line, in the shape of the earlier `NavigationOverlayProps.maximizable` removal. Premise, measured on `origin/main` 9171bed before the change: no caller passes `comments` to `NavigationOverlay`. Every render site under `ui/`, `examples/`, `packages/` and `apps/` was read (27 sites, including the e2e harness `ui/e2e/toast-under-modal.spec.ts`, which passes mode, isOverlay, isOpen, selectedRecord, close, setIsOpen, width, title, onExpand, expandLabel, children). The spread sites spread `useNavigationOverlay`'s result (no `comments` in the hook) or ObjectGrid's `recordOverlayShellProps` (storageKey, legacyStorageKey, width). ## Read first 1. `ui/packages/components/src/custom/navigation-overlay.tsx`: the three removals and the bar comment. 2. `ui/packages/components/src/__tests__/navigation-overlay-bar-26679.test.tsx`: the new top-level describe (type pin plus render check). 3. `.changeset/36410-navigation-overlay-comments-prop.md`: the disposition marker and FROM-TO line. ## Two-minute check `pnpm --filter @object-ui/components exec vitest run --maxWorkers=2 src/__tests__/navigation-overlay-bar-26679.test.tsx`: expect all tests to pass, including "the drawer bar takes no comments switch". ## Tests - The pin goes into the existing drawer bar harness: a `@ts-expect-error` on a partial `NavigationOverlayProps` object carrying `comments` (compiled by the package's `tsconfig.test.json`), and a render check that a stray `comments` is not drawn in the bar. - `record-top-bar-comments-36075.test.tsx`: docblock only. It no longer says the drawer hands the switch on. Every reading below is on head `8acc3c0e7`. <details><summary>Package test, type-check and pin ablation</summary> - `pnpm --filter @object-ui/components test` (under the verify lock): `Test Files 510 passed | 1 skipped (511)`, `Tests 4967 passed | 24 skipped (4991)`, `VERDICT command-exit 0`. - `pnpm --filter @object-ui/components type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`): `VERDICT command-exit 0`. - Ablation of the type pin (one-time, through `scripts/ablation-replace.mjs`): putting `comments?: React.ReactNode;` back into `NavigationOverlayProps` landed (anchor 1 to 0, blob a7cb247 to dbcac407), and `tsc -p tsconfig.test.json` failed with `navigation-overlay-bar-26679.test.tsx(129,5): error TS2578: Unused '@ts-expect-error' directive.` The file was restored to the HEAD blob a7cb247, and `git diff HEAD` was empty. A first attempt was a no-op: the tool refused it because the replacement text contained its anchor, and no command ran. </details> <details><summary>Dogfood battery (bang title and narrowing arm)</summary> `pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test` under the verify lock, with no shard and no path: `Test Files 487 passed | 3 skipped (490)`, `Tests 4128 passed | 68 skipped (4196)`, `VERDICT command-exit 0`. </details> ## Acceptance notes - `RecordTopBar.comments` stays, so this is the only published surface that narrows. - The e2e harness and the examples pass no `comments`, so no e2e or example text changes. ## Verification <details><summary>Derived gates, local subset</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 38 families from the 4-path change set (merge base 9171bed). Each family was run and its exit code captured before any pipe, and all 38 exited 0. Among them: `check-adr-0087-registration --base origin/main` verified `not-required (runtime-export-retired) -- verified: @object-ui/components#NavigationOverlayProps.comments (member, ui/packages/components/src/custom/navigation-overlay.tsx)`, plus `check-changeset-no-major`, `check-empty-changeset`, `check:type-check-debt`, `check:type-check-coverage`, `check:nul-bytes` and `pnpm --dir ui exec vitest run scripts/` (172 files passed). Reconciliation: `Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN` (a derived zero: all 38 recorded an exit code). `scripts/pm/overlap-check.mjs` before each push: `VERDICT clean exit 0`, and origin/main merges cleanly. `test:repo` and the repo-wide lint belong to CI. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0ad44a3 commit 6cfa758

4 files changed

Lines changed: 35 additions & 11 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
fix(components)!: `NavigationOverlay` drops its `comments` prop, which no caller fills
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/components#NavigationOverlayProps.comments) the retired operand is a prop of the drawer component in a published ui package entry; no packages/spec schema, no registered node type, no ADR-0087 conversion surface and no stored shape names it, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that passed `NavigationOverlay` its `comments` prop.
13+
14+
The record drawer took a comments switch and handed it to its top bar, ahead of the record's button group. Since the console stopped offering comments in the drawer, nothing passes it: a record's comments live on its full page, whose own bar draws the switch. The prop is removed so the drawer no longer advertises a slot no caller fills. `RecordTopBar` keeps its own `comments` slot: the record page fills it on the desktop and on a phone.
15+
16+
What leaves, and what to write instead:
17+
18+
- FROM `NavigationOverlayProps.comments` TO nothing, in the components package: the drawer's bar draws no comments switch. Fix: delete `comments` from the `NavigationOverlay` call; to show a record's comments, open its full page (the drawer's ⤢), where the bar draws the switch.

‎ui/packages/components/src/__tests__/navigation-overlay-bar-26679.test.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,13 @@ describe('↑ ↓ step through the host set (ruling 3 keeps the controls)', () =
123123
expect(onPrevious).not.toHaveBeenCalled();
124124
});
125125
});
126+
127+
describe('the drawer bar takes no comments switch (objectstack#36410)', () => {
128+
it('`comments` is not a NavigationOverlay prop, and a stray one is not drawn', () => {
129+
// @ts-expect-error `comments` left NavigationOverlayProps: the record's comments live on its full page
130+
const stray: Partial<NavigationOverlayProps> = { comments: <button type="button" data-testid="stray-comments" /> };
131+
renderBar(stray);
132+
expect(document.querySelector('[data-record-top-bar]')).not.toBeNull();
133+
expect(screen.queryByTestId('stray-comments')).toBeNull();
134+
});
135+
});

‎ui/packages/components/src/__tests__/record-top-bar-comments-36075.test.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
/**
1010
* objectstack#36075, item 2 — the record's comments switch sits in the record
11-
* row of the top bar, ahead of the record's button group, on the page and in
12-
* the drawer (`NavigationOverlay` hands it on); the one-row bar draws it
13-
* ahead of the button group too.
11+
* row of the top bar, ahead of the record's button group, on the record page;
12+
* the one-row bar draws it ahead of the button group too. The drawer
13+
* (`NavigationOverlay`) no longer takes or hands on a comments switch
14+
* (objectstack#36410); `navigation-overlay-bar-26679.test.tsx` pins that.
1415
*/
1516

1617
import * as React from 'react';

‎ui/packages/components/src/custom/navigation-overlay.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,6 @@ export interface NavigationOverlayProps {
271271
* host's to decide.
272272
*/
273273
toggles?: React.ReactNode;
274-
/**
275-
* The record's comment switch (objectstack#36075), drawn in the bar before
276-
* the record's button group (`RecordTopBar`'s `comments`).
277-
*/
278-
comments?: React.ReactNode;
279274
/**
280275
* The record header's one-row bar (objectstack#35593): handed the bar's
281276
* element the record's button group is drawn into, after the step pair.
@@ -523,7 +518,6 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
523518
trail,
524519
stepper,
525520
toggles,
526-
comments,
527521
actionSlotRef,
528522
stepperHidden = false,
529523
recordRow,
@@ -634,7 +628,9 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
634628
right end the counter and ↓ ↑, the host's panel switches, then ⤢ and ✕.
635629
With a `recordRow` it is two rows (objectstack#35853): ✕, `←`, the
636630
breadcrumb, ↑ ↓ and the counter over the record, ⤢ at the right of the
637-
first (✕ moved to the left by objectstack#36557). */
631+
first (✕ moved to the left by objectstack#36557). The bar carries no
632+
comments switch: the record's comments live on its full page, whose own
633+
bar draws the switch (objectstack#36410). */
638634
const bar = (
639635
<RecordTopBar
640636
leadingTestId="record-drawer-leading"
@@ -652,7 +648,6 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
652648
actionSlotRef={actionSlotRef}
653649
record={recordRow}
654650
toggles={toggles}
655-
comments={comments}
656651
frame={
657652
onExpand ? (
658653
<RecordTopBarButton label={resolvedExpandLabel} onClick={() => onExpand()} data-testid="record-pane-open-page">

0 commit comments

Comments
 (0)