Commit Graph

756 Commits

Author SHA1 Message Date
xintaofei
1554425b03 feat: show real-time download progress bar for app updates
Leverage the Tauri updater plugin's DownloadEvent callback to display
a progress bar with downloaded/total bytes during app updates, replacing
the previous spinner-only feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:01:46 +08:00
xintaofei
a763adaf36 feat: stream real-time progress for agent SDK install/upgrade/uninstall
Replace the spinner-only UX with live log output during agent SDK
operations, matching the existing OpenCode plugin install experience.

Backend: emit structured events (started/log/completed/failed) via
EventEmitter during npm install and binary download. npm commands now
run with piped stdio for line-by-line streaming; binary downloads
report chunked progress every 1 MB.

Frontend: subscribe to `app://agent-install` events through a new
`useAgentInstallStream` hook and render a theme-aware log terminal
below the preflight checks panel.

Also fixes the install log container in both agent settings and the
OpenCode plugins modal: auto-scroll no longer shifts the outer page,
and colours now follow the active light/dark theme.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:43:54 +08:00
xintaofei
6c69f432b9 docs: remove OverlayScrollbars migration design spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:45:02 +08:00
xintaofei
290ce14fa8 fix(frontend): remove inner padding from file tree container
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:43:45 +08:00
xintaofei
ee6053659c Merge commit 'b1bfc244d10627598f5fb533e62eb86bf166fd98'
# Conflicts:
#	src/app/globals.css
#	src/components/overlay-scrollbars-init.tsx
2026-04-12 20:23:59 +08:00
xintaofei
0fafe782ee feat(frontend): replace native scrollbar styling with OverlayScrollbars
Adopt OverlayScrollbars for cross-platform consistent overlay scrollbars
with auto-hide on pointer leave, hover grow effect, and click-to-scroll.

- Add overlayscrollbars + overlayscrollbars-react dependencies
- Rewrite ScrollArea component from Radix to OverlayScrollbars wrapper
- Define custom theme `os-theme-codeg` in globals.css (6px → 8px on hover)
- Initialize body-level overlay scrollbar via OverlayScrollbarsInit
- Migrate all scrollbar-thin / scrollbar-thin-edge usages to ScrollArea
- Keep native .scrollbar-thin fallback for virtua scroll containers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:21:06 +08:00
xintaofei
b1bfc244d1 feat(frontend): replace native scrollbar styling with OverlayScrollbars
Adopt OverlayScrollbars for cross-platform consistent overlay scrollbars
with auto-hide on pointer leave, hover grow effect, and click-to-scroll.

- Add overlayscrollbars + overlayscrollbars-react dependencies
- Rewrite ScrollArea component from Radix to OverlayScrollbars wrapper
- Define custom theme `os-theme-codeg` in globals.css (6px → 8px on hover)
- Initialize body-level overlay scrollbar via OverlayScrollbarsInit
- Migrate all scrollbar-thin / scrollbar-thin-edge usages to ScrollArea
- Keep native .scrollbar-thin fallback for virtua scroll containers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:16:46 +08:00
xintaofei
ad50cc28fc docs: add OverlayScrollbars migration design spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 19:45:09 +08:00
xintaofei
db6da4aecc fix(frontend): remove scrollbar-gutter and restore padding for scroll containers
Drop `scrollbar-gutter: stable both-edges` / `stable` from `.scrollbar-thin`
and `.scrollbar-thin-edge` so scrollbars overlay content without reserving
space, fixing layout inconsistencies between overlay and classic scrollbar
environments. Restore padding that was previously reduced to compensate for the
gutter: `px-1` to `px-3` in git-log-tab, `px-2` to `px-4` in
virtualized-message-thread, and add `px-2` to sidebar-conversation-list and
session-files-tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 19:20:45 +08:00
xintaofei
25def31a23 fix(windows): force UTF-8 encoding for all spawned child processes
- Set UTF-8 environment variables (PYTHONUTF8, PYTHONIOENCODING, LANG,
  LC_ALL) on all child processes via process.rs helpers
- Configure PTY terminals per shell flavor: chcp 65001 for cmd.exe,
  [Console]::OutputEncoding for PowerShell, LANG=C.UTF-8 for Git Bash
- Use /K and -NoExit for interactive shells to avoid nested processes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:47:31 +08:00
xintaofei
843cf8df19 feat(macos): set traffic-light position via Tauri builder API and sync with zoom
Use Tauri's native `traffic_light_position()` builder method to position
macOS window controls instead of runtime objc2 calls. A global AtomicU32
tracks the current zoom level so newly created windows reflect the latest
zoom. The frontend syncs zoom changes to the backend via a new
`update_traffic_light_position` command.

- Add `traffic_light_position()` to `apply_platform_window_style` builder
- Add `CURRENT_ZOOM` atomic and `traffic_light_position()` helper
- Register `update_traffic_light_position` Tauri command
- Add `syncTrafficLightPosition` in appearance-provider to sync on zoom
  change, mount, and cross-tab storage events
- Consolidate `ensure_windows_undecorated` calls into `post_window_setup`
- Remove dead `on_window_resized` no-op and its Resized event listener

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:11:40 +08:00
xintaofei
883fb64db0 # Release version 0.8.1
- feat(acp): add opencode plugin management — detect, install, uninstall plugins via preflight UI.
- feat(frontend): add OpencodePluginsModal with streaming install progress.
- feat(i18n): add opencode plugin management translations for 10 languages.
- fix(acp): use XDG paths for opencode config/cache instead of platform-native dirs.
- fix(acp): pin @latest plugin specs to installed versions and enable button when only floating versions exist.
- fix(acp): avoid false-positive comment detection on URLs in opencode.json.
- fix(acp): harden session-page connection and localize backend errors.
- fix(experts): handle Windows junction removal when unlinking skill entries.
- fix(frontend): remove explicit primary color from input bar controls.
-----------------------------
# 发布版本 0.8.1

- 新增(acp):添加 opencode 插件管理 —— 通过预检 UI 检测、安装、卸载插件;
- 新增(前端):添加 OpencodePluginsModal 组件,支持流式安装进度展示;
- 新增(i18n):为 opencode 插件管理添加 10 种语言翻译;
- 修复(acp):opencode 配置/缓存使用 XDG 路径而非平台原生目录;
- 修复(acp):将 @latest 浮动版本的插件规格固定为实际安装版本,并在仅有浮动版本时启用按钮;
- 修复(acp):避免对 opencode.json 中的 URL 误判为注释;
- 修复(acp):加固会话-页面连接并本地化后端错误信息;
- 修复(experts):处理 Windows 下取消技能条目链接时的 junction 移除问题;
- 修复(前端):移除输入栏控件的显式主色调。
2026-04-12 14:08:50 +08:00
xintaofei
f0e0196d35 fix(frontend): remove explicit primary color from input bar controls
Drop text-primary/80 from expert dropdown icons and text-primary from
mode/config selector trigger buttons so they inherit the default
foreground color and transition naturally with themed hover states.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:06:04 +08:00
xintaofei
9ab090a2b2 fix(acp): avoid false-positive comment detection on URLs in opencode.json
The naive // and /* check triggered on URLs like https://... inside
string values. Now we only reject the file as JSONC when serde_json
parsing fails AND comment-like sequences are found.
2026-04-12 12:00:47 +08:00
xintaofei
fbcfa3fb9c chore: add .docs to gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:58:53 +08:00
xintaofei
023e4c5514 fix(acp): pin @latest for all plugins and enable button when only floating versions exist
- install_missing_plugins now pins ALL @latest specs (not just newly installed)
- When nothing is missing but @latest exists, the pin-only path runs
- Modal button switches to 'Pin @latest Versions' when no missing plugins
- Added pinVersions i18n key for 10 languages
2026-04-12 11:56:55 +08:00
xintaofei
4397b0eae7 feat(acp): auto-pin @latest plugin specs to installed versions after install
After a successful plugin install, read the actual installed version from
node_modules and replace @latest in opencode.json with the pinned version.
This prevents opencode from hitting the npm registry on every startup.

Also add a preflight warning when @latest specs are detected, guiding
the user to install via the plugin manager to auto-pin.
2026-04-12 11:47:01 +08:00
xintaofei
6459e5286a fix(acp): use XDG paths for opencode config/cache instead of platform-native dirs 2026-04-12 11:31:45 +08:00
xintaofei
21800f25a1 style(acp): fix clippy warnings in opencode_plugins 2026-04-12 10:59:37 +08:00
xintaofei
6d035101c6 feat(i18n): add opencode plugin management translations for 10 languages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:53:44 +08:00
xintaofei
40e1483ab0 feat(frontend): integrate opencode plugin modal into preflight UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:48:17 +08:00
xintaofei
ebf0281251 fix(frontend): use correct i18n namespace prefix for opencode plugin modal 2026-04-12 10:43:34 +08:00
xintaofei
6da3a6cc34 feat(frontend): add OpencodePluginsModal component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:40:50 +08:00
xintaofei
185ba39269 feat(frontend): add usePluginInstallStream hook 2026-04-12 10:32:00 +08:00
xintaofei
4ff339d9fc feat(frontend): add opencode plugin types and API methods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:26:51 +08:00
xintaofei
996945223c feat(acp): add opencode plugin list/install/uninstall commands and routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:21:04 +08:00
xintaofei
8c807b62d3 feat(acp): integrate opencode plugin check into preflight
Add InstallOpencodePlugins variant to FixActionKind and wire
opencode_plugins::check_opencode_plugins into check_binary_environment
so preflight surfaces missing/installed plugin status for OpenCode agents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:15:48 +08:00
xintaofei
0901758937 feat(acp): implement install_missing_plugins and uninstall_plugin
Add concurrency lock (PLUGIN_OP_LOCK), install/uninstall functions with
bun subprocess management, progress event streaming via EventEmitter, and
protected-package guard for @opencode-ai/* internals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:12:34 +08:00
xintaofei
26cf618bd4 feat(acp): add resolve_bun_binary and atomic_rewrite_opencode_json helpers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:10:13 +08:00
xintaofei
c5d5f854b5 feat(acp): implement check_opencode_plugins detection
Add check_opencode_plugins() to read ~/.config/opencode/opencode.json,
parse the plugin[] array, and cross-reference against
~/.cache/opencode/node_modules/ to report installed vs. missing plugins.
Also adds opencode_config_path, opencode_cache_dir, and
has_project_opencode_config helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:08:27 +08:00
xintaofei
8c775d29e7 feat(acp): add opencode_plugins module with types and parse_plugin_spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:06:25 +08:00
xintaofei
1c1738298b fix(acp): harden session-page connection and localize backend errors
- Session-page connect never triggers download/install; returns
  SdkNotInstalled immediately and prompts the user to install from
  Agent Settings instead
- Binary agents now accept any cached version via
  find_best_cached_binary_for_agent so stale caches still connect
- Bound Initialize handshake with a 60s timeout and convert it to
  AcpError::InitializeTimeout via a sentinel in run_connection
- Spawn background task owns ConnectionManager map insertion and
  removes the entry on exit through an RAII guard that survives
  panics, preventing leaked stale entries
- AcpError gains SdkNotInstalled and InitializeTimeout variants plus
  a stable code() identifier; AcpEvent::Error carries code so the
  frontend can render localized messages by key
- Frontend preflight now runs for all connect sources; error event
  handler switches on code to show translated text for
  initialize_timeout, sdk_not_installed, platform_not_supported,
  process_exited, spawn_failed and download_failed
- Remove ConnectionStatus::Downloading enum variant, all frontend
  branches, and i18n strings; drop obsolete autoLinkFailedTitle,
  autoLinkPreflightFailed, preflightCheckFailedDefault and
  preflightFailedTitle keys across 10 locales
- Add backendErrors.* translations in 10 languages
- Diagnostic logging: always log agent stderr plus binary
  path/size/args/env keys and Initialize timing; gate stdin/stdout
  JSON-RPC tracing behind CODEG_ACP_DEBUG to avoid persisting user
  content into OS log files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 03:36:08 +08:00
xintaofei
5bda7d06e9 fix(experts): handle Windows junction removal when unlinking skill entries 2026-04-11 18:54:21 +08:00
xintaofei
d92cb8d619 chore: bump ACP agent SDK versions in registry 2026-04-11 18:43:49 +08:00
xintaofei
eb6933f254 # Release version 0.8.0
- feat(appearance): add theme color picker with 11 shadcn presets, zoom level selector, and reset button.
- feat(appearance): add AppearanceProvider with FOUC prevention script to persist theme across reloads.
- fix(settings): default settings panel to appearance section instead of system.
-----------------------------
# 发布版本 0.8.0

- 新增(外观):添加主题色选择器(内置 11 种 shadcn 预设)、缩放级别选择器和重置按钮;
- 新增(外观):添加 AppearanceProvider 和防闪烁(FOUC)内联脚本,持久化主题配置;
- 修复(设置):打开设置面板时默认进入"外观"分区而非"系统"。
2026-04-11 17:40:55 +08:00
xintaofei
c34eb84caa fix(settings): default to appearance section instead of system
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:38:18 +08:00
xintaofei
b06e8d5f1b chore(docs): remove .docs directory
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:41:37 +08:00
xintaofei
c8dfd00317 feat(appearance): add theme color picker, zoom level selector, reset button
外观设置页新增三个 UI 单元:12 个 shadcn 主题预设的色盘按钮网格、6 档窗口缩放
下拉选择器、以及只重置主题色和缩放(不动主题模式)的恢复默认按钮。
i18n 键在上一个 Task 中已预备好,本提交后整个外观设置功能即可在浏览器中端到端使用。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:01:09 +08:00
xintaofei
92b8a9729e fix(i18n): restore pre-existing AppearanceSettings translations
Task 7 inadvertently overwrote 18 carefully-tuned translations across 7 languages
(ar/de/es/fr/ja/ko/pt) with the plan author's slightly different wording while
adding the new themeColor / zoomLevel / resetToDefaults keys. The new additions
remain intact; only the pre-existing keys are reverted to the project's original
translations (e.g. de "Designmodus" instead of "Design-Modus", ja
"システム追従" instead of "システムに従う"). Affects: sectionDescription,
themeMode, placeholder, system, currentTheme.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:58:52 +08:00
xintaofei
87f1f686b2 i18n(appearance): add theme color, zoom level, and reset translations
为 10 种语言(en/zh-CN/zh-TW/ja/ko/es/de/fr/pt/ar)的 AppearanceSettings 命名空间
新增 themeColor / zoomLevel / resetToDefaults / resetHint 等键。预设颜色名保留
英文原名以与 shadcn 品牌一致。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:55:04 +08:00
xintaofei
a5cd1ce2a8 feat(appearance): wire AppearanceProvider and FOUC script into root layout
在 <body> 顶部注入同步执行的 inline 脚本,在 hydration 前为 <html> 写入
data-theme 属性和 font-size 样式;在 ThemeProvider 内嵌套 AppearanceProvider
管理 React 侧 state。两条通道并行运作,互不干扰。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:50:25 +08:00
xintaofei
ecff8832c0 feat(appearance): add AppearanceProvider and use-appearance hooks
新增 React Context 管理 themeColor 和 zoomLevel state,与 next-themes 正交,
通过 localStorage 持久化并支持跨标签页同步。提供语义化 hook
useThemeColor / useZoomLevel 供调用点按需使用。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:48:06 +08:00
xintaofei
fc457725c1 feat(appearance): add 11 shadcn theme color presets to globals.css
新增 zinc / slate / stone / gray / red / rose / orange / green / blue / yellow / violet
共 11 个主题预设的 light + dark CSS 变量定义,配合 [data-theme] 选择器使用。
chart 颜色全预设共用,避免数据可视化随主题色失真。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:45:28 +08:00
xintaofei
4b2e6d188a refactor(appearance): migrate base theme tokens to data-theme="neutral"
把现有 :root / .dark 中的 shadcn CSS 变量整体迁移到 [data-theme="neutral"]
和 [data-theme="neutral"].dark 选择器下,并保留 :root:not([data-theme]) 兜底
确保 inline 脚本未生效时仍维持原视觉。这是后续添加 11 个其他主题预设的基础。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:40:57 +08:00
xintaofei
2d5b71bf8a feat(appearance): add FOUC prevention inline script
提供同步执行的 inline 脚本字符串,在 hydration 前从 localStorage 读取
themeColor 和 zoomLevel 写入 <html>,避免首次加载时的主题/缩放闪烁。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:36:44 +08:00
xintaofei
5298830fb8 feat(appearance): add theme presets constants module
定义 12 个 shadcn 主题预设标识、6 档缩放档位以及 UI 预览代表色,
作为后续 AppearanceProvider 和 globals.css 的共享基础。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:35:31 +08:00
xintaofei
28f866e87a docs(dev-design): add appearance enhancement implementation plan
把外观设置增强的设计文档拆分为 10 个 bite-sized 实施任务(含完整代码、命令、
检查点和提交信息),可由 fresh agent 顺序执行。每个任务后留下独立 commit,
任务之间避免出现"半成品"状态。包含一项对设计的微调:默认主题色从 zinc
改为 neutral,因为当前 globals.css 的实际值与 shadcn neutral 预设一致,
保证升级后视觉零差异。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:31:26 +08:00
xintaofei
ab49ff43bc docs(dev-design): add appearance settings enhancement design
新增设计文档:外观设置页面增加 Window Zoom Level 和 Theme Color 两项偏好。
采用 shadcn 官方主题化方案(data-theme 属性 + CSS 变量),localStorage 持久化,
FOUC 防闪烁 inline 脚本,12 个预设主题色盘,6 档窗口缩放。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:11:18 +08:00
xintaofei
328884c802 # Release version 0.7.2
- feat(chat): show skills list on $ trigger for Codex instead of experts.
- fix(chat): restore ~/.agents/skills/ as additional Codex skill dir.
- fix(chat): support mid-text slash trigger and keyboard scroll in autocomplete.
- fix(chat): stop plan in-progress spinner when agent is not streaming.
-----------------------------
# 发布版本 0.7.2

- 新增(聊天):Codex 输入 $ 时显示技能列表,替代原有的专家列表;
- 修复(聊天):恢复 ~/.agents/skills/ 作为 Codex 额外的技能目录;
- 修复(聊天):支持在文本中间触发斜杠命令,自动补全支持键盘滚动;
- 修复(聊天):当 agent 未在流式响应时停止 plan 进行中的 spinner。
2026-04-11 11:23:30 +08:00
xintaofei
3901c40518 fix(chat): stop plan in-progress spinner when agent is not streaming
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:20:28 +08:00