Skip to content

Refactor UI components into modular architecture - #5

Merged
brianlovin merged 1 commit into
mainfrom
brianlovin/refactor-ui-components
Jan 26, 2026
Merged

Refactor UI components into modular architecture#5
brianlovin merged 1 commit into
mainfrom
brianlovin/refactor-ui-components

Conversation

@brianlovin

Copy link
Copy Markdown
Owner

Summary

  • Extract components into separate files (Header, StoryList, StoryDetail, ChatPanel, AuthSetup, SettingsPanel, etc.) with consistent state/render pattern
  • Create theme.ts for centralized color management with light/dark theme detection
  • Add ChatService for AI integration supporting both Anthropic and OpenAI
  • Reduce app.ts from 2500+ lines to ~550 lines of orchestration logic

Improvements

  • Better testability with isolated component functions
  • Fixed COLORS mutable export anti-pattern and unsafe setTimeout callbacks
  • Improved security by removing API key prefix logging
  • All tests passing, TypeScript verified

🤖 Generated with Claude Code

- Extract components (Header, StoryList, StoryDetail, ChatPanel, etc.) into separate files
- Create component state interfaces and render functions for better testability
- Add theme.ts for centralized color management with light/dark theme detection
- Create ChatService for AI integration (Anthropic and OpenAI)
- Fix COLORS mutable export anti-pattern by using Object.assign
- Add isActive flag to ChatPanelState to prevent stale setTimeout callbacks
- Remove API key prefix logging for improved security
- Reduce app.ts from 2500+ lines to ~550 lines of orchestration logic
- Update tests to work with new component structure
- All tests passing, TypeScript types verified

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@brianlovin
brianlovin merged commit 2aa1315 into main Jan 26, 2026
1 check passed
@brianlovin
brianlovin deleted the brianlovin/refactor-ui-components branch January 26, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant