Split dashboard page.tsx into hooks + consolidate source config#24
Merged
teallarson merged 5 commits intomainfrom Mar 10, 2026
Merged
Split dashboard page.tsx into hooks + consolidate source config#24teallarson merged 5 commits intomainfrom
teallarson merged 5 commits intomainfrom
Conversation
- Extract 3 custom hooks (use-arcade-connection, use-source-check, use-plan-stream) from the 585-line page.tsx, reducing it to ~350 lines - Add lib/sources.ts as single source of truth for source config (icon, label, color, tool-name pattern per source); adding a new integration is now a one-line change - Remove KNOWN_SERVICE regex gate from plan route so tools from any service pass through to the LLM (not just the 5 hardcoded ones) - Open ItemSource type to accept any string while preserving autocomplete - Deduplicate ConfigWarning type into types/dashboard.ts - Update task-card, stats-bar, source-auth-gate to import from lib/sources Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ation - useArcadeConnection: internalize useRouter, extract shared checkConnection - useSourceCheck: replace raw setter exports with action functions - usePlanStream: callback-based approach instead of cross-hook setters - page.tsx: wire callbacks, add useMemo/useCallback, add startPlan wrapper - header.tsx: replace useState+useEffect hydration guard with useSyncExternalStore - eslint.config: ignore test-proj in root lint Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a53119a to
dd1a13b
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
use-arcade-connection,use-source-check,use-plan-stream) from the 585-lineapp/dashboard/page.tsx, reducing it to ~350 lines of orchestration + JSXlib/sources.tsas a single source of truth for all source config (icon, label, color, tool-name pattern per integration) — adding a new source is now a one-line changeKNOWN_SERVICEregex gate from the plan route so tools from any service (Notion, Jira, etc.) pass through to the LLM, not just the 5 hardcoded onesItemSourcetype to accept any string while preserving autocomplete for known valuesConfigWarningintotypes/dashboard.ts(was defined in bothpage.tsxandhealth/route.ts)Files
New:
types/dashboard.ts—ConfigWarning,ArcadeStatus,SourceCheckPhaselib/sources.ts— source registry withgetSource()+mapToolToSource()hooks/use-arcade-connection.ts— Arcade OAuth connection state machinehooks/use-source-check.ts— pre-flight source auth checkinghooks/use-plan-stream.ts— SSE plan streamingModified:
page.tsx,task-card.tsx,stats-bar.tsx,source-auth-gate.tsx,types/inbox.ts,health/route.ts,map-tool-to-source.hbs,plan-route-body.hbsTest plan
npm run build && npm run lint && npm run format:checkpassesnode dist/index.js test-proj --template ai-sdk && cd test-proj && bun run buildsucceedsnode dist/index.js test-proj --template mastra && cd test-proj && bun run buildcompiles cleanly🤖 Generated with Claude Code