feat(desktop): file-tree context-menu ops, git timeline, system tray#89
Merged
deepagent-ai merged 2 commits intoJul 24, 2026
Merged
Conversation
- file-tree right-click menu: copy/cut/paste/delete/rename/archive/extract - git file timeline dialog backed by a local git binary - system tray with close-to-tray (graceful Linux GNOME fallback when no StatusNotifierItem host, so a window is never stranded) - powerSaveBlocker to prevent idle sleep while the app is active - multi-platform hardening: EXDEV cross-device move fallback, Windows illegal filename chars, git-missing degradation, loopback-only filesystem bridge so a remote Server Edition sidecar never touches local paths - CI: add macOS to the unit matrix; wire desktop test/test:ci into turbo - tests: 62 unit cases covering pure decision logic and real fs/git/zip paths
The desktop file-management branch added ContextMenu, InlineInput, GitTimelineDialog, and toast/language imports to file-tree.tsx. Their Kobalte-backed UI leaves (context-menu, dialog, toast, v2/toast-v2) call solid-js/web template() at module top level; under bun:test solid-js resolves to its server build and template() throws notSup(), failing the file-tree.test.ts load. Stub those leaves the way collapsible/tooltip already are so the pure-function tests load the module without the client-only render path.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
6 tasks
deepagent-ai
pushed a commit
that referenced
this pull request
Jul 24, 2026
### Issue for this PR Closes # (no tracking issue — this fixes the `unit (macos)` CI failure seen on #89) ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? `c0b79979` ("perf(core): 修复启动慢根因 — sessions.json 防抖") changed `session-state.ts` `saveToDisk()` from a synchronous write to a debounced `setImmediate(flushToDisk)`. The I33-1 plan-store test (`packages/core/test/deepagent/plan-store.test.ts`) predates that change and still assumed synchronous persistence: ```ts SessionState.setPlan("s3", p) // only schedules setImmediate(flushToDisk), nothing on disk yet const raw = readFileSync(path.join(stateDir, "sessions.json"), "utf8") // ENOENT ``` The test body is fully synchronous, so whether the file exists at read time depends on event-loop timing — on the macOS runner it consistently fails with ENOENT, which is what failed unit (macos) (@deepagent-code/core#test:ci exit 1) on #89. The linux/windows jobs in that run were cancelled (fail-fast) before executing, so this is not actually macOS-specific. Fix: make the test async and yield one event-loop turn (await new Promise((resolve) => setImmediate(resolve))) after setPlan, so the debounced flushToDisk lands sessions.json before the assertion reads it. No production code changes. I also replaced the inline require("node:fs").readFileSync with the top-level readFileSync import. I verified the root cause by checking out c0b7997^ in a worktree: the test passes there and fails at dev HEAD, so the debounce commit is what broke it. ### How did you verify your code works? - cd packages/core && bun test test/deepagent/plan-store.test.ts → 8 pass / 0 fail (previously 7 pass / 1 fail with ENOENT) - Full package suite bun test (2236 tests / 225 files): this test was the only failure before the fix - bun run typecheck in packages/core passes ### Screenshots / recordings If this is a UI change, please include a screenshot or recording. N/A — test-only change. ### Checklist - [x] I have tested my changes locally - [x] I have not included unrelated changes in this PR Signed-off-by: thomas-yanga <odie_majere@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #
Type of change
What does this PR do?
Adds local filesystem operations and a git timeline to the desktop file tree, plus a system tray and power
management so the app can stay resident.
File-tree context menu (
packages/app/src/components/file-tree-*,packages/desktop/src/main/file-ops.ts): right-click any node to copy / cut / paste / delete / rename /compress to ZIP / extract ZIP. Ops run in the main process over IPC; every positional path is checked with
assertWithinRootso the bridge can't touch files outside the workspace.movePathfalls back to copy+removeon
EXDEV(cross-device).renamePathrejects Windows-illegal chars up front.Git file timeline (
git-timeline-dialog.tsx,git.ts): lists commit history for a single file viagit log --follow. Degrades to an empty state whengitis missing or the path is outside a repo.System tray + close-to-tray (
tray.ts,close-to-tray.ts,windows.ts): closing the window hides totray only when a tray was created. On Linux GNOME (no StatusNotifierItem host) tray creation fails silently and
close-to-tray stays disabled, so a window is never stranded.
before-quit/ tray Quit / Cmd+Q setisQuittingto bypass hide; macOS
activatere-shows a hidden window.Power:
powerSaveBlocker("prevent-app-suspension")keeps the app running while active, letting thedisplay sleep.
Server Edition gating (
desktop-api.ts,context/file.tsx): local fs + git ops require the desktopbridge AND a loopback sidecar — a remote Server Edition connection never touches the local filesystem.
CI (
.github/workflows/test.yml,turbo.json): addsmacos-14to the unit matrix; wires@deepagent-code/desktop#test/test:ciinto turbo with JUnit output.How did you verify your code works?
bun typecheckpasses across@deepagent-code/appand@deepagent-code/desktop(15-package turbo run).fs, realgitbinary, realzip.js:file-ops.test.ts(29): all ops, path-traversal defense, the rename cwd≠root edge case, and a real EXDEVcross-device move via
/dev/shm.git.test.ts(6): isTracked/fileLog/rename-follow against a throwaway repo.close-to-tray.test.ts(4): the full boolean table incl. the GNOME no-tray fallback.desktop-api.test.ts(8) +file-tree-menu.test.ts(15): the degradation rules.Screenshots / recordings
UI change — TODO: attach a screenshot of the file-tree context menu and the git timeline dialog.
Checklist