Skip to content

Pending changes UI: show apply outcomes #403

Description

@jamesrochabrun

Parent: #398

Depends on: the apply outcome model from the fuzzy apply issue.

Goal

Show users what happened during pending edit preview generation: how many edits applied, which ones matched fuzzily, and which failed or were rejected.

Implementation Notes

Target area: app/modules/AgentHubCore/Sources/AgentHub/UI/PendingChangesView.swift.

Consume PreviewResult.outcomes from PendingChangesPreviewService and render compact, actionable status near the pending diff.

Expected UI behavior:

  • summary chip like Applied 3/4, with counts for exact/fuzzy/failed/rejected when present
  • fuzzy match rows include confidence and matched line range
  • failed rows include the reason
  • rejected artifact-contamination rows show a distinct error state and offending markers

Keep the diff preview itself focused; do not add a large explanatory panel unless there are failures/rejections.

Acceptance Criteria

  • Clean exact edits do not add noisy UI.
  • Partial MultiEdit previews visibly show applied count and failed edit reason.
  • Fuzzy previews show that a fuzzy match was used and where it matched.
  • Rejected previews show a clear rejection banner and cannot be accepted as if clean.

Tests

Add view-model or SwiftUI-friendly tests where practical. At minimum, keep PendingChangesPreviewServiceTests covering the data contract consumed by the UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions