Skip to content

Add vibe-coded custom sidebar examples - #5895

Merged
azooz2003-bit merged 2 commits into
mainfrom
feat-vibe-sidebar-examples
Jun 11, 2026
Merged

azooz2003-bit merged 2 commits into
mainfrom
feat-vibe-sidebar-examples

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jun 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add downloadable custom sidebar examples under Examples/CustomSidebars: status-board.swift and a Finder-style finder.swift.
  • Document how to copy, validate, and select the examples from docs/custom-sidebars.md and the examples README.
  • Add validator coverage so the downloadable examples render against representative workspace, tab, PR, progress, port, and clock data.

Testing

  • swift test --package-path Packages/CmuxSwiftRenderUI --filter CustomSidebarValidationTests

Issues

  • None

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds two downloadable, vibe-coded custom sidebar examples for cmux (status-board.swift and finder.swift), with docs and tests so users can copy, enable, select, and validate them.

  • New Features

    • Added Examples/CustomSidebars/status-board.swift and Examples/CustomSidebars/finder.swift.
    • Added examples README and expanded docs with install, validate, and select steps.
    • Added validator coverage that renders both examples against a richer, representative data set.
  • Migration

    • Copy: mkdir -p ~/.config/cmux/sidebars && cp Examples/CustomSidebars/{status-board.swift,finder.swift} ~/.config/cmux/sidebars/
    • Enable + select: Settings → Beta features → Custom sidebars; or cmux sidebar select status-board
    • Validate: cmux sidebar validate status-board and cmux sidebar validate finder

Written for commit c324dbf. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added two downloadable custom sidebar examples: Status Board (organize work items by urgency) and Finder (browse workspaces and tabs).
  • Documentation

    • Added step-by-step installation, enablement, selection, and validation instructions for custom sidebars; linked authoring guidance.
  • Tests

    • Added an automated validation test to verify downloadable custom sidebar examples.

@vercel

vercel Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 11, 2026 6:29pm
cmux-staging Building Building Preview, Comment Jun 11, 2026 6:29pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3fbdc3a1-90e6-448f-98fd-f3e96356ac11

📥 Commits

Reviewing files that changed from the base of the PR and between c8e3106 and c324dbf.

📒 Files selected for processing (3)
  • Examples/CustomSidebars/README.md
  • Examples/CustomSidebars/status-board.swift
  • Packages/CmuxSwiftRenderUI/Tests/CmuxSwiftRenderUITests/CustomSidebarValidationTests.swift

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Custom Sidebar Examples and Validation

Layer / File(s) Summary
Finder sidebar implementation
Examples/CustomSidebars/finder.swift
Finder-style two-panel layout with reorderable favorite workspaces on the left and a details panel on the right. Helper functions derive icons, tints, and display text (unread count, PR status, branch, progress, ports). Row and details views conditionally render status indicators and timestamps.
Status board sidebar implementation
Examples/CustomSidebars/status-board.swift
Activity lanes (urgent, review, wip, research, done) using keyword heuristics and metadata. Computes urgency, formats "ago" timestamps, and renders lane headers and truncated item rows with severity/PR/branch labels, dirty/progress indicators, and unread badges.
Validation tests and test context
Packages/CmuxSwiftRenderUI/Tests/CmuxSwiftRenderUITests/CustomSidebarValidationTests.swift
Adds CmuxSwiftRender import and a test that runs CustomSidebarValidator.validate against Examples/CustomSidebars, supplying a large static richSidebarContext and asserting expected sidebar names and zero validation errors. Includes examplesDirectory() helper.
Documentation and installation guide
Examples/CustomSidebars/README.md, docs/custom-sidebars.md
README and docs list the example files, show mkdir/cp install commands, cmux sidebar validate and cmux sidebar select usage, and describe each example's purpose.

Sequence Diagram

sequenceDiagram
  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"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • manaflow-ai/cmux#5327: Introduces/relates to CustomSidebarValidator validation features used by the new tests.
  • manaflow-ai/cmux#5823: Related changes to workspace PR/context fields that the example sidebars and validation tests rely on.

Poem

🐰 In branches, PRs, and lanes I hop,

Finder, Board — the sidebars pop.
Tests hum, docs show the way,
Copy, validate, enable — play!
A tiny rabbit cheers the day.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors, 1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Cmux Algorithmic Complexity ❌ Error finder.swift does eager full-scan filtering each render to find selection: ForEach(workspaces.filter { $0.selected }.prefix(1)); status-board bounds to workspaces.prefix(80). Avoid scanning all workspaces in finder.swift; use a provided selectedWorkspace/selectedTitle from dataContext or compute selection once upstream, then render without workspaces.filter.
Cmux Full Internationalization ❌ Error Rule requires Swift UI/menu/alert/command text be routed through String(localized:defaultValue:) (or equivalent). The new examples use hardcoded Text/Label strings (e.g., “Favorites”, “Status board”). Wrap all user-facing SwiftUI text in localized APIs (String(localized:defaultValue:)) and add corresponding Resources/*.xcstrings entries with translations for all supported locales.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the main changes and testing approach, but lacks Demo Video, Review Trigger block, and most Checklist items required by the template. Add a Demo Video section (or note N/A for documentation changes), include the Review Trigger block, and complete the Checklist with checkmarks indicating which items were done.
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add vibe-coded custom sidebar examples' accurately describes the main change—adding two downloadable custom sidebar examples (status-board.swift and finder.swift).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed No Swift 6 actor-isolation issues found: new examples/tests add no background UI/store access; CustomSidebarModel is @MainActor and validator uses Sendable SwiftValue synchronously.
Cmux Swift Blocking Runtime ✅ Passed Scanned PR-added Swift files (Examples/CustomSidebars/* and CustomSidebarValidationTests.swift) for forbidden blocking/sleep/sync/lock primitives per swift-blocking-runtime rules; none found.
Cmux Expensive Synchronous Load ✅ Passed PR diff only touches docs/examples/tests; in all changed Swift files there are no RestorableAgentSessionIndex.load, SharedLiveAgentIndex.shared, or .load() calls.
Cmux Cache Substitution Correctness ✅ Passed PR #5895 only adds custom sidebar example docs/code + validator test; the added sidebar/test sources contain no 'cache'/'snapshot'/'undo'/'history'/'persist' usage, so no cache-substitution in pers...
Cmux No Hacky Sleeps ✅ Passed PR diff only changes Swift example files, a Swift validator test, and docs/README; no TS/JS/shell/build runtime scripts changed and no sleep/timer keywords appear in the diff.
Cmux Swift Concurrency ✅ Passed Scanned added Swift files (status-board.swift, finder.swift) and CustomSidebarValidationTests.swift for legacy concurrency patterns (DispatchQueue.global().async, Combine/@published, completion han...
Cmux Swift @Concurrent ✅ Passed Scanned new Swift files (status-board.swift, finder.swift, CustomSidebarValidationTests.swift): no async/await/Task or @concurrent; only @MainActor on a test func, so no @concurrent/nonisolated-asy...
Cmux Swift File And Package Boundaries ✅ Passed PR adds new sidebar example Swift files (173, 229 lines) under Examples/CustomSidebars plus updates a 161-line test; boundary rules focus on Sources/CLI/Packages/cmuxTests/cmuxUITests oversized pro...
Cmux Swift Logging ✅ Passed Checked PR-added Swift files (status-board.swift, finder.swift, CustomSidebarValidationTests.swift) for print/debugPrint/dump/NSLog and file-scoped Logger; no matches found.
Cmux User-Facing Error Privacy ✅ Passed Reviewed the updated README/docs and SwiftUI sidebar example + validation test files for user-facing error/alert/recovery copy and sensitive upstream/secret details; no forbidden error text found.
Cmux Swiftui State Layout ✅ Passed Checked added Swift files (finder.swift, status-board.swift, CustomSidebarValidationTests.swift) for ObservableObject/@Published/@StateObject/@Bindable/GeometryReader/onAppear/Task/DispatchQueue/La...
Cmux Architecture Rethink ✅ Passed Scanned the added SwiftUI example files and the new validator test for forbidden timing/locking/polling/observer/side-channel patterns from swift-architectural-rethink; none were found.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed Added Swift files (finder.swift, status-board.swift) and new tests contain no NSWindow/NSPanel/Window/WindowGroup code, so no auxiliary close-shortcut ownership rule is implicated.
Cmux Source Artifacts ✅ Passed Rules file forbids generated logs/caches/build output/DerivedData; the PR-intended added files (custom sidebars README/finder/status-board, docs, and test) exist, are text/source, and contain none...
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-vibe-sidebar-examples

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds two vibe-coded custom sidebar examples (status-board.swift and finder.swift), docs covering installation and validation, and a round-trip validator test that renders both examples against a rich three-workspace fixture.

  • status-board.swift classifies workspaces into five Kanban lanes using keyword matching on title/branch/prompt signals; the input is pre-bounded to prefix(80) with an explanatory comment, and each lane is further capped before rendering.
  • finder.swift builds a Finder-style HSplitView with a source list (capped to prefix(30)) on the left and a full workspace inspector on the right; helper functions like workspaceDetails, finderRow, and tabRow are factored cleanly.
  • Tests validate both examples end-to-end with a representative richSidebarContext fixture covering PR, progress, port, and clock data; report.names is now .sorted() before comparison, resolving the filesystem-order concern raised in a prior review thread.

Confidence Score: 5/5

These 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

Filename Overview
Examples/CustomSidebars/finder.swift Adds a Finder-style HSplitView example with a source list capped to the first 30 workspaces and a full-scan inspector pane; logic is sound for an example file.
Examples/CustomSidebars/status-board.swift Adds a Kanban-style status board that classifies workspaces into five lanes; input is bounded to prefix(80) with an explanatory comment, and lane counts are passed through without re-scanning.
Packages/CmuxSwiftRenderUI/Tests/CmuxSwiftRenderUITests/CustomSidebarValidationTests.swift Adds a round-trip validation test against a rich three-workspace fixture; path resolution uses five .deletingLastPathComponent() calls from #filePath which is correct for the current package nesting depth. report.names is now sorted() before comparison, addressing the filesystem-order concern from a prior review.
Examples/CustomSidebars/README.md Adds install, validate, and description content for both examples; correctly notes that inline labels are intentional due to the absence of a localization catalog in interpreted sidebars.
docs/custom-sidebars.md Adds a Downloadable examples section with copy/validate/select commands; placed before Quick start with no conflicts with existing content.

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
Loading

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"])

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 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)

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.

P2 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!

Comment on lines +149 to +153
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" }

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.

P2 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)

@azooz2003-bit

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@azooz2003-bit
azooz2003-bit merged commit 7258d10 into main Jun 11, 2026
20 checks passed
@azooz2003-bit
azooz2003-bit deleted the feat-vibe-sidebar-examples branch June 11, 2026 18:57

This branch was successfully deployed

1 active deployment
Preview – cmux — c324dbf1 Deployed Jun 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant