Repository navigation
Revert "Out-of-process custom sidebars: isolated interpreter + remote rendering (#5294)" - #5372
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR removes the out-of-process sidebar interpreter service and consolidates sidebar rendering to in-process only. It deletes the entire ChangesSidebar Rendering Consolidation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (15 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryThis PR reverts #5294 ("Out-of-process custom sidebars") to restore green CI after
Confidence Score: 3/5The revert correctly removes the out-of-process infrastructure, but two issues in the restored code need addressing before the branch is production-ready. The bulk of the change is a mechanical deletion (~3,000 lines of the out-of-process package) that is correct. Two concrete defects ride along in the restored production code path: mutating
Important Files Changed
Reviews (1): Last reviewed commit: "Revert "Out-of-process custom sidebars: ..." | Re-trigger Greptile |
| reload() | ||
| startWatcher() | ||
| if reloadObserver == nil { | ||
| reloadObserver = NotificationCenter.default.addObserver( | ||
| forName: .customSidebarReloadRequested, | ||
| object: nil, | ||
| queue: .main | ||
| ) { [weak self] notification in | ||
| let names = notification.userInfo?["names"] as? [String] | ||
| Task { @MainActor [weak self] in | ||
| self?.requestReload(names: names) | ||
| } | ||
| guard reloadObserver == nil else { return } | ||
| reloadObserver = NotificationCenter.default.addObserver( | ||
| forName: .customSidebarReloadRequested, | ||
| object: nil, | ||
| queue: .main | ||
| ) { [weak self] notification in | ||
| let names = notification.userInfo?["names"] as? [String] | ||
| Task { @MainActor [weak self] in | ||
| guard let self else { return } | ||
| guard self.matchesReloadRequest(names: names) else { return } | ||
| self.reload() |
There was a problem hiding this comment.
Observable cache mutation during body rendering
renderNode writes to cachedSource and cachedProgram — both plain stored properties on an @Observable class, so the macro wraps their setters with _$observationRegistrar.withMutation. Calling this method from CustomSidebarView.content (which runs during body) causes SwiftUI to schedule a re-invalidation mid-render on the first call for each new source string. In Debug you'll see "Modifying state during view update, this will cause undefined behavior." and in practice the view renders an extra cycle on every source change (initial load and each file reload). Annotating both properties @ObservationIgnored (they are an internal parse cache, not view-driving state) eliminates the spurious signal entirely.
Rule Used: Flag SwiftUI changes that can cause stale state, b... (source)
| @@ -26,9 +25,6 @@ let package = Package( | |||
| .product(name: "CmuxSwiftRender", package: "CmuxSwiftRender"), | |||
| .product(name: "CmuxSettings", package: "CmuxSettings"), | |||
| .product(name: "CmuxFileWatch", package: "CmuxFileWatch"), | |||
| ], | |||
| resources: [ | |||
| .process("Resources"), | |||
| ] | |||
| ), | |||
| .testTarget( | |||
There was a problem hiding this comment.
Deleted string catalog drops Japanese translations for three live UI strings
defaultLocalization: "en" and resources: [.process("Resources")] are both removed, and Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings is deleted entirely. CustomSidebarView still emits String(localized: "sidebar.custom.missing", defaultValue: ...), String(localized: "sidebar.custom.noView", defaultValue: ...), and String(localized: "sidebar.custom.error", defaultValue: ...). Without the catalog bundle, Swift resolves all three to their English defaultValue for every locale — Japanese users who previously saw "サイドバーエラー", "サイドバーファイルが空か見つかりません。", etc. will now see English. The fix is to keep (or restore) Localizable.xcstrings with at minimum the ja entries for these three keys, and reinstate defaultLocalization and the resources target in Package.swift.
Rule Used: Flag production user-facing text that is not fully... (source)
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Sidebar/CustomSidebarModel.swift`:
- Around line 63-80: start() currently only listens for
.customSidebarReloadRequested and no longer reacts to on-disk edits; restore a
file-change reload trigger by adding a filesystem watcher or a
NotificationCenter observer for file-change events in CustomSidebarModel.start()
that watches the mounted sidebar file(s) and calls reload() (use the existing
matchesReloadRequest(names:) check before reloading). Ensure the new watcher is
stored (analogous to reloadObserver) so it can be removed in stop(), and tie it
to the same logical identity used by TerminalController (or to the file URL(s)
associated with this CustomSidebarModel) so edits on disk trigger reload() just
like selection-based reloads.
- Around line 113-117: The matchesReloadRequest function currently treats nil
and [] the same; change its logic so nil still returns true (reload-all) but an
empty array returns false (no-op) while non-empty arrays check membership;
specifically update the private func matchesReloadRequest(names: [String]?) to
first if names == nil { return true }, then if names!.isEmpty { return false },
then return names!.contains(sidebarName) so that nil vs empty semantics are
preserved for sidebarName matching.
- Around line 29-35: Move all parse-cache mutations out of
CustomSidebarModel.renderNode(dataContext:) so renderNode reads only
cachedProgram; instead, perform parsing and update cachedSource/cachedProgram
inside reload() (or a dedicated lifecycle hook) and ensure reload() is invoked
from start() and from the .customSidebarReloadRequested notification handler
(posted by TerminalController) to refresh the cache; keep
matchesReloadRequest(names:) behavior as-is but ensure reload() only reparses
when source has actually changed relative to cachedSource and that start()
subscribes to the reload notification so external edits trigger reloads.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5bb91fe1-fa45-42dd-b7de-fa08bd50fa2e
📒 Files selected for processing (58)
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swiftPackages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/BetaFeaturesSection.swiftPackages/CmuxSidebarInterpreterService/Package.resolvedPackages/CmuxSidebarInterpreterService/Package.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient+ReexecSelf.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient+SidebarInterpreting.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterRequest.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterResponse.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/LengthPrefixedMessageChannel.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RemoteContextCache.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderInterpreterRunner.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderPointerEvent.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderScene.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderSurfaceGeometry.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerClient+ReexecSelf.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerClient.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerEvent.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerInbound.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerOutbound.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/SidebarInterpreterWorker.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteCustomSidebarView.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteHostedLayer.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteRenderContext.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteSidebarSurfaceView.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteWorkerRootView.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteWorkerWindow.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RenderWorkerCoordinator.swiftPackages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RunSidebarRenderWorker.swiftPackages/CmuxSidebarInterpreterService/Sources/cmux-sidebar-interpreter/main.swiftPackages/CmuxSidebarInterpreterService/Sources/cmux-sidebar-render-fixture/main.swiftPackages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/InterpreterClientTests.swiftPackages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/InterpreterWorkerLocator.swiftPackages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/LengthPrefixedMessageChannelTests.swiftPackages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/RenderWorkerClientTests.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/ActionCommand.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/ButtonAction.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/InProcessSidebarInterpreter.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/ModifierArg.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/RenderModifier.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/RenderNode.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/ReorderSpec.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/SidebarInterpreting.swiftPackages/CmuxSwiftRender/Sources/CmuxSwiftRender/SwiftValue.swiftPackages/CmuxSwiftRenderUI/Package.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/JSON/DSLDocument.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/JSON/DSLSidebarRenderer.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/RenderNodeView.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/SidebarTapTarget.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/SidebarTapTargetsKey.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstringsPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Sidebar/CustomSidebarContentView.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Sidebar/CustomSidebarModel.swiftPackages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Sidebar/CustomSidebarView.swiftResources/Localizable.xcstringsSources/ContentView.swiftSources/cmuxApp.swiftcmux.xcodeproj/project.pbxproj
💤 Files with no reviewable changes (46)
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/SidebarInterpreterWorker.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerOutbound.swift
- Packages/CmuxSwiftRender/Sources/CmuxSwiftRender/InProcessSidebarInterpreter.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient+SidebarInterpreting.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderScene.swift
- Packages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/LengthPrefixedMessageChannelTests.swift
- Packages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/InterpreterWorkerLocator.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderPointerEvent.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterResponse.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerClient+ReexecSelf.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerEvent.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteSidebarSurfaceView.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RemoteContextCache.swift
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Resources/Localizable.xcstrings
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Sidebar/CustomSidebarContentView.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterRequest.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteWorkerWindow.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderInterpreterRunner.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RunSidebarRenderWorker.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteWorkerRootView.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient+ReexecSelf.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderSurfaceGeometry.swift
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/SidebarTapTarget.swift
- Packages/CmuxSwiftRender/Sources/CmuxSwiftRender/SidebarInterpreting.swift
- Packages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/InterpreterClientTests.swift
- Packages/CmuxSidebarInterpreterService/Package.swift
- Resources/Localizable.xcstrings
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/JSON/DSLSidebarRenderer.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteCustomSidebarView.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RenderWorkerCoordinator.swift
- Packages/CmuxSidebarInterpreterService/Sources/cmux-sidebar-render-fixture/main.swift
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/SidebarTapTargetsKey.swift
- Packages/CmuxSidebarInterpreterService/Sources/cmux-sidebar-interpreter/main.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerClient.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/RenderWorkerInbound.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteHostedLayer.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/InterpreterClient.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarRemoteRender/RemoteRenderContext.swift
- Packages/CmuxSidebarInterpreterService/Package.resolved
- Packages/CmuxSidebarInterpreterService/Tests/CmuxSidebarInterpreterClientTests/RenderWorkerClientTests.swift
- Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift
- Packages/CmuxSwiftRenderUI/Package.swift
- Sources/cmuxApp.swift
- Packages/CmuxSwiftRenderUI/Sources/CmuxSwiftRenderUI/Rendering/RenderNodeView.swift
- Packages/CmuxSidebarInterpreterService/Sources/CmuxSidebarInterpreterClient/LengthPrefixedMessageChannel.swift
- cmux.xcodeproj/project.pbxproj
|
@coderabbitai resolve This is an urgent straight revert to restore a green |
|
🐇 🟢 🧠 Learnings used✅ Action performedComments resolved and changes approved. |
Reverts 56db7a9. The main
testsjob went red exactly at that commit (e380d42 immediately before it is green) with a cluster ofAppDelegateShortcutRoutingTestsfailures — see #5367 for the cluster analysis. The failing test files are byte-identical to green main, so the trigger is an interaction (likely test-host state or execution-order shift from the added code), but main must be green first; #5294 will be re-landed once the interaction is understood and thetestsjob passes on the re-land PR.🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Reverts the out-of-process custom sidebars feature (#5294) to restore a green main build after test failures in AppDelegateShortcutRoutingTests. Custom sidebars now render in-process again; the isolated interpreter and remote rendering path are removed.
CmuxSidebarInterpreterServicepackage, worker executables, and tests; deleted remote layer hosting and worker coordination code.CustomSidebarViewand model to interpret locally; removed app worker-mode flags and entry points.CmuxSettingsUIandCmuxSwiftRenderUI.Codablefrom render types inCmuxSwiftRendernow that no cross-process encoding is needed.Written for commit 6c2e51b. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Chores