Skip to content

Commit 22ddd2f

Browse files
committed
docs(studio): shorten the header and inspector tab comments to fit the comment gate
1 parent 8d84f59 commit 22ddd2f

5 files changed

Lines changed: 11 additions & 41 deletions

File tree

‎packages/studio/src/components/RightPanelTabs.test.tsx‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// @vitest-environment happy-dom
2+
23
/**
3-
* The inspector strip's keyboard behaviour, and the two things a reskin can
4-
* silently break: which tab reads as selected, and how the global hotkey
5-
* filters classify the elements (KTD13).
6-
*
7-
* The strip used to be `aria-pressed` buttons. Arrow keys did nothing, so the
8-
* first two tests here are new behaviour, not a port.
4+
* The strip's keyboard behaviour, which tab reads as selected, and how the hotkey
5+
* filters classify the elements (KTD13). The arrow-key tests are new behaviour, not a port.
96
*/
107
import React, { act } from "react";
118
import { createRoot, type Root } from "react-dom/client";
@@ -28,11 +25,7 @@ afterEach(() => {
2825
host.remove();
2926
});
3027

31-
/**
32-
* The strip is controlled by the panel's own state, so the harness owns that
33-
* state too: a mount whose `active` never moved would make every second
34-
* selection look like a no-op the real panel does not have.
35-
*/
28+
/** The harness owns the active state too, so a selection moves as it does in the real panel. */
3629
function mount(initialActive: string[]): {
3730
host: HTMLElement;
3831
selections: ReturnType<typeof vi.fn>;

‎packages/studio/src/components/RightPanelTabs.tsx‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/**
2-
* The inspector panel's tab strip.
3-
*
4-
* It used to be a row of `aria-pressed` buttons, which no arrow key reached
5-
* and which assistive tech announced as five unrelated toggles. This is the
6-
* shared Tabs primitive, so the strip gets the roving tabindex, the arrow keys
7-
* and Home / End from the library rather than from nobody.
8-
*
9-
* The selected tab is derived, not stored: `active` comes from the panel state
10-
* the panel already keeps (which pane is open, which tab the layout holds), so
11-
* this component adds no second source for that decision. In the legacy split
12-
* inspector both Design and Layers can be open at once; one of them holds the
13-
* `aria-selected` state and the other still wears the selected look, because
14-
* both panes really are on screen.
2+
* The inspector tab strip on the shared Tabs primitive. The selected tab is derived from the
3+
* panel's state; in the legacy split inspector two can be open, only one holds `aria-selected`.
154
*/
165

176
import { Tab, Tabs, TabsList, Tooltip, cn } from "./ui";

‎packages/studio/src/components/StudioHeader.dom.test.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
// @vitest-environment happy-dom
2+
23
/**
3-
* The header after the primitive sweep: the controls really are the shared
4-
* ones, the disabled history buttons still say why they are disabled, and both
5-
* global hotkey filters classify the new elements the way they classified the
6-
* hand-rolled ones (KTD13).
7-
*
8-
* The contexts are mocked rather than provided: this file is about the markup
9-
* the header renders, and building three real provider values would test the
10-
* providers instead.
4+
* The header on the shared primitives: same controls, disabled history still explained,
5+
* hotkey filters unchanged (KTD13). Contexts are mocked, not provided.
116
*/
127
import React, { act } from "react";
138
import { createRoot, type Root } from "react-dom/client";

‎packages/studio/src/components/StudioHeader.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ function HyperframesLogo() {
138138
);
139139
}
140140

141-
/**
142-
* The Undo / Redo tooltip: the shortcut always, the last action's name when
143-
* there is one. Pure so the wording is testable without a pointer, which a
144-
* disabled trigger cannot give a tooltip anyway.
145-
*/
141+
/** The Undo / Redo tooltip: the shortcut always, the last action's name when there is one. */
146142
export function historyTooltipLabel(
147143
action: "undo" | "redo",
148144
lastAction: string | null | undefined,

‎packages/studio/src/components/ui/Button.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ export const buttonVariants: Record<ButtonVariant, string> = {
7373

7474
/**
7575
* The three control heights, 24 / 28 / 32 px, from `--spacing-ctl-*`.
76-
*
77-
* Exported beside `buttonBase` and `buttonVariants` for the one header control
78-
* a `<button>` cannot be: Capture is a download `<a href>`. A link that wears
79-
* the recipe from here cannot drift away from a real Button.
76+
* Exported so the Capture download `<a href>` can wear the same recipe as a Button.
8077
*/
8178
export const buttonSizes: Record<ButtonSize, string> = {
8279
sm: "h-ctl-sm px-2 gap-1 rounded-sm text-step-11",

0 commit comments

Comments
 (0)