28 Commits

Author SHA1 Message Date
linshen
b0680cda7e feat: add deployment-aware remote backups 2026-05-08 21:17:23 +08:00
linshen
4bd19a76b9 feat(data): support resource-complete backup imports
- Export favorite and data-manager backup packages with referenced resources
- Normalize backup resource metadata during package creation and import
- Add selective package import controls in the data manager UI
- Cover package normalization and selective import behavior with focused tests
2026-05-01 16:22:41 +08:00
linshen
c75afa89e9 feat(i18n): establish english-first locale baseline
- split UI locale packs into en-US, zh-CN, and zh-TW modules
- switch runtime defaults, docs, and repository guidance toward an English-first baseline
- update core, MCP, and UI runtime copy to remove hardcoded Chinese fallbacks
- add locale parity and no-hardcoded-runtime guardrails across the repo
2026-04-08 20:18:27 +08:00
linshen
520ae2be99 build(deps): align toolchain peers and replace npm-run-all
- align TypeScript with the current eslint peer range across packages
- replace npm-run-all with a local run-many script and test coverage
- tighten remaining mcp-server typing so the package lint stays clean
- update the lockfile after removing redundant root-level tooling deps
2026-03-27 22:18:57 +08:00
linshen
37d6fa564c build(deps): prune redundant deps and fix ui type outputs
- remove redundant direct dependencies that are no longer used
- restore UI library type build outputs after the dependency cleanup
- keep Tailwind/PostCSS-related package config aligned with actual usage
2026-03-27 21:26:43 +08:00
linshen
e69086f075 build(deps): refresh workspace dependency baselines
- refresh direct dependency baselines across workspace packages
- require Node 22 consistently in docs, Docker, and package engines
- update lint/build tooling configs to match the new workspace baseline
- keep package manifests and lockfile aligned after the dependency refresh
2026-03-27 20:41:18 +08:00
linshen
ca877ea794 build(ui): add vue-tsc typecheck
- Add vue-tsc typecheck to UI build pipeline
2026-01-18 16:43:00 +08:00
linshen
69bffd4260 refactor(ui): 完善单一真源架构解决跨模式状态污染
- 修复跨模式状态污染问题,实现单一真源架构
- 完善单一真源架构并优化代码分割
- 归档 Session Store 单一真源重构文档
- 将未完成的迁移指南移回 workspace
2026-01-02 16:52:00 +08:00
linshen
6d21babfdd refactor(ui): 引入 Pinia 状态管理并重构服务访问
- 引入 Pinia 状态管理:创建 promptDraft store 和多个 session stores
- 重构服务访问:移除 $services 插件,统一服务访问方式
- 修复 session 存储竞态条件:使用 Pinia 的响应式系统
- 归档 Pinia 重构文档:记录完整的迁移过程
- 修正 MCP server bin 入口配置
2026-01-01 14:23:00 +08:00
linshen
c3c46b6e83 fix(deps): 升级 vitest 和 tsup 修复 vite 漏洞
- vitest: 3.2.4 → 4.0.15 (vite-node 不再依赖旧版 vite)
- tsup: 8.5.0 → 8.5.1

修复 Dependabot 警报:
- #21 vite server.fs.deny bypass
- #18 vite public directory 文件泄露
- #17 vite HTML 文件未应用 server.fs 设置
2025-12-07 16:30:05 +08:00
linshen
fe961eb4f5 fix(deps): 修复多个安全漏洞
升级直接依赖:
- @google/genai: 1.19.0 → 1.32.0 (修复 jws HMAC 签名验证漏洞)
- vite: 6.x → 7.2.7 (修复 3 个安全漏洞)
- electron: 37.1.0 → 39.2.6 (修复 ASAR 完整性绕过)
- electron-builder: 24.13.3 → 26.0.12
- electron-builder-squirrel-windows: 新增 26.0.12
- electron-updater: 6.3.9 → 6.6.2
- vue-i18n: 10.0.6 → 11.2.2 (修复 XSS 漏洞)
- @modelcontextprotocol/sdk: 1.16.0 → 1.24.3 (修复 DNS 重绑定)
- element-plus: 2.10.2 → 2.12.0 (修复 el-link href 验证)
- @typescript-eslint/*: 6.21.0 → 8.49.0 (支持 TypeScript 5.8.3)

自动修复的传递依赖:
- jws: 4.0.1, form-data: 4.0.5, tmp: 0.2.5
- body-parser: 2.2.1, @eslint/plugin-kit: 0.3.5

其他:
- 修复 lint 错误 (未使用的 catch 变量添加 _ 前缀)
2025-12-07 15:59:24 +08:00
linshen
68540b244d feat: 将项目协议从 MIT/ISC 迁移到 AGPL-3.0
- 替换 LICENSE 文件为 AGPL-3.0 完整协议文本
- 更新所有 package.json 的 license 字段为 AGPL-3.0-only
- 更新 README 文件协议说明,采用简洁易懂的描述方式
- 为关键入口文件添加 AGPL-3.0 标准协议头部注释
- 明确说明 AGPL-3.0 允许商业使用但要求网络服务开源

BREAKING CHANGE: 协议从宽松的 MIT/ISC 变更为强 Copyleft 的 AGPL-3.0
2025-10-30 22:41:45 +08:00
linshen
b6b3765516 feat(ui): 实现 CodeMirror 6 变量高亮系统与完整测试套件
核心功能:
- 将 VariableAwareInput 从原生 textarea 升级到 CodeMirror 6
- 新增变量实时高亮功能 (全局/临时/预定义/缺失)
- 新增智能自动完成功能 (输入 {{ 触发)
- 新增缺失变量快捷添加功能
- 完善变量提取安全性机制
- 新增临时变量双向同步机制

测试覆盖:
- 新增集成测试覆盖完整用户工作流
- 新增 VariableAwareInput 组件单元测试
- 新增 useVariableDetection 组合式函数测试
- 新增选择安全机制和 CodeMirror 扩展测试
- 增强测试环境配置支持国际化和 Naive UI
- 总计 25 个测试文件 242 个测试用例全部通过

技术实现:
- 新增 useVariableDetection.ts 变量检测引擎
- 新增 codemirror-extensions.ts 扩展集合
- 重构 VariableAwareInput.vue 使用 CodeMirror 6
- 增强 ContextUserWorkspace.vue 临时变量管理
- 完善 TestAreaPanel.vue 变量同步事件
- 新增 variableDetection 国际化文案

架构亮点:
- 模块化架构设计,职责分离清晰
- 完善的变量边界保护机制
- 实时高亮与智能补全体验
- 类型安全的 TypeScript 实现
2025-10-25 18:58:33 +08:00
linshen
609f454d6a refactor(ui): 全面优化收藏管理、交互与组件库,统一消息提示
## 主要变更

### 收藏管理界面重构与优化
- **布局与组件规范化**:
    - 统一组件命名风格(NCard, NButton等),100% 使用 Naive UI 原生组件替代自定义div+class,删除 22 个冗余自定义样式类。
    - 工具栏重构为两行布局(视图切换、搜索、操作按钮 / 分类筛选、标签筛选、统计信息),解决单行拥挤问题。
    - 网格布局改进,使用 CSS Grid 的 `auto-fill + minmax` 实现真正的响应式,删除 `NGrid/NGridItem` 依赖。
    - 列表视图重构,使用 `NListItem` 插槽替代 `NThing`,删除 9 个自定义布局样式类。
    - 卡片组件优化,使用 `NCard` 插槽,固定高度 280px,内边距优化为 12px,标题自动省略,内容预览增加到 3 行,标签区域单行显示。
- **功能增强与交互优化**:
    - 新增手动创建收藏功能,支持完整的表单编辑。
    - 允许收藏重复内容,支持为相同内容设置不同标题、分类、标签,移除 `FavoriteAlreadyExistsError` 校验。
    - 收藏夹打开时自动刷新最新数据。
    - 新增标签多选过滤功能。
    - 分类筛选升级为树状选择器,支持层级分类。
    - 简化收藏卡片操作,将菜单改为直观按钮组。
    - 编辑/创建对话框布局优化,增加功能模式选择。
    - 所有操作按钮添加 `NTooltip` 悬浮提示,删除操作增加 `NPopconfirm` 二次确认,操作按钮默认隐藏(移动端始终显示)。
    - 修复收藏管理器 props 声明以支持 watch。
    - 重构 FavoriteManager 为完整 Modal 组件,将 CategoryManager Modal 移至外层,避免事件拦截。

### 统一与优化按钮样式
- 为 `TestControlBar` 中的主要操作按钮和对比模式切换按钮添加 `round` 属性,统一为圆角。
- 去除所有按钮文字的箭头符号(→)。

### 编辑界面与核心显示逻辑统一
- 移除全屏界面 (`OutputDisplayFullscreen`) 和保存收藏对话框 (`SaveFavoriteDialog`) 的对比功能。
- 统一所有新建/编辑界面只保留复制和编辑功能。
- `OutputDisplayCore` 的 `editable` 模式默认显示源码视图,新增模式切换时的视图自动同步逻辑。

### 消息提示系统整合
- 删除 `useSafeMessage.ts`,统一所有组件(`Toast.vue`, `FavoriteManager.vue`, `OutputDisplayCore.vue`, `FavoriteButton.vue`)使用 `useToast()` 作为消息 API。

### 其他修复与优化
- 修复 `InputPanel` 栅格布局,提交按钮宽度从 `span=4` 增加到 `span=5`,解决文字溢出。
- 修复 `useImageWorkspace` 中事件监听器注册时机,解决 TDZ (Temporal Dead Zone) 错误。
- 实现完整的收藏分类管理系统 (CRUD),新增 `CategoryManager` 组件。
- 更新国际化文件 (zh-CN/en-US/zh-TW)。
- 间距从 8px 优化为 6px,标签从最多 2 个恢复到 3 个,添加明确字体大小和行高控制,卡片添加 `overflow: hidden`。
2025-10-18 11:25:30 +08:00
linshen
54fd56b120 feat: 完成Naive UI重构最终修复和统一维护架构
主要变更:
- Extension App.vue统一维护:完整复制Web版本实现跨平台功能一致性
- TypeScript类型修复:useAppInitializer添加显式返回类型解决推断问题
- 主题系统优化:清理naive-theme.ts不存在属性,完善5主题配置
- ESLint配置:新增Vue文件解析支持,提升代码质量检查
- 接口适配完善:补充IImportExportable方法,增强服务层兼容性
- 依赖更新:同步ESLint相关包版本,确保构建稳定性

技术影响:
- 跨平台维护成本降低,Extension与Web功能完全同步
- TypeScript编译错误清零,开发体验提升
- 主题切换功能在所有5个主题下验证通过
- 代码质量工具链完善,支持Vue3+TS混合开发

测试验证:完成19/19规范任务,开发服务器localhost:18182稳定运行
2025-08-31 15:42:46 +08:00
linshen
fe4d158ac3 feat: Naive UI 组件重构与问题修复
主要变更内容:
- 将所有UI组件从自定义实现迁移到Naive UI设计系统
- 移除废弃的theme.css,实现纯themeOverrides主题系统
- 新增useNaiveTheme组合式函数统一主题管理
- 更新42+个组件使用Naive UI设计规范
- 删除过时的OutputPanel组件
- 添加完整的主题配置系统和相关文档记录
- 将Toast组件完全迁移到Naive UI NMessage系统
- 重构useToast组合式函数使用原生useMessage API
- 补全6个缺失组件的导出:ConversationMessageEditor、FullscreenDialog等
- 修复useClipboard中缺失的Ref类型导入
- 修复naive-theme.ts中不支持的borderColorHover属性
- 组件导出覆盖率从76%提升到92%

此次变更实现了UI架构现代化,提升了界面一致性和可维护性,并消除了混合架构的遗留问题。
2025-08-24 20:41:43 +08:00
且炼时光
c2e457a5f5 Merge branch 'master' into update-deprecated-dev-dependencies 2025-03-17 20:37:09 +08:00
Joseph Hau
5e8f658c6a Update development dependencies to the latest versions:
Update TypeScript to ^5.8.2 in root directory
Update UI directory dependencies:
jsdom to ^26.0.0
TypeScript to ^5.8.2
vite-plugin-dts to ^4.5.3
2025-03-17 17:57:19 +08:00
Joseph Hau
8a9f94c05f feat: implement intelligent auto-scroll functionality
1. Create new useAutoScroll composable function
2. Implement user scroll interruption detection that pauses auto-scrolling when user scrolls up and resumes when scrolled to bottom
3. Refactor OutputPanel and PromptPanel to use the new auto-scroll methods
4. Add @types/node as dev dependency to resolve TypeScript errors
2025-03-17 11:51:32 +08:00
Joseph Hau
f5cdfa0cd6 - Use Markdown-it instead of marked
- Add thinking process translation
2025-03-15 23:27:17 +08:00
Joseph Hau
caa4f47480 Add markdown rendering on test result
- Add markdown swith button
- Add markdown button tip translation
- Optimize 'Start test' button width
2025-03-15 10:24:24 +08:00
linshen
8afce63de3 chore: 更新 npm 和包管理器配置
- 在 .npmrc 中启用预/后置脚本和公共依赖提升
- 扩展 package.json 的包管理器支持,增加 pnpm 版本约束
- 调整 core 和 ui 包的导出配置,优化模块引入方式
- 更新 Node.js 版本支持范围,兼容 18、20 和 22 版本
2025-02-28 00:14:29 +08:00
linshen
c1acf7d7b6 chore: Update project dependencies and development scripts
- Upgrade Vite, Vitest, and Vue-related dependencies to latest versions
- Modify package scripts for improved development workflow
- Update environment variable loading configuration
- Enhance test configuration and mocking strategies
- Simplify root and package-level scripts
- Improve cross-platform development support
2025-02-23 21:44:38 +08:00
linshen
e567f5f2dc refactor: Optimize UI package service imports and build scripts
- Remove redundant `services/index.ts` file
- Update service imports to use `@prompt-optimizer/core` directly
- Add Windows-specific build script with readme note
- Clarify component export strategy with 'UI' suffix comment
2025-02-22 14:20:09 +08:00
linshen
9902d7b0d8 refactor: Modularize UI package and improve type safety in extension and web apps
- Extract common composables and services in UI package
- Implement useServiceInitializer, useModelManager, and useHistoryManager
- Enhance type safety with TypeScript configuration updates
- Simplify App.vue in extension and web packages
- Remove redundant code and improve component modularity
- Update package dependencies and lock files
2025-02-18 21:03:41 +08:00
linshen
653772ca78 refactor: Synchronize core and UI package interfaces with async/sync method transformations
- Modify TemplateManager to use synchronous methods instead of async
- Update core service interfaces to remove async/await requirements
- Simplify initialization and method calls across core and UI packages
- Remove unnecessary async/await wrappers in composables and components
- Enhance error handling and logging during service initialization
- Standardize method signatures in template, history, and model managers
2025-02-17 21:19:51 +08:00
linshen
04dccf3e38 refactor: Migrate extension package components to UI package
- Move all Vue components from extension package to @prompt-optimizer/ui
- Remove local component implementations in extension package
- Update import statements to use UI package components
- Add necessary dependencies for component migration
- Simplify extension package structure and improve code modularity
- Prepare for unified component management across packages
2025-02-15 19:28:14 +08:00
linshen
5e42a81aa4 refactor: Extract UI components to separate package
- Move common Vue components from web package to new @prompt-optimizer/ui package
- Update import statements in web package to use @prompt-optimizer/ui
- Add necessary dependencies for UI package
- Simplify component imports and improve code modularity
- Update package.json files to include new UI package dependency
2025-02-15 15:18:59 +08:00