Commit Graph

146 Commits

Author SHA1 Message Date
DrSmoothl
e9a081d46b refactor(react19): replace Context.Provider with Context value={}
- 升级 6 个文件的 Context 语法为 React 19 标准
- ThemeProviderContext, ChartContext, AnimationContext, TourContext, AssetStoreContext, RestartContext
- 构建验证通过
- 功能完全等价
2026-03-01 20:02:04 +08:00
DrSmoothl
e1f9936561 refactor(config): split modelProvider.tsx into modular directory
- 拆分为 7 个文件:index.ts (barrel), types.ts, utils.ts, 3 个组件, index.tsx (主页面 895行)
- 所有子组件 < 500 行
- 构建零错误
- 功能完全等价
2026-03-01 19:58:18 +08:00
DrSmoothl
b800011ed7 refactor(config): split ChatSection.tsx into sub-components
- 将 ChatSection.tsx (610行) 拆分为 4 个子组件
- TimeRangePicker.tsx: 时间范围选择器组件
- RulePreview.tsx: 规则预览组件
- RuleEditor.tsx: 规则编辑器组件
- RuleList.tsx: 规则列表组件
- ChatSection.tsx 重构为主容器组件 (197行)
- 功能完全不变,构建零错误
- 遵循具名导出规范

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 19:41:47 +08:00
DrSmoothl
c53840006d refactor(lib): split plugin-api.ts into plugin-api/ directory
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 19:35:36 +08:00
DrSmoothl
feb2b89917 refactor(routes): split plugins.tsx into modular plugins/ directory
- Extract types.ts: Plugin types and category name mapping
- Extract PluginCard.tsx: Single plugin card component
- Extract MarketplaceTab.tsx: All plugins marketplace view
- Extract InstalledTab.tsx: Installed plugins view
- Extract InstallDialog.tsx: Plugin installation dialog with branch selection
- Create index.tsx: Main PluginsPage with WebSocket state management
- Delete original 1244-line plugins.tsx
- Maintain full functionality, zero logic changes
- Build verified: bun run build passes with zero errors
2026-03-01 19:30:47 +08:00
DrSmoothl
f334d9882d refactor(dashboard): split chat.tsx into modular chat/ directory
- Extract types, utils, and components into separate files
- types.ts: All interfaces and type definitions (107 lines)
- utils.ts: Pure utility functions (50 lines)
- MessageRenderer.tsx: Message rendering components (96 lines)
- VirtualIdentityDialog.tsx: Virtual identity dialog (206 lines)
- ChatTabBar.tsx: Tab bar component (79 lines)
- index.tsx: Main ChatPage component (1147 lines)
- Update router import path to chat/index
- Fix TypeScript type imports per verbatimModuleSyntax
- Build passes with zero errors
2026-03-01 19:19:22 +08:00
DrSmoothl
34b05e4e16 fix(hooks): remove duplicate save calls in useAutoSave legacy 2026-03-01 19:09:08 +08:00
DrSmoothl
bddc6087cd refactor(T11): split settings.tsx into settings/ directory 2026-03-01 19:03:09 +08:00
DrSmoothl
dc7e037582 refactor(dashboard): migrate plugin-api HTTP functions to ApiResponse pattern
- Migrate 14 HTTP functions in plugin-api.ts to return ApiResponse<T>
  - fetchPluginList, checkGitStatus, getMaimaiVersion
  - getInstalledPlugins, installPlugin, uninstallPlugin, updatePlugin
  - getPluginConfigSchema, getPluginConfig, getPluginConfigRaw
  - updatePluginConfig, updatePluginConfigRaw, resetPluginConfig, togglePlugin
- Update 3 caller files to handle ApiResponse pattern:
  - plugins.tsx: 5 function calls updated
  - plugin-config.tsx: 5 function calls updated
  - plugin-detail.tsx: 5 function calls updated
- All callers now check .success before accessing .data
- Preserve WebSocket and utility functions unchanged
- Build verification: npm run build succeeds with 0 errors
2026-03-01 18:06:25 +08:00
DrSmoothl
d4bfc9591c refactor(api): migrate config-api to ApiResponse pattern 2026-03-01 17:49:05 +08:00
DrSmoothl
88e157040f refactor(api): migrate expression-api to ApiResponse pattern
- Migrated all 11 functions in expression-api.ts to return Promise<ApiResponse<T>>
- Implemented manual response handling following person-api pattern
- Properly unwrap nested API responses and re-wrap in ApiResponse
- Updated all 16 call sites across 4 files with proper error handling
- Fixed type annotations (ChatInfo) in expression.tsx
- Build passes successfully with no TypeScript errors
- Follows AGENTS.md import conventions and Wave 2 constraints
- All HTTP and API-level errors handled consistently via ApiResponse
2026-03-01 17:26:34 +08:00
DrSmoothl
c863d5a3be refactor(components): split layout.tsx into layout/ directory 2026-03-01 17:07:38 +08:00
DrSmoothl
7e93d886a2 refactor(types): eliminate any types in DynamicField icon lookup 2026-03-01 17:05:16 +08:00
DrSmoothl
5f211f2bcc refactor(css): clean up Tailwind base layers and CSS variables 2026-03-01 16:57:57 +08:00
DrSmoothl
3680009122 chore(config): tighten tsconfig and eslint strictness
- Enable strict mode in tsconfig.app.json (already enabled, now reinforced)
- Add allowSyntheticDefaultImports for better ES module compatibility
- Add skipLibCheck to suppress @types errors during compilation
- Change @typescript-eslint/no-explicit-any from 'off' to 'warn'
- @typescript-eslint/no-unused-vars already enabled as 'warn'
- Remove unused jotai from vite bundle configuration
- Build passes successfully with 0 errors
2026-03-01 16:57:49 +08:00
DrSmoothl
e1c8a30376 refactor(lib): unify WebSocket utilities into ws-utils 2026-03-01 16:57:45 +08:00
DrSmoothl
1533ec505b chore(deps): remove unused Jotai dependency
- Jotai was declared in package.json but never imported or used in any source code
- Verified with grep -r 'jotai' dashboard/src/ (zero matches)
- Build remains unaffected after removal
2026-03-01 16:57:01 +08:00
DrSmoothl
f9dd197f53 refactor(types): add unified API response types and error helpers 2026-03-01 16:53:34 +08:00
DrSmoothl
1fec4c3b9a feat(dashboard): add background customization system
Add image/video background support across 5 layout layers (page, sidebar,
header, card, dialog) with per-layer effect controls and custom CSS injection.
- IndexedDB asset store for blob persistence (idb)
- AssetStoreProvider for blob URL lifecycle management
- BackgroundLayer component with CSS effects and prefers-reduced-motion support
- useBackground hook with inherit logic
- BackgroundUploader with local file and remote URL support
- BackgroundEffectsControls and ComponentCSSEditor UI components
- Background settings integrated into AppearanceTab in settings.tsx
- Layout, Card, and Dialog integration via non-breaking wrapper components
2026-02-23 18:08:01 +08:00
DrSmoothl
6a54a796f1 修复 build 问题 2026-02-19 18:56:49 +08:00
DrSmoothl
79871100be feat(theme): add theme import/export and cleanup legacy code 2026-02-19 18:31:10 +08:00
DrSmoothl
bb556dc7ae feat(theme): extend settings UI with token controls and custom CSS editor 2026-02-19 18:22:35 +08:00
DrSmoothl
06a88a877f refactor(theme): migrate all CSS variable references and adapt third-party components
- Task 10: Bulk migrate CSS variable references from --primary/--secondary/etc to --color-primary/--color-secondary/etc across all components
- Task 11: Adapt CodeEditor to auto-detect theme from ThemeProvider context, remove hardcoded theme='dark' from plugin-config and bot config pages
2026-02-19 18:01:14 +08:00
DrSmoothl
b5088fa455 feat(theme): migrate CSS variables and Tailwind config, refactor settings UI color picker
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-02-19 17:44:49 +08:00
DrSmoothl
8fb137a318 feat(theme): add CSS injection pipeline, presets, rewrite ThemeProvider, FOUC prevention 2026-02-19 17:26:53 +08:00
DrSmoothl
6aa1132f4c feat(theme): add design token schema, palette derivation, CSS sanitizer, and storage manager 2026-02-19 17:16:28 +08:00
DrSmoothl
760561f45e fix(version): update APP_VERSION to 1.0.0 2026-02-17 18:52:06 +08:00
DrSmoothl
6bb0bc9afc feat(dashboard): integrate DynamicConfigForm in model config page
- Add DynamicConfigForm import and fieldHooks integration
- Replace TaskConfigCard list with DynamicConfigForm in tasks tab
- Use hardcoded schema POC approach (fields: [], nested: {})
- Maintain existing auto-save and state management logic
- TypeScript compilation verified

Task 14 complete - Wave 4 finished (4/4)
2026-02-17 18:32:31 +08:00
DrSmoothl
2de618464a docs(dashboard): add comprehensive dynamic form system documentation
- Overview of schema-driven UI system
- Quick start guide with examples
- Backend UI metadata guide (json_schema_extra)
- Hook component creation tutorial
- API reference for all components
- Troubleshooting section
2026-02-17 18:18:51 +08:00
DrSmoothl
fa15fef1f0 feat(dashboard): convert 4 Sections to Hook components
- Create PersonalitySectionHook (medium complexity)
- Create DebugSectionHook (simple complexity)
- Create ExpressionSectionHook (high complexity)
- Create BotInfoSectionHook (simple complexity)
- Update hooks/index.ts with exports
- Pattern validated across different complexity levels
2026-02-17 18:18:44 +08:00
DrSmoothl
69dfd0cac6 test(dashboard): add unit tests for dynamic form components
- Create comprehensive test suite for DynamicField (21 tests)
- Create comprehensive test suite for DynamicConfigForm (10 tests)
- Create comprehensive test suite for FieldHookRegistry (21 tests)
- Configure Vitest 4.0.18 with jsdom environment
- Add test setup with ResizeObserver and matchMedia polyfills
- 52 tests total covering all core functionality
2026-02-17 18:18:32 +08:00
DrSmoothl
c58ad64352 feat(dashboard): integrate DynamicConfigForm for ChatSection POC
- Register ChatSectionHook as 'replace' mode field hook
- Replace ChatSection rendering with DynamicConfigForm
- Use hardcoded minimal schema (POC - API integration pending)
- Preserve all existing state management and auto-save logic
- TypeScript compilation: ✓ PASSED

Complete Task 11 (Wave 3)
Ref: WebUI config visualization refactor plan
2026-02-17 17:46:40 +08:00
DrSmoothl
3fcf02866a feat(dashboard): export ChatSectionHook in hooks index
- Add ChatSectionHook export to hooks/index.ts
- Complete Task 10 (Wave 3)
- ChatSectionHook now available for import and registration
2026-02-17 17:41:41 +08:00
DrSmoothl
b382747398 feat(dashboard): convert ChatSection to Hook component 2026-02-17 17:37:47 +08:00
DrSmoothl
449e2f470c feat(dashboard): create DynamicConfigForm component with Hook integration
- Accept schema, values, onChange, hooks props
- Check for field hooks, use if present (replace/wrapper modes)
- Fall back to DynamicField for non-hooked fields
- Support nested schema rendering with recursive calls
- Export DynamicConfigForm and DynamicField from index

Groups with Task 5. Completes Task 6 of webui-config-visualization-refactor plan.
2026-02-17 17:20:50 +08:00
DrSmoothl
2962a95341 feat(dashboard): create DynamicField renderer component
- Render fields based on x-widget or type
- Support slider, switch, textarea, select, custom widgets
- Include label, icon, description rendering
- Placeholder for unsupported types (array, object)

Completes Task 5 of webui-config-visualization-refactor plan.
2026-02-17 17:14:41 +08:00
DrSmoothl
e530ee8fa6 feat(dashboard): create FieldHookRegistry for dynamic form hooks 2026-02-17 16:49:32 +08:00
DrSmoothl
5838dda175 feat(dashboard): add UI metadata fields to FieldSchema type 2026-02-17 16:48:58 +08:00
DrSmoothl
b6441ea17b 更新 WebUI 版本 2026-02-15 16:46:52 +08:00
DrSmoothl
275608abea test WebUI CI x5 2026-02-15 16:39:32 +08:00
DrSmoothl
ba10124152 test WebUI CI x4 2026-02-15 16:36:52 +08:00
DrSmoothl
c3adc688e8 test WebUI CI x3 2026-02-15 16:33:34 +08:00
DrSmoothl
a19b9b2c42 test WebUI CI x2 2026-02-15 16:30:56 +08:00
DrSmoothl
63c27aaf21 test WebUI CI 2026-02-15 16:19:48 +08:00
墨梓柒
433a4551f9 移除gitignore中的lib文件夹,上传被排除掉的前端lib文件 2026-01-21 15:41:43 +08:00
墨梓柒
812296590e 上传完整的WebUI前端仓库 2026-01-13 06:24:35 +08:00