Commit Graph

458 Commits

Author SHA1 Message Date
xintaofei
7524613439 fix(ui): sharpen dialog rendering with flex centering and stronger ring
Replace translate-based centering with a grid place-items-center wrapper
to eliminate half-pixel subpixel blur on non-retina displays. Strengthen
the content border by switching from ring-foreground/5 to ring-border
and adding shadow-2xl for a clearer visual boundary.
2026-04-15 20:53:04 +08:00
xintaofei
2cec462594 feat(chat): stream partial tool output during live agent response
Live tool calls that produce output while running (e.g. streaming bash
stdout from Codex) now render their partial output in real time instead
of appearing blank until the tool completes. The tool card keeps its
running visual state — spinner and 24KB tail truncation — while chunks
arrive, and transitions to the completed state once the final status
lands. A WeakMap keyed on the ACP reducer's chunks-array identity
memoizes the joined output so repeated renders don't re-run O(n) string
concatenation.
2026-04-15 19:16:50 +08:00
xintaofei
2da2378ae3 feat(settings): add reasoning effort level for Claude Code
Add an Effort Level dropdown under the Claude Code model inputs with
options Low / Medium / High / Max (Opus only). The selection writes an
"effortLevel" key at the root of the Claude Code config JSON, and is
removed when the default is chosen. Manual edits to the native JSON
textarea stay in sync with the dropdown.
2026-04-15 16:38:39 +08:00
xintaofei
503b149d03 feat(settings): use overlay scrollbars for sub-page scroll areas 2026-04-15 15:54:22 +08:00
xintaofei
b46db2f1a1 feat(settings): add Enable Fast toggle for Codex service tier 2026-04-15 15:29:17 +08:00
xintaofei
a6f80088d0 feat(skills): support folder-scoped skills in agent sessions
- Thread workspace path through useAgentSkills so Codex $-autocomplete
  surfaces folder-local skills in addition to global ones; cache keyed
  by agent + workspace and invalidated per key on focus.
- Add Global/Folder scope tabs and a folder picker (sourced from the
  folder table via loadFolderHistory) to the Skills settings page.
  CRUD for skills now operates against the selected scope and folder.
- Default the settings right panel to a placeholder hint; the new-skill
  form only appears after clicking "New Skill" or selecting an existing
  skill. Search input is hidden in folder scope.
- Disable "New Skill" when folder scope has no folder chosen; show a
  pick-folder hint in the path preview for that state.
- Add scope/noSelectionHint/pickFolderHint strings across 10 locales.
2026-04-15 14:56:53 +08:00
xintaofei
3148966371 fix(folder): prevent branch submenu from being clipped in scroll area 2026-04-15 13:18:10 +08:00
xintaofei
f3630ba48a feat(folder): add commit reset action in git log
Add a "Reset to Here" context action for git log commit items in the folder page.

Show a reset dialog with branch, target commit, commit message, and reset mode details for soft, mixed, hard, and keep.

Disable reset when viewing a non-current branch filter and keep the action ordering under commit diff.

Add git_reset support across Rust commands, Tauri invoke registration, web handlers/routes, and frontend API/type bindings.

Add localized reset labels, mode descriptions, and toast messages across all supported languages.
2026-04-15 11:14:37 +08:00
xintaofei
66549ce2f7 feat(folder): add Add to session actions in changes menus
Add the Add to session context action for tracked and untracked nodes in the Changes panel, including root, directory, and file entries.

Reorder Changes context actions so Add to session is placed below View diff, and Rollback is placed below Add to VCS.

Update attachToCurrentSession translations to the Add to session wording across all supported locales.
2026-04-15 09:54:07 +08:00
xintaofei
98fc75e585 fix(folder): add sidebar blank-space conversation actions 2026-04-14 23:09:28 +08:00
xintaofei
570b142e44 fix(folder): align file workspace tab bar height 2026-04-14 22:44:27 +08:00
xintaofei
0557eab154 refactor(folder): remove workspace debug logging from aux panels 2026-04-14 22:39:57 +08:00
xintaofei
b5e8fd8acb feat(folder): unify workspace state streaming for tree and git panels
Introduce a shared workspace-state backend stream with snapshot/delta APIs for file tree and git changes.

Migrate both aux panels to a common frontend workspace store with lifecycle-safe stream handling.

Apply batched watch throttling, path-aware git refresh gating, no-op delta suppression, and bounded history compaction to improve runtime stability.
2026-04-14 22:26:36 +08:00
xintaofei
90e8bb645a fix(folder): prevent stale file watch subscriptions in aux tabs
Ensure async watch setup is safely discarded after effect cleanup.

Use idempotent watcher release logic to avoid duplicate subscriptions and unbalanced stop calls.
2026-04-14 16:43:35 +08:00
xintaofei
9f1540129b fix(folder): keep mobile sidebars closed on initial load
Prevent left and right sidebars from auto-opening on small screens during folder page initialization, regardless of persisted open state.

Gate mobile sidebar sheets behind restored panel state to avoid initial sidebar pop-in.
2026-04-14 15:52:52 +08:00
xintaofei
7808a5f0d0 feat(acp): notify when permission approval is requested
Send a system notification when an agent triggers a permission request while the app window is not visible.
2026-04-14 15:31:12 +08:00
xintaofei
f9c0887346 perf(chat): reduce input rerender overhead in conversation shell
Memoize ChatInput to minimize unnecessary updates in the chat input area during frequent parent renders.

Compute localized Claude API retry banner text lazily and only when retry state is present.
2026-04-14 15:12:14 +08:00
xintaofei
f9923df1fe feat(acp): surface Claude API retry state in chat input
Enable raw Claude SDK forwarding for ACP sessions and emit only system/api_retry events to the frontend.

Show a localized single-line retry banner with loading under the conversation input, including error details and retry progress.
2026-04-14 14:59:32 +08:00
xintaofei
0a39e1daf4 fix(windows): normalize Windows file paths with leading slash and add i18n to link safety dialog
Strip spurious leading slash from Windows drive-letter paths (/D:/foo → D:/foo) in parseLocalFileTarget so that workspace-relative comparison succeeds and local files can be opened correctly. Display the normalized path in the confirmation dialog. Internationalize all link safety dialog and toast strings across 10 locales.
2026-04-13 22:47:14 +08:00
xintaofei
96acd6039d perf(frontend): optimize ACP tool call output handling to reduce CPU and memory pressure
Replace raw_output single-string accumulation with a chunks array to
eliminate O(n^2) string concatenation on every 200ms terminal poll event.
Batch tool_call_update dispatches via requestAnimationFrame so multiple
agents no longer trigger 25+ React re-renders per second.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:05:26 +08:00
xintaofei
6ebfa2b744 fix(i18n): add ellipsis to reasoning thinking label across all locales
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:08:51 +08:00
xintaofei
917ff9a672 fix(frontend): fix find widget tooltip flicker, clipping, and close button alignment
- Prevent hover tooltip flicker by adding pointer-events:none to the
  .context-view overlay that covers trigger buttons
- Escape overflow:hidden clipping on ancestor elements by switching the
  tooltip overlay to position:fixed, with CSS custom properties
  (--cv-offset-x/y) set via ResizeObserver to translate container-relative
  coordinates to viewport-relative
- Give the find widget its own border/radius styles (no top border,
  bottom-only border-radius) since it slides from the editor top
- Adjust close button vertical position to align with action buttons

Closes #73

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:08:00 +08:00
xintaofei
41b28001af fix(frontend,macos): reduce dark mode white flash on window open
Detect dark/light mode before React hydrates to eliminate the visible
white-to-dark flash when opening windows in dark mode.

Frontend:
- Inline script now reads next-themes localStorage key and applies
  .dark class, colorScheme, and backgroundColor on <html> before first
  paint
- Add CSS-only fallback via prefers-color-scheme media query in an
  inline <style> tag that fires before any JS executes

macOS backend:
- Detect system dark mode via `defaults read -g AppleInterfaceStyle`
  (cached with OnceLock) and set native window background color to
  match dark theme in apply_platform_window_style
- Persist user appearance mode preference (dark/light/system) to DB
  alongside zoom level so new windows use the correct background
- Add update_appearance_mode Tauri command; frontend syncs on mount,
  on settings change, and on cross-window storage events

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:15:13 +08:00
xintaofei
5038e352f7 fix(frontend): restore os-theme-codeg scrollbar theme lost during merge
The merge commit ee60536 dropped the custom OverlayScrollbars theme
definition from globals.css, leaving scrollbar handles with zero size
and no background color. Restore the theme with a compound selector
(.os-scrollbar.os-theme-codeg) to ensure higher specificity than the
library's base defaults regardless of CSS load order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 23:10:13 +08:00
xintaofei
0f7286b858 fix(frontend): prevent body OverlayScrollbar from intercepting message list scroll events
The body-level OverlayScrollbar (position: fixed, z-index: 99999) with
clickScroll and dragScroll enabled was capturing pointer events on the
scrollbar track, preventing the message list's native scrollbar from
receiving them. Disable both interactions on the body instance since it
does not need to scroll.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 22:39:31 +08:00
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
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
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
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
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
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
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
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
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