Skip to content

feat: Implement /theme shortcut for theme selection - #138

Merged
edenreich merged 11 commits into
mainfrom
claude/issue-127-20250827-1625
Aug 28, 2025
Merged

edenreich merged 11 commits into
mainfrom
claude/issue-127-20250827-1625

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Implements /theme shortcut feature with multiple themes and dropdown selection.

Changes

  • Add ThemeProvider with 3 themes: tokyo-night, github-light, dracula
  • Implement /theme command with searchable dropdown UI
  • Add dynamic theme switching for entire app
  • Fix icon consistency throughout codebase
  • Auto-documented via /help command

Closes #127

🤖 Generated with Claude Code

…consistency

- Add ThemeProvider with 3 themes: tokyo-night, github-light, dracula
- Implement /theme command with dropdown selection UI
- Add ViewStateThemeSelection and ThemeSelectedEvent
- Create theme selection view component with search functionality
- Add consistent colored icon usage with helper functions
- Update all components to support dynamic theme switching
- Register theme shortcut in container and wire up UI handling

Addresses acceptance criteria:
✅ User can select theme using /theme
✅ Theme dropdown changes entire styling
✅ Consistent colored icons throughout app
✅ Self-documented via /help command

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <[email protected]>
@edenreich

Copy link
Copy Markdown
Contributor Author

@claude CI is failing - please fix.

@claude

claude Bot commented Aug 27, 2025 •

Copy link
Copy Markdown
Contributor

Claude finished @edenreich's task —— View job


✅ CI Failures Fixed Successfully!

Todo List:

  • Analyze CI failure details
  • Check available development tasks
  • Identify import cycle issue
  • Move ThemeProvider to domain package to break import cycle
  • Update imports in shortcuts package
  • Update container registration
  • Update theme selector component to use ThemeService interface
  • Remove the old ui/themes.go file
  • Run local checks to verify fix
  • Verify fixes with task check
  • Push fixes to branch

Issue Found: Import cycle detected in the shortcuts package:

github.com/inference-gateway/cli/internal/shortcuts -> github.com/inference-gateway/cli/internal/ui -> github.com/inference-gateway/cli/internal/shortcuts

Root Cause: The ThemeShortcut in core.go was importing ui.ThemeProvider, but the ui package also imports from shortcuts, creating a circular dependency.

Solution Applied:
✅ Moved ThemeProvider from ui package to domain package
✅ Updated all references to use domain.ThemeService interface
✅ Removed the old ui/themes.go file
✅ Fixed all linting issues (printf formatting, complex nested logic)
✅ Verified build passes locally
✅ Pushed fix to branch

Changes Made:

  • Created internal/domain/theme_provider.go with ThemeProvider implementing ThemeService
  • Updated internal/shortcuts/core.go to use domain.ThemeService
  • Updated internal/container/container.go to register the new theme service
  • Updated cmd/chat.go and internal/app/chat.go to use the new service
  • Updated internal/ui/components/theme_selection_view.go to use the interface
  • Fixed printf formatting in internal/shortcuts/git.go
  • Simplified complex nested logic in theme selection view

The theme feature should now work correctly and pass CI! 🎨


edenreich and others added 10 commits August 27, 2025 19:05
…ckage

- Move ThemeProvider from ui package to domain package to break circular dependency
- Update all references to use domain.ThemeService interface instead of ui.ThemeProvider  
- Fix import cycle: shortcuts -> ui -> shortcuts
- Clean up unused imports and fix linting issues
- Simplify complex nested theme selection logic for better maintainability

Fixes CI failure caused by import cycle not allowed error.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <[email protected]>
- Added ThemeService integration in chat application and related components.
- Updated approval, conversation selection, file selection, and model selection views to use ThemeService.
- Created a test implementation of ThemeService for testing purposes.
- Generated mocks for ThemeService to facilitate unit testing.
- Removed direct theme references and replaced them with ThemeService calls to improve modularity and testability.

Signed-off-by: Eden Reich <[email protected]>
@edenreich
edenreich merged commit d21605f into main Aug 28, 2025
@edenreich
edenreich deleted the claude/issue-127-20250827-1625 branch August 28, 2025 00:33
inference-gateway-releaser Bot pushed a commit that referenced this pull request Aug 28, 2025
## [0.47.0](v0.46.1...v0.47.0) (2025-08-28)

### 🚀 Features

* Implement /theme shortcut for theme selection ([#138](#138)) ([d21605f](d21605f)), closes [#127](#127)
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.47.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement /theme shortcut to allow Theme selection

1 participant