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
8 changes: 8 additions & 0 deletions .changeset/overlay-slot-requiredness-7106.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
---

Docs-only fix: `alert-dialog.mdx` and `sheet.mdx` published `trigger`/`content`
node slots as required; the shipped `AlertDialogSchema`/`SheetSchema`
declarations (and their Zod mirrors) already declare them optional. No
declaration changes; test-only update to the fixture pin that records this
class of divergence.
2 changes: 1 addition & 1 deletion content/docs/components/overlay/alert-dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface AlertDialogSchema {
description?: string; // Dialog description

// Trigger
trigger: SchemaNode | SchemaNode[]; // Component that triggers the dialog
trigger?: SchemaNode | SchemaNode[]; // Component that triggers the dialog

// Body and footer
content?: SchemaNode | SchemaNode[]; // Rendered between the header and the footer
Expand Down
4 changes: 2 additions & 2 deletions content/docs/components/overlay/sheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ The Sheet component displays content in a panel that slides in from the edge of
```plaintext
interface SheetSchema {
type: 'sheet';
trigger: SchemaNode | SchemaNode[]; // Trigger component
trigger?: SchemaNode | SchemaNode[]; // Trigger component
title?: string; // Sheet title
description?: string; // Sheet description
content: SchemaNode | SchemaNode[]; // Sheet content
content?: SchemaNode | SchemaNode[]; // Sheet content
side?: 'left' | 'right' | 'top' | 'bottom';
className?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@
* pins those rows). `EmptySchema.action` keeps its row and its pin. The day it
* is declared, this file goes red and the page is owed a row.
*
* Likewise the requiredness of `AlertDialogSchema.trigger`, `SheetSchema.trigger`
* and `SheetSchema.content`: all three are declared OPTIONAL and published
* REQUIRED. That is objectui#7073's defect class, not this card's, and it is
* fenced out of the diff -- but pinned here so it cannot be lost, and so a fix
* on either side turns this file red rather than passing unnoticed.
* The requiredness of `AlertDialogSchema.trigger`, `SheetSchema.trigger` and
* `SheetSchema.content` was the exception left after that: all three were
* declared OPTIONAL and published REQUIRED, objectui#7073's defect class
* rather than this card's, so it was fenced out of the diff and pinned
* instead so a fix on either side would turn this file red rather than
* passing unnoticed. objectui#7106 closed it: all three pages now spell `?`,
* joining `ContextMenuSchema.trigger` -- the row #7073 had already corrected
* -- as agreement rather than divergence.
*/

import { describe, expect, it } from 'vitest';
Expand Down Expand Up @@ -326,19 +329,15 @@ describe('rows a docs-only edit cannot honestly resolve, recorded rather than re
});
});

describe('requiredness divergences left to the objectui#7073 class, pinned so they cannot be lost', () => {
describe('requiredness: the objectui#7073 class, closed -- all four rows agree on both faces (objectui#7106)', () => {
it.each([
['ContextMenuSchema', 'trigger'],
['AlertDialogSchema', 'trigger'],
['SheetSchema', 'trigger'],
['SheetSchema', 'content'],
])('%s.%s is declared optional and still published required', (owner, key) => {
])('%s.%s is declared optional and published optional', (owner, key) => {
expect(declRow(owner, key)?.optional).toBe(true);
expect(docRow(owner, key)?.optional).toBe(false);
});

it('`ContextMenuSchema.trigger` is the one already corrected, by #7073 -- the control', () => {
expect(declRow('ContextMenuSchema', 'trigger')?.optional).toBe(true);
expect(docRow('ContextMenuSchema', 'trigger')?.optional).toBe(true);
expect(docRow(owner, key)?.optional).toBe(true);
});
});

Expand Down
Loading