Commit Graph

5229 Commits

Author SHA1 Message Date
DrSmoothl
7866443c9c refactor(routes): modernize auth, setup, person routes
- auth.tsx: 统一错误处理,使用 parseResponse<T>
- setup/api.ts: 重构 12 个函数使用 ApiResponse 模式
- person.tsx: 优化 imports,使用 import type 语法
- 构建验证通过
- 功能完全等价
2026-03-01 20:11:32 +08:00
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
416bf36f1a refactor(database_model): replace Literal with Enum for modified_by field 2026-02-28 22:47:40 +08:00
UnCLAS-Prommer
1e917cc87d Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-02-28 21:16:41 +08:00
UnCLAS-Prommer
a39ccedb9a 应要求提交上未完成的HFC, expression部分 2026-02-28 21:14:46 +08:00
DrSmoothl
5f5bdab85d 补全 WebUI 缺失文件 2026-02-28 20:50:04 +08:00
UnCLAS-Prommer
c58da95353 链式调用构建消息 2026-02-28 16:54:38 +08:00
UnCLAS-Prommer
78983c4ed8 expression 2026-02-28 15:57:44 +08:00
UnCLAS-Prommer
b9faed4924 拆分新的utils 2026-02-27 22:07:26 +08:00
UnCLAS-Prommer
e253a2ed2a 分离提及和at必回复 2026-02-27 16:11:47 +08:00
UnCLAS-Prommer
7ef21c516a 一点注释和渲染修改 2026-02-24 16:01:39 +08:00
UnCLAS-Prommer
a8e8f6b7b3 HFC对应修改(部分) 2026-02-24 15:59:35 +08:00
UnCLAS-Prommer
12d4f236be Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-02-23 21:29:35 +08:00
UnCLAS-Prommer
0d07e85434 全新的process方法完成(Message其他部分仍未完成);对应测试;调整部分注释;数据库检索优化 2026-02-23 21:29:17 +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
UnCLAS-Prommer
698b8355a4 移除旧文件;补充chat_manager方法 2026-02-22 22:33:54 +08:00
UnCLAS-Prommer
37f8c923c1 ChatSession(原ChatStream)与ChatManager;由于功能简单,测试略 2026-02-22 22:26:28 +08:00
UnCLAS-Prommer
04a5bf3c6d Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-02-21 23:50:53 +08:00
UnCLAS-Prommer
8674f50d90 PersonInfo相关提交,添加注释,重命名文件 2026-02-21 23:50:18 +08:00
DrSmoothl
6378bb2052 fix Ruff 2026-02-21 16:29:30 +08:00
DrSmoothl
eaef7f0e98 Ruff Format 2026-02-21 16:24:24 +08:00
DrSmoothl
2cb512120b feat(plugin-system): harden P0 safety with workflow timeout, service ACL, and contract validation
- enforce step timeout/cancellation in workflow engine
- add caller authorization boundary for cross-plugin service calls
- validate params_schema and return_schema at runtime
2026-02-21 16:11:52 +08:00
UnCLAS-Prommer
6d196454ee Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-02-21 15:55:57 +08:00
UnCLAS-Prommer
119241f251 PersonInfoModel; 修改部分方法参数和部分文件位置;移除多余文件;炸毁可启动性 2026-02-21 15:54:03 +08:00
DrSmoothl
6fcc53a22b feat(plugin-system): add workflow pipeline and cross-plugin service registry 2026-02-20 19:24:05 +08:00
UnCLAS-Prommer
6bcd7cbebb Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-02-19 19:03:25 +08:00
UnCLAS-Prommer
1c0580c577 ImageManager及测试 2026-02-19 19:02:44 +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