diff --git a/frontend/src/lib/components/common/checkbox/Checkbox.svelte b/frontend/src/lib/components/common/checkbox/Checkbox.svelte index 270b260d04..980f2f0a71 100644 --- a/frontend/src/lib/components/common/checkbox/Checkbox.svelte +++ b/frontend/src/lib/components/common/checkbox/Checkbox.svelte @@ -54,7 +54,11 @@ clicks++ }} class={twMerge( - 'rounded max-w-4 w-full', + // `no-default-style` opts out of the global `input` rule in tailwind.config.cjs, + // which is written for text inputs: it forces `width: 100%`, `display: block` + // and text padding onto a checkbox, inflating the 16px box to 18px and putting + // a floor under it that `w-4` can't get past. + 'no-default-style rounded max-w-4 w-full', // When disabled, grey it and let hover fall through to a wrapping trigger // (e.g. a tooltip explaining why it can't be selected). disabled ? 'opacity-50 cursor-not-allowed pointer-events-none' : '', diff --git a/frontend/src/lib/components/common/table/AppRow.svelte b/frontend/src/lib/components/common/table/AppRow.svelte index 636bd2c9d6..7e553143bb 100644 --- a/frontend/src/lib/components/common/table/AppRow.svelte +++ b/frontend/src/lib/components/common/table/AppRow.svelte @@ -11,7 +11,7 @@ import { createEventDispatcher } from 'svelte' import Button from '../button/Button.svelte' import Row from './Row.svelte' - import type { RowSelection } from './rowSelection' + import { selectMenuItems, type RowSelection } from './rowSelection' import InheritedLabels from '$lib/components/InheritedLabels.svelte' import Badge from '../badge/Badge.svelte' import { @@ -188,6 +188,7 @@ const canEdit = canWrite && showEditButton if (draft_only) { return [ + ...selectMenuItems(rowSelection), { displayName: 'Delete', icon: Trash, @@ -221,6 +222,7 @@ ] } return [ + ...selectMenuItems(rowSelection), { displayName: 'Duplicate/Fork', icon: GitFork, diff --git a/frontend/src/lib/components/common/table/FlowRow.svelte b/frontend/src/lib/components/common/table/FlowRow.svelte index a155ca3a97..55d4b2b142 100644 --- a/frontend/src/lib/components/common/table/FlowRow.svelte +++ b/frontend/src/lib/components/common/table/FlowRow.svelte @@ -14,7 +14,7 @@ import Badge from '../badge/Badge.svelte' import Button from '../button/Button.svelte' import Row from './Row.svelte' - import type { RowSelection } from './rowSelection' + import { selectMenuItems, type RowSelection } from './rowSelection' import { sendUserToast } from '$lib/toast' import { copyToClipboard, isOwner } from '$lib/utils' import { isDeployable } from '$lib/utils_deployable' @@ -210,6 +210,7 @@ const canEdit = flow.canWrite && showEditButton if (draft_only) { return [ + ...selectMenuItems(rowSelection), { displayName: 'Delete', icon: Trash, @@ -233,6 +234,7 @@ ] } return [ + ...selectMenuItems(rowSelection), { displayName: 'View runs', icon: List, diff --git a/frontend/src/lib/components/common/table/Row.svelte b/frontend/src/lib/components/common/table/Row.svelte index 849d77e2d9..a04e6f8e11 100644 --- a/frontend/src/lib/components/common/table/Row.svelte +++ b/frontend/src/lib/components/common/table/Row.svelte @@ -25,8 +25,10 @@ * children — checkbox, buttons, links) toggles selection. Opt-in so * existing tables that don't want it are unaffected. */ selectOnRowClick?: boolean - /** Home-style multi-select: the kind icon doubles as the checkbox instead - * of adding a column, so an unused selection costs the row nothing. */ + /** Home-style multi-select: a leading gutter the row reserves whether or + * not it is in use, revealing its checkbox on hover. Unlike `isSelectable` + * the checkbox is not shown at rest, so an unused selection costs the row + * 16px and no visual noise. */ rowSelection?: RowSelection alignWithSelectable?: boolean errorHandlerMuted?: boolean @@ -167,7 +169,9 @@ + with its sibling folder at the same depth. The selection gutter below adds a + further 16px, which TreeView's folder header mirrors with an empty box of + the same width and margins — change one and the other has to follow. -->