Skip to content

fix: diff view and create new diff view package#54

Merged
sirily11 merged 2 commits into
mainfrom
diff-view
May 25, 2026
Merged

fix: diff view and create new diff view package#54
sirily11 merged 2 commits into
mainfrom
diff-view

Conversation

@sirily11

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 25, 2026 04:34
@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 25, 2026 4:34am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes diff rendering across the app by extracting a shared DiffView Swift package and switching thread-change diffs to prefer snapshot-pair (before/after) content when available. It also improves the mobile “Briefing → New Thread” flow (including Git-init affordances) and extends desktop/mobile sync behavior (presence + auto-delete policy).

Changes:

  • Introduce DiffView (rendering + computation) and refactor existing diff surfaces to use it, including wrap/scroll toggles and snapshot-based diffs.
  • Add snapshot-pair capture/storage/sync for per-thread file edits (original + modified), including payload budgeting to avoid relay envelope limits.
  • Improve briefing navigation/new-thread creation on mobile (and UITests), plus add Git-init actions, paired-device online presence, and archived-chat auto-delete settings.

Reviewed changes

Copilot reviewed 51 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
RxCodeMobileUITests/Support/MobileAppRobot.swift Add robot helpers for New Thread sheet interactions.
RxCodeMobileUITests/Mock/MockRelayServer.swift Allow runtime-created sessions/threads for New Thread UITest flows.
RxCodeMobileUITests/iPhoneNavigationUITests.swift Add iPhone regression test for “new thread from briefing detail opens chat”.
RxCodeMobileUITests/iPadNavigationUITests.swift Add iPad regression test for “new thread from briefing split opens chat”.
RxCodeMobile/Views/ThreadChangesSheet.swift Prefer snapshot-pair diffs/stats; add diff display toggle and syntax language hinting.
RxCodeMobile/Views/RootView.swift Keep briefing navigation stable when opening sessions from briefing detail.
RxCodeMobile/Views/NewThreadSheet.swift Support preferred branch application when opening the New Thread sheet from context.
RxCodeMobile/Views/MobileBriefingView.swift Plumb session-opening callback; tweak unknown-branch presentation.
RxCodeMobile/Views/MobileBriefingDetailView.swift Add New Thread button/sheet; add “Initialize Git” affordance for unknown branch.
RxCodeMobile/State/MobileAppState+Intents.swift Add intent to request git init via branch op request.
RxCodeMobile/Resources/Localizable.xcstrings Add new localization keys and remove stale entries.
RxCode/Views/Sidebar/GitStatusView.swift Add “Initialize Git” button when project isn’t a repo.
RxCode/Views/Settings/MobileSettingsTab.swift Show paired device online/offline pill in settings list.
RxCode/Views/ProjectWindowView.swift Pass modified snapshot content into diff/preview file model.
RxCode/Views/MainView.swift Pass modified snapshot content into diff/preview file model.
RxCode/Views/Inspector/ThisThreadDiffView.swift Compute sidebar +/- counts from snapshot-pair when available.
RxCode/Views/ChatSettingsTab.swift Add auto-delete settings section (retention window + enable toggle).
RxCode/Views/Chat/BranchPickerChip.swift Show Init Git CTA when no branch can be detected; add init action.
RxCode/Services/ThreadStore.swift Add query for stale archived IDs; persist modified snapshot for file edits.
RxCode/Services/MobileSyncService+EventDispatch.swift Update offline/online tracking from delivery failures and inbound traffic.
RxCode/Services/MobileSyncService.swift Add OnlineState, presence probing loop, and gate relay broadcast for offline peers.
RxCode/App/AppState+Worktree.swift Implement auto-delete of archived chats beyond retention window.
RxCode/App/AppState+Stream.swift Persist snapshot-pair (original + modified) per file edit on tool_result.
RxCode/App/AppState+MobileSync.swift Handle new branch op .initGit requests from mobile.
RxCode/App/AppState+MobileSnapshots.swift Send snapshot pairs to mobile; apply size budget to avoid relay cap drops.
RxCode/App/AppState+Lifecycle.swift Run auto-delete at app launch after auto-archive.
RxCode/App/AppState+CrossProject.swift Capture pre-edit snapshots synchronously to avoid large-file race collapses.
RxCode/App/AppState.swift Replace async snapshot tasks with stored snapshots; add auto-delete UserDefaults.
Packages/Tests/RxCodeChatKitTests/MCPToolResultViewTests.swift Update tests for renamed tool detail sheet view.
Packages/Tests/RxCodeChatKitTests/FileDiffViewTests.swift Remove old FileDiffView diff-building tests (logic moved to DiffView/DiffComputation).
Packages/Tests/RxCodeChatKitTests/ChangeDiffViewTests.swift Update ChangeDiffView tests for DiffView-backed rendering.
Packages/Tests/DiffViewTests/GutterLayoutTests.swift Add tests for gutter column behavior across diff shapes.
Packages/Tests/DiffViewTests/DiffComputationTests.swift Add tests for snapshot/hunk/full-file diff computation and unified parsing.
Packages/Sources/RxCodeSync/Protocol/Payload+Sessions.swift Add originalContent/modifiedContent to SyncFileEdit with Codable support.
Packages/Sources/RxCodeSync/Protocol/Payload.swift Add .initGit to branch op operation enum.
Packages/Sources/RxCodeCore/Utilities/SyntaxHighlighter.swift Add helper to infer highlighting language from filename extension.
Packages/Sources/RxCodeCore/Utilities/GitHelper.swift Add async git init helper.
Packages/Sources/RxCodeCore/Models/ThreadFileEdit.swift Store modified snapshot alongside original snapshot; include in summary.
Packages/Sources/RxCodeCore/Models/PreviewFile.swift Carry modified snapshot content through preview/diff models.
Packages/Sources/RxCodeCore/Models/ChatMessage.swift Improve Codex diff parsing fallback; add modifiedContent to FileEditSummary.
Packages/Sources/RxCodeChatKit/ToolResultView.swift Add write-content diff rendering; rename detail sheet; improve diff marker synthesis.
Packages/Sources/RxCodeChatKit/MessageBubble.swift Improve transient tool summary expansion animation and transitions.
Packages/Sources/RxCodeChatKit/FileDiffView.swift Replace macOS-only renderer with DiffView; prefer snapshot-pair diffs.
Packages/Sources/RxCodeChatKit/ChatMessageListView.swift Match transient tool summary animation behavior.
Packages/Sources/RxCodeChatKit/ChangeDiffView.swift Delegate rendering + diff building to DiffView/DiffComputation; add snapshotStat helper.
Packages/Sources/DiffView/DiffView.swift New cross-platform SwiftUI diff renderer (wrap/scroll, sticky gutter).
Packages/Sources/DiffView/DiffLine.swift New shared diff line model with gutter line numbers.
Packages/Sources/DiffView/DiffComputation.swift New shared diff builders/parsers (snapshot, hunks, full-file, unified parsing).
Packages/Package.swift Register new DiffView library target and test target; wire dependency into RxCodeChatKit.
MobileUITestPlan-iPhone.xctestplan Add new iPhone navigation test to the plan.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +158 to +165
/// Types `text` into the New Thread sheet's prompt input and taps Send.
/// Waits for the sheet to dismiss so the caller can immediately assert on
/// whatever surface comes next.
func createNewThread(
with text: String,
file: StaticString = #filePath,
line: UInt = #line
) {
Comment on lines +109 to +129
let toDelete = allSessionSummaries.filter { staleIds.contains($0.id) }
for summary in toDelete {
let cwd = summary.worktreePath
?? projects.first(where: { $0.id == summary.projectId })?.path
do {
try await persistence.deleteSession(
projectId: summary.projectId,
sessionId: summary.id,
origin: summary.origin,
cwd: cwd
)
} catch {
logger.error("Auto-delete: failed to remove session \(summary.id): \(error.localizedDescription)")
}
}

allSessionSummaries.removeAll { staleIds.contains($0.id) }
for id in staleIds {
threadStore.delete(id: id)
sessionStates.removeValue(forKey: id)
}
$0.hasPrefix("+") || $0.hasPrefix("-") || $0.hasPrefix("@@")
}
let lines: [String] = hasAnyMarker ? rawLines : rawLines.map { line in
line.isEmpty ? line : "+" + line
@sirily11 sirily11 merged commit 5073e21 into main May 25, 2026
14 checks passed
@sirily11 sirily11 deleted the diff-view branch May 25, 2026 04:47
@sirily11

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.11.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants