feat: add run profile feature#11
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
Adds a run profile feature to RxCode, including persisted run configurations, toolbar run/stop controls, an inspector tab for run output, process execution helpers, and core tests.
Changes:
- Added run profile models, environment parsing, wrapper script generation, and persistence.
- Added SwiftUI configuration, toolbar, and run output inspector views.
- Added tests for core run profile helpers and
.envparsing.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
RxCode/Views/Toolbar/RxCodeToolbar.swift |
Adds the run profile toolbar group. |
RxCode/Views/RunProfile/RunProfileToolbarGroup.swift |
Implements profile selection plus run/stop toolbar controls. |
RxCode/Views/RunProfile/RunOutputInspectorView.swift |
Adds the Run inspector output UI and terminal host. |
RxCode/Views/RunProfile/RunConfigurationsView.swift |
Adds the run configuration editor sheet. |
RxCode/Views/MainView.swift |
Presents the run configurations sheet. |
RxCode/Views/Inspector/RightInspectorPanel.swift |
Handles the new Run inspector tab case. |
RxCode/Views/Inspector/InspectorContentView.swift |
Mounts the Run inspector view. |
RxCode/Services/RunProfile/RunService.swift |
Adds run task lifecycle and terminal process management. |
RxCode/Services/PersistenceService.swift |
Persists run profiles per project. |
RxCode/App/AppState.swift |
Adds run service ownership and run profile cache/load/save APIs. |
Packages/Tests/RxCodeCoreTests/RunTaskExecutorTests.swift |
Tests run task helper behavior and model round-tripping. |
Packages/Tests/RxCodeCoreTests/RunEnvFileParserTests.swift |
Tests .env parser behavior. |
Packages/Sources/RxCodeCore/WindowState.swift |
Adds Run inspector tab and per-window run UI state. |
Packages/Sources/RxCodeCore/RunProfile/RunTaskExecutor.swift |
Adds working-directory, environment, and wrapper-script helpers. |
Packages/Sources/RxCodeCore/RunProfile/RunEnvFileParser.swift |
Adds .env parsing utilities. |
Packages/Sources/RxCodeCore/Models/RunStep.swift |
Adds run step model. |
Packages/Sources/RxCodeCore/Models/RunProfile.swift |
Adds run profile model. |
Packages/Sources/RxCodeCore/Models/BashRunConfig.swift |
Adds Bash run config, environment preset, and env var models. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+38
to
+42
| draft = appState.runProfiles(for: project.id) | ||
| selectedId = windowState.selectedRunProfileId ?? draft.first?.id | ||
| } | ||
| } | ||
|
|
| func ensureRunProfilesLoaded(for projectId: UUID) async { | ||
| if runProfilesByProject[projectId] != nil { return } | ||
| let loaded = await persistence.loadRunProfiles(projectId: projectId) | ||
| runProfilesByProject[projectId] = loaded |
Comment on lines
+108
to
+115
| // Login but *not* interactive: `-i` makes `set -e` + builtins (e.g. | ||
| // `cd`) exit with code 1 and skip the EXIT trap in zsh — a quirk that | ||
| // left users staring at a silent "exit 1" with no diagnostics. | ||
| // `-l` still sources /etc/zprofile and ~/.zprofile, which is where | ||
| // macOS and Homebrew configure PATH. The wrapper script also | ||
| // tolerantly sources ~/.zshrc for users who stash PATH there. | ||
| terminalView.startProcess( | ||
| executable: "/bin/zsh", |
Comment on lines
+86
to
+88
| // weirdness) can't leak back here. | ||
| lines.append("__rxcode_user_path=$(/bin/zsh -ic 'printf %s \"$PATH\"' 2>/dev/null)") | ||
| lines.append("[ -n \"$__rxcode_user_path\" ] && export PATH=\"$__rxcode_user_path\"") |
Comment on lines
+153
to
+154
| nonisolated func processTerminated(source: TerminalView, exitCode: Int32?) { | ||
| onTerminated(exitCode ?? -1) |
| } | ||
|
|
||
| func start() { | ||
| let envPairs = resolvedEnvironment.map { "\($0.key)=\($0.value)" } |
Comment on lines
+114
to
+118
| terminalView.startProcess( | ||
| executable: "/bin/zsh", | ||
| args: ["-lc", wrapperScript], | ||
| environment: envPairs, | ||
| currentDirectory: resolvedCwd |
| .frame(minWidth: 760, minHeight: 560, idealHeight: 620) | ||
| .onAppear { | ||
| draft = appState.runProfiles(for: project.id) | ||
| selectedId = windowState.selectedRunProfileId ?? draft.first?.id |
Comment on lines
+446
to
+450
| ForEach(steps.wrappedValue.indices, id: \.self) { i in | ||
| HStack(spacing: 6) { | ||
| Picker("", selection: Binding( | ||
| get: { steps.wrappedValue[i].type }, | ||
| set: { steps.wrappedValue[i].type = $0 } |
Comment on lines
+405
to
+423
| ForEach(preset.wrappedValue.manualVars.indices, id: \.self) { i in | ||
| HStack(spacing: 8) { | ||
| TextField("API_KEY", text: Binding( | ||
| get: { preset.wrappedValue.manualVars[i].key }, | ||
| set: { preset.wrappedValue.manualVars[i].key = $0 } | ||
| )) | ||
| .textFieldStyle(.roundedBorder) | ||
| .font(.system(.body, design: .monospaced)) | ||
| .frame(width: 140) | ||
|
|
||
| TextField("value", text: Binding( | ||
| get: { preset.wrappedValue.manualVars[i].value }, | ||
| set: { preset.wrappedValue.manualVars[i].value = $0 } | ||
| )) | ||
| .textFieldStyle(.roundedBorder) | ||
| .font(.system(.body, design: .monospaced)) | ||
|
|
||
| Button { | ||
| preset.wrappedValue.manualVars.remove(at: i) |
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.