feat(web/ui): consolidate dialogs, cards, and breakpoints (Pass 3)

- Unify modal/dialog system; .modal-* are now aliases of .dialog-*
- Migrate WorkspacesPage, start-tool-modal, merge-dialog, workspace-tools-panel to .dialog-*
- Add .card-sm/.card-md/.card-lg/.card-elevated/.card-borderless modifiers
- Apply card utilities across workspaces, projects, ssh-keys, workspace-detail, git-history
- Remove duplicated card-like background/border/padding from page CSS
- Remove 860px breakpoint; standardize on 767px/768px mobile split
- Add docs/development/ui-review-checklist.md
- Archive web-ui-spacing-typography-rework OpenSpec change
This commit is contained in:
Developer
2026-06-16 15:27:45 +00:00
parent 4f4939406f
commit 6e419f815d
25 changed files with 752 additions and 202 deletions
@@ -61,11 +61,13 @@ export const MergeDialog = ({
};
return (
<div className="modal-overlay" onClick={onClose}>
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
<h2>Merge Branch</h2>
<div className="dialog-overlay" onClick={onClose}>
<div className="dialog" onClick={(e) => e.stopPropagation()}>
<div className="dialog-header">
<h3>Merge Branch</h3>
</div>
<div className="merge-form">
<div className="dialog-body merge-form">
<div className="form-field">
<label>Source Branch (merge from)</label>
<select
@@ -108,7 +110,7 @@ export const MergeDialog = ({
<div className="success-text">Merge successful!</div>
)}
<div className="modal-actions">
<div className="dialog-actions">
<button
className="secondary-button"
onClick={onClose}
@@ -124,7 +124,7 @@ export const ProjectCard = ({
) : (
<div className="repo-list">
{(project.repositories || []).map((repo) => (
<div key={repo.id} className="repo-block">
<div key={repo.id} className="card card-md repo-block">
<div className="repo-header">
<h4>{repo.name}</h4>
<button
@@ -255,7 +255,7 @@ export const InstanceList = ({
) : (
<div className="instance-grid">
{instances.map((instance) => (
<div key={instance.id} className="instance-card">
<div key={instance.id} className="card card-md instance-card">
<LoadingOverlay
visible={busyInstanceId === instance.id}
label={busyLabel}
@@ -47,9 +47,9 @@ export function StartToolModal({
};
return (
<div className="modal-overlay" onClick={onClose}>
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<div className="dialog-overlay" onClick={onClose}>
<div className="dialog" onClick={(e) => e.stopPropagation()}>
<div className="dialog-header">
<h3>
<Icon name="play" size="sm" /> Start Tool on {workspace.name}
</h3>
@@ -57,7 +57,7 @@ export function StartToolModal({
<Icon name="cancel" size="sm" />
</button>
</div>
<form onSubmit={handleSubmit}>
<form onSubmit={handleSubmit} className="dialog-body">
<div className="form-group">
<label htmlFor="tool-type">Tool Type</label>
<select
@@ -90,7 +90,7 @@ export function StartToolModal({
/>
</div>
{error && <p className="form-error">{error}</p>}
<div className="form-actions">
<div className="dialog-actions">
<button
type="button"
className="btn btn-secondary"
@@ -68,7 +68,7 @@ export function WorkspaceFilePanel({ workspaceId }: WorkspaceFilePanelProps) {
return (
<div className="files-tab">
{status && (
<div className="git-toolbar">
<div className="card card-md git-toolbar">
<div className="git-toolbar-status">
{status.modified.length > 0 && (
<span className="status-modified">
@@ -114,7 +114,7 @@ export function WorkspaceFilePanel({ workspaceId }: WorkspaceFilePanelProps) {
</div>
)}
<div className="files-split">
<div className="file-tree">
<div className="card card-md file-tree">
{currentPath && (
<button
className="tree-entry tree-up"
@@ -141,7 +141,7 @@ export function WorkspaceFilePanel({ workspaceId }: WorkspaceFilePanelProps) {
</button>
))}
</div>
<div className="file-viewer">
<div className="card card-md file-viewer">
{selectedPath ? (
<>
<div className="file-viewer-header">
@@ -28,7 +28,7 @@ export function WorkspaceGitPanel({ workspaceId }: WorkspaceGitPanelProps) {
{error && <p className="error-text">{error}</p>}
<div className="commit-history">
{history.map((commit) => (
<div key={commit.hash} className="commit-row">
<div key={commit.hash} className="card card-sm commit-row">
<span className="commit-hash">{commit.hash.slice(0, 7)}</span>
<span className="commit-message">{commit.message}</span>
<span className="commit-author">{commit.author}</span>
@@ -11,7 +11,7 @@ export function WorkspaceSettingsPanel({
}: WorkspaceSettingsPanelProps) {
return (
<div className="settings-tab">
<div className="settings-section">
<div className="card card-lg settings-section">
<h3>Workspace Info</h3>
<div className="form-group">
<label>Name</label>
@@ -18,7 +18,7 @@ export function WorkspaceToolsPanel({ workspace }: WorkspaceToolsPanelProps) {
<div className="tools-tab">
{loading && <p className="muted">Loading instances...</p>}
{instances.length === 0 ? (
<div className="empty-state-card">
<div className="card card-lg empty-state-card">
<Icon name="terminal" size="lg" />
<h3>No tools running</h3>
<p>Start a tool to begin coding in this workspace</p>
@@ -62,8 +62,8 @@ export function WorkspaceToolsPanel({ workspace }: WorkspaceToolsPanelProps) {
</>
)}
{showModal && (
<div className="modal-overlay" onClick={() => setShowModal(false)}>
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
<div className="dialog-overlay" onClick={() => setShowModal(false)}>
<div className="dialog" onClick={(e) => e.stopPropagation()}>
<h3>Start Tool</h3>
<ToolStarter
workspace={workspace}
+2 -2
View File
@@ -107,7 +107,7 @@ export const GitHistoryPage = () => {
{commits.map((commit) => (
<div
key={commit.hash}
className={`commit-item ${selectedCommit === commit.hash ? "selected" : ""}`}
className={`card card-sm commit-item ${selectedCommit === commit.hash ? "selected" : ""}`}
onClick={() => void handleCommitClick(commit.hash)}
role="button"
tabIndex={0}
@@ -146,7 +146,7 @@ export const GitHistoryPage = () => {
</div>
{selectedCommit && (
<div className="commit-detail-panel">
<div className="card card-lg commit-detail-panel">
<div className="detail-header">
<h3>Commit Details</h3>
<button className="ghost-button" onClick={handleCloseDetail} type="button">
+4 -4
View File
@@ -120,10 +120,10 @@ export function WorkspacesPage() {
{startWorkspace && (
<div
className="modal-overlay"
className="dialog-overlay"
onClick={() => setStartWorkspace(null)}
>
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
<div className="dialog" onClick={(e) => e.stopPropagation()}>
<h3>Start Tool</h3>
<ToolStarter
workspace={startWorkspace}
@@ -202,8 +202,8 @@ export function WorkspacesPage() {
)}
{startWorkspace && (
<div className="modal-overlay" onClick={() => setStartWorkspace(null)}>
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
<div className="dialog-overlay" onClick={() => setStartWorkspace(null)}>
<div className="dialog" onClick={(e) => e.stopPropagation()}>
<h3>Start Tool</h3>
<ToolStarter
workspace={startWorkspace}
+131 -134
View File
@@ -255,8 +255,27 @@
.card {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
padding: 1rem;
border-radius: var(--radius-md);
}
.card-sm {
padding: var(--space-3);
}
.card-md {
padding: var(--space-4);
}
.card-lg {
padding: var(--space-5);
}
.card-elevated {
box-shadow: var(--shadow-sm);
}
.card-borderless {
border-color: transparent;
}
.card-label {
@@ -387,40 +406,129 @@
margin: 0;
}
/* ─── Dialog / Modal System ───
* .dialog-* is the canonical implementation.
* .modal-overlay and .modal-content are deprecated aliases kept for backward compatibility.
*/
.dialog-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.35);
display: grid;
place-content: center;
z-index: 50;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
padding: var(--space-4);
background: rgba(0, 0, 0, 0.45);
backdrop-filter: blur(2px);
}
.modal-overlay {
/* deprecated alias */
position: fixed;
inset: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
padding: var(--space-4);
background: rgba(0, 0, 0, 0.45);
backdrop-filter: blur(2px);
}
.dialog {
width: 100%;
max-width: 32rem;
max-height: calc(100vh - var(--space-8));
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
padding: var(--space-5);
width: min(560px, 100vw - 2rem);
max-height: min(800px, 100vh - 2rem);
overflow-y: auto;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-xl);
}
.modal-content {
/* deprecated alias */
width: 100%;
max-width: 32rem;
max-height: calc(100vh - var(--space-8));
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-xl);
}
.dialog-lg {
width: min(800px, 100vw - 2rem);
max-width: 48rem;
}
.dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
padding: var(--space-4);
border-bottom: 1px solid var(--border);
}
.dialog-header h2,
.dialog-header h3 {
margin: 0;
font-size: var(--font-size-lg);
line-height: var(--line-height-tight);
}
.dialog-body {
flex: 1;
overflow: auto;
padding: var(--space-4);
}
.dialog-footer,
.dialog-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-3);
padding: var(--space-4);
border-top: 1px solid var(--border);
}
.dialog-close {
display: flex;
align-items: center;
justify-content: center;
width: var(--touch-target);
height: var(--touch-target);
padding: 0;
background: transparent;
border: none;
border-radius: var(--radius-md);
color: var(--muted);
cursor: pointer;
}
.dialog-close:hover {
background: var(--bg);
color: var(--ink);
}
@media (max-width: 767px) {
.dialog {
width: 100vw;
height: 100vh;
max-height: 100vh;
border-radius: 0;
padding: var(--space-4);
.dialog-overlay,
.modal-overlay {
align-items: flex-end;
padding: 0;
}
.dialog-overlay {
padding: 0;
.dialog,
.modal-content {
max-width: 100%;
max-height: calc(100vh - var(--space-6));
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
}
@@ -551,18 +659,8 @@
border-radius: 10px;
}
@media (max-width: 860px) {
.shell-body {
grid-template-columns: 1fr;
}
.shell-nav {
flex-direction: row;
overflow-x: auto;
border-right: 0;
border-bottom: 1px solid var(--border);
}
/* The 860px breakpoint is deprecated; mobile layout is handled at 767px above. */
@media (max-width: 767px) {
.card-grid {
grid-template-columns: 1fr;
}
@@ -641,43 +739,6 @@
font-size: 0.85rem;
}
/* Modal Styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-content {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
padding: 1.5rem;
min-width: 400px;
max-width: 600px;
max-height: 80vh;
overflow: auto;
}
.modal-content h2 {
margin: 0 0 1rem 0;
font-size: 1.25rem;
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
margin-top: 1.5rem;
}
/* Merge Dialog */
.merge-form {
display: flex;
@@ -776,7 +837,7 @@
}
/* Mobile responsiveness */
@media (max-width: 768px) {
@media (max-width: 767px) {
.settings-layout {
flex-direction: column;
gap: 1rem;
@@ -879,65 +940,9 @@
}
/* Commit Dialog */
.dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
padding: 1rem;
}
.commit-dialog {
background: var(--panel);
border-radius: 14px;
width: 100%;
max-width: 600px;
max-height: 90vh;
overflow: auto;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.dialog-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--border);
}
.dialog-header h3 {
margin: 0;
font-size: 1.1rem;
}
.dialog-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--muted);
padding: 0;
width: 2rem;
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
}
.dialog-close:hover {
background: var(--bg);
color: var(--ink);
}
.dialog-body {
padding: 1.5rem;
}
.file-info {
@@ -1012,14 +1017,6 @@
margin-bottom: 1rem;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
padding: 1rem 1.5rem;
border-top: 1px solid var(--border);
}
/* Icon System */
.icon {
display: inline-flex;
+19 -11
View File
@@ -8,7 +8,7 @@
.branch-selector {
padding: 0.45rem 0.7rem;
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
font: inherit;
background: var(--panel);
color: var(--ink);
@@ -37,13 +37,17 @@
display: flex;
gap: 0.75rem;
padding: 0.75rem;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
cursor: pointer;
transition: background-color 0.15s ease;
}
.commit-item,
.commit-item.card-sm {
background: var(--panel);
border: 1px solid var(--border);
}
.commit-item:hover {
background: #ece7df;
}
@@ -84,7 +88,7 @@
color: var(--brand);
background: #f0f7f4;
padding: 0.15rem 0.4rem;
border-radius: 6px;
border-radius: var(--radius-sm);
}
.commit-refs {
@@ -117,14 +121,18 @@
}
.commit-detail-panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
border-radius: var(--radius-lg);
padding: 1.25rem;
overflow-y: auto;
max-height: 70vh;
}
.commit-detail-panel,
.commit-detail-panel.card-lg {
background: var(--panel);
border: 1px solid var(--border);
}
.detail-header {
display: flex;
justify-content: space-between;
@@ -183,7 +191,7 @@
align-items: center;
padding: 0.75rem;
background: #f5f3ee;
border-radius: 10px;
border-radius: var(--radius-md);
}
.stat.additions {
@@ -224,7 +232,7 @@
font-size: 0.85rem;
padding: 0.2rem 0.5rem;
background: #f5f3ee;
border-radius: 6px;
border-radius: var(--radius-sm);
}
.diff-content {
@@ -233,7 +241,7 @@
line-height: 1.5;
background: #f5f3ee;
padding: 0.75rem;
border-radius: 10px;
border-radius: var(--radius-md);
overflow-x: auto;
white-space: pre-wrap;
word-break: break-all;
+12 -4
View File
@@ -18,7 +18,7 @@
color: inherit;
cursor: pointer;
padding: var(--space-2);
border-radius: 10px;
border-radius: var(--radius-md);
flex: 1;
}
@@ -57,8 +57,12 @@
gap: var(--space-3);
padding: var(--space-4);
background: var(--bg);
border-radius: var(--radius-md);
}
.repo-block,
.repo-block.card-md {
border: 1px solid var(--border);
border-radius: 10px;
}
.repo-header {
@@ -85,10 +89,14 @@
flex-direction: column;
gap: var(--space-1);
padding: var(--space-3);
font-size: var(--font-size-sm);
border-radius: var(--radius-md);
}
.workspace-chip,
.workspace-chip.card-sm {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
font-size: var(--font-size-sm);
}
.workspace-chip a {
+1 -2
View File
@@ -11,8 +11,7 @@
gap: var(--space-2);
padding: var(--space-4);
background: var(--bg);
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
}
@media (min-width: 768px) {
+40 -12
View File
@@ -144,11 +144,15 @@
gap: var(--space-3);
padding: var(--space-3);
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
flex-wrap: wrap;
}
.git-toolbar,
.git-toolbar.card-md {
border: 1px solid var(--border);
}
.git-toolbar-status {
display: flex;
gap: var(--space-2);
@@ -209,12 +213,16 @@
.file-tree {
overflow-y: auto;
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
padding: var(--space-3);
background: var(--panel);
}
.file-tree,
.file-tree.card-md {
border: 1px solid var(--border);
}
.tree-entry {
display: flex;
align-items: center;
@@ -244,12 +252,16 @@
.file-viewer {
display: flex;
flex-direction: column;
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
background: var(--panel);
overflow: hidden;
}
.file-viewer,
.file-viewer.card-md {
border: 1px solid var(--border);
}
.file-viewer-header {
display: flex;
justify-content: space-between;
@@ -324,12 +336,16 @@
gap: var(--space-3);
padding: var(--space-3);
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
border-radius: var(--radius-md);
align-items: center;
font-size: var(--font-size-sm);
}
.commit-row,
.commit-row.card-sm {
border: 1px solid var(--border);
}
.commit-hash {
font-family: monospace;
color: var(--brand);
@@ -360,10 +376,14 @@
align-items: center;
gap: var(--space-3);
padding: var(--space-10);
border-radius: var(--radius-lg);
text-align: center;
}
.empty-state-card,
.empty-state-card.card-lg {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
text-align: center;
}
.empty-state-card h3 {
@@ -386,9 +406,13 @@
flex-direction: column;
gap: var(--space-3);
padding: var(--space-4);
border-radius: var(--radius-lg);
}
.instance-card,
.instance-card.card-md {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
}
.instance-card.running {
@@ -405,9 +429,13 @@
flex-direction: column;
gap: var(--space-4);
padding: var(--space-5);
border-radius: var(--radius-lg);
}
.settings-section,
.settings-section.card-lg {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
}
.settings-section h3 {
+13 -13
View File
@@ -18,14 +18,19 @@
flex-direction: column;
gap: var(--space-4);
padding: var(--space-5);
border: 1px solid var(--border);
border-radius: 12px;
background: var(--panel);
transition:
box-shadow 0.15s ease,
border-color 0.15s ease;
}
.workspace-card,
.workspace-card.card-lg {
/* Uses global .card as base; explicit here if class not added to markup */
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
}
.workspace-card:hover {
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
border-color: color-mix(in srgb, var(--border) 80%, var(--brand));
@@ -186,29 +191,23 @@
margin-right: auto;
}
/* Status badges */
.status-badge {
flex-shrink: 0;
font-size: var(--font-size-xs);
font-weight: 600;
padding: var(--space-1) var(--space-2);
border-radius: 999px;
text-transform: capitalize;
}
/* Status badges — use global .status-badge */
.status-ready {
background: var(--success-light);
color: var(--success);
border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.status-syncing {
background: var(--warning-light);
color: var(--warning);
border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}
.status-error {
background: var(--danger-light);
color: var(--danger);
border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
/* Empty state */
@@ -236,6 +235,7 @@
.workspace-card {
padding: var(--space-4);
gap: var(--space-3);
border-radius: var(--radius-md);
}
.workspace-actions {
+14
View File
@@ -0,0 +1,14 @@
# UI Change Review Checklist
When changing styles or components in `apps/web/src`:
- [ ] New layout/spacing uses `--space-*` tokens, not hardcoded px/rem.
- [ ] New type sizes use `--font-size-*` tokens.
- [ ] New radii use `--radius-*` tokens.
- [ ] New shadows use `--shadow-*` tokens.
- [ ] No new inline `style={{...}}` blocks for static layout (computed values are OK).
- [ ] Interactive controls meet `min-height: var(--touch-target)`.
- [ ] `:focus-visible` states are visible and use `--brand`.
- [ ] Mobile layouts are tested down to 375px wide.
- [ ] New class names are defined in a stylesheet before being referenced.
- [ ] Breakpoints use the literal values from `tokens.css` (`480px`, `768px`, `1024px`, `1280px`).
@@ -0,0 +1,375 @@
# OpenSpec Spec: Web UI Consolidation & Polish — Modals, Cards, Breakpoints
## Change
`web-ui-spacing-typography-rework` — Pass 3: Consolidation & Polish
## Parent Proposal
`openspec/proposals/web-ui-spacing-typography-rework.md`
## Parent Specs
- `openspec/specs/web-ui-spacing-typography-rework.md`
- `openspec/specs/web-ui-spacing-typography-rework-pass2.md`
## Status
spec
---
## 1. Scope of This Spec
This spec covers **Pass 3 (Consolidation & Polish)** only:
- Unify the two modal/dialog systems (`.modal-*` and `.dialog-*`).
- Consolidate duplicated card patterns across page CSS files into `global.css` modifiers.
- Standardize responsive breakpoints to the existing token scale (`--bp-sm`, `--bp-md`, `--bp-lg`, `--bp-xl`).
- Add design-system documentation to `tokens.css`.
- Add a lightweight code-review checklist to prevent new inline `style={{...}}` layout declarations and undefined class names.
Out of scope for Pass 3:
- Token additions (Pass 1, done).
- Inline-style refactor in editor components (Pass 2, done).
- Behavior changes or new features.
---
## 2. Modal/Dialog Unification
### Current state
Two separate modal implementations exist:
1. `.dialog-overlay` + `.dialog` / `.dialog-lg` (rounded, centered, responsive)
2. `.modal-overlay` + `.modal-content` (older, square, fixed `min-width: 400px`)
Callers mix both:
- `.modal-overlay` / `.modal-content`: `WorkspacesPage`, `SessionsPage`, `workspace-tools-panel`, `merge-dialog`, `start-tool-modal`, `start-tool-fab`
- `.dialog-overlay` / `.dialog`: `instance-list`, `commit-dialog`, `ProjectDialog`, `repository-create-dialog`
### Target state
Deprecate `.modal-*` and make it a backward-compatible alias to `.dialog-*`.
```css
.modal-overlay {
/* alias */
composes: dialog-overlay; /* plain CSS fallback: duplicate the rule */
}
.modal-content {
/* alias */
composes: dialog; /* plain CSS fallback: duplicate the rule */
}
```
Because plain CSS does not support `composes`, the worker must:
1. Keep `.dialog-overlay` and `.dialog` as the canonical implementation.
2. Make `.modal-overlay` and `.modal-content` duplicate or wrap the same rules.
3. Migrate callers incrementally:
- For components being touched anyway in this pass, replace `.modal-overlay``.dialog-overlay` and `.modal-content``.dialog`.
- For components not being touched, leave the old class names; the aliases keep them working.
### Canonical dialog styles
Ensure `.dialog-overlay` and `.dialog` already in `global.css` cover:
```css
.dialog-overlay {
position: fixed;
inset: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
padding: var(--space-4);
background: rgba(0, 0, 0, 0.45);
backdrop-filter: blur(2px);
}
.dialog {
width: 100%;
max-width: 32rem;
max-height: calc(100vh - var(--space-8));
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-xl);
}
.dialog-lg {
max-width: 48rem;
}
.dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
padding: var(--space-4);
border-bottom: 1px solid var(--border);
}
.dialog-header h2,
.dialog-header h3 {
margin: 0;
font-size: var(--font-size-lg);
line-height: var(--line-height-tight);
}
.dialog-body {
flex: 1;
overflow: auto;
padding: var(--space-4);
}
.dialog-footer,
.dialog-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--space-3);
padding: var(--space-4);
border-top: 1px solid var(--border);
}
.dialog-close {
display: flex;
align-items: center;
justify-content: center;
width: var(--touch-target);
height: var(--touch-target);
padding: 0;
background: transparent;
border: none;
border-radius: var(--radius-md);
color: var(--muted);
cursor: pointer;
}
.dialog-close:hover {
background: var(--bg);
color: var(--ink);
}
```
### Mobile dialog behavior
On viewports narrower than `--bp-md`:
```css
@media (max-width: 767px) {
.dialog-overlay {
align-items: flex-end;
padding: 0;
}
.dialog {
max-width: 100%;
max-height: calc(100vh - var(--space-6));
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
}
```
Note: this breakpoint will be standardized to `--bp-md` in §4.
---
## 3. Card Consolidation
### Current state
Each page CSS file redeclares card-like containers:
- `.repo-block`, `.workspace-chip`, `.instance-card`, `.settings-section`, `.project-card`, `.session-card`, `.config-profile-card`, etc.
- Common pattern: `background: var(--panel); border: 1px solid var(--border); border-radius: 10/12/14px;`.
### Target state
Consolidate into `global.css` card modifiers:
```css
.card {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-md);
}
.card-sm {
padding: var(--space-3);
}
.card-md {
padding: var(--space-4);
}
.card-lg {
padding: var(--space-5);
}
.card-elevated {
box-shadow: var(--shadow-sm);
}
.card-borderless {
border-color: transparent;
}
```
Then update page CSS files to:
1. Use `.card` / `.card-md` / `.card-lg` where the structure is generic.
2. Keep only page-specific layout (e.g. `.history-container` two-column grid, `.sessions-grid` column config).
3. Remove duplicate background/border/border-radius/padding declarations.
### Migration order
Start with the page files that have the most duplication:
1. `styles/pages/workspaces.css`
2. `styles/pages/sessions.css`
3. `styles/pages/ssh-keys.css`
4. `styles/pages/workspace-detail.css`
5. `styles/pages/projects.css` (if it has card-like patterns)
6. `styles/pages/git-history.css`
Leave `styles/pages/sessions.css` option-menu styles untouched; they are component-specific, not card patterns.
---
## 4. Breakpoint Standardization
### Current state
Breakpoints are inconsistent:
- `767px` (max-width)
- `768px` (min-width)
- `860px` (max-width, one-off in `.shell-body`)
- `1024px` (min-width)
The token scale already defines:
```css
--bp-sm: 480px;
--bp-md: 768px;
--bp-lg: 1024px;
--bp-xl: 1280px;
```
### Target state
1. Remove the `860px` one-off breakpoint.
2. Standardize all media queries to use `--bp-md` (`768px`) for mobile/desktop split.
3. Prefer mobile-first `min-width` queries for new/refactored rules.
4. For existing `max-width: 767px` rules, convert to `max-width: 767px` (equivalent to `--bp-md - 1px`) or refactor to mobile-first `min-width: 768px` where the logic is clearer.
Because CSS custom properties cannot be used directly in `@media` queries, document the pixel values in a comment and use the literal values `480px`, `768px`, `1024px`, `1280px`.
### Specific changes
- `global.css` line 554: remove `@media (max-width: 860px)` and make `.shell-body` collapse at `767px` only.
- `global.css` line 779: change `max-width: 768px` to `max-width: 767px` for consistency.
- Page CSS files: update any `767px`/`768px` queries to be consistent with the chosen direction.
### Recommended mobile-first pattern
For refactored rules, prefer:
```css
.my-component {
/* mobile first */
padding: var(--space-3);
}
@media (min-width: 768px) {
.my-component {
padding: var(--space-4);
}
}
```
For existing rules that are desktop-first, keep `max-width: 767px` with a comment linking to `--bp-md`.
---
## 5. Token Documentation
Add a documentation block at the top of `apps/web/src/styles/tokens.css`:
```css
/*
* Headquarter Design Tokens
*
* Naming convention:
* --space-* : 4px-based spacing scale (1 = 4px, 2 = 8px, ...)
* --font-size-*: fluid type scale from xs to 2xl
* --radius-* : border radius (sm/md/lg/xl/full)
* --shadow-* : elevation shadows (sm/md/lg/xl)
* --line-height-*: text line heights
* --bp-* : responsive breakpoints (use literal px in @media)
*
* Prefer these tokens over hardcoded px/rem values in all new CSS.
*/
```
---
## 6. Code Review Checklist
Add a lightweight markdown file at `docs/development/ui-review-checklist.md`:
```markdown
# UI Change Review Checklist
When changing styles or components in `apps/web/src`:
- [ ] New layout/spacing uses `--space-*` tokens, not hardcoded px/rem.
- [ ] New type sizes use `--font-size-*` tokens.
- [ ] New radii use `--radius-*` tokens.
- [ ] New shadows use `--shadow-*` tokens.
- [ ] No new inline `style={{...}}` blocks for static layout (computed values are OK).
- [ ] Interactive controls meet `min-height: var(--touch-target)`.
- [ ] `:focus-visible` states are visible and use `--brand`.
- [ ] Mobile layouts are tested down to 375px wide.
- [ ] New class names are defined in a stylesheet before being referenced.
- [ ] Breakpoints use the literal values from `tokens.css` (`480px`, `768px`, `1024px`, `1280px`).
```
---
## 7. Acceptance Criteria
- [ ] `.modal-overlay` and `.modal-content` are aliases/wrappers of `.dialog-overlay` and `.dialog`.
- [ ] At least two `.modal-*` callers are migrated to `.dialog-*`.
- [ ] Dialog mobile behavior (slide-up sheet) is implemented.
- [ ] `.card`, `.card-sm`, `.card-md`, `.card-lg`, `.card-elevated` exist in `global.css`.
- [ ] At least two page CSS files have duplicated card rules removed.
- [ ] The `860px` breakpoint is removed.
- [ ] All media queries use `480px`, `768px`, `1024px`, or `1280px` consistently.
- [ ] `tokens.css` has a documentation header.
- [ ] `docs/development/ui-review-checklist.md` exists.
- [ ] `npm run typecheck` passes in `apps/web`.
- [ ] `npm run lint` passes in `apps/web`.
---
## 8. Verification Plan
1. Run `cd apps/web && npm run typecheck`.
2. Run `cd apps/web && npm run lint`.
3. Search for `.modal-overlay` and `.modal-content` in `apps/web/src`; confirm they are aliases or have fewer direct callers.
4. Search for `860px`; confirm zero matches.
5. Search for card-like duplicated rules in page CSS; confirm reductions.
6. Open a dialog on desktop and mobile viewport and verify behavior.
7. Confirm `tokens.css` has documentation header.
8. Confirm `docs/development/ui-review-checklist.md` exists.
---
## 9. Next Phase
After this spec is approved, create **tasks** for Pass 3 implementation, then delegate to `sdd-apply`. After Pass 3 is complete, archive the OpenSpec change.
@@ -0,0 +1,84 @@
# OpenSpec Tasks: Web UI Consolidation & Polish — Modals, Cards, Breakpoints
## Change
`web-ui-spacing-typography-rework` — Pass 3: Consolidation & Polish
## Parent Spec
`openspec/specs/web-ui-spacing-typography-rework-pass3.md`
## Status
tasks
---
## Implementation Tasks
- [x] 1. Unify modal/dialog system in `apps/web/src/styles/global.css`
- Ensure `.dialog-overlay`, `.dialog`, `.dialog-lg`, `.dialog-header`, `.dialog-body`, `.dialog-footer`, `.dialog-actions`, `.dialog-close` are canonical
- Add `.modal-overlay` and `.modal-content` as aliases/wrappers
- Add mobile dialog slide-up behavior at `767px`
- [x] 2. Migrate at least two `.modal-*` callers to `.dialog-*`
- Candidates: `components/features/tool/start-tool-modal.tsx`, `components/features/workspace/workspace-tools-panel.tsx`, `components/features/git/merge-dialog.tsx`, `pages/WorkspacesPage.tsx`, `pages/SessionsPage.tsx`, `components/features/tool/start-tool-fab.tsx`
- [x] 3. Consolidate card patterns in `apps/web/src/styles/global.css`
- `.card`, `.card-sm`, `.card-md`, `.card-lg`, `.card-elevated`, `.card-borderless`
- [x] 4. Remove duplicated card rules from page CSS files
- `styles/pages/workspaces.css`
- `styles/pages/sessions.css`
- `styles/pages/ssh-keys.css`
- `styles/pages/workspace-detail.css`
- `styles/pages/projects.css`
- `styles/pages/git-history.css`
- [x] 5. Standardize breakpoints
- Remove `860px` breakpoint from `global.css`
- Make `global.css` line 779 use `767px` instead of `768px`
- Ensure all `@media` queries use `480px`, `767px`, `768px`, `1024px`, or `1280px`
- Prefer mobile-first `min-width: 768px` for refactored rules
- [x] 6. Add token documentation header to `apps/web/src/styles/tokens.css`
- [x] 7. Create `docs/development/ui-review-checklist.md`
- [x] 8. Verification
- Run `cd apps/web && npm run typecheck`
- Run `cd apps/web && npm run lint`
- Search for `860px` in `apps/web/src`; confirm zero matches
- Search for `.modal-overlay` / `.modal-content`; confirm they are aliases or have fewer direct callers
- Open a dialog on desktop and mobile viewport and verify behavior
- Confirm `tokens.css` documentation header exists
- Confirm `docs/development/ui-review-checklist.md` exists
- [x] 9. Update OpenSpec artifacts
- Mark tasks in `openspec/tasks/web-ui-spacing-typography-rework-pass3.md` complete
- Add final report note
- [x] 10. Archive OpenSpec change
- Move `openspec/proposals/`, `openspec/specs/`, `openspec/tasks/` files for this change to `openspec/changes/archive/web-ui-spacing-typography-rework/` (or current archive structure)
- Update `progress.md` if applicable
---
## Acceptance Criteria
- All tasks above are completed.
- `npm run typecheck` passes.
- `npm run lint` passes.
- `.modal-overlay` and `.modal-content` are aliases/wrappers of `.dialog-*`.
- At least two `.modal-*` callers migrated to `.dialog-*`.
- `.card` family exists and is used by at least two page CSS files.
- `860px` breakpoint removed.
- `tokens.css` has documentation header.
- `docs/development/ui-review-checklist.md` exists.
- OpenSpec change archived.
---
## Notes
- Keep aliases for backward compatibility; do not delete `.modal-*` classes if other callers remain.
- Do not change behavior of dialogs; only visual unification.
- Do not remove page-specific layout grids; only remove duplicated card-like background/border/padding.
- Prefer one commit per major area (modals, cards, breakpoints, docs).
+35
View File
@@ -0,0 +1,35 @@
Implemented Pass 1 (Foundations) of the web UI spacing/typography/visual-rhythm rework.
**Changed files:**
- `apps/web/src/styles/tokens.css` — expanded spacing, radius, line-height, shadow, layout, touch-target, sidebar-width, mobile-nav-height tokens; added documentation header.
- `apps/web/src/styles/global.css` — added primitive classes: `.btn`/`.btn-primary`/`.btn-secondary`/`.btn-sm`/`.btn-icon`/`.btn-danger`, `.link-button`, `.form-input`/`.form-textarea`, `.checkbox-label`/`.checkbox-label-compact`, `.hint`, `.form-error`/`.error-message`, `.alert`/`.alert-error`/`.alert-warning`/`.alert-info`, `.loading-state`, `.badge`/`.badge-success`/`.badge-secondary`, `.text-muted`, `.profile-avatar-section`/`.avatar-*`, `.mobile-detail-back`, `.button-secondary` alias; added `:focus-visible` rings for `.nav-item`, `.mobile-nav-item`, `.tab`, `.tree-entry`, `.btn`, `.form-input`, `.form-textarea`, `.link-button`.
- `apps/web/src/styles/utilities.css` — added `.mobile-detail-*` view classes, `.mobile-list-search`/`.mobile-list-search-input`, SSH key `.key-signing`/`.key-verification`/`.signature-result`/`.verify-result`, profile mobile avatar classes, replaced hard-coded `64px` and `44px` values with `--mobile-nav-height`/`--touch-target`, and removed a redundant `.mobile-nav-item` override.
- `apps/web/src/components/features/config-profiles/ConfigProfileListSidebar.tsx` — replaced inline `0.7rem` styles with `.badge`/`.badge-secondary`; added `.delete-btn`.
- `apps/web/src/components/features/config-profiles/ConfigProfileEditorPanel.tsx` — switched Discard button to `.button-secondary` alias.
- `apps/web/src/components/features/tool/instance-list.tsx` — replaced inline checkbox styles with `.checkbox-label-compact`.
- OpenSpec artifacts: `openspec/proposals/web-ui-spacing-typography-rework.md`, `openspec/specs/web-ui-spacing-typography-rework.md`, `openspec/tasks/web-ui-spacing-typography-rework.md` (tasks marked done).
- `ui-audit-spacing-typography.md` audit report.
**Commits (on `feat/web-ui-foundations`, merged into `dev`):**
1. `feat(web/ui): expand design tokens and add primitive component styles`
2. `feat(web/ui): add mobile detail/search, ssh/profile utilities and nav-height tokens`
3. `feat(web/ui): replace inline font-size violations and use new primitives in components`
4. `docs(openspec): add web ui spacing/typography proposal, spec, tasks and audit`
5. `docs(openspec): mark pass 1 tasks complete`
**Validation:**
- `npm run typecheck` passes.
- `npm run lint` passes.
- `npm run build` passes (only pre-existing chunk-size warnings).
- Class coverage check: 486 classes referenced across `src/`; only false-positive `page` lacks a rule. All audit-listed missing classes now have rules.
- Spot-checked mobile detail view, SSH key signing/verification, profile avatar classes, and mobile nav/FAB height token usage — all present.
**Open risk/question:**
- Push to `origin dev` is blocked by the runtime safety policy because the required override disables SSH host-key checking (`StrictHostKeyChecking=no`). The merge is complete locally and `dev` is ready.
**Recommended next step:**
- Run the push from the parent session or approve the blocked command:
```bash
cd /home/user/headquarter && GIT_SSH_COMMAND='ssh -i ~/.ssh/id_ed25519_headquarter -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes' git push origin dev
```
- After push, proceed to Pass 2 (Component Cleanup) or handle other requests.