Replace mock-only goals behavior with live API-backed create/edit/archive flows in GoalsView. - load goals from GET /api/goals when initial goals are not injected - add inline create form that POSTs goals and handles active-goal cap 409 errors - add per-goal edit form that PATCHes title/description changes - add archive/unarchive actions wired to archive endpoints with inline error handling - refresh GoalsView docs and expand component tests for loading, CRUD, cap errors, and status transitions Files changed: docs/dashboard-guide.md | 18 +- packages/dashboard/app/components/GoalsView.css | 52 ++- packages/dashboard/app/components/GoalsView.tsx | 402 +++++++++++++++++---- packages/dashboard/app/components/__tests__/GoalsView.test.tsx | 250 +++++++++++-- 4 files changed, 600 insertions(+), 122 deletions(-) Fusion-Task-Id: FN-5649 Fusion-Task-Lineage: b787c8e3-64c5-4243-ae84-0f20f12ea09e
145 lines
2.3 KiB
CSS
145 lines
2.3 KiB
CSS
.goals-view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-lg);
|
|
padding: var(--space-lg);
|
|
}
|
|
|
|
.goals-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: var(--space-md);
|
|
}
|
|
|
|
.goals-title {
|
|
margin: 0;
|
|
color: var(--text);
|
|
font-size: calc(var(--space-lg) + var(--space-xs));
|
|
}
|
|
|
|
.goals-count {
|
|
margin: 0;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.goals-add-button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.goals-add-button:focus-visible,
|
|
.goals-card:focus-visible,
|
|
.goals-activate-button:focus-visible {
|
|
outline: none;
|
|
box-shadow: var(--focus-ring-strong);
|
|
}
|
|
|
|
.goals-warning {
|
|
margin: 0;
|
|
padding: var(--space-md);
|
|
border-radius: var(--radius-md);
|
|
border: calc(var(--space-xs) / 4) solid var(--color-warning);
|
|
background: color-mix(in srgb, var(--color-warning) 10%, transparent);
|
|
color: var(--color-warning);
|
|
}
|
|
|
|
.goals-error {
|
|
margin: 0;
|
|
}
|
|
|
|
.goals-form {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.goals-form-label {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.goals-form textarea.input {
|
|
min-height: calc(var(--space-2xl) * 2);
|
|
resize: vertical;
|
|
}
|
|
|
|
.goals-form-actions {
|
|
display: flex;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.goals-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-md);
|
|
}
|
|
|
|
.goals-card {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-md);
|
|
}
|
|
|
|
.goals-card-archived {
|
|
border-color: color-mix(in srgb, var(--text-muted) 25%, transparent);
|
|
}
|
|
|
|
.goals-card-main {
|
|
min-width: 0;
|
|
}
|
|
|
|
.goals-card-edit {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.goals-card-title {
|
|
margin: 0;
|
|
color: var(--text);
|
|
font-size: calc(var(--space-md) + var(--space-xs));
|
|
}
|
|
|
|
.goals-card-description {
|
|
margin: var(--space-xs) 0 0;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.goals-card-status {
|
|
margin: var(--space-xs) 0 0;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.goals-card-actions {
|
|
display: flex;
|
|
gap: var(--space-sm);
|
|
}
|
|
|
|
.goals-activate-button {
|
|
min-width: calc(var(--space-2xl) * 2);
|
|
}
|
|
|
|
.goals-empty {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.goals-header {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.goals-card {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.goals-form-actions,
|
|
.goals-card-actions {
|
|
flex-direction: column;
|
|
}
|
|
}
|