@diegopluna/narvi 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app-shell/AppShellMain.svelte +14 -2
- package/dist/components/app-shell/AppShellPanel.svelte +108 -12
- package/dist/components/app-shell/AppShellPanel.svelte.d.ts +11 -1
- package/dist/components/app-shell/AppShellSheet.svelte +11 -1
- package/dist/components/app-shell/context.d.ts +8 -0
- package/dist/components/app-shell/context.js +7 -0
- package/dist/components/avatar/AvatarRoot.svelte +20 -7
- package/dist/components/avatar/AvatarRoot.svelte.d.ts +10 -3
- package/dist/components/badge/Badge.svelte +13 -1
- package/dist/components/badge/Badge.svelte.d.ts +6 -0
- package/dist/components/button/Button.svelte +71 -32
- package/dist/components/button/Button.svelte.d.ts +13 -0
- package/dist/components/command/CommandDialog.svelte +24 -2
- package/dist/components/command/CommandDialog.svelte.d.ts +12 -0
- package/dist/components/command/CommandItem.svelte +15 -4
- package/dist/components/command/CommandItem.svelte.d.ts +20 -4
- package/dist/components/command/CommandRoot.svelte +57 -2
- package/dist/components/command/CommandRoot.svelte.d.ts +25 -1
- package/dist/components/composer/ComposerModelPicker.svelte +608 -53
- package/dist/components/composer/ComposerModelPicker.svelte.d.ts +56 -1
- package/dist/components/composer/ComposerRoot.svelte.d.ts +1 -1
- package/dist/components/composer/ComposerSubmit.svelte +12 -2
- package/dist/components/composer/ComposerSubmit.svelte.d.ts +6 -0
- package/dist/components/composer/index.d.ts +1 -1
- package/dist/components/input/Input.svelte.d.ts +1 -1
- package/dist/components/menu/MenuCheckboxItem.svelte +14 -5
- package/dist/components/menu/MenuCheckboxItem.svelte.d.ts +15 -4
- package/dist/components/menu/MenuItem.svelte +9 -3
- package/dist/components/menu/MenuItem.svelte.d.ts +11 -4
- package/dist/components/menu/MenuRadioItem.svelte +18 -9
- package/dist/components/menu/MenuRadioItem.svelte.d.ts +15 -4
- package/dist/components/menu/MenuSubTrigger.svelte +9 -3
- package/dist/components/menu/MenuSubTrigger.svelte.d.ts +11 -4
- package/dist/components/questionnaire/Questionnaire.svelte +100 -9
- package/dist/components/questionnaire/Questionnaire.svelte.d.ts +11 -0
- package/dist/components/segmented/SegmentedControl.svelte +12 -1
- package/dist/components/segmented/SegmentedControl.svelte.d.ts +3 -1
- package/dist/components/select/Select.svelte +36 -5
- package/dist/components/select/Select.svelte.d.ts +12 -0
- package/dist/components/settings-row/SettingsRow.svelte +87 -37
- package/dist/components/settings-row/SettingsRow.svelte.d.ts +13 -0
- package/dist/components/slider/Slider.svelte.d.ts +2 -2
- package/dist/components/split-button/SplitButton.svelte +147 -0
- package/dist/components/split-button/SplitButton.svelte.d.ts +36 -0
- package/dist/components/tab-strip/TabStrip.svelte +410 -109
- package/dist/components/tab-strip/TabStrip.svelte.d.ts +51 -3
- package/dist/components/tab-strip/drag.svelte.d.ts +31 -0
- package/dist/components/tab-strip/drag.svelte.js +148 -0
- package/dist/components/textarea/Textarea.svelte.d.ts +1 -1
- package/dist/components/toggle-group/ToggleGroupRoot.svelte.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/internal/ItemDescription.svelte +34 -0
- package/dist/internal/ItemDescription.svelte.d.ts +10 -0
- package/dist/internal/roving.d.ts +3 -1
- package/dist/internal/roving.js +6 -3
- package/dist/media.stylex.d.ts +6 -0
- package/dist/media.stylex.js +6 -0
- package/dist/vite.js +4 -0
- package/package.json +20 -1
- package/skills/building-ui/SKILL.md +48 -20
- package/skills/building-ui/references/components.md +43 -42
- package/skills/markdown/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/styling/SKILL.md +11 -2
- package/skills/theming/SKILL.md +1 -1
|
@@ -4,28 +4,76 @@ import { type Sx } from '../../internal/sx.js';
|
|
|
4
4
|
export type TabStripTab = {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
|
+
/** The tab's name in full, as a tooltip, where the label is short. Defaults to the label. */
|
|
8
|
+
title?: string | undefined;
|
|
7
9
|
/** Shown in place of the close button until the pointer is on the tab: unsaved, or live. */
|
|
8
10
|
mark?: 'unsaved' | 'live' | undefined;
|
|
11
|
+
/** The DOM id of the tab, for its panel's `aria-labelledby`. */
|
|
12
|
+
tabId?: string | undefined;
|
|
13
|
+
/** The id of this tab's own panel, in place of the strip's `controls`. */
|
|
14
|
+
panelId?: string | undefined;
|
|
15
|
+
/** With `onrename`, whether this tab can be renamed. Defaults to true. */
|
|
16
|
+
renamable?: boolean | undefined;
|
|
9
17
|
};
|
|
10
|
-
export type TabStripProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onclose'> & {
|
|
18
|
+
export type TabStripProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onclose' | 'onchange'> & {
|
|
11
19
|
tabs: TabStripTab[];
|
|
12
20
|
/** The id of the open tab. Bindable. */
|
|
13
21
|
value?: string | undefined;
|
|
22
|
+
/** Called as a tab is opened: clicked, or reached with the arrow keys. */
|
|
23
|
+
onchange?: ((id: string) => void) | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* `automatic` opens the tab the arrow keys reach, as a browser's tabs do; `manual` only moves
|
|
26
|
+
* the focus, and Enter or Space opens it, for tabs slow to show.
|
|
27
|
+
*/
|
|
28
|
+
activation?: 'automatic' | 'manual' | undefined;
|
|
14
29
|
/** Names the strip: "Open threads". */
|
|
15
30
|
label: string;
|
|
16
31
|
/** The id of the panel the tabs show. */
|
|
17
32
|
controls?: string | undefined;
|
|
18
33
|
/** Called to close a tab. Without it the tabs cannot be closed. */
|
|
19
34
|
onclose?: ((id: string) => void) | undefined;
|
|
20
|
-
/** Called to add one. Without it there is no button to add. */
|
|
35
|
+
/** Called to add one. Without it, or `addMenu`, there is no button to add. */
|
|
21
36
|
onadd?: (() => void) | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* What can be added, as Menu parts: the button to add opens them, in place of calling
|
|
39
|
+
* `onadd`. For a strip that opens several kinds of tab: a file, a page, a terminal.
|
|
40
|
+
*/
|
|
41
|
+
addMenu?: Snippet | undefined;
|
|
22
42
|
addLabel?: string | undefined;
|
|
23
43
|
/** The name of a tab's close button. */
|
|
24
44
|
closeLabel?: ((tab: TabStripTab) => string) | undefined;
|
|
25
45
|
/** Before a tab's label: an icon, or a StatusIndicator. */
|
|
26
46
|
leading?: Snippet<[TabStripTab]> | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Buttons of a tab's own, after its label and before its close button: one that mutes a
|
|
49
|
+
* page, say. Keep them few and small: an `xs` or `micro` icon-only Button.
|
|
50
|
+
*/
|
|
51
|
+
trailing?: Snippet<[TabStripTab]> | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* A tab's menu, of Menu parts: Move left, Rename, Close. It opens on a right-click, on
|
|
54
|
+
* Shift+F10 or the menu key, and on a long press on a touch screen.
|
|
55
|
+
*/
|
|
56
|
+
menu?: Snippet<[TabStripTab]> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Called as a tab is dropped into another place, with its id and the index it goes to
|
|
59
|
+
* among the tabs. Without it the tabs cannot be dragged. Alt+Shift with an arrow moves
|
|
60
|
+
* the focused tab too.
|
|
61
|
+
*/
|
|
62
|
+
onmove?: ((id: string, index: number) => void) | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Called with a tab's new name, as Enter is pressed. Without it the tabs cannot be
|
|
65
|
+
* renamed. Renaming starts on a double-click, on F2, or as `renaming` is set. A name
|
|
66
|
+
* cleared is passed as `''`, for the tab to take back a name of its own.
|
|
67
|
+
*/
|
|
68
|
+
onrename?: ((id: string, label: string) => void) | undefined;
|
|
69
|
+
/** The id of the tab being renamed. Bindable: set it from a menu's Rename. */
|
|
70
|
+
renaming?: string | undefined;
|
|
71
|
+
/** The name of a tab's field while it is renamed. */
|
|
72
|
+
renameLabel?: ((tab: TabStripTab) => string) | undefined;
|
|
73
|
+
/** The id of a tab shown beside the open one, as in a split view: it is lit, as under the pointer. */
|
|
74
|
+
beside?: string | undefined;
|
|
27
75
|
sx?: Sx | undefined;
|
|
28
76
|
};
|
|
29
|
-
declare const TabStrip: import("svelte").Component<TabStripProps, {}, "value">;
|
|
77
|
+
declare const TabStrip: import("svelte").Component<TabStripProps, {}, "value" | "renaming">;
|
|
30
78
|
type TabStrip = ReturnType<typeof TabStrip>;
|
|
31
79
|
export default TabStrip;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dragging a tab along a TabStrip into another place: it follows the pointer, the others slide
|
|
3
|
+
* aside to make room, and let go, it settles into its place before the move is made. From
|
|
4
|
+
* Eregion's side panel (`tabDrag.svelte.ts`).
|
|
5
|
+
*/
|
|
6
|
+
type Rect = {
|
|
7
|
+
readonly left: number;
|
|
8
|
+
readonly width: number;
|
|
9
|
+
};
|
|
10
|
+
export type TabDrag = {
|
|
11
|
+
/** The place of the tab being dragged, and the place it would drop into. */
|
|
12
|
+
readonly from: number;
|
|
13
|
+
readonly to: number;
|
|
14
|
+
/** How far it has moved, in pixels. */
|
|
15
|
+
readonly dx: number;
|
|
16
|
+
/** Let go, and moving into its place. */
|
|
17
|
+
readonly settling: boolean;
|
|
18
|
+
readonly rects: readonly Rect[];
|
|
19
|
+
};
|
|
20
|
+
/** How far the tab at `index` moves while another is dragged: aside, to make room, or not at all. */
|
|
21
|
+
export declare function tabOffset(drag: TabDrag | null, index: number): number;
|
|
22
|
+
export declare class TabDragging {
|
|
23
|
+
#private;
|
|
24
|
+
drag: TabDrag | null;
|
|
25
|
+
constructor(tabs: () => HTMLElement[], strip: () => HTMLElement | null, onmove: (from: number, to: number) => void);
|
|
26
|
+
/** A press on the tab at `index`, which becomes a drag once the pointer moves far enough. */
|
|
27
|
+
press(index: number, event: PointerEvent): void;
|
|
28
|
+
/** Stops a drop settling, as the strip goes. */
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dragging a tab along a TabStrip into another place: it follows the pointer, the others slide
|
|
3
|
+
* aside to make room, and let go, it settles into its place before the move is made. From
|
|
4
|
+
* Eregion's side panel (`tabDrag.svelte.ts`).
|
|
5
|
+
*/
|
|
6
|
+
/** How far the pointer moves before a press on a tab becomes a drag, in pixels. */
|
|
7
|
+
const THRESHOLD = 4;
|
|
8
|
+
/** How long a dropped tab takes to settle into its place: `motion.fast`. */
|
|
9
|
+
const SETTLE_MS = 120;
|
|
10
|
+
/**
|
|
11
|
+
* The place a tab dragged by `dx` would drop into. It passes another once its leading edge
|
|
12
|
+
* crosses that one's middle, so a wide tab passes a narrow one as readily as the other way.
|
|
13
|
+
*/
|
|
14
|
+
function dropPlace(rects, from, dx) {
|
|
15
|
+
const moving = rects[from];
|
|
16
|
+
if (!moving)
|
|
17
|
+
return from;
|
|
18
|
+
const left = moving.left + dx;
|
|
19
|
+
const right = left + moving.width;
|
|
20
|
+
return rects.filter((rect, index) => {
|
|
21
|
+
const middle = rect.left + rect.width / 2;
|
|
22
|
+
return index !== from && (index < from ? left > middle : right > middle);
|
|
23
|
+
}).length;
|
|
24
|
+
}
|
|
25
|
+
/** How far the dragged tab moves to sit in the place it drops into. */
|
|
26
|
+
function settledOffset(rects, from, to) {
|
|
27
|
+
const moving = rects[from];
|
|
28
|
+
const target = rects[to];
|
|
29
|
+
if (!moving || !target || to === from)
|
|
30
|
+
return 0;
|
|
31
|
+
return to < from
|
|
32
|
+
? target.left - moving.left
|
|
33
|
+
: target.left + target.width - moving.width - moving.left;
|
|
34
|
+
}
|
|
35
|
+
/** How far the tab at `index` moves while another is dragged: aside, to make room, or not at all. */
|
|
36
|
+
export function tabOffset(drag, index) {
|
|
37
|
+
if (!drag)
|
|
38
|
+
return 0;
|
|
39
|
+
if (index === drag.from)
|
|
40
|
+
return drag.dx;
|
|
41
|
+
const moving = drag.rects[drag.from];
|
|
42
|
+
const [first, second] = drag.rects;
|
|
43
|
+
const gap = first && second ? second.left - (first.left + first.width) : 0;
|
|
44
|
+
const room = (moving?.width ?? 0) + gap;
|
|
45
|
+
if (index > drag.from && index <= drag.to)
|
|
46
|
+
return -room;
|
|
47
|
+
if (index < drag.from && index >= drag.to)
|
|
48
|
+
return room;
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
export class TabDragging {
|
|
52
|
+
drag = $state.raw(null);
|
|
53
|
+
#settling = 0;
|
|
54
|
+
/** The tabs, in order. */
|
|
55
|
+
#tabs;
|
|
56
|
+
/** The strip they are dragged along, and kept within. */
|
|
57
|
+
#strip;
|
|
58
|
+
#onmove;
|
|
59
|
+
constructor(tabs, strip, onmove) {
|
|
60
|
+
this.#tabs = tabs;
|
|
61
|
+
this.#strip = strip;
|
|
62
|
+
this.#onmove = onmove;
|
|
63
|
+
}
|
|
64
|
+
/** A press on the tab at `index`, which becomes a drag once the pointer moves far enough. */
|
|
65
|
+
press(index, event) {
|
|
66
|
+
const strip = this.#strip();
|
|
67
|
+
const tab = event.currentTarget;
|
|
68
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
69
|
+
// Its close button and its own buttons keep their presses, and so does a name being typed
|
|
70
|
+
const control = target?.closest('button, input, a');
|
|
71
|
+
if (!strip ||
|
|
72
|
+
!(tab instanceof HTMLElement) ||
|
|
73
|
+
event.button !== 0 ||
|
|
74
|
+
(control && control.getAttribute('role') !== 'tab'))
|
|
75
|
+
return;
|
|
76
|
+
const pointer = event.pointerId;
|
|
77
|
+
const startX = event.clientX;
|
|
78
|
+
const bounds = strip.getBoundingClientRect();
|
|
79
|
+
const rects = this.#tabs().map((each) => {
|
|
80
|
+
const rect = each.getBoundingClientRect();
|
|
81
|
+
return { left: rect.left, width: rect.width };
|
|
82
|
+
});
|
|
83
|
+
const moving = rects[index];
|
|
84
|
+
if (!moving)
|
|
85
|
+
return;
|
|
86
|
+
const state = { started: false, to: index, dx: 0 };
|
|
87
|
+
const move = (next) => {
|
|
88
|
+
if (next.pointerId !== pointer)
|
|
89
|
+
return;
|
|
90
|
+
const dx = next.clientX - startX;
|
|
91
|
+
if (!state.started && Math.abs(dx) < THRESHOLD)
|
|
92
|
+
return;
|
|
93
|
+
if (!state.started) {
|
|
94
|
+
state.started = true;
|
|
95
|
+
tab.setPointerCapture?.(pointer);
|
|
96
|
+
}
|
|
97
|
+
// It stays within the strip
|
|
98
|
+
const low = bounds.left - moving.left;
|
|
99
|
+
const high = bounds.right - (moving.left + moving.width);
|
|
100
|
+
state.dx = Math.min(high, Math.max(low, dx));
|
|
101
|
+
state.to = dropPlace(rects, index, state.dx);
|
|
102
|
+
this.drag = { from: index, to: state.to, dx: state.dx, settling: false, rects };
|
|
103
|
+
};
|
|
104
|
+
const end = (last) => {
|
|
105
|
+
if (last.pointerId !== pointer)
|
|
106
|
+
return;
|
|
107
|
+
removeEventListener('pointermove', move);
|
|
108
|
+
removeEventListener('pointerup', end);
|
|
109
|
+
removeEventListener('pointercancel', end);
|
|
110
|
+
if (!state.started)
|
|
111
|
+
return;
|
|
112
|
+
// The press ends in a click, which would open the tab, and a drag is not one
|
|
113
|
+
const swallow = (click) => {
|
|
114
|
+
click.stopPropagation();
|
|
115
|
+
click.preventDefault();
|
|
116
|
+
};
|
|
117
|
+
addEventListener('click', swallow, { capture: true, once: true });
|
|
118
|
+
setTimeout(() => removeEventListener('click', swallow, { capture: true }));
|
|
119
|
+
const commit = () => {
|
|
120
|
+
this.drag = null;
|
|
121
|
+
if (state.to !== index)
|
|
122
|
+
this.#onmove(index, state.to);
|
|
123
|
+
};
|
|
124
|
+
if (last.type === 'pointercancel' || matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
125
|
+
if (last.type === 'pointercancel')
|
|
126
|
+
state.to = index;
|
|
127
|
+
commit();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.drag = {
|
|
131
|
+
from: index,
|
|
132
|
+
to: state.to,
|
|
133
|
+
dx: settledOffset(rects, index, state.to),
|
|
134
|
+
settling: true,
|
|
135
|
+
rects
|
|
136
|
+
};
|
|
137
|
+
clearTimeout(this.#settling);
|
|
138
|
+
this.#settling = window.setTimeout(commit, SETTLE_MS);
|
|
139
|
+
};
|
|
140
|
+
addEventListener('pointermove', move);
|
|
141
|
+
addEventListener('pointerup', end);
|
|
142
|
+
addEventListener('pointercancel', end);
|
|
143
|
+
}
|
|
144
|
+
/** Stops a drop settling, as the strip goes. */
|
|
145
|
+
dispose() {
|
|
146
|
+
clearTimeout(this.#settling);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -8,6 +8,6 @@ export type TextareaProps = Omit<HTMLTextareaAttributes, 'children'> & {
|
|
|
8
8
|
sx?: Sx | undefined;
|
|
9
9
|
ref?: HTMLTextAreaElement | null | undefined;
|
|
10
10
|
};
|
|
11
|
-
declare const Textarea: import("svelte").Component<TextareaProps, {}, "
|
|
11
|
+
declare const Textarea: import("svelte").Component<TextareaProps, {}, "ref" | "value">;
|
|
12
12
|
type Textarea = ReturnType<typeof Textarea>;
|
|
13
13
|
export default Textarea;
|
|
@@ -31,6 +31,6 @@ export type ToggleGroupRootProps = Html & Base & ({
|
|
|
31
31
|
value?: string[] | undefined;
|
|
32
32
|
onValueChange?: ((value: string[]) => void) | undefined;
|
|
33
33
|
});
|
|
34
|
-
declare const ToggleGroupRoot: import("svelte").Component<ToggleGroupRootProps, {}, "
|
|
34
|
+
declare const ToggleGroupRoot: import("svelte").Component<ToggleGroupRootProps, {}, "ref" | "value">;
|
|
35
35
|
type ToggleGroupRoot = ReturnType<typeof ToggleGroupRoot>;
|
|
36
36
|
export default ToggleGroupRoot;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export * as Command from './components/command/index.js';
|
|
|
31
31
|
export type { CommandDialogProps, CommandEmptyProps, CommandFooterProps, CommandGroupProps, CommandInputProps, CommandItemProps, CommandListProps, CommandRootProps } from './components/command/index.js';
|
|
32
32
|
export * as Composer from './components/composer/index.js';
|
|
33
33
|
export { getComposerContext } from './components/composer/index.js';
|
|
34
|
-
export type { ComposerAttachButtonProps, ComposerAttachmentProps, ComposerAttachmentsProps, ComposerContext, ComposerMessage, ComposerModel, ComposerModelPickerProps, ComposerRejection, ComposerRootProps, ComposerStatus, ComposerSubmitProps, ComposerTextareaProps, ComposerToggleProps, ComposerToolbarProps, ComposerTrayProps } from './components/composer/index.js';
|
|
34
|
+
export type { ComposerAttachButtonProps, ComposerAttachmentProps, ComposerAttachmentsProps, ComposerContext, ComposerMessage, ComposerModel, ComposerModelPickerProps, ComposerModelProvider, ComposerRejection, ComposerRootProps, ComposerStatus, ComposerSubmitProps, ComposerTextareaProps, ComposerToggleProps, ComposerToolbarProps, ComposerTrayProps } from './components/composer/index.js';
|
|
35
35
|
export * as ContextMenu from './components/menu/context-menu.js';
|
|
36
36
|
export type { ContextMenuContentProps, ContextMenuTriggerProps } from './components/menu/context-menu.js';
|
|
37
37
|
export * as Conversation from './components/conversation/index.js';
|
|
@@ -122,6 +122,8 @@ export { default as Slider } from './components/slider/Slider.svelte';
|
|
|
122
122
|
export type { SliderProps } from './components/slider/Slider.svelte';
|
|
123
123
|
export { default as Spinner } from './components/spinner/Spinner.svelte';
|
|
124
124
|
export type { SpinnerProps } from './components/spinner/Spinner.svelte';
|
|
125
|
+
export { default as SplitButton } from './components/split-button/SplitButton.svelte';
|
|
126
|
+
export type { SplitButtonProps } from './components/split-button/SplitButton.svelte';
|
|
125
127
|
export { default as Stack } from './components/stack/Stack.svelte';
|
|
126
128
|
export type { StackAlign, StackDirection, StackGap, StackJustify, StackProps } from './components/stack/Stack.svelte';
|
|
127
129
|
export * as Suggestions from './components/suggestions/index.js';
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,7 @@ export * as Sidebar from './components/sidebar/index.js';
|
|
|
92
92
|
export { default as Skeleton } from './components/skeleton/Skeleton.svelte';
|
|
93
93
|
export { default as Slider } from './components/slider/Slider.svelte';
|
|
94
94
|
export { default as Spinner } from './components/spinner/Spinner.svelte';
|
|
95
|
+
export { default as SplitButton } from './components/split-button/SplitButton.svelte';
|
|
95
96
|
export { default as Stack } from './components/stack/Stack.svelte';
|
|
96
97
|
// Compound: <Suggestions.Root>, <Suggestions.Item>
|
|
97
98
|
export * as Suggestions from './components/suggestions/index.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The line under an item's label in a menu: words, or a snippet of words with an
|
|
3
|
+
icon in them, such as a branch's icon and its name. An icon put in it is 12px
|
|
4
|
+
and lies in the line, rather than breaking it as an svg's block would.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts" module>
|
|
7
|
+
import * as stylex from '@stylexjs/stylex';
|
|
8
|
+
import type { Snippet } from 'svelte';
|
|
9
|
+
import { layer } from './layer.js';
|
|
10
|
+
import './icons.css';
|
|
11
|
+
|
|
12
|
+
/** A line under an item's label: words, or a snippet that may hold an icon. */
|
|
13
|
+
export type ItemDescriptionContent = string | Snippet;
|
|
14
|
+
|
|
15
|
+
const styles = stylex.create({
|
|
16
|
+
rich: {
|
|
17
|
+
'--narvi-icon-size': '0.75rem',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
gap: '0.25rem',
|
|
21
|
+
minWidth: 0
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
let { description }: { description: ItemDescriptionContent } = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if typeof description === 'function'}
|
|
31
|
+
<span data-icons {...stylex.attrs(layer.description, styles.rich)}>{@render description()}</span>
|
|
32
|
+
{:else}
|
|
33
|
+
<span {...stylex.attrs(layer.description)}>{description}</span>
|
|
34
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import './icons.css';
|
|
3
|
+
/** A line under an item's label: words, or a snippet that may hold an icon. */
|
|
4
|
+
export type ItemDescriptionContent = string | Snippet;
|
|
5
|
+
type $$ComponentProps = {
|
|
6
|
+
description: ItemDescriptionContent;
|
|
7
|
+
};
|
|
8
|
+
declare const ItemDescription: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type ItemDescription = ReturnType<typeof ItemDescription>;
|
|
10
|
+
export default ItemDescription;
|
|
@@ -13,5 +13,7 @@ export type RovingOptions = {
|
|
|
13
13
|
selector: string;
|
|
14
14
|
/** Which arrow keys move: up and down, or left and right. */
|
|
15
15
|
orientation?: 'vertical' | 'horizontal' | undefined;
|
|
16
|
+
/** Past the last item, the arrows go on to the first, and back from the first to the last, as tabs do. */
|
|
17
|
+
wrap?: boolean | undefined;
|
|
16
18
|
};
|
|
17
|
-
export declare function roving({ selector, orientation }: RovingOptions): Attachment<HTMLElement>;
|
|
19
|
+
export declare function roving({ selector, orientation, wrap }: RovingOptions): Attachment<HTMLElement>;
|
package/dist/internal/roving.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const isTyping = (target) => target instanceof HTMLElement &&
|
|
2
2
|
(target.isContentEditable || target.matches('input, textarea, select'));
|
|
3
|
-
export function roving({ selector, orientation = 'vertical' }) {
|
|
3
|
+
export function roving({ selector, orientation = 'vertical', wrap = false }) {
|
|
4
4
|
return (container) => {
|
|
5
5
|
let last = null;
|
|
6
6
|
const items = () => [...container.querySelectorAll(selector)].filter((item) => !item.hasAttribute('disabled') &&
|
|
@@ -38,10 +38,13 @@ export function roving({ selector, orientation = 'vertical' }) {
|
|
|
38
38
|
const forward = orientation === 'vertical' ? 'ArrowDown' : rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
39
39
|
const back = orientation === 'vertical' ? 'ArrowUp' : rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
40
40
|
let next;
|
|
41
|
+
const step = (by) => wrap
|
|
42
|
+
? all[(index + by + all.length) % all.length]
|
|
43
|
+
: all[Math.min(Math.max(index + by, 0), all.length - 1)];
|
|
41
44
|
if (event.key === forward)
|
|
42
|
-
next =
|
|
45
|
+
next = step(1);
|
|
43
46
|
else if (event.key === back)
|
|
44
|
-
next =
|
|
47
|
+
next = step(-1);
|
|
45
48
|
else if (event.key === 'Home')
|
|
46
49
|
next = all[0];
|
|
47
50
|
else if (event.key === 'End')
|
package/dist/media.stylex.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export declare const media: {
|
|
|
39
39
|
* hold, such as an image's opacity.
|
|
40
40
|
*/
|
|
41
41
|
dark: string;
|
|
42
|
+
/**
|
|
43
|
+
* The app's own dark mode: a `dark` class on the root, as Tailwind and shadcn set it, and
|
|
44
|
+
* as an app does that keeps its own Light, Dark and System setting. For an app that picks its scheme itself, where `dark` would follow the
|
|
45
|
+
* system instead; like it, for what the tokens cannot hold, such as a logo's dark version.
|
|
46
|
+
*/
|
|
47
|
+
darkClass: string;
|
|
42
48
|
/** Forced-colours mode, such as Windows High Contrast: shadows are gone, outlines stay. */
|
|
43
49
|
forcedColors: string;
|
|
44
50
|
/** 640px: large phones on their side, small tablets. */
|
package/dist/media.stylex.js
CHANGED
|
@@ -40,6 +40,12 @@ export const media = stylex.defineConsts({
|
|
|
40
40
|
* hold, such as an image's opacity.
|
|
41
41
|
*/
|
|
42
42
|
dark: '@media (prefers-color-scheme: dark)',
|
|
43
|
+
/**
|
|
44
|
+
* The app's own dark mode: a `dark` class on the root, as Tailwind and shadcn set it, and
|
|
45
|
+
* as an app does that keeps its own Light, Dark and System setting. For an app that picks its scheme itself, where `dark` would follow the
|
|
46
|
+
* system instead; like it, for what the tokens cannot hold, such as a logo's dark version.
|
|
47
|
+
*/
|
|
48
|
+
darkClass: ':is(.dark *)',
|
|
43
49
|
/** Forced-colours mode, such as Windows High Contrast: shadows are gone, outlines stay. */
|
|
44
50
|
forcedColors: '@media (forced-colors: active)',
|
|
45
51
|
/** 640px: large phones on their side, small tablets. */
|
package/dist/vite.js
CHANGED
|
@@ -61,6 +61,10 @@ export function narvi({ tailwind = false, ...options } = {}) {
|
|
|
61
61
|
after: ['components', 'utilities']
|
|
62
62
|
}
|
|
63
63
|
: { before: [BASE_LAYER], prefix: NARVI_LAYER },
|
|
64
|
+
// The style applied last wins, a shorthand over a longhand too: a caller's `padding` in
|
|
65
|
+
// `sx` sets a part's padding, which StyleX's default would leave to the part's own
|
|
66
|
+
// `paddingInline`, whatever the order
|
|
67
|
+
styleResolution: 'application-order',
|
|
64
68
|
...options,
|
|
65
69
|
// Narvi ships StyleX source, which must reach the compiler: Vite's dependency
|
|
66
70
|
// pre-bundling would hand the page `stylex.create` calls that throw at runtime.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopluna/narvi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"packageManager": "pnpm@12.18.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"format": "prettier --write .",
|
|
107
107
|
"test:unit": "vitest",
|
|
108
108
|
"test": "npm run test:unit -- --run",
|
|
109
|
+
"bench:markdown": "NODE_ENV=production vitest --run --config src/bench/markdown/vitest.config.ts",
|
|
109
110
|
"test:browsers": "NARVI_BROWSERS=firefox,webkit vitest --run --project client src/tests/markdown",
|
|
110
111
|
"deploy": "pnpm build:docs && wrangler deploy"
|
|
111
112
|
},
|
|
@@ -128,6 +129,7 @@
|
|
|
128
129
|
"@fontsource/ibm-plex-mono": "^5.3.0",
|
|
129
130
|
"@fontsource/ibm-plex-sans": "^5.3.0",
|
|
130
131
|
"@fontsource/instrument-serif": "^5.3.0",
|
|
132
|
+
"@humanspeak/svelte-markdown": "2.2.0",
|
|
131
133
|
"@lezer/common": "^1.5.5",
|
|
132
134
|
"@lezer/highlight": "^1.2.5",
|
|
133
135
|
"@lezer/javascript": "^1.5.6",
|
|
@@ -138,22 +140,39 @@
|
|
|
138
140
|
"@sveltejs/package": "^2.5.8",
|
|
139
141
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
140
142
|
"@tanstack/intent": "0.5.6",
|
|
143
|
+
"@types/markdown-it": "14.2.0",
|
|
141
144
|
"@types/node": "^24",
|
|
145
|
+
"@types/react": "19.2.14",
|
|
146
|
+
"@types/react-dom": "19.2.3",
|
|
142
147
|
"@vitest/browser-playwright": "^4.1.8",
|
|
143
148
|
"axe-core": "^4.14.0",
|
|
144
149
|
"eslint": "^10.4.1",
|
|
145
150
|
"eslint-config-prettier": "^10.1.8",
|
|
146
151
|
"eslint-plugin-svelte": "^3.19.0",
|
|
147
152
|
"globals": "^17.6.0",
|
|
153
|
+
"markdown-it": "15.0.3",
|
|
154
|
+
"marked": "18.1.2",
|
|
155
|
+
"micromark": "4.0.3",
|
|
156
|
+
"micromark-extension-gfm": "3.0.0",
|
|
148
157
|
"playwright": "^1.60.0",
|
|
149
158
|
"prettier": "^3.8.3",
|
|
150
159
|
"prettier-plugin-svelte": "^4.1.0",
|
|
151
160
|
"publint": "^0.3.21",
|
|
161
|
+
"react": "19.2.9",
|
|
162
|
+
"react-dom": "19.2.9",
|
|
163
|
+
"rehype-stringify": "10.0.1",
|
|
164
|
+
"remark-gfm": "4.0.1",
|
|
165
|
+
"remark-parse": "11.0.0",
|
|
166
|
+
"remark-rehype": "11.1.2",
|
|
152
167
|
"shiki": "^4.6.0",
|
|
168
|
+
"streamdown": "2.7.1",
|
|
153
169
|
"svelte": "^5.57.2",
|
|
154
170
|
"svelte-check": "^4.6.0",
|
|
171
|
+
"svelte-exmarkdown": "5.0.2",
|
|
172
|
+
"svelte-streamdown": "5.0.0",
|
|
155
173
|
"typescript": "^6.0.3",
|
|
156
174
|
"typescript-eslint": "^8.60.1",
|
|
175
|
+
"unified": "11.0.5",
|
|
157
176
|
"vite": "^8.3.0",
|
|
158
177
|
"vitest": "^4.1.8",
|
|
159
178
|
"vitest-browser-svelte": "^2.1.1",
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
Grid, and Narvi's conventions for colour, labels and copy.
|
|
13
13
|
type: core
|
|
14
14
|
library: '@diegopluna/narvi'
|
|
15
|
-
library_version: '0.3.
|
|
15
|
+
library_version: '0.3.5'
|
|
16
16
|
requires:
|
|
17
17
|
- setup
|
|
18
18
|
sources:
|
|
@@ -32,6 +32,11 @@ sources:
|
|
|
32
32
|
- src/lib/components/list/ListRoot.svelte
|
|
33
33
|
- src/lib/components/choice-cards/ChoiceCards.svelte
|
|
34
34
|
- src/lib/components/dialog/DialogContent.svelte
|
|
35
|
+
- src/lib/components/tab-strip/TabStrip.svelte
|
|
36
|
+
- src/lib/components/split-button/SplitButton.svelte
|
|
37
|
+
- src/lib/components/app-shell/AppShellPanel.svelte
|
|
38
|
+
- src/lib/components/composer/ComposerModelPicker.svelte
|
|
39
|
+
- src/lib/components/questionnaire/Questionnaire.svelte
|
|
35
40
|
---
|
|
36
41
|
|
|
37
42
|
# Build interfaces with Narvi
|
|
@@ -125,7 +130,8 @@ A Select, Menu or Popover opened inside a dialog or a sheet opens over it.
|
|
|
125
130
|
|
|
126
131
|
A menu that picks one of several uses `Menu.RadioGroup` and `Menu.RadioItem`. Picking an item
|
|
127
132
|
closes the menu, as a select does (`closeOnSelect={false}` keeps it open), and an item takes
|
|
128
|
-
an `icon` snippet
|
|
133
|
+
an `icon` snippet, a `shortcut` and a `trailing` snippet ("Default", "Custom"), as `Menu.Item`
|
|
134
|
+
does; a `Select` option's `detail` is the same word in a select's list. `Menu.CheckboxItem` takes the same and
|
|
129
135
|
closes the menu too; pass `closeOnSelect={false}` for a menu of settings set several at a time.
|
|
130
136
|
A `Menu.Label` names the `Menu.Group` or `Menu.RadioGroup` it is in; on its own it is a heading
|
|
131
137
|
only to the eye, with no group needed. On a `ContextMenu.Trigger`, `menuKey={false}` leaves
|
|
@@ -168,7 +174,8 @@ The other controls don't read Field, so label them directly:
|
|
|
168
174
|
|
|
169
175
|
- `Checkbox` and `Switch` take their label as children: `<Switch bind:checked>Night shift</Switch>`.
|
|
170
176
|
To act on a change, `onCheckedChange={(checked) => save(checked)}` gets the new value; the
|
|
171
|
-
native `onchange` gets the event. `Select`'s `onchange`
|
|
177
|
+
native `onchange` gets the event. `Select`'s and `SegmentedControl`'s `onchange` get the new
|
|
178
|
+
value, as the person picks it: narrow it to your type there rather than in a `bind:value` setter.
|
|
172
179
|
- `SegmentedControl`, `ToggleGroup.Root` and `Slider` need an `aria-label` (or
|
|
173
180
|
`aria-labelledby`), for example `<SegmentedControl aria-label="Theme" … />`.
|
|
174
181
|
A `SegmentedControl` option with a short label can carry a `title` that names it in full
|
|
@@ -232,6 +239,9 @@ of the heading), which lays them on one card with a line between each, and each
|
|
|
232
239
|
- Attributes such as `id`, `tabindex` and `data-*` go on the row's element (and on the group's
|
|
233
240
|
`<section>`), so search can scroll to one and focus it. Set `highlighted` for a moment as it
|
|
234
241
|
lands to light it.
|
|
242
|
+
- `leading` is a snippet before the label (a provider's mark, an icon), `dimmed` mutes the
|
|
243
|
+
label (an agent switched off), and `mono` sets it in monospace (an environment variable, a
|
|
244
|
+
tool). Don't draw a row of your own for these.
|
|
235
245
|
- A `SettingsGroup` draws its lines between any children, so rows of the app's own go in it too;
|
|
236
246
|
give them their own padding (`SettingsRow` is inset 16px on the card).
|
|
237
247
|
|
|
@@ -305,27 +315,35 @@ line, `lines={2}` for several). Use `Code` and `Kbd` inline, and
|
|
|
305
315
|
- Rows on one card with a line between each: `List.Root` (a `ul`, or `as="div"`) holding
|
|
306
316
|
`List.Item`s, or rows of your own. Don't redraw the card and its lines.
|
|
307
317
|
- `Badge` shows its tone as a dot; `plain` hides the dot and colours the words in the tone.
|
|
318
|
+
`color` paints the dot alone in a colour of its own (a label's `#d73a4a`): don't draw a dot.
|
|
308
319
|
`size="sm"` is 18px, a sidebar row's line, so it sits in a row without growing it. An icon in
|
|
309
320
|
it is sized to 12px.
|
|
310
321
|
- `Collapsible.Trigger` takes `chevron="start"` to put the chevron before its label, as in a tree.
|
|
311
322
|
- `Tabs` and `SegmentedControl` options take an `icon` (a component, sized to fit) and a
|
|
312
323
|
`title` that names a short label in full, as a tooltip and the item's description.
|
|
313
|
-
- A `Button`
|
|
314
|
-
a
|
|
315
|
-
|
|
316
|
-
|
|
324
|
+
- A loading `Button` hides its label under the spinner; `loadingLabel="Connecting…"` says what
|
|
325
|
+
it does beside it instead. `tooltip` (words or a snippet) gives it a tooltip, as on
|
|
326
|
+
`Composer.Submit` and a `SplitButton` (`menuTooltip` for its chevron, `onopenchange` for its
|
|
327
|
+
menu): don't wrap one in `Tooltip` parts. `variant="link"` sits in a sentence, unpadded. A ghost, bare, secondary or floating Button that opens a menu or a
|
|
317
328
|
popover holds an open look while it shows, by the `aria-expanded` bits-ui sets: don't style
|
|
318
|
-
the open trigger yourself.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
329
|
+
the open trigger yourself. `pressed` makes it a toggle button (`aria-pressed`) held in the same
|
|
330
|
+
look while true: don't style `aria-pressed` by hand.
|
|
331
|
+
- A main action with a menu of how to do it (Merge, Sign in) is a `SplitButton`: `menu` snippet,
|
|
332
|
+
`menuLabel` for the chevron, `label` for the group, both halves disabled together. Without
|
|
333
|
+
`menu` it stands alone. Don't join two Buttons by hand.
|
|
334
|
+
- `Toggle` and `ToggleGroup.Root` take `tone="neutral"`: pressed, a toolbar's icon takes the fill
|
|
335
|
+
of what is chosen, not the accent.
|
|
336
|
+
- `Menu.Item`, `Menu.SubTrigger`, `Menu.CheckboxItem` and `Menu.RadioItem` take a
|
|
337
|
+
`description` (a line under the label): a string, or a snippet whose icon is 12px and lies in
|
|
338
|
+
the line; say in words what the icon stands for. All but the SubTrigger take `trailing`. A `Menu.CheckboxItem` with an
|
|
323
339
|
`icon` puts its tick at the end, so its icon lines up with the others'. `Menu.Content` takes a
|
|
324
340
|
`width` (`'18rem'`) in place of fitting its items, up to 22rem.
|
|
325
341
|
- `Popover.Content` takes `padding="none"`, `layout="column"` and a `width`;
|
|
326
342
|
`HoverCard.Content` takes `layout="column"` and `padding`; `Tooltip.Content` takes
|
|
327
343
|
`layout="column"` for a title over a line that says more.
|
|
328
|
-
- `Select` takes
|
|
344
|
+
- `Select` takes `optionIcon` for an icon with props, and `prefix` for muted words before the
|
|
345
|
+
choice on its trigger ("Text size"). An option's `detail` (`detailMono` for code) is muted at
|
|
346
|
+
the end of its row, off the trigger. Groups get a hairline between them.
|
|
329
347
|
- `EmptyState`'s title is a heading (`level`, 2 by default). `Heading` takes a `weight`.
|
|
330
348
|
|
|
331
349
|
### App and chat screens
|
|
@@ -374,7 +392,16 @@ Parts of the shell that are easy to redraw by hand, and shouldn't be:
|
|
|
374
392
|
- **A mark with a badge** in a row's `meta` may overhang it; the line clips only far past its end.
|
|
375
393
|
- `AppShell.Main` is not focusable, so a press on text in the page leaves focus where it was.
|
|
376
394
|
- **TabStrip** tabs narrow to an ellipsis before the strip scrolls. With a `leading` icon, a
|
|
377
|
-
tab's close button takes the icon's place, so no room is kept at its end.
|
|
395
|
+
tab's close button takes the icon's place, so no room is kept at its end. A side panel's tabs
|
|
396
|
+
are a TabStrip too: `menu` (a snippet of Menu parts, given the tab: right-click, the menu key,
|
|
397
|
+
a long press), `onmove(id, index)` (drag, or Alt+Shift+arrow), `onrename(id, label)` with
|
|
398
|
+
`bind:renaming` (double-click, F2, or a menu's Rename), `trailing` for a tab's own buttons,
|
|
399
|
+
`beside` for the tab shown in a split, and per tab `tabId`, `panelId`, `title`, `renamable`.
|
|
400
|
+
Arrows open the tab they reach (`activation="manual"` only moves focus); `onchange(id)`; a
|
|
401
|
+
name cleared comes as `''`; `addMenu` (Menu parts) makes the add button open a menu.
|
|
402
|
+
- **AppShell.Panel** goes narrow by its row, not the window; `maximized` lays it over the page,
|
|
403
|
+
kept inert, so give it an `AppShell.Header` with `AppShell.Toggle when="closed"`. Beside a
|
|
404
|
+
thread, put it in a flex row of yours (`position: relative`) inside `AppShell.Main`.
|
|
378
405
|
- **A Sheet** focuses itself as it opens (`focusOnOpen="sheet"`), so a Rail or a list in it
|
|
379
406
|
shows no focus ring until the keys move in. Pass `focusOnOpen="first"` for a sheet that
|
|
380
407
|
holds a form.
|
|
@@ -388,10 +415,12 @@ Parts of a thread that are easy to redraw by hand, and shouldn't be:
|
|
|
388
415
|
its own). The frame shows its focus edge and sends clicks to it. Set `hasContent` from the
|
|
389
416
|
editor, so `Composer.Submit` knows there is something to send, and `sending` while a message
|
|
390
417
|
is on its way and can't be stopped: Submit spins, says "Sending" (`sendingLabel`), and nothing
|
|
391
|
-
more is sent. `onfiles` receives picked, dropped and pasted files; return `false` to keep them
|
|
418
|
+
more is sent. `sendingText="Creating worktree…"` says it beside the spinner, widening Submit. `onfiles` receives picked, dropped and pasted files; return `false` to keep them
|
|
392
419
|
on a list of your own instead of the composer's.
|
|
393
420
|
- **Composer.ModelPicker** takes `bind:open`, and `multiple` with `value: string[]` to pick
|
|
394
|
-
several
|
|
421
|
+
several, `providers` (a `provider` on each model) for a rail of agents beside the list,
|
|
422
|
+
`searchable` for a field that searches them all, and `bind:starred` (values; keep them where
|
|
423
|
+
they last) for stars, ⌘D included, and a Starred place in the rail. A model's `older` folds it into one row; `bind:also` adds models beside the chosen one with Shift or ⌘. `Composer.Toggle` works outside a `Composer.Root` too.
|
|
395
424
|
- **Composer.Tray** shows its shelf for a child that holds something and isn't `hidden`; pass
|
|
396
425
|
`waiting` when what is inside hides itself some other way.
|
|
397
426
|
- **A user's message with attachments:** `<Message.Content bubble={false}>` is a column at the
|
|
@@ -405,12 +434,11 @@ Parts of a thread that are easy to redraw by hand, and shouldn't be:
|
|
|
405
434
|
Markdown, in place of `text`. `Activity.Step` takes `wrap` for a label that runs on, and
|
|
406
435
|
`status="neutral"` for a step that settled without going through or failing ("Skipped",
|
|
407
436
|
`statusLabels.neutral`); it and `WorkFold` pass `data-*` attributes on.
|
|
408
|
-
- **A divider with more than words:** `Divider` takes children (a link, a time) and
|
|
409
|
-
`role="status"` for words read out as they change. A long label wraps between the rules.
|
|
437
|
+
- **A divider with more than words:** `Divider` takes children (a link, a time) and `role="status"`.
|
|
410
438
|
- **Answers on their way:** `Approval` and `Questionnaire` take `busy`, which spins the button
|
|
411
439
|
pressed and holds the rest. A `Question` takes a `description`, and `secret` for an answer
|
|
412
|
-
|
|
413
|
-
|
|
440
|
+
never shown back. ⌘Enter sends once every question is answered or skipped. `Questionnaire` takes a `heading` snippet beside its count, and `bare`
|
|
441
|
+
inside a card of yours; its arrow keys are built in (↑/↓ answers, ←/→ questions).
|
|
414
442
|
- **Closed folds** (`WorkFold`, `Collapsible`, `Activity`, `Reasoning`, `Tool`) stop rendering
|
|
415
443
|
their content once shut, so `checkVisibility()`, find-in-page and Playwright see it as hidden.
|
|
416
444
|
Don't add `display: none` of your own.
|