FE-578: UI refinements; design adaptations & alignments#42
Conversation
FE-578 UI refinements; design adaptations & alignments
Port design tokens, layout primitives, card patterns, and component iteration environment from the parallel |
🤖 Augment PR SummarySummary: Implements slice-17 UI refinements and transport hardening across the knowledge/interview workspaces. Changes:
Technical Notes: Most client/server JSON boundaries are now validated via shared Zod schemas; observer-driven entity refresh is now handled via an explicit fetch + local state instead of React Query invalidation. 🤖 Was this summary useful? React with 👍 or 👎 |
| @@ -28,47 +35,90 @@ async function fetchWorkspaceEntities(projectId: number): Promise<EntitiesData> | |||
| return response.json(); | |||
There was a problem hiding this comment.
src/client/workspace/workspace-data.ts:35 — fetchWorkspaceEntities() returns response.json() without validating against entitiesDataSchema, so a malformed entities payload could slip past the new transport contracts and break downstream assumptions. Consider parsing this refresh response the same way the route loader does so observer-triggered refreshes get the same safety guarantees.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| export const requirementEntitySchema = z.object({ | ||
| id: z.number().int().positive(), | ||
| project_id: z.number().int().positive(), | ||
| kind: knowledgeItemKindSchema, |
There was a problem hiding this comment.
src/shared/api-types.ts:108 — requirementEntitySchema.kind currently accepts any KnowledgeKind, which means a server regression could return the wrong kind and still pass validation. Other locations where this applies: src/shared/api-types.ts:118.
Severity: low
Other Locations
src/shared/api-types.ts:118
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| relationships: z.array(entityRelationshipSchema), | ||
| }); | ||
|
|
||
| export const exportLoaderDataSchema = z.object({ |
There was a problem hiding this comment.
src/shared/api-types.ts:171 — exportLoaderDataSchema allows { ready: true } with no markdown, which can let an inconsistent export payload through validation and force every consumer to defensively check both fields. Consider modeling this as a discriminated union so validation fails fast if ready: true ever arrives without markdown.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| const displayLabel = edgeLabel.charAt(0).toUpperCase() + edgeLabel.slice(1); | ||
| const targetText = edge.targetLabel ?? `item #${edge.targetId}`; | ||
| return ( | ||
| <div key={i} className="rounded-lg bg-white p-3 text-sm shadow-[var(--shadow-card-ring)]"> |
There was a problem hiding this comment.
src/client/components/knowledge-card.tsx:182 — Using the array index (key={i}) for edges can lead to React reconciliation bugs if the edges list ever reorders or inserts, causing connection rows to display stale data. Other locations where this applies: src/client/components/knowledge-card.tsx:249.
Severity: low
Other Locations
src/client/components/knowledge-card.tsx:249
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| - Invariants to respect: → SPEC.md §Invariants I24, I44, I48 | ||
| - Acceptance: Inter font renders across all routes; color ramp matches Figma reference values; StageSidebar collapses to PhaseSidebar and back; resizable panels work in interview and knowledge workspaces; at least one Ladle story renders with shared design tokens; question card shows inline `why` with collapsible answered state; empty states appear for all unpopulated sections; skeleton loading renders during route transitions | ||
| - **Verification approach**: inner — Ladle stories as visual regression surface; existing workspace seam tests pass after layout migration. Outer — manual walkthrough comparing rendered UI against Figma reference screens. | ||
| 17. **UI refinement + design-system alignment** `done` |
There was a problem hiding this comment.
PR metadata: the PR title doesn’t match the repo naming convention for stacked slice branches (it should be {ISSUE-ID}: {Linear title} per (Rule: AGENTS.md)). Consider renaming the PR title to the expected FE-* format so it stays traceable to Linear.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Add card-within-card pattern components (KnowledgeGroupCard, KnowledgeDetailCard, KnowledgeRow) with Figma design tokens, status badges (KindBadge, ReviewBadge, CountBadge), and MetadataRow. Add scroll-area, resizable, and skeleton shadcn primitives. All patterns verified via Ladle stories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace basic list view with KnowledgeGroupCard (white header / tinted edges body), kind badges, review badges, count badges, progress bars, and empty-state cards for kinds with no items. Edge labels resolve to content text via content map. ScrollArea wraps the workspace. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
InterviewWorkspace conversation + entity sidebar now use ResizablePanelGroup (65/35 default split, adjustable via handle). Route transitions show skeleton loading for interview and knowledge workspaces via TanStack Router pendingComponent. KnowledgeWorkspace edge labels resolve to content text and show only outgoing edges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tool JSON now renders via plain <pre><code> instead of CodeBlock with shiki highlighting. The /debug showcase route is replaced by a Ladle story for AI Elements components. shiki is eliminated from all production build chunks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
415deb1 to
09d47d7
Compare

feat: knowledge card components + shadcn primitives for slice 17
Add card-within-card pattern components (KnowledgeGroupCard,
KnowledgeDetailCard, KnowledgeRow) with Figma design tokens,
status badges (KindBadge, ReviewBadge, CountBadge), and
MetadataRow. Add scroll-area, resizable, and skeleton shadcn
primitives. All patterns verified via Ladle stories.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
feat: integrate card-within-card pattern into KnowledgeWorkspace
Replace basic list view with KnowledgeGroupCard (white header / tinted
edges body), kind badges, review badges, count badges, progress bars,
and empty-state cards for kinds with no items. Edge labels resolve to
content text via content map. ScrollArea wraps the workspace.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
feat: resizable panels, skeleton loading, and route integration
InterviewWorkspace conversation + entity sidebar now use
ResizablePanelGroup (65/35 default split, adjustable via handle).
Route transitions show skeleton loading for interview and knowledge
workspaces via TanStack Router pendingComponent. KnowledgeWorkspace
edge labels resolve to content text and show only outgoing edges.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
chore: mark slice 17 done in PLAN.md
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
test: characterize workspace and transport seams
refactor: add explicit shared transport contracts
refactor: parse workspace transport payloads through shared contracts
refactor: make turn-response and review payloads explicit
refactor: add explicit boundary return types
refactor: reset chat state at the project boundary
refactor: make route transitions own entity hydration
refactor: make workspace contracts readonly
feat: remove debug route, decouple shiki from production bundle
Tool JSON now renders via plain