Repository navigation
Add vibe-coded custom sidebar examples - #5895
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds two downloadable custom sidebar examples (finder.swift, status-board.swift), a unit test validating them with a rich example data context, and README/docs with installation, validation, and enablement steps. ChangesCustom Sidebar Examples and Validation
Sequence DiagramsequenceDiagram
participant Shell
participant CmuxCLI
participant CustomSidebarValidator
participant ExamplesDir
Shell->>CmuxCLI: cp Examples/... ~/.config/cmux/sidebars
Shell->>CmuxCLI: cmux sidebar validate --path Examples/CustomSidebars
CmuxCLI->>CustomSidebarValidator: validate(examplesPath, dataContext)
CustomSidebarValidator->>ExamplesDir: read sidebar files (finder.swift, status-board.swift)
CustomSidebarValidator->>CmuxCLI: return validation results
Shell->>CmuxCLI: cmux sidebar select "Finder" / "Status board"
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 1 warning, 1 inconclusive)
✅ Passed checks (17 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 |
Greptile SummaryThis PR adds two vibe-coded custom sidebar examples (
Confidence Score: 5/5These are new example files and documentation; no production app or runtime code is changed, and the validator test guards correctness end-to-end. All changes are additive — two example Swift files copied to a user's config dir, updated docs, and a new test case. Prior review threads flagged the algorithmic complexity of the five-filter pass and the inline English labels; both are acknowledged in the README (inline labels are intentional pending localization catalog support), and the filter input is bounded to prefix(80) with an explanatory comment. No unguarded regressions were introduced in cmux's compiled codebase. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
WS[workspaces context] --> PFX["prefix(80) — boardWorkspaces"]
PFX --> F1["filter laneOf == urgent"] --> URGENT["lane: Urgent bugs (prefix 20)"]
PFX --> F2["filter laneOf == review"] --> REVIEW["lane: In review (prefix 20)"]
PFX --> F3["filter laneOf == wip"] --> WIP["lane: In progress (prefix 20)"]
PFX --> F4["filter laneOf == research"] --> RESEARCH["lane: Research (prefix 20)"]
PFX --> F5["filter laneOf == done"] --> DONE["lane: Done (prefix 5)"]
subgraph laneOf [laneOf classification]
L1{"hasPR && status != open"} -->|yes| D[done]
L1 -->|no| L2{"isBug"}
L2 -->|yes| U[urgent]
L2 -->|no| L3{"hasPR"}
L3 -->|yes| R[review]
L3 -->|no| L4{"dirty OR progress OR prompt"}
L4 -->|yes| W[wip]
L4 -->|no| RS[research]
end
subgraph finder [finder.swift HSplitView]
WS2[workspaces] --> PFX2["prefix(30) → Reorderable left pane"]
WS2 --> SEL["filter selected → workspaceDetails right pane"]
end
Reviews (2): Last reviewed commit: "Address sidebar example review feedback" | Re-trigger Greptile |
| let directory = examplesDirectory() | ||
| let report = validator.validate(directory: directory, dataContext: Self.richSidebarContext) | ||
|
|
||
| #expect(report.names == ["finder", "status-board"]) |
There was a problem hiding this comment.
Ordered name assertion may be flaky across filesystems
report.names == ["finder", "status-board"] hardcodes alphabetical order, but FileManager.contentsOfDirectory does not guarantee a stable order — on Linux CI (ext4) entries come back in hash order, not lexicographic. If the validator internally sorts before building names, this is fine, but nothing in the test documents that guarantee. A deterministic alternative is to assert containment and count, or explicitly call .sorted() on the result side so the intent is self-evident.
The only other report.names assertion in the suite (#expect(report.names == ["missing"])) has a single element, so it gives no ordering signal either way.
| let research = workspaces.filter { laneOf($0) == "research" }.sorted { $0.unread > $1.unread } | ||
| let done = workspaces.filter { laneOf($0) == "done" } | ||
|
|
||
| lane(urgent, "exclamationmark.triangle.fill", "Bugs urgent need help", "#F7768E", clock.epoch) |
There was a problem hiding this comment.
Hardcoded English user-visible strings without localization
The lane label "Bugs urgent need help" is awkward as UI copy (reads like unfinished vibe-generated text). More broadly, both sidebar examples display strings that appear live in the cmux UI — "Status board", "none", "In review", "In progress", "Research", "Done" here, and "Cmux", "Favorites", "Tabs", "No tabs in this workspace" in finder.swift — none of which pass through a localized API. While these are example files rather than compiled production UI, they're intended as user-adopted sidebars and the cmux-full-internationalization rule flags UI text not routed through String(localized:defaultValue:). If the interpreter cannot call localized APIs, a note in the README or a brief comment in the examples acknowledging this limitation would clarify the design intent.
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!
| let urgent = workspaces.filter { laneOf($0) == "urgent" }.sorted { urgencyRank($0) > urgencyRank($1) } | ||
| let review = workspaces.filter { laneOf($0) == "review" }.sorted { $0.unread > $1.unread } | ||
| let wip = workspaces.filter { laneOf($0) == "wip" }.sorted { $0.unread > $1.unread } | ||
| let research = workspaces.filter { laneOf($0) == "research" }.sorted { $0.unread > $1.unread } | ||
| let done = workspaces.filter { laneOf($0) == "done" } |
There was a problem hiding this comment.
Five full workspace scans per render with
laneOf called repeatedly
The five sequential .filter { laneOf($0) == "…" } calls each walk the full workspace list, and laneOf computes bugText (string concatenation + lowercasing) on every element for every call. For a user with ~1 000 workspaces and a live-updating sidebar, every render triggers 5 000 bugText evaluations. A single pass with a Dictionary(grouping:) or a cached laneOf result would drop this to O(n). This is an example file that users may adapt as-is, so it's worth noting in a comment rather than leaving a silent complexity trap.
Rule Used: Flag production code that adds nested full-collect... (source)
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Summary
Examples/CustomSidebars:status-board.swiftand a Finder-stylefinder.swift.docs/custom-sidebars.mdand the examples README.Testing
swift test --package-path Packages/CmuxSwiftRenderUI --filter CustomSidebarValidationTestsIssues
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Adds two downloadable, vibe-coded custom sidebar examples for
cmux(status-board.swiftandfinder.swift), with docs and tests so users can copy, enable, select, and validate them.New Features
Examples/CustomSidebars/status-board.swiftandExamples/CustomSidebars/finder.swift.Migration
mkdir -p ~/.config/cmux/sidebars && cp Examples/CustomSidebars/{status-board.swift,finder.swift} ~/.config/cmux/sidebars/cmux sidebar select status-boardcmux sidebar validate status-boardandcmux sidebar validate finderWritten for commit c324dbf. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation
Tests