Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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.
| /// 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 | ||
| ) { |
| 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 |
|
🎉 This PR is included in version 1.11.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.