Skip to content

Commit c09083d

Browse files
committed
Fix up export dialog
1 parent 44ee020 commit c09083d

File tree

2 files changed

+59
-50
lines changed

2 files changed

+59
-50
lines changed

src-web/components/ExportDataDialog.tsx

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -84,63 +84,70 @@ function ExportDataDialogContent({
8484
const numSelected = Object.values(selectedWorkspaces).filter(Boolean).length;
8585
const noneSelected = numSelected === 0;
8686
return (
87-
<VStack space={3} className="w-full mb-3 px-4">
88-
<table className="w-full mb-auto min-w-full max-w-full divide-y divide-surface-highlight">
89-
<thead>
90-
<tr>
91-
<th className="w-6 min-w-0 py-2 text-left pl-1">
92-
<Checkbox
93-
checked={!allSelected && !noneSelected ? 'indeterminate' : allSelected}
94-
hideLabel
95-
title="All workspaces"
96-
onChange={handleToggleAll}
97-
/>
98-
</th>
99-
<th className="py-2 text-left pl-4" onClick={handleToggleAll}>
100-
Workspace
101-
</th>
102-
</tr>
103-
</thead>
104-
<tbody className="divide-y divide-surface-highlight">
105-
{workspaces.map((w) => (
106-
<tr key={w.id}>
107-
<td className="min-w-0 py-1 pl-1">
87+
<div className="w-full grid grid-rows-[minmax(0,1fr)_auto]">
88+
<VStack space={3} className="overflow-auto px-5 pb-6">
89+
<table className="w-full mb-auto min-w-full max-w-full divide-y divide-surface-highlight">
90+
<thead>
91+
<tr>
92+
<th className="w-6 min-w-0 py-2 text-left pl-1">
10893
<Checkbox
109-
checked={selectedWorkspaces[w.id] ?? false}
110-
title={w.name}
94+
checked={!allSelected && !noneSelected ? 'indeterminate' : allSelected}
11195
hideLabel
112-
onChange={() =>
113-
setSelectedWorkspaces((prev) => ({ ...prev, [w.id]: !prev[w.id] }))
114-
}
96+
title="All workspaces"
97+
onChange={handleToggleAll}
11598
/>
116-
</td>
117-
<td
118-
className="py-1 pl-4 text whitespace-nowrap overflow-x-auto hide-scrollbars"
119-
onClick={() => setSelectedWorkspaces((prev) => ({ ...prev, [w.id]: !prev[w.id] }))}
120-
>
121-
{w.name} {w.id === activeWorkspace.id ? '(current workspace)' : ''}
122-
</td>
99+
</th>
100+
<th className="py-2 text-left pl-4" onClick={handleToggleAll}>
101+
Workspace
102+
</th>
123103
</tr>
124-
))}
125-
</tbody>
126-
</table>
127-
<DetailsBanner color="secondary" open summary="Extra Settings">
128-
<Checkbox
129-
checked={includePrivateEnvironments}
130-
onChange={setIncludePrivateEnvironments}
131-
title="Include private environments"
132-
help='Environments marked as "sharable" will be exported by default'
133-
/>
134-
</DetailsBanner>
135-
<div className="grid grid-cols-[1fr_auto] items-center mt-6 pb-1.5">
104+
</thead>
105+
<tbody className="divide-y divide-surface-highlight">
106+
{workspaces.map((w) => (
107+
<tr key={w.id}>
108+
<td className="min-w-0 py-1 pl-1">
109+
<Checkbox
110+
checked={selectedWorkspaces[w.id] ?? false}
111+
title={w.name}
112+
hideLabel
113+
onChange={() =>
114+
setSelectedWorkspaces((prev) => ({ ...prev, [w.id]: !prev[w.id] }))
115+
}
116+
/>
117+
</td>
118+
<td
119+
className="py-1 pl-4 text whitespace-nowrap overflow-x-auto hide-scrollbars"
120+
onClick={() =>
121+
setSelectedWorkspaces((prev) => ({ ...prev, [w.id]: !prev[w.id] }))
122+
}
123+
>
124+
{w.name} {w.id === activeWorkspace.id ? '(current workspace)' : ''}
125+
</td>
126+
</tr>
127+
))}
128+
</tbody>
129+
</table>
130+
<DetailsBanner color="secondary" open summary="Extra Settings">
131+
<Checkbox
132+
checked={includePrivateEnvironments}
133+
onChange={setIncludePrivateEnvironments}
134+
title="Include private environments"
135+
help='Environments marked as "sharable" will be exported by default'
136+
/>
137+
</DetailsBanner>
138+
</VStack>
139+
<footer className="px-5 grid grid-cols-[1fr_auto] items-center bg-surface-highlight py-2 border-t border-border-subtle">
136140
<div>
137-
<Link href="https://yaak.app/button/new" noUnderline className="text-text-subtle">Create Run Button</Link>
141+
<Link href="https://yaak.app/button/new" noUnderline className="text-text-subtle">
142+
Create Run Button
143+
</Link>
138144
</div>
139145
<HStack space={2} justifyContent="end">
140-
<Button className="focus" variant="border" onClick={onHide}>
146+
<Button size="sm" className="focus" variant="border" onClick={onHide}>
141147
Cancel
142148
</Button>
143149
<Button
150+
size="sm"
144151
type="submit"
145152
className="focus"
146153
color="primary"
@@ -151,7 +158,7 @@ function ExportDataDialogContent({
151158
{pluralizeCount('Workspace', numSelected, { omitSingle: true, noneWord: 'Nothing' })}
152159
</Button>
153160
</HStack>
154-
</div>
155-
</VStack>
161+
</footer>
162+
</div>
156163
);
157164
}

src-web/components/core/DetailsBanner.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export function DetailsBanner({ className, color, summary, children, ...extraPro
2121
'w-0 h-0 border-t-[0.3em] border-b-[0.3em] border-l-[0.5em] border-r-0',
2222
'border-t-transparent border-b-transparent border-l-text-subtle',
2323
)}
24-
></div>
24+
/>
2525
{summary}
2626
</summary>
27+
<div className="mt-1.5">
2728
{children}
29+
</div>
2830
</details>
2931
</Banner>
3032
);

0 commit comments

Comments
 (0)