fix: square task graph control items

This commit is contained in:
hairyf committed 2026-10-14 12:44:34 +08:00
1 parent 2bcee4c635
commit 6df581c14f
5 files changed
+17

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+1
View File
@@ -152,6 +152,7 @@ export function ViewModeToggle(props: {
<Button
variant="ghost"
size="sm"
className={css.controlText}
icon={toTree ? <IconTreeCornerRegular /> : <WorkflowGlyph size={13} />}
aria-label={t(toTree ? 'tasksViewSwitchToTree' : 'tasksViewSwitchToGraph')}
title={t(toTree ? 'tasksViewSwitchToTree' : 'tasksViewSwitchToGraph')}
+3
View File
@@ -654,6 +654,7 @@
display: flex;
flex-direction: row;
align-items: center;
overflow: hidden;
background: var(--dsw-alias-bg-layer-1);
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 3px;
@@ -674,6 +675,7 @@
justify-content: center;
padding: 0 4px;
border: none;
border-radius: 0;
background: none;
color: var(--dsw-alias-label-secondary);
font-family: var(--ds-font-family-code, monospace);
@@ -708,6 +710,7 @@
justify-content: center;
padding: 0 8px;
border: none;
border-radius: 0;
background: none;
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xxxs-11);
+13
View File
@@ -41,6 +41,19 @@ describe('Tasks page motion', () => {
expect(source('src/client/JobsDrawer.tsx')).toContain('useAutoAnimateRef')
})
it('keeps graph control menu items square while clipping the rounded cluster', () => {
const styles = source('src/client/tasks-graph.module.css')
const controls = /\.controls \{([\s\S]*?)\n\}/.exec(styles)?.[1]
const button = /\.controlBtn \{([\s\S]*?)\n\}/.exec(styles)?.[1]
const textButton = /\.controlText \{([\s\S]*?)\n\}/.exec(styles)?.[1]
if (controls === undefined || button === undefined || textButton === undefined) {
throw new Error('graph control rules must exist')
}
expect(controls).toContain('overflow: hidden')
expect(button).toContain('border-radius: 0')
expect(textButton).toContain('border-radius: 0')
})
it('gives canvas cards a mount-only CSS entrance that respects reduced motion', () => {
const styles = source('src/client/tasks-graph.module.css')
const node = /\.node \{([\s\S]*?)\n\}/.exec(styles)?.[1]