refactor(dashboard): split monolithic styles.css into per-component files

Split app/styles.css from ~40k lines down to ~4.5k. Created 56 co-located
component CSS files in app/components/, each imported by its owning .tsx.
The remainder of styles.css holds genuinely global rules (design tokens,
.btn/.card/.modal/.form-input primitives, cross-component @media overrides).

- Lazy-load 13 heavy views (AgentsView, RoadmapsView, NodesView, etc.) via
  React.lazy + Suspense; prefetch all chunks on idle so first navigation is
  instant. Initial JS bundle: 1.58 MB → 1.16 MB (-26%). Initial CSS bundle:
  635 kB → 471 kB (-26%); the rest splits into 13 per-view chunks.

- Add app/test/cssFixture.ts exposing loadAllAppCss() + loadAllAppCssBaseOnly()
  so CSS regression tests load the full per-component bundle (mirroring Vite
  source order). Migrate 30+ tests off direct readFileSync('../styles.css').

- Enable test.css: { include: [/.+/] } in vitest.config.ts so component CSS
  imports actually inject styles in jsdom (fixes getComputedStyle assertions).

- Add ESLint rule (no-restricted-syntax) banning direct styles.css reads in
  dashboard test files; points at loadAllAppCss() instead.

- Restore lost utility classes (.text-muted, .text-secondary, .text-dim,
  .form-input) and rescue dropped chat tool-call rules into QuickChatFAB.css.

- Mobile fixes along the way: scroll containment for view containers
  (min-height:0 + -webkit-overflow-scrolling), QuickChatFAB full-screen on
  mobile (with safe-area-inset for iOS home bar), AgentsView single-row
  header layout, ActivityLogModal close button on right, model-combobox
  z-index above the mobile quick-chat panel.

- Bug fix: SkillsView toggle was display:none which hid the input from the
  accessibility tree; replaced with the visually-hidden pattern so screen
  readers + getByRole still find the checkbox.

- Bug fix: standalone Delete button in TaskDetailModal for triage-column
  tasks (Actions dropdown is hidden in triage state, so previously no way
  to delete a freshly-created task without status change first).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-24 19:37:02 -07:00
parent 4d43bf8d6b
commit f11800f2c6
173 changed files with 37072 additions and 36734 deletions

View File

@@ -0,0 +1,474 @@
/* === Workflow Step Manager Modal === */
.workflow-step-manager-modal {
width: 560px;
overflow: hidden;
}
.wfm-body {
padding: var(--space-md);
max-height: 70vh;
overflow-y: auto;
}
/* Loading / empty states */
.wfm-empty {
text-align: center;
padding: var(--space-xl);
color: var(--text-muted);
font-size: 14px;
}
.wfm-loading {
text-align: center;
padding: var(--space-xl);
color: var(--text-muted);
}
/* Tab navigation row */
.wfm-tab-row {
display: flex;
gap: var(--space-sm);
margin-bottom: var(--space-md);
border-bottom: 1px solid var(--border);
padding-bottom: var(--space-sm);
}
.wfm-tab-btn {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
padding: 6px 12px;
}
/* Step list */
.wfm-step-list {
display: flex;
flex-direction: column;
gap: var(--space-sm);
}
/* Step card */
.wfm-step-card {
padding: 12px 16px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
}
.wfm-step-card-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.wfm-step-card-info {
flex: 1;
min-width: 0;
}
.wfm-step-card-title-row {
display: flex;
align-items: center;
gap: var(--space-sm);
margin-bottom: 4px;
}
.wfm-step-card-name {
font-weight: 600;
font-size: 14px;
}
.wfm-step-card-desc {
font-size: 12px;
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wfm-step-card-actions {
display: flex;
gap: 4px;
margin-left: var(--space-sm);
flex-shrink: 0;
}
.wfm-delete-confirm {
display: flex;
gap: 4px;
align-items: center;
}
/* Badges */
.wfm-badge {
font-size: 11px;
padding: 2px 6px;
border-radius: var(--radius-sm);
}
.wfm-badge-enabled {
background: color-mix(in srgb, var(--ws-success) 15%, transparent);
color: var(--ws-success);
}
.wfm-badge-disabled {
background: var(--bg-tertiary);
color: var(--text-muted);
}
.wfm-badge-prompt {
background: color-mix(in srgb, var(--ws-pre-merge) 15%, transparent);
color: var(--ws-pre-merge);
}
.wfm-badge-script {
background: color-mix(in srgb, var(--ws-post-merge) 15%, transparent);
color: var(--ws-post-merge);
}
.wfm-badge-pre-merge {
background: color-mix(in srgb, var(--ws-pre-merge) 15%, transparent);
color: var(--ws-pre-merge);
}
.wfm-badge-post-merge {
background: color-mix(in srgb, var(--ws-info) 15%, transparent);
color: var(--ws-info);
}
.wfm-badge-default-on {
background: color-mix(in srgb, var(--ws-warning) 15%, transparent);
color: var(--ws-warning);
}
.wfm-badge-category {
font-size: 11px;
padding: 2px 6px;
border-radius: var(--radius-sm);
}
.wfm-badge-category-quality {
background: color-mix(in srgb, var(--ws-quality) 15%, transparent);
color: var(--ws-quality);
}
.wfm-badge-category-security {
background: color-mix(in srgb, var(--ws-security) 15%, transparent);
color: var(--ws-security);
}
.wfm-delete-confirm-btn {
color: var(--ws-error);
}
/* Template cards */
.wfm-template-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.wfm-template-card {
padding: var(--space-md);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
}
.wfm-template-inner {
display: flex;
gap: 12px;
align-items: flex-start;
}
.wfm-template-icon {
padding: var(--space-sm);
border-radius: var(--radius-sm);
background: var(--bg-tertiary);
color: var(--text);
flex-shrink: 0;
}
.wfm-template-content {
flex: 1;
min-width: 0;
}
.wfm-template-title-row {
display: flex;
align-items: center;
gap: var(--space-sm);
margin-bottom: 4px;
}
.wfm-template-name {
font-weight: 600;
font-size: 14px;
}
.wfm-template-desc {
font-size: 12px;
color: var(--text-muted);
margin-bottom: var(--space-sm);
}
.wfm-template-add-btn {
font-size: 12px;
padding: 4px 12px;
display: flex;
align-items: center;
gap: 4px;
}
/* Edit/create form */
.wfm-form {
padding: var(--space-md);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-secondary);
}
.wfm-form-title {
margin: 0 0 12px;
font-size: 14px;
font-weight: 600;
}
.wfm-form-fields {
display: flex;
flex-direction: column;
gap: var(--space-md);
}
.wfm-field label,
.wfm-field-label {
display: block;
font-size: 12px;
color: var(--text-muted);
margin-bottom: 4px;
}
.wfm-field input[type="text"],
.wfm-field textarea,
.wfm-field select {
width: 100%;
padding: 8px 12px;
border-radius: var(--radius-md);
border: 1px solid var(--border);
background: var(--bg);
color: var(--text);
font-size: 13px;
font-family: inherit;
outline: none;
transition:
border-color var(--transition-fast),
box-shadow var(--transition-fast);
}
.wfm-field input[type="text"]:focus,
.wfm-field textarea:focus,
.wfm-field select:focus {
border-color: var(--todo);
box-shadow: var(--focus-ring);
}
.wfm-field textarea {
resize: vertical;
}
.wfm-field textarea.wfm-prompt-textarea {
font-family: var(--font-mono, monospace);
}
/* Mode selector */
.wfm-mode-selector {
display: flex;
gap: var(--space-sm);
}
.wfm-mode-btn {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
padding: 6px 12px;
flex: 1;
justify-content: center;
}
/* Prompt header row (label + refine button) */
.wfm-prompt-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
}
.wfm-refine-btn {
font-size: 12px;
display: flex;
align-items: center;
gap: 4px;
}
.wfm-refine-btn span {
font-size: 11px;
}
/* No-scripts placeholder */
.wfm-no-scripts {
padding: 8px 12px;
border-radius: var(--radius-md);
border: 1px solid var(--border);
background: var(--bg-tertiary);
color: var(--text-muted);
font-size: 12px;
}
/* Checkbox toggle */
.wfm-checkbox-label {
display: flex;
align-items: center;
gap: var(--space-sm);
font-size: 13px;
cursor: pointer;
}
.wfm-checkbox-label input[type="checkbox"] {
accent-color: var(--todo);
}
/* Form actions */
.wfm-form-actions {
display: flex;
justify-content: flex-end;
gap: var(--space-sm);
margin-top: 4px;
}
/* Footer */
.wfm-footer {
padding: 12px 16px;
border-top: 1px solid var(--border);
}
.wfm-footer-add-btn {
display: flex;
align-items: center;
gap: 6px;
}
/* Spinner */
.wfm-spinner {
margin: 0 auto var(--space-sm);
}
.wfm-model-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.wfm-model-header label {
margin-bottom: 0;
}
.wfm-model-clear-btn {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 11px;
color: var(--text-tertiary);
background: none;
border: none;
cursor: pointer;
padding: 2px 6px;
border-radius: 4px;
}
.wfm-model-clear-btn:hover {
color: var(--text-secondary);
background: var(--bg-tertiary);
}
.wfm-model-hint {
display: block;
font-size: 11px;
color: var(--text-tertiary);
margin-bottom: 6px;
}
@media (max-width: 768px) {
.wfm-body {
flex: 1;
min-height: 0;
max-height: none;
overflow-y: auto;
}
.wfm-tab-row {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.wfm-tab-row::-webkit-scrollbar {
display: none;
}
.wfm-tab-btn {
flex-shrink: 0;
white-space: nowrap;
}
.wfm-step-card-top {
flex-wrap: wrap;
gap: var(--space-sm);
}
.wfm-step-card-actions {
flex-wrap: wrap;
margin-left: 0;
width: 100%;
justify-content: flex-end;
}
.wfm-step-card-desc {
overflow: visible;
text-overflow: clip;
white-space: normal;
word-break: break-word;
}
.wfm-template-inner {
flex-direction: column;
}
.wfm-mode-selector {
flex-wrap: wrap;
}
.wfm-form-actions {
flex-direction: column;
}
.wfm-form-actions .btn {
width: 100%;
}
.wfm-footer {
padding: 12px 14px;
}
}
@media (max-width: 768px) {
.workflow-step-manager-modal {
width: 100%;
max-width: 100%;
max-height: 100vh;
max-height: 100dvh;
border-radius: 0;
}
}