@kabmo-labs/kabmo 0.59.0 → 0.59.1
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/client/index.html +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/static/js/{Body-jqq4654r.js → Body-5yedtmnk.js} +1 -1
- package/dist/client/static/js/{CsvGrid-avw0taqb.js → CsvGrid-39m8pp1c.js} +1 -1
- package/dist/client/static/js/{DocxView-d221vr6g.js → DocxView-vd99cv12.js} +1 -1
- package/dist/client/static/js/{DrawioView-gjsy7p01.js → DrawioView-6nq4412n.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-949393v1.js → HtmlPreview-cs51gszy.js} +1 -1
- package/dist/client/static/js/{ImageView-pan9pqtm.js → ImageView-nc2n0w6s.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-p0qmghgt.js → LayoutWrapper-j7786frq.js} +1 -1
- package/dist/client/static/js/MergeDiffView-0rn5zsy5.js +1 -0
- package/dist/client/static/js/{Modal-4spmcn44.js → Modal-7ag7a9qq.js} +1 -1
- package/dist/client/static/js/{PdfView-dzj2s6rj.js → PdfView-0zab721q.js} +1 -1
- package/dist/client/static/js/{SessionsView-b6szjdg5.js → SessionsView-t9rhx472.js} +1 -1
- package/dist/client/static/js/{SheetView-jpc178g5.js → SheetView-2wdn5hkd.js} +1 -1
- package/dist/client/static/js/{SvgPreview-94fap32p.js → SvgPreview-fmrfxd7z.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-a6eyfzrj.js → abnfDiagram-O67JEVCF-41scfh9v.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-pgmyfncy.js → architectureDiagram-NJMV4G6O-fp6etjvt.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-rf51jyb2.js → blockDiagram-BEXU5L5S-pespk9mt.js} +1 -1
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-0faj48jp.js → c4Diagram-YGBWAQC7-rt4z91dx.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bvzsws8x.js → classDiagram-v2-NBCMYWYE-6bzaq8sd.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-j1amnd3m.js → cose-bilkent-JH36ORCC-z3fhgcba.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-f73w6zzz.js → cynefinDiagram-VND7K2PF-8endeh4p.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-a5vgvjsg.js → dagre-6A5THRUB-2a2f32dv.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-6y9efamp.js → diagram-22UHCM2B-wgbyr6b7.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-2mycy7xm.js → diagram-3UASUU5V-5122b41x.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-10zgjb66.js → diagram-ATOU4E4O-1gt9fr7e.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-bewa52yf.js → diagram-CDSNMT55-v6hs59jb.js} +1 -1
- package/dist/client/static/js/{diagram-MLGK6HIB-mh3b7gd3.js → diagram-MLGK6HIB-yey2m5nm.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-gvdrbdm5.js → diagram-MPIPVDR6-hg4f3q4d.js} +1 -1
- package/dist/client/static/js/{dockerfile-6bn19kg0.js → dockerfile-56tfnp5r.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-2prre93c.js → ebnfDiagram-ZINNZB2B-2mhc9aar.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-9t6t9kc6.js → elk-276RUBZZ-wedtvz9y.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-etcggr5n.js → erDiagram-OPXOYQCR-1kysnby9.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-vd4z6bvy.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-cdc4mwhs.js → ganttDiagram-FUAMR5RP-j4g65rpm.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-55d0fa7x.js → gitGraphDiagram-X574FWY7-vcwmj4b3.js} +1 -1
- package/dist/client/static/js/{index-eggbcdwx.js → index-1mkn5fbf.js} +8 -8
- package/dist/client/static/js/{index-j1ksa4x2.js → index-2h7xh93h.js} +1 -1
- package/dist/client/static/js/{index-2f6afhze.js → index-3kedv94b.js} +1 -1
- package/dist/client/static/js/{index-xe447cw3.js → index-42k78whj.js} +1 -1
- package/dist/client/static/js/{index-yg38s8t3.js → index-42q5gg7t.js} +1 -1
- package/dist/client/static/js/{index-pe5f2gmn.js → index-6vbra7p9.js} +1 -1
- package/dist/client/static/js/{index-gcad7b6g.js → index-7enfdvh0.js} +1 -1
- package/dist/client/static/js/{index-me0b6wkw.js → index-9mgpbwfr.js} +1 -1
- package/dist/client/static/js/{index-fyt8m8ah.js → index-a70sk36c.js} +1 -1
- package/dist/client/static/js/{index-pzwf6hwe.js → index-c5401dqs.js} +2 -2
- package/dist/client/static/js/{index-a5ecn5yx.js → index-csxnqgzw.js} +1 -1
- package/dist/client/static/js/{index-jpvng27a.js → index-d201jvs9.js} +1 -1
- package/dist/client/static/js/{index-wwyjzhgs.js → index-dbsy29gn.js} +1 -1
- package/dist/client/static/js/{index-rw84kefb.js → index-dw9epydj.js} +1 -1
- package/dist/client/static/js/{index-537m8a3x.js → index-e39m185a.js} +1 -1
- package/dist/client/static/js/{index-yh7gngsh.js → index-fg0ne74z.js} +1 -1
- package/dist/client/static/js/{index-skvfxcd8.js → index-fnaq8baz.js} +1 -1
- package/dist/client/static/js/{index-fr91ghwb.js → index-fvphmwkf.js} +1 -1
- package/dist/client/static/js/{index-s9ts6qbj.js → index-gajpd90b.js} +1 -1
- package/dist/client/static/js/{index-pgy7ree5.js → index-hgzf4ask.js} +1 -1
- package/dist/client/static/js/{index-c253x7vt.js → index-hrez92pw.js} +1 -1
- package/dist/client/static/js/{index-8z9aqgf3.js → index-jaf968hx.js} +2 -2
- package/dist/client/static/js/{index-mx5y9vt9.js → index-kt77dwsg.js} +1 -1
- package/dist/client/static/js/{index-27gwghmp.js → index-m62sf9wn.js} +1 -1
- package/dist/client/static/js/{index-sx2yz2wx.js → index-n7bmqeqz.js} +1 -1
- package/dist/client/static/js/{index-3akjcs82.js → index-pn0ja904.js} +1 -1
- package/dist/client/static/js/{index-ax8gaayq.js → index-pr8wsq24.js} +1 -1
- package/dist/client/static/js/{index-pa70qj4p.js → index-qc3de995.js} +1 -1
- package/dist/client/static/js/{index-9rvjegmy.js → index-r42f3r1p.js} +1 -1
- package/dist/client/static/js/{index-f13ern5e.js → index-s7p2wdr1.js} +1 -1
- package/dist/client/static/js/{index-y09de44h.js → index-skp6991n.js} +1 -1
- package/dist/client/static/js/{index-f6t91mpp.js → index-spnrx2c0.js} +1 -1
- package/dist/client/static/js/{index-mngpcca7.js → index-sqyvj03y.js} +1 -1
- package/dist/client/static/js/{index-njhrm5qa.js → index-tz5ewsza.js} +1 -1
- package/dist/client/static/js/{index-6bsez5n6.js → index-vs3g6njv.js} +1 -1
- package/dist/client/static/js/{index-nnwcbp2d.js → index-wkxsypj1.js} +1 -1
- package/dist/client/static/js/{index-60cxxnpk.js → index-xqz7bqcn.js} +2 -2
- package/dist/client/static/js/{index-trq7bdvk.js → index-y5pkqrga.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-9xph6cr5.js → infoDiagram-VRGFBTTK-7craq9x2.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-3gshs3v8.js → ishikawaDiagram-OU5B5YK6-ncjty2re.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-fa8x56mf.js → journeyDiagram-ZHPQQLJL-yx222bzt.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-fybp2hh4.js → kanban-definition-PNTS6WVX-a2f84qmn.js} +1 -1
- package/dist/client/static/js/{mermaid.core-jjh5ggp0.js → mermaid.core-9vfwthw3.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-gtfbg619.js → mindmap-definition-NLK3R4M7-fsxysg6f.js} +1 -1
- package/dist/client/static/js/one-dark-pro-7v4by00h.js +1 -0
- package/dist/client/static/js/one-light-5rfzh8p4.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-1a51sbqv.js → pegDiagram-GJSIUBJH-77wxmp9g.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-zd9svyyn.js → pieDiagram-5QR66LMP-gvgfhez0.js} +1 -1
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-5gtw2m6s.js → quadrantDiagram-O4NWA36T-9zkbt5h8.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-3ccwpfzz.js → railroadDiagram-XR7U4H2S-w55bsyw6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-sasndrrp.js → requirementDiagram-PLB6GJNP-828s1e5g.js} +1 -1
- package/dist/client/static/js/{rust-n9z2c9m3.js → rust-csv5f258.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2ahb4sda.js → sankeyDiagram-IPEJSGJF-34f3fyvg.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bfj90kz1.js → sequenceDiagram-PO4LG4MO-nnta2hn0.js} +1 -1
- package/dist/client/static/js/{sizeCapture-INFHLROL-5tygxmtc.js → sizeCapture-INFHLROL-gpcramga.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-533xw76e.js → stateDiagram-v2-GCMORJYK-3f2en220.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-gd3d04pk.js → swimlanes-2SLR337P-jgqt12z9.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-xxmvdyg4.js → swimlanesDiagram-TC7HE7FX-xx1z57df.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-fvqvgqvg.js → timeline-definition-EJHVYXUP-sgchcs11.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-tm1f0m4x.js → usecaseDiagram-POWQR4AR-znkg9pkq.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-2vdvv1hd.js → vennDiagram-UO4OBE2U-dncg96ej.js} +1 -1
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-7avcjznx.js → wardleyDiagram-VNRHLVJA-77xz2d49.js} +1 -1
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-g39y526n.js → xychartDiagram-PMCCYNJV-40j1aqyf.js} +1 -1
- package/package.json +1 -1
- package/src/client/components/common/session-row/TrailingSlot.tsx +8 -1
- package/src/client/components/common/session-row/index.tsx +4 -0
- package/src/client/components/common/session-row/session-row.test.tsx +5 -0
- package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +36 -5
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -0
- package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +28 -1
- package/src/client/components/workspace/model-dropdown/CloseButton.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +10 -1
- package/src/client/components/workspace/model-dropdown/Header.tsx +27 -20
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +18 -0
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +34 -4
- package/dist/client/static/js/MergeDiffView-swt467g7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7c2ncsw7.js +0 -1
- package/dist/client/static/js/one-dark-pro-vht9rv39.js +0 -1
- package/dist/client/static/js/one-light-arxc5whh.js +0 -1
|
@@ -15,30 +15,61 @@
|
|
|
15
15
|
* for height, so after a partial reveal the user needs to keep going AND to
|
|
16
16
|
* start over, which is what two controls say and one alternating control
|
|
17
17
|
* cannot.
|
|
18
|
+
*
|
|
19
|
+
* The chevron takes the HARNESS MARK's column, not the label's: it sits in the
|
|
20
|
+
* same 12px box (13px on touch) as the glyph every session row draws, and the
|
|
21
|
+
* label starts on the title column. The row markup uses the row's own numbers
|
|
22
|
+
* (`sessionRowBranchStyle`) so moving the harness mark cannot leave this
|
|
23
|
+
* chevron behind.
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
26
|
import { ChevronDown, ChevronUp } from 'lucide-preact';
|
|
27
|
+
import { sessionRowBranchStyle } from '@/client/components/common/session-row';
|
|
21
28
|
|
|
22
29
|
interface Props {
|
|
23
30
|
hiddenCount: number;
|
|
24
31
|
canShowLess: boolean;
|
|
25
32
|
onShowMore: () => void;
|
|
26
33
|
onShowLess: () => void;
|
|
34
|
+
/** Phone drawer: the row's leading slot and mark are one step larger. */
|
|
35
|
+
touch?: boolean;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
|
-
export function WorkspaceRevealRow({
|
|
38
|
+
export function WorkspaceRevealRow({
|
|
39
|
+
hiddenCount,
|
|
40
|
+
canShowLess,
|
|
41
|
+
onShowMore,
|
|
42
|
+
onShowLess,
|
|
43
|
+
touch = false,
|
|
44
|
+
}: Props) {
|
|
30
45
|
if (hiddenCount <= 0 && !canShowLess) return null;
|
|
31
46
|
|
|
47
|
+
const { slotWidth, markGap, glyph } = sessionRowBranchStyle(touch);
|
|
48
|
+
|
|
32
49
|
return (
|
|
33
|
-
<div className="flex items-center gap-1
|
|
50
|
+
<div className="flex items-center gap-1">
|
|
34
51
|
{hiddenCount > 0 && (
|
|
35
52
|
<button
|
|
36
53
|
type="button"
|
|
37
54
|
onClick={onShowMore}
|
|
38
|
-
className="min-w-0
|
|
55
|
+
className="flex min-w-0 items-center rounded-md px-1 py-1 text-[11px] text-ink/45 transition-colors cursor-pointer hover:bg-ink/[0.04] hover:text-ink/80"
|
|
39
56
|
>
|
|
40
|
-
|
|
41
|
-
|
|
57
|
+
{/* The row's leading geometry: inset (the button's own `px-1`), the
|
|
58
|
+
status slot, then its 8px gap — so the mark below lands exactly
|
|
59
|
+
where a row's harness mark does. */}
|
|
60
|
+
<span aria-hidden="true" className="shrink-0" style={{ width: slotWidth }} />
|
|
61
|
+
<span aria-hidden="true" className="shrink-0" style={{ width: markGap }} />
|
|
62
|
+
<span
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
className="flex shrink-0 items-center justify-center"
|
|
65
|
+
style={{ width: glyph, height: glyph }}
|
|
66
|
+
>
|
|
67
|
+
<ChevronDown size={glyph} />
|
|
68
|
+
</span>
|
|
69
|
+
{/* The harness wrapper's own `mr-1.5`, so the label starts on the
|
|
70
|
+
title column instead of stopping short of it. */}
|
|
71
|
+
<span className="w-1.5 shrink-0" />
|
|
72
|
+
<span className="truncate">{hiddenCount} more</span>
|
|
42
73
|
</button>
|
|
43
74
|
)}
|
|
44
75
|
{canShowLess && (
|
|
@@ -48,7 +48,7 @@ afterEach(() => {
|
|
|
48
48
|
container?.remove();
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
function mount(props: { hiddenCount: number; canShowLess: boolean; onShowMore?: () => void; onShowLess?: () => void }) {
|
|
51
|
+
function mount(props: { hiddenCount: number; canShowLess: boolean; touch?: boolean; onShowMore?: () => void; onShowLess?: () => void }) {
|
|
52
52
|
if (container) {
|
|
53
53
|
render(null, container);
|
|
54
54
|
container.remove();
|
|
@@ -101,4 +101,31 @@ describe('modern workspace reveal row', () => {
|
|
|
101
101
|
less!.click();
|
|
102
102
|
expect(calls).toEqual(['more', 'less']);
|
|
103
103
|
});
|
|
104
|
+
|
|
105
|
+
test('the chevron takes the harness mark column at the compact row size', () => {
|
|
106
|
+
mount({ hiddenCount: 4, canShowLess: false });
|
|
107
|
+
const button = buttons()[0]!;
|
|
108
|
+
const [slot, gap, mark, labelGap] = Array.from(button.children) as HTMLElement[];
|
|
109
|
+
// The session row's geometry: inset (button padding) · 16px status slot ·
|
|
110
|
+
// 8px gap · the 12px harness mark · its 6px trailing gap. A chevron drawn
|
|
111
|
+
// with its own inline width drifted off this column.
|
|
112
|
+
expect(slot.style.width).toBe('16px');
|
|
113
|
+
expect(gap.style.width).toBe('8px');
|
|
114
|
+
expect(mark.style.width).toBe('12px');
|
|
115
|
+
expect(mark.style.height).toBe('12px');
|
|
116
|
+
expect(mark.querySelector('svg')?.getAttribute('width')).toBe('12');
|
|
117
|
+
expect(labelGap.className).toContain('w-1.5');
|
|
118
|
+
expect(button.textContent).toContain('4 more');
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('the touch row keeps the same columns one step larger', () => {
|
|
122
|
+
mount({ hiddenCount: 2, canShowLess: false, touch: true });
|
|
123
|
+
const button = buttons()[0]!;
|
|
124
|
+
const [slot, gap, mark, labelGap] = Array.from(button.children) as HTMLElement[];
|
|
125
|
+
expect(slot.style.width).toBe('18px');
|
|
126
|
+
expect(gap.style.width).toBe('8px');
|
|
127
|
+
expect(mark.style.width).toBe('13px');
|
|
128
|
+
expect(mark.querySelector('svg')?.getAttribute('width')).toBe('13');
|
|
129
|
+
expect(labelGap.className).toContain('w-1.5');
|
|
130
|
+
});
|
|
104
131
|
});
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* strip, so the phone spent TWO chrome rows (85px of an 844px screen) on a
|
|
12
12
|
* surface whose whole job is to list models, and the word named the thing the
|
|
13
13
|
* user had just tapped. The control now rides the strip's trailing edge (or the
|
|
14
|
-
*
|
|
15
|
-
* header at all.
|
|
14
|
+
* Add new provider row when the picker offers no harness tabs), and the frame
|
|
15
|
+
* draws no header at all.
|
|
16
16
|
*
|
|
17
17
|
* One component for both rows, because the button has to look the same wherever
|
|
18
18
|
* the first band lands — a second `X` written inline is how the two would pick
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* content was the word "Model" and a 28px `X`, sitting above a 49px harness tab
|
|
18
18
|
* strip — two chrome rows where every other phone surface has one, and a label
|
|
19
19
|
* that named the thing the user had just tapped. The close control now rides the
|
|
20
|
-
* picker's own first row (the harness tabs, or the
|
|
21
|
-
* offers no tabs), which is what removes the second band without leaving
|
|
20
|
+
* picker's own first row (the harness tabs, or the Add new provider row when the
|
|
21
|
+
* picker offers no tabs), which is what removes the second band without leaving
|
|
22
22
|
* dialog undismissable: `ModelDropdownPanel` renders it into `headerActions`.
|
|
23
23
|
*
|
|
24
24
|
* PORTALLED to `<body>`, not rendered in place. The composer card can become a
|
|
@@ -163,7 +163,16 @@ export function HarnessTabs({ harnesses, active, onSelect, onFix, actions }: Har
|
|
|
163
163
|
className={`relative flex-none ${PICKER_BAND_HEIGHT} ${PICKER_STRIP_SHIFT} flex items-stretch bg-canvas/40`}
|
|
164
164
|
>
|
|
165
165
|
<div
|
|
166
|
-
|
|
166
|
+
// Horizontal scroll ONLY. `overflow-x-auto` computes `overflow-y` to
|
|
167
|
+
// `auto` too, and `.scrollbar-overlay-container` (which the strip used
|
|
168
|
+
// to carry) states the same axis — so on a browser whose styled 8px
|
|
169
|
+
// scrollbar takes layout space, the track cut the 48px band's content
|
|
170
|
+
// box to 40px while a coarse tab stays 44px: 4px of vertical overflow,
|
|
171
|
+
// measured, and a vertical bar over the harness marks. `no-scrollbar`
|
|
172
|
+
// keeps the horizontal track out of layout entirely (the same choice
|
|
173
|
+
// `TabStrip` makes), and `overflow-y-hidden` keeps a vertical gesture
|
|
174
|
+
// going to the model list instead of this strip.
|
|
175
|
+
className={`no-scrollbar flex min-w-0 flex-1 items-stretch gap-0.5 overflow-x-auto overflow-y-hidden ${PICKER_STRIP_INSET} pr-1`}
|
|
167
176
|
role="tablist"
|
|
168
177
|
aria-label="Harness"
|
|
169
178
|
// The one surface where a harness HUE is not decoration: with no label in
|
|
@@ -7,9 +7,13 @@ interface ModelDropdownHeaderProps {
|
|
|
7
7
|
onSearchChange: (value: string) => void;
|
|
8
8
|
onAddProvider?: () => void;
|
|
9
9
|
/**
|
|
10
|
-
* Trailing controls on the
|
|
11
|
-
* button here when it offers no harness tabs, so the frame never
|
|
12
|
-
* header row of its own.
|
|
10
|
+
* Trailing controls on the Add new provider row. The full-screen picker puts
|
|
11
|
+
* its close button here when it offers no harness tabs, so the frame never
|
|
12
|
+
* needs a header row of its own.
|
|
13
|
+
*
|
|
14
|
+
* This row is a real row — the action button and this slot are SIBLINGS, not
|
|
15
|
+
* a button nested in a button — so pressing the close control cannot also
|
|
16
|
+
* fire `onAddProvider`.
|
|
13
17
|
*/
|
|
14
18
|
actions?: ComponentChildren;
|
|
15
19
|
}
|
|
@@ -22,23 +26,27 @@ export function ModelDropdownHeader({
|
|
|
22
26
|
}: ModelDropdownHeaderProps) {
|
|
23
27
|
return (
|
|
24
28
|
<div className="flex shrink-0 flex-col bg-canvas/40">
|
|
25
|
-
{/* Top Add New Provider
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
{/* Top Add New Provider row. The trailing slot holds the picker's close
|
|
30
|
+
control when this row is the frame's first band (the picker offers no
|
|
31
|
+
harness strip). */}
|
|
32
|
+
<div className={`flex ${PICKER_BAND_HEIGHT} items-stretch border-b border-ink/5 pr-2`}>
|
|
33
|
+
<button
|
|
34
|
+
type="button"
|
|
35
|
+
onClick={onAddProvider}
|
|
36
|
+
className="flex min-w-0 flex-1 items-center gap-2 pl-2.5 pr-3 text-xs text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors text-left font-medium cursor-pointer"
|
|
37
|
+
>
|
|
38
|
+
{/* The 18px slot is the picker's icon rail: every band's leading mark
|
|
39
|
+
centres in it (the section heading, the row's grip, the thinking
|
|
40
|
+
strip and the search field), so the marks read as one column. */}
|
|
41
|
+
<span className="inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center">
|
|
42
|
+
<Plus size={14} className="text-ink/60" />
|
|
43
|
+
</span>
|
|
44
|
+
<span>Add new provider</span>
|
|
45
|
+
</button>
|
|
46
|
+
{actions ? <div className="flex flex-none items-center titlebar-no-drag">{actions}</div> : null}
|
|
47
|
+
</div>
|
|
39
48
|
|
|
40
|
-
{/* Search Input.
|
|
41
|
-
this row is the frame's first band. */}
|
|
49
|
+
{/* Search Input. */}
|
|
42
50
|
<div className={`flex ${PICKER_BAND_HEIGHT} items-center gap-1 pl-2.5 pr-2 border-b border-ink/10 bg-canvas/60`}>
|
|
43
51
|
<div className="flex min-w-0 flex-1 items-center">
|
|
44
52
|
<span className="mr-2 inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center">
|
|
@@ -63,7 +71,6 @@ export function ModelDropdownHeader({
|
|
|
63
71
|
</button>
|
|
64
72
|
)}
|
|
65
73
|
</div>
|
|
66
|
-
{actions ? <div className="flex flex-none items-center titlebar-no-drag">{actions}</div> : null}
|
|
67
74
|
</div>
|
|
68
75
|
</div>
|
|
69
76
|
);
|
|
@@ -179,7 +179,7 @@ export function ModelDropdownPanel({
|
|
|
179
179
|
|
|
180
180
|
In the full-screen placement the strip is the FRAME's first row, so
|
|
181
181
|
it carries the close control when it exists; otherwise the control
|
|
182
|
-
rides the
|
|
182
|
+
rides the Add new provider row. */}
|
|
183
183
|
{showTabs && (
|
|
184
184
|
<HarnessTabs
|
|
185
185
|
harnesses={harnesses}
|
|
@@ -274,6 +274,24 @@ describe('harness tabs', () => {
|
|
|
274
274
|
expect(tab.textContent).toContain('⚠');
|
|
275
275
|
});
|
|
276
276
|
|
|
277
|
+
test('the strip scrolls horizontally and never vertically', async () => {
|
|
278
|
+
const el = await mount(h(HarnessTabs, {
|
|
279
|
+
harnesses: [summary('omp-rpc'), summary('claude')],
|
|
280
|
+
active: 'omp-rpc',
|
|
281
|
+
onSelect: () => {},
|
|
282
|
+
}));
|
|
283
|
+
const strip = el.querySelector('[role="tablist"]') as HTMLElement;
|
|
284
|
+
// Horizontal pan is the strip's one axis.
|
|
285
|
+
expect(strip.className).toContain('overflow-x-auto');
|
|
286
|
+
// `overflow-x-auto` computes `overflow-y: auto`. Without the explicit
|
|
287
|
+
// `hidden`, a browser whose styled 8px scrollbar takes layout space shrank
|
|
288
|
+
// the band's content box to 40px while a `tap-chip` tab stays 44px — 4px
|
|
289
|
+
// of vertical overflow and a scrollbar painted over the marks (measured).
|
|
290
|
+
expect(strip.className).toContain('overflow-y-hidden');
|
|
291
|
+
expect(strip.className).toContain('no-scrollbar');
|
|
292
|
+
expect(strip.className).not.toContain('scrollbar-overlay-container');
|
|
293
|
+
});
|
|
294
|
+
|
|
277
295
|
test('no harnesses draws nothing rather than an empty strip', async () => {
|
|
278
296
|
const el = await mount(h(HarnessTabs, { harnesses: [], active: null, onSelect: () => {} }));
|
|
279
297
|
expect(el.querySelector('[role="tablist"]')).toBeNull();
|
|
@@ -64,13 +64,18 @@ function harness(id: string): HarnessSummary {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
function mount(
|
|
67
|
+
function mount(
|
|
68
|
+
harnesses: HarnessSummary[],
|
|
69
|
+
onClose: () => void,
|
|
70
|
+
editable = true,
|
|
71
|
+
onAddProvider: () => void = () => {},
|
|
72
|
+
): void {
|
|
68
73
|
act(() =>
|
|
69
74
|
render(
|
|
70
75
|
h(ModelDropdownPanel, {
|
|
71
76
|
search: '',
|
|
72
77
|
onSearchChange: () => {},
|
|
73
|
-
onAddProvider
|
|
78
|
+
onAddProvider,
|
|
74
79
|
isLoading: false,
|
|
75
80
|
filteredModels: [],
|
|
76
81
|
favoriteModels: [],
|
|
@@ -115,12 +120,18 @@ describe('the full-screen picker close control', () => {
|
|
|
115
120
|
expect(dialog.querySelector('header')).toBeNull();
|
|
116
121
|
});
|
|
117
122
|
|
|
118
|
-
test('a picker with no harness tabs puts the control on the
|
|
123
|
+
test('a picker with no harness tabs puts the control on the Add new provider row', () => {
|
|
119
124
|
mount([], () => {});
|
|
120
125
|
const dialog = document.querySelector('[role="dialog"][aria-label="Select model"]') as HTMLElement;
|
|
121
126
|
const close = dialog.querySelector('button[aria-label="Close"]') as HTMLElement;
|
|
122
127
|
expect(close).not.toBeNull();
|
|
123
128
|
expect(dialog.querySelector('[role="tablist"]')).toBeNull();
|
|
129
|
+
const addButton = [...dialog.querySelectorAll('button')]
|
|
130
|
+
.find((button) => button.textContent?.includes('Add new provider')) as HTMLElement | undefined;
|
|
131
|
+
expect(addButton).not.toBeUndefined();
|
|
132
|
+
// The control's slot (actions div) is a SIBLING of the Add button inside
|
|
133
|
+
// that row — not nested in it, and not on the search row.
|
|
134
|
+
expect(close.parentElement?.parentElement).toBe(addButton?.parentElement);
|
|
124
135
|
expect(dialog.querySelector('input[placeholder="Search models"]')).not.toBeNull();
|
|
125
136
|
});
|
|
126
137
|
|
|
@@ -132,9 +143,12 @@ describe('the full-screen picker close control', () => {
|
|
|
132
143
|
const dialog = document.querySelector('[role="dialog"][aria-label="Select model"]') as HTMLElement;
|
|
133
144
|
expect(dialog.querySelector('[role="tablist"]')).toBeNull();
|
|
134
145
|
expect(dialog.querySelectorAll('[role="tab"]')).toHaveLength(0);
|
|
135
|
-
// The close control still rides the picker's first row.
|
|
146
|
+
// The close control still rides the picker's first row: Add new provider.
|
|
136
147
|
const close = dialog.querySelector('button[aria-label="Close"]') as HTMLElement;
|
|
137
148
|
expect(close).not.toBeNull();
|
|
149
|
+
const addButton = [...dialog.querySelectorAll('button')]
|
|
150
|
+
.find((button) => button.textContent?.includes('Add new provider')) as HTMLElement | undefined;
|
|
151
|
+
expect(close.parentElement?.parentElement).toBe(addButton?.parentElement);
|
|
138
152
|
expect(dialog.querySelector('input[placeholder="Search models"]')).not.toBeNull();
|
|
139
153
|
});
|
|
140
154
|
|
|
@@ -150,4 +164,20 @@ describe('the full-screen picker close control', () => {
|
|
|
150
164
|
act(() => close?.click());
|
|
151
165
|
expect(closed).toBe(1);
|
|
152
166
|
});
|
|
167
|
+
|
|
168
|
+
test('pressing it never adds a provider', () => {
|
|
169
|
+
// The row is a button plus a trailing slot, so the close control is not a
|
|
170
|
+
// button nested in a button and a press on it cannot bubble into
|
|
171
|
+
// `onAddProvider`.
|
|
172
|
+
let closed = 0;
|
|
173
|
+
let added = 0;
|
|
174
|
+
mount([], () => { closed += 1; }, true, () => { added += 1; });
|
|
175
|
+
const close = document.querySelector<HTMLButtonElement>(
|
|
176
|
+
'[role="dialog"] button[aria-label="Close"]',
|
|
177
|
+
);
|
|
178
|
+
expect(close).not.toBeNull();
|
|
179
|
+
act(() => close?.click());
|
|
180
|
+
expect(closed).toBe(1);
|
|
181
|
+
expect(added).toBe(0);
|
|
182
|
+
});
|
|
153
183
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Sg}from"./index-mx5y9vt9.js";import"./index-q3k8r0ms.js";import"./index-2f6afhze.js";export{Sg as MergeDiffView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-60cxxnpk.js";import"./index-rw84kefb.js";import{Sb}from"./index-njhrm5qa.js";export{Sb as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yh}from"./index-eggbcdwx.js";export{Yh as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Vh}from"./index-eggbcdwx.js";export{Vh as default};
|