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
18 changes: 18 additions & 0 deletions .changeset/36410-navigation-overlay-comments-prop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@object-ui/components': patch
---

fix(components)!: `NavigationOverlay` drops its `comments` prop, which no caller fills

Clause-②: yes (narrowing)
Metadata-protocol: none

<!-- 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 -->

**BREAKING** for a host that passed `NavigationOverlay` its `comments` prop.

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.

What leaves, and what to write instead:

- 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.
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,13 @@ describe('↑ ↓ step through the host set (ruling 3 keeps the controls)', () =
expect(onPrevious).not.toHaveBeenCalled();
});
});

describe('the drawer bar takes no comments switch (objectstack#36410)', () => {
it('`comments` is not a NavigationOverlay prop, and a stray one is not drawn', () => {
// @ts-expect-error `comments` left NavigationOverlayProps: the record's comments live on its full page
const stray: Partial<NavigationOverlayProps> = { comments: <button type="button" data-testid="stray-comments" /> };
renderBar(stray);
expect(document.querySelector('[data-record-top-bar]')).not.toBeNull();
expect(screen.queryByTestId('stray-comments')).toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

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

import * as React from 'react';
Expand Down
11 changes: 3 additions & 8 deletions ui/packages/components/src/custom/navigation-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,6 @@ export interface NavigationOverlayProps {
* host's to decide.
*/
toggles?: React.ReactNode;
/**
* The record's comment switch (objectstack#36075), drawn in the bar before
* the record's button group (`RecordTopBar`'s `comments`).
*/
comments?: React.ReactNode;
/**
* The record header's one-row bar (objectstack#35593): handed the bar's
* element the record's button group is drawn into, after the step pair.
Expand Down Expand Up @@ -523,7 +518,6 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
trail,
stepper,
toggles,
comments,
actionSlotRef,
stepperHidden = false,
recordRow,
Expand Down Expand Up @@ -634,7 +628,9 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
right end the counter and ↓ ↑, the host's panel switches, then ⤢ and ✕.
With a `recordRow` it is two rows (objectstack#35853): ✕, `←`, the
breadcrumb, ↑ ↓ and the counter over the record, ⤢ at the right of the
first (✕ moved to the left by objectstack#36557). */
first (✕ moved to the left by objectstack#36557). The bar carries no
comments switch: the record's comments live on its full page, whose own
bar draws the switch (objectstack#36410). */
const bar = (
<RecordTopBar
leadingTestId="record-drawer-leading"
Expand All @@ -652,7 +648,6 @@ export const NavigationOverlay: React.FC<NavigationOverlayProps> = ({
actionSlotRef={actionSlotRef}
record={recordRow}
toggles={toggles}
comments={comments}
frame={
onExpand ? (
<RecordTopBarButton label={resolvedExpandLabel} onClick={() => onExpand()} data-testid="record-pane-open-page">
Expand Down
Loading