Commit Graph

29 Commits

Author SHA1 Message Date
xintaofei
692b700c0d fix(file-tree): invalidate both cached target and ancestor, skip collapsed refetches
When a deep directory was renamed or deleted externally and both the
directory itself and a parent directory were cached, only the self entry
was cleared — leaving the parent's children list holding a ghost reference
to the old child. Walk up to the nearest cached ancestor in addition to
the direct hit so both stale entries are dropped together.

Also gate the follow-up getFileTree refetch on the directory still being
expanded. Collapsed branches only need their cache cleared; they will
re-hydrate naturally on the next expansion, which avoids unnecessary IPC
traffic during FS event bursts.
2026-04-20 23:20:08 +08:00
xintaofei
baf3b6e89f fix(file-tree): keep aux-panel tree in sync with filesystem changes
Deep directories (beyond the workspace snapshot's depth limit) relied on
a lazy-loaded override cache that was never invalidated, so agent-created
files, in-app deletes / renames / rollbacks, and external changes inside
expanded deep folders stayed invisible until the folder was reopened.

Propagate watcher `changed_paths` through the delta envelope and fire a
Meta event whenever FS activity doesn't alter the tree/git snapshots, so
the frontend can surgically invalidate affected cache entries and
re-fetch. Manual refresh (Reload from disk) clears the cache and
re-hydrates still-expanded deep dirs through the same path. Replayed
deltas after reconnect are forwarded to the same listeners.

Also split the combined workspace-state effect into tree / git / status
slices so unrelated state transitions (e.g. the 'resyncing' flip during
a refresh) no longer rebuild the entire node tree and cause a flash.
2026-04-20 22:57:24 +08:00
xintaofei
7ef8d84d44 fix(workspace-state): stop resync loop on non-git folders and allow retry for degraded watcher
Gate git refresh on .git presence so file churn in non-git workspaces no longer produces endless resync_hint events, and silently log tree/git refresh errors during watch flushing instead of flagging requires_resync, which turned transient failures into self-reinforcing loops.

Degrade gracefully when the filesystem watcher fails to attach (e.g. permission denied, inotify quota): keep the initial snapshot, surface a degraded flag, and expose a store-level restart that the banner uses to retry attachment after the root cause is fixed.

Propagate is_git_repo through the snapshot so the git log and changes tabs render a dedicated "Not a Git repository" empty state instead of raw git stderr with a useless retry button.

Stop polling get_git_branch from the title bar once it returns null and re-arm on visibility change.

Add translations for the new banner, empty-state, and retry keys across all ten locales.
2026-04-18 17:18:11 +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
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
150b927610 fix(ui): unify scrollbar styles across scrollable containers
Add .scrollbar-thin and .scrollbar-thin-edge utility classes in
globals.css and apply them to sidebar, file tree, git changes,
git log, session files, diff preview, and message thread panels.
Replace scattered inline webkit-scrollbar overrides with the
shared classes for consistent appearance and gutter behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 18:50:14 +08:00
xintaofei
9396127cd9 feat: add @ file mention support in chat input and unify directory attachment
Support typing "@" in the chat input to trigger a file list popup with
filtering, keyboard navigation, and file/directory attachment. Directories
from the sidebar file tree now attach as resource links instead of injecting
text into the input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:43:27 +08:00
xintaofei
f33f658a85 修复:“添加到VCS”的弹框显示了已经被git跟踪的文件 2026-04-01 10:39:15 +08:00
xintaofei
ac09d3db9e 初始化web服务功能 2026-03-25 14:26:26 +08:00
xintaofei
be08b59aa0 支持把目录附加到会话(临时处理) 2026-03-23 18:15:30 +08:00
xintaofei
aeddc37655 优化文件树git状态检测性能 2026-03-20 22:46:17 +08:00
xintaofei
dc461c1c18 文件搜索结果里对目录图标着色 2026-03-19 00:35:36 +08:00
xintaofei
33d70b8866 支持搜索文件和目录 2026-03-19 00:24:50 +08:00
xintaofei
c86ee488c4 修复构建错误 2026-03-15 23:26:20 +08:00
xintaofei
d386d8c2b9 Merge branch 'main' into cv-main-xx1jlt 2026-03-15 22:46:27 +08:00
xintaofei
7a3b32a9c6 新建文件/目录时输入框自动获得焦点 2026-03-15 22:46:19 +08:00
xintaofei
726a20c8ce 支持提交窗口中目录的右键快捷操作 2026-03-15 22:45:15 +08:00
xintaofei
157fa2b77f 修复.gitignore一处子目录/子文件着色问题 2026-03-15 18:33:50 +08:00
xintaofei
f4f70c438a 在文件树上支持右键添加文件和添加目录操作 2026-03-13 23:33:31 +08:00
xintaofei
874591a473 优化远程Git分组显示 2026-03-13 23:20:25 +08:00
xintaofei
3376974d0f 支持文件和变更区域的根目录快捷操作 2026-03-13 21:50:15 +08:00
xintaofei
080a969c1e 修复右侧边栏“提交”区域在没有提交记录时显示错误 2026-03-12 22:51:53 +08:00
xintaofei
91636ada7f 重构会话消息处理和显示逻辑 2026-03-10 19:32:44 +08:00
xintaofei
c1220e1a8f 优化事件处理 2026-03-08 17:08:31 +08:00
xintaofei
7b65fe8ddc 右侧边栏支持快捷操作“提交代码” 2026-03-08 08:42:51 +08:00
xintaofei
a356b813a6 folder页面全量多语言处理 2026-03-07 13:44:40 +08:00
xggz
54d1097b41 Initial commit 2026-03-06 22:56:13 +08:00