♻️ refactor: implement Phase 3 sidebar refactoring (partial)

Extract inline components and organize sidebar structure:
- Create sidebar/ subfolder structure (components/, hooks/, dialogs/)
- Extract types.ts: NavSection, NavItem, component prop interfaces
- Extract constants.ts: theme options, feature flags
- Extract 3 inline components into separate files:
  - sortable-project-item.tsx (drag-and-drop project item)
  - theme-menu-item.tsx (memoized theme selector)
  - bug-report-button.tsx (reusable bug report button)
- Update sidebar.tsx to import from extracted modules
- Reduce sidebar.tsx from 2323 to 2187 lines (-136 lines)

This is Phase 3 (partial) of folder-pattern.md compliance: breaking down
the monolithic sidebar.tsx into maintainable, reusable components.

Further refactoring (hooks extraction, dialog extraction) can be done
incrementally to avoid disrupting functionality.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-21 19:51:04 +01:00
parent e47b34288b
commit 7e8995df24
7 changed files with 178 additions and 156 deletions

View File

@@ -0,0 +1,24 @@
import { darkThemes, lightThemes } from '@/config/theme-options';
export const PROJECT_DARK_THEMES = darkThemes.map((opt) => ({
value: opt.value,
label: opt.label,
icon: opt.Icon,
color: opt.color,
}));
export const PROJECT_LIGHT_THEMES = lightThemes.map((opt) => ({
value: opt.value,
label: opt.label,
icon: opt.Icon,
color: opt.color,
}));
export const SIDEBAR_FEATURE_FLAGS = {
hideTerminal: import.meta.env.VITE_HIDE_TERMINAL === 'true',
hideWiki: import.meta.env.VITE_HIDE_WIKI === 'true',
hideRunningAgents: import.meta.env.VITE_HIDE_RUNNING_AGENTS === 'true',
hideContext: import.meta.env.VITE_HIDE_CONTEXT === 'true',
hideSpecEditor: import.meta.env.VITE_HIDE_SPEC_EDITOR === 'true',
hideAiProfiles: import.meta.env.VITE_HIDE_AI_PROFILES === 'true',
} as const;