Files
fusion/packages/dashboard/app/components/SpecEditor.css
gsxdsm f11800f2c6 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>
2026-04-24 19:39:20 -07:00

216 lines
4.1 KiB
CSS

/* === Spec Editor === */
.spec-editor {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow: hidden;
}
/* Double-click to edit cursor - only when not readOnly */
.spec-editor:not(.spec-editor-readonly) .markdown-body {
cursor: pointer;
}
/* Toolbar - fixed at top */
.spec-editor-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.spec-editor-mode-toggle {
display: flex;
align-items: center;
gap: var(--space-xs);
}
.spec-editor-actions {
display: flex;
align-items: center;
gap: var(--space-sm);
}
/* Actions row for Save/Cancel in Definition tab edit mode */
.spec-editor-actions-row {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-sm);
margin-top: var(--space-sm);
}
/* Edit mode container in Definition tab */
.spec-editor-edit-mode {
display: flex;
flex-direction: column;
gap: var(--space-sm);
}
/* Content area - flexible and scrollable */
.spec-editor-content {
flex: 1;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
padding: 12px 0;
}
/* Textarea - fills available space in edit mode */
.spec-editor-textarea {
width: 100%;
min-height: 200px;
height: 100%;
flex: 1;
padding: var(--space-md);
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: var(--font-mono);
font-size: 13px;
line-height: 1.6;
resize: none;
outline: none;
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.spec-editor-textarea:focus {
border-color: var(--todo);
box-shadow: var(--focus-ring);
}
.spec-editor-textarea:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* Empty state */
.spec-editor-empty {
padding: var(--space-xl);
text-align: center;
color: var(--text-muted);
font-size: 13px;
font-style: italic;
}
/* Keyboard hint - stays above revision section */
.spec-editor-hint {
display: flex;
align-items: center;
gap: var(--space-xs);
padding: 8px 0;
font-size: 12px;
color: var(--text-muted);
border-top: 1px solid var(--border);
flex-shrink: 0;
}
.spec-editor-hint kbd {
display: inline-block;
padding: 2px 6px;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-size: 11px;
font-family: var(--font-mono);
}
/* AI Revision section - fixed at bottom */
.spec-editor-revision {
padding: 16px 0;
border-top: 1px solid var(--border);
flex-shrink: 0;
}
.spec-editor-revision h4 {
font-size: 13px;
font-weight: 600;
margin: 0 0 4px 0;
color: var(--text);
}
.spec-editor-revision-help {
font-size: 12px;
color: var(--text-muted);
margin: 0 0 8px 0;
}
.spec-editor-feedback {
width: 100%;
padding: 10px 12px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: inherit;
font-size: 13px;
line-height: 1.5;
resize: vertical;
outline: none;
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.spec-editor-feedback:focus {
border-color: var(--todo);
box-shadow: var(--focus-ring);
}
.spec-editor-feedback:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.spec-editor-revision-actions {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: var(--space-sm);
}
.spec-editor-char-count {
font-size: calc(var(--space-sm) + var(--space-xs) * 0.75);
color: var(--text-muted);
font-family: var(--font-mono);
}
/* Mobile responsive */
@media (max-width: 768px) {
.spec-editor-content {
padding: 8px 0;
}
.spec-editor-textarea {
min-height: 150px;
padding: 10px;
font-size: 14px;
}
.spec-editor-toolbar {
padding: 6px 0;
flex-wrap: wrap;
gap: var(--space-sm);
}
.spec-editor-hint {
padding: 6px 0;
font-size: 11px;
}
.spec-editor-revision {
padding: 12px 0;
}
.spec-editor-revision h4 {
font-size: 12px;
}
.spec-editor-revision-help {
font-size: 11px;
}
}