feat(web): merge Grid route into Pipeline as view toggle (UC-2) #267
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!267
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/263"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
?view=list|gridsearch param to/monitor; malformed values fall back to list silently/monitor/gridto a redirect that preserves all filter params and forwards to/monitor?view=grid&…FilterBar(role=tablist, aria-selected, keyboard-accessible); toggle usesreplace: trueso back button doesn't stack history entriesonPipelineStagecallback into sharedusePipelineSSE(queryClient)hook — single route, one handlerAppShellTest plan
validateSearchunit tests:view=gridaccepted,view=listdropped (default implied),view=xyzdropped (fallback to list)beforeLoadthrows redirect to/monitorwithview=grid+ all filter params preservedonViewChangeprovided,aria-selectedcorrect, click callbacks fire,role=tablistpresent/app/monitor/grid?repo=…&risk=1→/app/monitor?view=grid&repo=…&risk=1, grid rendersCloses #263
🤖 Generated with Claude Code
Review — UC-2 Grid→Pipeline view toggle
CI green (run #1941, 4m9s). All acceptance criteria met. Two minor nits below; neither is a blocker.
✅ Acceptance criteria
/monitorgainsview?: "list" | "grid"— malformed values dropped<PipelineList>/<PipelineGrid>based on?view=/monitor/grid→ redirect preserving all filter paramsPipelineSearchvalidator removedrole="tablist",aria-selected,replace: trueusePipelineSSE(queryClient)shared hook — no duplicateonPipelineStagecallbacksapp-shell.tsxdrops the Grid nav entryvalidateSearchunit testsbeforeLoadunit testspipeline-list.test.tsx+90 lines)Nit 1 —
lib/imports fromroutes/(layering inversion)File:
apps/web/src/lib/pipeline-sse.ts, line 2patchPipelineStageis a pure data transformation with no route or React deps, but its home is a route component file. This creates alib → routesdependency direction that's the reverse of the normal flow and could create awkward test-setup requirements if the route ever gains heavier React imports.Suggested fix (non-blocking): move
patchPipelineStageintoapps/web/src/lib/pipeline-cache.ts(or similar) and import it from there in bothmonitor.index.tsxandpipeline-sse.ts. The existingexport+__testablespattern in the route can then be removed.Nit 2 —
handleViewChangespreadsprev, risking?state=openURL noiseFile:
apps/web/src/routes/monitor.index.tsx,handleViewChangecallbackhandleFilterChangecarefully avoids writingstate=openback to the URL (if (state && state !== "open") next.state = state).handleViewChangespreadsprevverbatim, so a user who arrived via an explicit?state=openbookmark and then toggles the view will get?state=openadded to the new URL. Minor noise, not a functional bug —validateSearchhandles it correctly — but it's inconsistent with howhandleFilterChangecleans the URL.Suggested fix (non-blocking): apply the same field-by-field reconstruction inside
handleViewChange, or factor the "build clean PipelineSearch from prev" logic into a shared helper called by both callbacks.Overall
Clean, well-scoped implementation. The redirect approach (keep the route file, gut the logic, throw from
beforeLoad) is the right move for TanStack Router's file-based routing. TheusePipelineSSEextraction correctly usessetQueriesDatawith the prefix key to patch all cached pipeline queries in one shot. Approved.