iOfficeAI / iOfficeAI/AionCore
Workspace file diff: baseline-vs-disk comparison can't produce diffs for staged files
- Dominant language
- Rust
- Stars
- 105
- Forks
- 169
- Avg merge
- 5h 58m
- Merged PRs (30d)
- 84
Description
## Summary
The workspace "Changes" panel computes file diffs as **baseline snapshot vs. current disk content** (renderer: `FileChangeList.loadDiffState` → `ipcBridge.fileSnapshot.getBaselineContent` → `POST /api/fs/snapshot/baseline`). This has no awareness of the git index, so **staged files cannot produce a meaningful diff** — expanding a staged file shows nothing.
## Impact
In the Changes panel, staged-group rows expose expand/preview actions but they yield empty diffs. (The frontend is temporarily hiding those buttons for staged rows as a stopgap — see iOfficeAI/AionUi#3684.)
## Expected
The snapshot/compare backend should support an **index-aware** diff so staged files can be diffed correctly:
- staged file → diff HEAD (or baseline) ↔ **index / staged content**
- unstaged file → diff index (or baseline) ↔ **working-tree content**
## Pointers
- Renderer consumer: `packages/desktop/src/renderer/pages/conversation/Workspace/components/FileChangeList.tsx` (`loadDiffState`)
- IPC: `ipcBridge.fileSnapshot.getBaselineContent` / `compare` → `/api/fs/snapshot/*`
- Backend owner: aioncore snapshot/compare module
Once the backend can return correct staged content, the frontend can re-enable expand/preview for staged files (see iOfficeAI/AionUi#3684).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing FileChangeList.tsx through ipcBridge.fileSnapshot.getBaselineContent and compare to the /api/fs/snapshot/* endpoints, then inspect the AionCore snapshot/compare module. Done means staged files compare HEAD or the baseline with index content, while unstaged files compare index or baseline with working-tree content, so staged expand/preview can be re-enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust, typescript
- Domain
- backend, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100