Skip to content

Require explicit Dock config - #3366

Merged
lawrencecchen merged 3 commits into
mainfrom
fix-custom-dock-json-only
Apr 30, 2026
Merged

lawrencecchen merged 3 commits into
mainfrom
fix-custom-dock-json-only

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #3217.

Changes:

  • Removes the built-in Feed fallback from Dock.
  • Leaves Dock empty unless .cmux/dock.json or ~/.config/cmux/dock.json exists.
  • Updates Feed sidebar UI test setup to provide a temporary custom Dock config.
  • Updates Dock docs to describe Feed as an example control, not a default control.

Verification:

  • git diff --check
  • jq empty Resources/Localizable.xcstrings
  • python3 scripts/swift_file_length_budget.py --budget .github/swift-file-length-budget.tsv
  • CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag fix-dock-json

Summary by CodeRabbit

  • New Behavior

    • Dock no longer includes a built-in default Feed; add a Feed control in your Dock config to enable it.
    • When no Dock config exists, Dock opens empty and offers to create a starter configuration.
    • Dock source label simplified to “Dock” for consistency.
  • Documentation

    • Guides updated with examples and instructions for configuring the Feed in Dock and managing Dock contents.

@vercel

vercel Bot commented Apr 30, 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 Apr 30, 2026 0:59am
cmux-staging Building Building Preview, Comment Apr 30, 2026 0:59am

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d39b89cc-cc3b-4e19-92eb-afc521b906bc

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd4206 and 2bd7082.

📒 Files selected for processing (1)
  • cmuxUITests/FeedSidebarUITests.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmuxUITests/FeedSidebarUITests.swift

📝 Walkthrough

Walkthrough

Removes the Dock's built‑in default Feed and associated UI‑test helpers; requires an explicit dock.json Feed control for the Feed sidebar; renames a localization key; updates UI tests to provision per‑run dock configs; updates docs to reflect explicit configuration behavior. (≤50 words)

Changes

Cohort / File(s) Summary
Localization
Resources/Localizable.xcstrings
Removed dock.default.feed.title; renamed dock.source.builtIn → dock.source.title and changed values from "Built‑in Dock" / "組み込みDock" to "Dock".
Dock UI Logic
Sources/DockPanelView.swift
Removed fallback that injected a built‑in feed control in resolve(rootDirectory:); removed UI‑test-only feed helpers and related fallback; updated non‑project source label to use dock.source.title; when UI testing read CMUX_UI_TEST_DOCK_CONFIG_PATH.
UI Tests
cmuxUITests/FeedSidebarUITests.swift
Create per‑run dock JSON and export CMUX_UI_TEST_DOCK_CONFIG_PATH; always resolve bunPath and write dock config atomically with a feed control whose env includes CMUX_FEED_TUI_READY_PATH; include CMUX_FEED_TUI_BUN_PATH only if bun found; delete temp config in setup/cleanup.
Documentation
docs/dock.md, docs/feed.md
Updated docs to require explicit Dock JSON for the Feed control, revised examples and wording about config search behavior and Bun/OpenTUI fallback, and clarified enabling the Feed sidebar via JSON.

Sequence Diagram(s)

sequenceDiagram
    participant Test as FeedSidebar\nUITests
    participant FS as File System
    participant Env as Environment
    participant App as DockPanelView

    Test->>FS: create temp dock.json (with Feed control)
    Test->>Env: set CMUX_UI_TEST_DOCK_CONFIG_PATH
    Test->>Env: set CMUX_UI_TEST_MODE="1"
    Test->>App: launch app
    App->>Env: read CMUX_UI_TEST_DOCK_CONFIG_PATH
    App->>FS: load dock.json config
    App->>App: initialize Dock (no built-in feed fallback)
    Test->>FS: cleanup temp dock.json
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

Poem

🐰 I used to tuck a Feed inside,
Now configs tell me where to hide.
Tests leave crumbs of JSON bright,
Dock waits patient, day or night.
Hop on—write your Dock just right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Require explicit Dock config' clearly and concisely summarizes the main change: removing built-in Dock defaults and requiring explicit configuration.
Description check ✅ Passed The PR description covers what changed and why, but omits the template's Testing section (no test verification details provided) and Demo Video section.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix-custom-dock-json-only

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
Review rate limit: 4/8 reviews remaining, refill in 27 minutes and 58 seconds.

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

@greptile-apps

greptile-apps Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the built-in Feed fallback from Dock: the resolve function now returns an empty controls array when no config file is found, defaultFeedControl/defaultFeedCommand/shellSingleQuoted helpers are deleted, and the UI-test injection path is replaced with a temporary dock config file written before app launch. Docs and localization strings are updated to match the explicit-config-only model.

Confidence Score: 4/5

Safe to merge; the only finding is a leftover dead launch-environment assignment in the UI test.

All production code changes are straightforward removals with a clean empty-fallback replacement. One P2 finding in the test file — CMUX_UI_TEST_FEED_TUI_BUN_PATH is set but never read by the app after this PR — has no runtime impact on production behavior.

cmuxUITests/FeedSidebarUITests.swift — dead CMUX_UI_TEST_FEED_TUI_BUN_PATH launch environment entry.

Important Files Changed

Filename Overview
Sources/DockPanelView.swift Removes built-in Feed fallback and related helpers; empty controls array is now the default; globalConfigURL gains a UI-test redirect via CMUX_UI_TEST_DOCK_CONFIG_PATH.
cmuxUITests/FeedSidebarUITests.swift Replaced env-var-driven Feed injection with a written dock config file; CMUX_UI_TEST_FEED_TUI_BUN_PATH is set but is now dead (Bun path already embedded in the config file via writeFeedDockConfig).
Resources/Localizable.xcstrings Removes dock.default.feed.title string; renames dock.source.builtIn to dock.source.title with simplified copy.
docs/dock.md Rewrites Feed from a default control to an example config snippet; documents empty-Dock behavior and removes mention of built-in fallback.
docs/feed.md Single sentence updated to reflect that Feed TUI in Dock now requires an explicit user-added control.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[DockControlsStore.resolve] --> B{Project .cmux/dock.json found?}
    B -- Yes --> C[loadConfig from project URL]
    B -- No --> D{globalConfigURL exists?}
    D -- "UI test mode + CMUX_UI_TEST_DOCK_CONFIG_PATH set" --> E[Redirect to temp test dock.json]
    D -- Normal --> F[~/.config/cmux/dock.json]
    E --> G{File exists?}
    F --> G
    G -- Yes --> H[loadConfig from global URL]
    G -- No --> I[Return empty controls array - Dock shows empty state]
    C --> J[Dock populated with controls]
    H --> J
Loading

Reviews (1): Last reviewed commit: "fix: require custom dock config" | Re-trigger Greptile

Comment thread cmuxUITests/FeedSidebarUITests.swift
@lawrencecchen
lawrencecchen merged commit 314dbf9 into main Apr 30, 2026
21 checks passed
@lawrencecchen
lawrencecchen deleted the fix-custom-dock-json-only branch April 30, 2026 13:13
ShubhamPatilsd pushed a commit to emergent-inc/mosaic that referenced this pull request Jul 9, 2026

This branch was successfully deployed

1 active deployment
Preview – cmux — 2bd7082c Deployed Apr 30, 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