Add a reusable dashboard workflow picker that shows inline task status counts across board and list views. - Replace native workflow selects with a themed accessible dropdown component. - Share workflow status count calculation between board and list views. - Add styling, i18n labels, tests, and dashboard docs for the switcher behavior. Files changed: docs/dashboard-guide.md | 3 +- packages/dashboard/app/components/Board.tsx | 28 +-- packages/dashboard/app/components/Lane.css | 2 + .../dashboard/app/components/LeftSidebarNav.tsx | 2 +- packages/dashboard/app/components/ListView.css | 17 -- packages/dashboard/app/components/ListView.tsx | 31 ++- .../dashboard/app/components/WorkflowSwitcher.css | 186 ++++++++++++++ .../dashboard/app/components/WorkflowSwitcher.tsx | 270 +++++++++++++++++++++ .../app/components/__tests__/Board.test.tsx | 60 +++-- .../app/components/__tests__/ListView.test.tsx | 79 +++++- .../components/__tests__/WorkflowSwitcher.test.tsx | 92 +++++++ .../__tests__/workflowStatusCounts.test.ts | 122 ++++++++++ .../app/components/workflowStatusCounts.ts | 54 +++++ packages/i18n/locales/en/app.json | 9 + packages/i18n/locales/es/app.json | 9 + packages/i18n/locales/fr/app.json | 9 + packages/i18n/locales/ko/app.json | 9 + packages/i18n/locales/zh-CN/app.json | 9 + packages/i18n/locales/zh-TW/app.json | 9 + 19 files changed, 930 insertions(+), 70 deletions(-) Fusion-Task-Id: FN-6763 Fusion-Task-Lineage: 3503ea85-841a-4cd3-9960-1b22ef2cd4ea
187 lines
3.9 KiB
CSS
187 lines
3.9 KiB
CSS
.workflow-switcher {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--space-xs);
|
|
min-width: 0;
|
|
color: var(--text-muted);
|
|
font-size: calc(var(--space-sm) + var(--space-xs) * 0.75);
|
|
}
|
|
|
|
.workflow-switcher-label {
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
.workflow-switcher-trigger {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-sm);
|
|
min-width: calc(var(--space-xl) * 7.5);
|
|
max-width: calc(var(--space-xl) * 12);
|
|
min-height: calc(var(--space-lg) + var(--space-sm));
|
|
padding: var(--space-xs) var(--space-sm);
|
|
background: var(--bg-secondary);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text);
|
|
font: inherit;
|
|
text-align: left;
|
|
}
|
|
|
|
.workflow-switcher-trigger:hover,
|
|
.workflow-switcher-trigger[aria-expanded="true"] {
|
|
background: var(--bg-tertiary);
|
|
border-color: var(--text-dim);
|
|
}
|
|
|
|
.workflow-switcher-trigger:focus-visible {
|
|
outline: none;
|
|
box-shadow: var(--focus-ring);
|
|
}
|
|
|
|
.workflow-switcher-trigger-main {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--space-sm);
|
|
min-width: 0;
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.workflow-switcher-current-name,
|
|
.workflow-switcher-option-name {
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.workflow-switcher-current-name {
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.workflow-switcher-chevron {
|
|
flex: 0 0 auto;
|
|
color: var(--text-muted);
|
|
transition: transform var(--transition-fast);
|
|
}
|
|
|
|
.workflow-switcher-trigger[aria-expanded="true"] .workflow-switcher-chevron {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
.workflow-switcher-counts {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: calc(var(--space-xs) / 2);
|
|
flex: 0 0 auto;
|
|
font-variant-numeric: tabular-nums;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.workflow-switcher-count {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: calc(var(--space-md) + var(--space-xs));
|
|
padding: 0 var(--space-xs);
|
|
border-radius: var(--radius-pill);
|
|
border: 1px solid var(--border);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
line-height: calc(var(--space-md) / var(--space-sm));
|
|
}
|
|
|
|
.workflow-switcher-count--todo {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.workflow-switcher-count--in-progress {
|
|
color: var(--color-warning);
|
|
}
|
|
|
|
.workflow-switcher-count--done {
|
|
color: var(--color-success);
|
|
}
|
|
|
|
.workflow-switcher-count-separator {
|
|
color: var(--text-dim);
|
|
}
|
|
|
|
.workflow-switcher-menu {
|
|
position: fixed;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow);
|
|
z-index: 1200;
|
|
}
|
|
|
|
.workflow-switcher-options {
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
padding: var(--space-xs) 0;
|
|
}
|
|
|
|
.workflow-switcher-option {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-sm);
|
|
width: 100%;
|
|
padding: var(--space-sm) var(--space-md);
|
|
border: 0;
|
|
background: transparent;
|
|
color: var(--text);
|
|
font: inherit;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.workflow-switcher-option:hover,
|
|
.workflow-switcher-option--highlighted {
|
|
background: var(--card-hover);
|
|
}
|
|
|
|
.workflow-switcher-option--selected {
|
|
background: color-mix(in srgb, var(--todo) 15%, transparent);
|
|
}
|
|
|
|
.workflow-switcher-option--selected:hover,
|
|
.workflow-switcher-option--selected.workflow-switcher-option--highlighted {
|
|
background: color-mix(in srgb, var(--todo) 25%, transparent);
|
|
}
|
|
|
|
.workflow-switcher-option-name {
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.workflow-switcher-counts--option {
|
|
margin-left: auto;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.workflow-switcher {
|
|
flex: 1 1 auto;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.workflow-switcher-label {
|
|
align-self: center;
|
|
}
|
|
|
|
.workflow-switcher-trigger {
|
|
min-width: 0;
|
|
max-width: none;
|
|
width: 100%;
|
|
}
|
|
|
|
.workflow-switcher-menu {
|
|
max-width: calc(100vw - var(--space-xl));
|
|
}
|
|
}
|