Skip to content

Workspace file diff: baseline-vs-disk comparison can't produce diffs for staged files #667

Description

@IceyLiu

Summary

The workspace "Changes" panel computes file diffs as baseline snapshot vs. current disk content (renderer: FileChangeList.loadDiffStateipcBridge.fileSnapshot.getBaselineContentPOST /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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions