feat(web): port Home page from platform repo, wire up React Query + HeyAPI client#31061
feat(web): port Home page from platform repo, wire up React Query + HeyAPI client#31061ashleeradka wants to merge 1 commit into
Conversation
…eyAPI client Part of LUM-1601 - Wire up QueryClientProvider in main.tsx with configured QueryClient - Add HeyAPI client singleton (src/lib/api-client.ts) for daemon endpoints - Add API error utilities (src/lib/api-errors.ts) - Port avatar system: types, API, SVG compositor, useAssistantAvatar hook, AnimatedAvatar + ChatAvatar components - Port Home domain: types, API layer, feed utils, useHomeFeedQuery + useHomeStateQuery hooks, all page components (greeting header, suggestion pills, feed list, filter bar, recap rows, detail panel) - Port shared components: ResizablePanel, useIsMobile hook - Enhance design library Button: add outlined variant, compact size, leftIcon/rightIcon/iconOnly props with proper Tailwind styling - Add /home route in routes.tsx - All files follow new repo conventions: kebab-case filenames, no 'use client' directives, no Next.js imports, .js extension imports Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "@hey-api/client-fetch": "^0.13.1", | ||
| "@tanstack/react-query": "5.90.21", | ||
| "@vellum/design-library": "file:../../packages/design-library", | ||
| "lucide-react": "^1.16.0", | ||
| "motion": "^12.39.0", |
There was a problem hiding this comment.
🟡 bun.lock workspace section has ^ prefixes inconsistent with exact-pinned package.json
The bun.lock workspace dependencies section records "^0.13.1", "^1.16.0", and "^12.39.0" for the three newly added packages, while package.json correctly has exact versions ("0.13.1", "1.16.0", "12.39.0"). This indicates the lockfile was generated from a state where package.json had ^ prefixes (violating the exact-pinning rule in AGENTS.md), and the lockfile was never regenerated after correcting the package.json. The root bunfig.toml sets [install] exact = true, so this should not have occurred if bun add --exact was used. The lockfile needs to be regenerated via bun install to bring it into sync with the package.json constraints.
Prompt for agents
The bun.lock file's workspace section shows caret (^) version ranges for @hey-api/client-fetch, lucide-react, and motion, but the package.json correctly pins these to exact versions. This discrepancy means the lockfile was generated when the package.json still had ^ prefixes. To fix: run `cd apps/web && bun install` to regenerate the lockfile from the current (correct) package.json. This will update the workspace section in bun.lock to show exact versions matching package.json. The root bunfig.toml has [install] exact = true which should prevent this in the future when using `bun add`.
Was this helpful? React with 👍 or 👎 to provide feedback.
| function parsePathNumbers(d: string): number[] { | ||
| const nums: number[] = []; | ||
| const re = /-?\d+\.?\d*(?:e[+-]?\d+)?/gi; | ||
| let m: RegExpExecArray | null; | ||
| while ((m = re.exec(d)) !== null) { | ||
| nums.push(parseFloat(m[0])); | ||
| } | ||
| return nums; | ||
| } |
There was a problem hiding this comment.
🚩 SVG path number regex may misparse compact SVG notation
The regex /-?\d+\.?\d*(?:e[+-]?\d+)?/gi in parsePathNumbers and wobblePath requires at least one digit before an optional decimal (\d+\.?\d*). SVG path data allows numbers starting with just a decimal point (e.g., .5 meaning 0.5), which this regex won't match. Additionally, compact notation like 1.5.3 (meaning coordinates 1.5 and 0.3) would be parsed as 1.5 and 3 instead of 1.5 and 0.3, producing a 10x wobble error on the second coordinate. This only matters if bodyShape.svgPath from the server uses such compact notation. If paths are generated with explicit leading zeros (e.g., 0.3), this is a non-issue.
Was this helpful? React with 👍 or 👎 to provide feedback.
Part of LUM-1601
Why
The web app migration from
vellum-assistant-platform(Next.js) tovellum-assistant(Vite + React Router v7) requires moving feature domains incrementally. The Home page is the first real feature domain to land, chosen because it:QueryClientProvider+ HeyAPI client config, completing the runtime half of LUM-1601 with a real consumer (not premature infrastructure)*Options()hooks or the full codegen pipelineWhat changed
Infrastructure (LUM-1601 runtime wiring)
src/lib/query-client.ts— ConfiguredQueryClientsingletonsrc/lib/api-client.ts— HeyAPIcreateClientsingleton for daemon endpoints (docs)src/lib/api-errors.ts—assertHasResponseutility for narrowing HeyAPI response typessrc/main.tsx—QueryClientProviderwrapping the routerAvatar domain (
src/domains/avatar/)useAssistantAvatarhookAnimatedAvatar+ChatAvatarcomponents (src/components/avatar/)Home domain (
src/domains/home/)FeedItem,HomeFeedResponse,RelationshipState, etc.fetchHomeFeed,fetchRelationshipState,updateFeedItemStatus,triggerFeedActionuseHomeFeedQuery(with optimistic updates + visibility-change refetch),useHomeStateQuerysortFeedItems,groupByTime,filterByCategory,excludeHighUrgency,getPresentCategoriesHomePage,HomeGreetingHeader,HomeSuggestionPillBar,HomeFeedList,HomeFeedFilterBar,HomeRecapRow,HomeDetailPanel,HomeGenericDetail,HomeToolPermissionCardShared utilities
src/hooks/use-is-mobile.ts—useSyncExternalStore-based media query hooksrc/components/resizable-panel.tsx— Draggable split-pane with pointer capture + localStorage persistenceDesign library enhancement
packages/design-library/src/components/button.tsx— Addedoutlinedvariant,compactsize,leftIcon/rightIcon/iconOnlyprops with proper Tailwind styling (previously had placeholdervdl-btn-*classes with no CSS definitions)Routing
/homeroute inroutes.tsxConvention compliance applied during the move
"use client"directives (Vite SPA, not needed).jsextensions (NodeNext module resolution)AppImagereplaced with plain<img>)@vellum/design-library/components/*hooks/,components/,lib/per CONVENTIONS.mddomains/home/anddomains/avatar/^or~)Safety
main.tsx(QueryClientProvider wrapper),routes.tsx(new route), andpackage.json(new deps)Test plan
bun run lint— passesbun run typecheck— passes (only pre-existing error)Link to Devin session: https://app.devin.ai/sessions/536ceadb023a4059908b0609b9833bc1
Requested by: @ashleeradka