Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public struct BrowserStackSidebar: CmuxExtensionSidebarMutableProvider {
}

public static func postStateDidLoadNotification() {
NotificationCenter.default.post(name: stateDidLoadNotification, object: nil)
// Dispatch async so SwiftUI views that subscribed to this notification
// inside `body` are guaranteed to have their .onReceive subscription
// installed before the post arrives. Without this, a small persisted
// state file can finish loading during the same render pass and the
// notification gets missed.
DispatchQueue.main.async {
NotificationCenter.default.post(name: stateDidLoadNotification, object: nil)
}
}

public func render(snapshot: CmuxExtensionSidebarSnapshot) -> CmuxExtensionSidebarRenderModel {
Expand Down
16 changes: 15 additions & 1 deletion Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import AppKit
import Bonsplit
import Combine
import CmuxExtensionKit
import CmuxExtensionSidebarExamples
import ImageIO
import Observation
import SwiftUI
Expand Down Expand Up @@ -9682,8 +9683,15 @@ enum CmuxExtensionSidebarSelection {
static let defaultsKey = "cmuxExtensionSidebar.providerId"
static let defaultProviderId = CmuxExtensionSidebarProviderID.defaultWorkspaces

// User-vibe-coded sidebar providers. To add your own:
// 1. Implement `CmuxExtensionSidebarProvider` in a new file under
// Examples/CmuxExtensionSidebarExamples/Sources/CmuxExtensionSidebarExamples/
// (or any Swift Package depended on by the cmux target).
// 2. Append your provider to `SidebarExamples.providers`.
// 3. Rebuild with `./scripts/reload.sh --tag <tag>` and pick it from the
// sidebar provider menu.
static var providers: [any CmuxExtensionSidebarProvider] {
[]
SidebarExamples.providers
}
Comment on lines 9693 to 9695

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing locale translations for all 18 non-ja locales

Localizable.xcstrings carries translations for 20 locales (ar, bs, da, de, en, es, fr, it, ja, km, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant), but every example.sidebar.* key — all 27 of them covering provider titles, subtitles, and section headings — is only translated for en and ja. Before this PR, SidebarExamples.providers was dead code ([]); wiring it in here makes these strings live in the provider menu for all locale users. On any non-English, non-Japanese device, every provider name and section header will fall back to the English default value instead of a translated string.

The fix is to add translated entries for all 18 remaining locales to each example.sidebar.* key in Resources/Localizable.xcstrings before shipping.

Rule Used: Flag production user-facing text that is not fully... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declining: per CLAUDE.md, the policy is "All user-facing strings must be localized [...] for all supported languages (currently English and Japanese)". The example.sidebar.* keys already match that policy with en+ja entries. These are clearly-labeled demo providers (com.example.cmux.sidebar.* IDs, subtitle "User extension") meant as templates for users vibe-coding their own sidebars, not first-class shipping features.


static var descriptors: [CmuxExtensionSidebarProviderDescriptor] {
Expand Down Expand Up @@ -10493,6 +10501,12 @@ struct VerticalTabsSidebar: View {
) { _ in
refreshExtensionSidebarSnapshot()
}
.onReceive(
NotificationCenter.default.publisher(for: BrowserStackSidebar.stateDidLoadNotification)
.receive(on: RunLoop.main)
) { _ in
refreshExtensionSidebarSnapshot()
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions cmux.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
E7E000000000000000000007 /* CmuxEventPublishing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7E000000000000000000008 /* CmuxEventPublishing.swift */; };
E7E000000000000000000001 /* CmuxEventStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7E000000000000000000002 /* CmuxEventStream.swift */; };
C0DE45000000000000000001 /* CmuxExtensionKit in Frameworks */ = {isa = PBXBuildFile; productRef = C0DE45000000000000000002 /* CmuxExtensionKit */; };
C0DE45000000000000000004 /* CmuxExtensionSidebarExamples in Frameworks */ = {isa = PBXBuildFile; productRef = C0DE45000000000000000005 /* CmuxExtensionSidebarExamples */; };
C0DE34020000000000000001 /* CmuxHelpCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DE34020000000000000003 /* CmuxHelpCommands.swift */; };
C0DE34020000000000000002 /* CmuxHelpResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DE34020000000000000004 /* CmuxHelpResource.swift */; };
E7E00000000000000000000B /* CmuxLifecycleEventPublishing.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7E00000000000000000000C /* CmuxLifecycleEventPublishing.swift */; };
Expand Down Expand Up @@ -1120,6 +1121,7 @@
F53000A0A1B2C3D4E5F60718 /* CMUXAgentVault in Frameworks */,
5EDB6027B346C46521A93C74 /* CMUXAuthCore in Frameworks */,
C0DE45000000000000000001 /* CmuxExtensionKit in Frameworks */,
C0DE45000000000000000004 /* CmuxExtensionSidebarExamples in Frameworks */,
3069F1D10000000000000005 /* CMUXPasteboardFidelity in Frameworks */,
A5354303A5354303A5354303 /* CMUXSocketPathDomain in Frameworks */,
AA11BB22CC33DD44EE550001 /* CMUXWorkstream in Frameworks */,
Expand Down Expand Up @@ -1787,6 +1789,7 @@
29813FE5A6CBC1019289A251 /* CMUXAuthCore */,
AA11BB22CC33DD44EE550002 /* CMUXWorkstream */,
C0DE45000000000000000002 /* CmuxExtensionKit */,
C0DE45000000000000000005 /* CmuxExtensionSidebarExamples */,
3069F1D10000000000000006 /* CMUXPasteboardFidelity */,
F53000A2A1B2C3D4E5F60718 /* CMUXAgentVault */,
A5B00002A1B2C3D4E5F60718 /* CMUXAgentLaunch */,
Expand Down Expand Up @@ -1920,6 +1923,7 @@
40B63BB4A170F0BD2D1DEFD1 /* XCLocalSwiftPackageReference "CMUXAuthCore" */,
AA11BB22CC33DD44EE550003 /* XCLocalSwiftPackageReference "CMUXWorkstream" */,
C0DE45000000000000000003 /* XCLocalSwiftPackageReference "CmuxExtensionKit" */,
C0DE45000000000000000006 /* XCLocalSwiftPackageReference "CmuxExtensionSidebarExamples" */,
3069F1D10000000000000007 /* XCLocalSwiftPackageReference "CMUXPasteboardFidelity" */,
F53000A1A1B2C3D4E5F60718 /* XCLocalSwiftPackageReference "CMUXAgentVault" */,
A5B00001A1B2C3D4E5F60718 /* XCLocalSwiftPackageReference "CMUXAgentLaunch" */,
Expand Down Expand Up @@ -2975,6 +2979,10 @@
isa = XCLocalSwiftPackageReference;
relativePath = Packages/CmuxExtensionKit;
};
C0DE45000000000000000006 /* XCLocalSwiftPackageReference "CmuxExtensionSidebarExamples" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Examples/CmuxExtensionSidebarExamples;
};
3069F1D10000000000000007 /* XCLocalSwiftPackageReference "CMUXPasteboardFidelity" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Packages/CMUXPasteboardFidelity;
Expand Down Expand Up @@ -3052,6 +3060,11 @@
package = C0DE45000000000000000003 /* XCLocalSwiftPackageReference "CmuxExtensionKit" */;
productName = CmuxExtensionKit;
};
C0DE45000000000000000005 /* CmuxExtensionSidebarExamples */ = {
isa = XCSwiftPackageProductDependency;
package = C0DE45000000000000000006 /* XCLocalSwiftPackageReference "CmuxExtensionSidebarExamples" */;
productName = CmuxExtensionSidebarExamples;
};
3069F1D10000000000000006 /* CMUXPasteboardFidelity */ = {
isa = XCSwiftPackageProductDependency;
package = 3069F1D10000000000000007 /* XCLocalSwiftPackageReference "CMUXPasteboardFidelity" */;
Expand Down
Loading