Skip to content

feat: add run profile support#28

Merged
sirily11 merged 1 commit into
mainfrom
webstreaming
May 20, 2026
Merged

feat: add run profile support#28
sirily11 merged 1 commit into
mainfrom
webstreaming

Conversation

@sirily11
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 10:30
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 20, 2026 11:38am

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

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 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 thread RxCodeMobile/Views/SessionsList.swift Outdated
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 thread RxCode/App/AppState.swift
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 thread RxCode/App/AppState.swift
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)
@sirily11 sirily11 enabled auto-merge (squash) May 20, 2026 11:39
@sirily11 sirily11 merged commit 5731895 into main May 20, 2026
6 checks passed
@sirily11 sirily11 deleted the webstreaming branch May 20, 2026 11:41
@sirily11
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.7.0 🎉

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

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants