feat: add run profile support#28
Merged
Merged
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 adds end-to-end “Run Profile” support for the mobile app by extending the sync protocol, adding mobile UI for listing/editing/running profiles, and mirroring live run task state (including recent terminal output) from the desktop.
Changes:
- Add mobile UI entry points and screens to view/edit run profiles and trigger run/stop actions.
- Extend the desktop↔mobile sync protocol and desktop AppState to send/receive run profile mutations and run task updates.
- Capture and sync a tail of terminal output for recent run tasks; also extend session summaries to include todo items.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| RxCodeMobile/Views/SessionsList.swift | Adds Run Profiles toolbar entry + sheets; implements mobile run profiles list/editor UI. |
| RxCodeMobile/Views/MobileChatView.swift | Falls back to desktop-provided todo snapshots when message-derived todos aren’t available. |
| RxCodeMobile/State/MobileAppState.swift | Stores mirrored run profiles/tasks and sends run profile mutation/run/stop requests. |
| RxCode/Services/RunProfile/RunService.swift | Adds output tail capture and a onTasksChanged hook for task state/output changes. |
| RxCode/Services/MobileSyncService.swift | Introduces relay handling + notifications for run-profile-related payloads and task updates. |
| RxCode/App/AppState.swift | Handles mobile run profile requests, includes run profiles/tasks in snapshots, and broadcasts task updates. |
| Packages/Tests/RxCodeSyncTests/PayloadTests.swift | Adds a snapshot round-trip test ensuring session todos are carried over the wire. |
| Packages/Sources/RxCodeSync/Protocol/Payload.swift | Adds new protocol payload types + snapshot fields for run profiles/tasks and session todos. |
| Packages/Sources/RxCodeCore/RunProfile/RunTaskExecutor.swift | Adds optional wrapper-script redirection to tee output into a desktop temp log. |
Comments suppressed due to low confidence (1)
RxCodeMobile/Views/SessionsList.swift:233
- This toolbar '+' button is icon-only; please add an accessibility label (e.g. "New Run Profile") so VoiceOver users can understand what it does.
ToolbarItem(placement: .primaryAction) {
Button {
editingProfile = Self.newProfile(projectID: projectID)
} label: {
Image(systemName: "plus")
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+46
| ToolbarItem(placement: .topBarTrailing) { | ||
| Button { | ||
| showingRunProfiles = true | ||
| } label: { | ||
| Image(systemName: "play.rectangle") | ||
| } |
Comment on lines
+273
to
+288
| if let task { | ||
| Button { | ||
| Task { await state.stopRunTask(task) } | ||
| } label: { | ||
| Image(systemName: "stop.fill") | ||
| } | ||
| .buttonStyle(.bordered) | ||
| .controlSize(.small) | ||
| .tint(.red) | ||
| } else { | ||
| Button { | ||
| Task { await state.runProfile(projectID: projectID, profileID: profile.id) } | ||
| } label: { | ||
| Image(systemName: "play.fill") | ||
| } | ||
| .buttonStyle(.borderedProminent) |
Comment on lines
+66
to
+71
| /// Desktop-owned run profiles per project, mirrored into the mobile app. | ||
| @Published var runProfilesByProject: [UUID: [RunProfile]] = [:] | ||
| /// Recent and active run tasks mirrored from the desktop. | ||
| @Published var runTasks: [MobileRunTaskSnapshot] = [] | ||
| @Published var inFlightRunProfileRequests: Set<UUID> = [] | ||
| @Published var lastRunProfileError: String? |
Comment on lines
+142
to
+161
| outputCaptureTask = Task { @MainActor [weak self] in | ||
| while !Task.isCancelled { | ||
| try? await Task.sleep(nanoseconds: 300_000_000) | ||
| guard let self else { return } | ||
| self.refreshOutputTail() | ||
| self.onOutputChanged(self.id) | ||
| if self.status.isTerminal { break } | ||
| } | ||
| self?.refreshOutputTail() | ||
| if let self { self.onOutputChanged(self.id) } | ||
| } | ||
| } | ||
|
|
||
| private func refreshOutputTail() { | ||
| guard let data = try? Data(contentsOf: outputLogURL), | ||
| let text = String(data: data, encoding: .utf8) | ||
| else { return } | ||
| terminalOutputTail = String(text.suffix(20_000)) | ||
| } | ||
|
|
Comment on lines
+2268
to
+2273
| private func broadcastMobileRunTasks() { | ||
| scheduleMobileSnapshotBroadcast() | ||
| guard !MobileSyncService.shared.pairedDevices.isEmpty else { return } | ||
| for task in runService.tasks.prefix(5) { | ||
| MobileSyncService.shared.broadcastRunTaskUpdate(mobileRunTaskSnapshot(task)) | ||
| } |
Comment on lines
+1716
to
+1718
| await replyRunProfileResult( | ||
| requestID: request.clientRequestID, | ||
| projectID: request.projectID ?? stoppedTask?.project.id ?? UUID(), |
Comment on lines
+40
to
+44
| case runProfileMutationRequest(RunProfileMutationRequestPayload) | ||
| case runProfileResult(RunProfileResultPayload) | ||
| case runProfileRunRequest(RunProfileRunRequestPayload) | ||
| case runProfileStopRequest(RunProfileStopRequestPayload) | ||
| case runTaskUpdate(RunTaskUpdatePayload) |
Contributor
Author
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.