Gate Feed behind Beta Features (mirror Dock), default off - #5174
Conversation
Feed was made unconditionally available by #3854 (5829da2, "Enable Feed by default"), which deleted its beta gating. This reinstates the gating — mirroring Dock exactly — so Feed is hidden from the right-sidebar mode switcher until the user opts in under Settings → Beta Features. Default is off, same as Dock. Only the gating-removal hunks of #3854 are reinstated; that PR's Feed focus-handling bugfixes (and the "All Activity" rename) are preserved. The Settings layer was refactored into Swift packages since #3854, so Feed is mirrored in both parallel registrations Dock now lives in: - RightSidebarBetaFeatureSettings: add feedEnabledKey / defaultFeedEnabled / isFeedEnabled mirroring the Dock members (rightSidebar.beta.feed.enabled, default false). - RightSidebarMode+Availability: gate .feed on feedEnabled, threaded through availableModes / isAvailable alongside dockEnabled (reverts to the pre-#3854 shape). - RightSidebarPanelView: read feedEnabled via @AppStorage and feed it into availability + refresh-on-change. - App-target search index (SettingsNavigation, SettingsSearchAliases) and CmuxSettingsUI package index (CuratedSettingEntry+Default, SettingsSectionID): register the feed beta setting, anchor, and aliases mirroring dock. - CmuxSettings BetaFeaturesCatalogSection: add rightSidebarFeed catalog key (cmux.json-configurable, default false). - CmuxSettingsUI BetaFeaturesSection: re-add the Feed toggle row (SettingsBetaFeedToggle) with on/off subtitle. - CommandPaletteSettingsToggle: add the betaFeatures.feed toggle command. - Localizable.xcstrings: restore settings.betaFeatures.feed / .subtitleOn / .subtitleOff (en + ja). The plural beta warning already covers >1 feature (Dock + Extensions), so it is unchanged. Tests: - FileExplorerStateModePersistenceTests / RightSidebarCommandPaletteTests: restore the gated assertions (disabled Feed clamps to Files; default mode set excludes Feed). - RightSidebarChromeHeightUITests: re-add the feed-enable launch arg so the feed secondary bar is reachable. - SettingsSidebarBetaBehaviorUITests: add a Feed toggle derived-subtitle test mirroring the Dock one. - SettingsRowAnchorResolutionTests: register the feed search anchor. Feed hooks (per-tool-use feed.push installers) are intentionally NOT gated on this flag — see PR description. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughGates the right-sidebar Feed mode behind a new opt-in beta toggle. Adds the persistent setting and runtime accessor, restores the Settings UI toggle and localization, threads feedEnabled into availability and panel logic, registers search/navigation/command-palette entries, and updates tests. ChangesFeed Beta Feature Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (16 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 reinstates the beta gate for the Feed right-sidebar mode, making it opt-in (default off) to match Dock's existing gating under Settings → Beta Features. The change is purely UI/settings-layer: feed hooks remain installed and are not affected.
Confidence Score: 5/5Safe to merge — all changes are additive UI/settings gating that mirrors an already-proven pattern; no data, hooks, or auth paths are touched. The change is a faithful, symmetrical replication of the Dock beta gate. Every production callsite (availability filter, @AppStorage observer, settings UI, command palette, search index, xcstrings) is updated consistently, and the existing Dock path provides a working template. Localization is complete for both supported locales. Tests cover the new default-off behavior and the settings subtitle round-trip. No production logic is removed or altered beyond the feed availability predicate. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[UserDefaults key: rightSidebar.beta.feed.enabled] -->|AppStorage| B[RightSidebarPanelView feedEnabled]
A -->|isFeedEnabled| C[RightSidebarMode+Availability]
B --> C
C -->|false| D[Mode switcher: Files, Find, Sessions]
C -->|true| E[Mode switcher: Files, Find, Sessions, Feed]
F[BetaFeaturesSection feedRow Toggle] -->|DefaultsValueModel.set| A
G[CommandPalette betaFeatures.feed] -->|UserDefaults write| A
H[cmux.json rightSidebar.beta.feed.enabled] -->|SettingCatalog| A
B -->|onChange| I[refreshModeAvailabilityAndFocusIfNeeded]
Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmuxTests/FileExplorerStateModePersistenceTests.swift (1)
1-96: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winConvert to Swift Testing per coding guideline.
This file should be migrated to Swift Testing when adding or modifying tests. The coding guideline requires: "Use Swift Testing (import Testing,
@Test,@Suite,#expect,#require) for all unit and integration tests" and "When touching existing XCTest test, convert in place."The learning exemption for XCTest-based integration tests applies only to suites with tightly-coupled Unix-socket mock server harnesses. This file is a simple unit test suite using UserDefaults and does not meet the exemption criteria.
As per coding guidelines: convert XCTestCase →
@Suite, test methods →@Test, XCTAssert →#expect, setUp/tearDown → init/deinit.Conversion outline
import Testing import Foundation `@testable` import cmux_DEV // or cmux `@Suite` struct FileExplorerStateModePersistenceTests { private let modeKey = "rightSidebar.mode" private let feedEnabledKey = RightSidebarBetaFeatureSettings.feedEnabledKey private let dockEnabledKey = RightSidebarBetaFeatureSettings.dockEnabledKey init() { resetDefaults([modeKey, feedEnabledKey, dockEnabledKey]) } deinit { resetDefaults([modeKey, feedEnabledKey, dockEnabledKey]) } `@Test` func disabledFeedStoredModeFallsBackToFiles() { withSavedRightSidebarModeDefaults { let defaults = UserDefaults.standard defaults.set(RightSidebarMode.feed.rawValue, forKey: modeKey) defaults.set(false, forKey: feedEnabledKey) let state = FileExplorerState() `#expect`(state.mode == .files) `#expect`(defaults.string(forKey: modeKey) == RightSidebarMode.files.rawValue) } } // ... convert remaining tests similarly }🤖 Prompt for 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. In `@cmuxTests/FileExplorerStateModePersistenceTests.swift` around lines 1 - 96, Convert the XCTest-based suite FileExplorerStateModePersistenceTests to Swift Testing: replace import XCTest with import Testing, change the test container from class FileExplorerStateModePersistenceTests: XCTestCase to `@Suite` struct FileExplorerStateModePersistenceTests, convert each test method (e.g., testDisabledFeedStoredModeFallsBackToFiles, testEnabledFeedStoredModeSurvives, testModeSetterClampsUnavailableBetaModes, testCLIArgumentNormalizerMapsVaultAndSessionsToSessions) to `@Test` functions, replace XCTAssert* assertions with `#expect` expressions, move setUp/tearDown logic (the withSavedRightSidebarModeDefaults helper and its restore) into init/deinit (or a resetDefaults helper) to preserve state isolation, and ensure `@testable` import selection remains (cmux_DEV / cmux).
🤖 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/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/BetaFeaturesSection.swift`:
- Around line 5-6: The three localization keys settings.betaFeatures.feed,
settings.betaFeatures.feed.subtitleOn, and
settings.betaFeatures.feed.subtitleOff are only present for en and ja; add
missing translations for every supported locale in the Localizable.xcstrings
catalog so the "Feed" beta label and its on/off subtitles appear in all locales.
Update the Localizable.xcstrings entries for those keys (same key names) in each
locale file, ensuring the translated strings are added and encoded correctly and
that the localization tool recognizes the new entries.
In `@Sources/SettingsSearchAliases.swift`:
- Line 15: Add the missing localization entries for the keys referenced in
Sources/SettingsSearchAliases.swift by updating Resources/Localizable.xcstrings:
add settings.search.alias.section.betaFeatures and
settings.search.alias.setting.betaFeatures.feed with complete translations for
the supported locales (en, ja), using the same English defaultValue text ("beta
experimental unstable preview feed dock right sidebar") for the en locale and
appropriate Japanese translations for ja; ensure the key names exactly match
those used in SettingsSearchAliases.swift so the localized(...) calls resolve to
translations instead of falling back to defaults.
---
Outside diff comments:
In `@cmuxTests/FileExplorerStateModePersistenceTests.swift`:
- Around line 1-96: Convert the XCTest-based suite
FileExplorerStateModePersistenceTests to Swift Testing: replace import XCTest
with import Testing, change the test container from class
FileExplorerStateModePersistenceTests: XCTestCase to `@Suite` struct
FileExplorerStateModePersistenceTests, convert each test method (e.g.,
testDisabledFeedStoredModeFallsBackToFiles, testEnabledFeedStoredModeSurvives,
testModeSetterClampsUnavailableBetaModes,
testCLIArgumentNormalizerMapsVaultAndSessionsToSessions) to `@Test` functions,
replace XCTAssert* assertions with `#expect` expressions, move setUp/tearDown
logic (the withSavedRightSidebarModeDefaults helper and its restore) into
init/deinit (or a resetDefaults helper) to preserve state isolation, and ensure
`@testable` import selection remains (cmux_DEV / cmux).
🪄 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: 017cee4f-84dc-4e28-88cd-e078e6bb7f67
📒 Files selected for processing (16)
Packages/CmuxSettings/Sources/CmuxSettings/Keys/BetaFeaturesCatalogSection.swiftPackages/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swiftPackages/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/SettingsSectionID.swiftPackages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/BetaFeaturesSection.swiftPackages/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swiftResources/Localizable.xcstringsSources/App/WorkspaceRuntimeSettings.swiftSources/CommandPalette/CommandPaletteSettingsToggle.swiftSources/RightSidebarMode+Availability.swiftSources/RightSidebarPanelView.swiftSources/SettingsNavigation.swiftSources/SettingsSearchAliases.swiftcmuxTests/FileExplorerStateModePersistenceTests.swiftcmuxTests/RightSidebarCommandPaletteTests.swiftcmuxUITests/RightSidebarChromeHeightUITests.swiftcmuxUITests/SettingsSidebarBetaBehaviorUITests.swift
There was a problem hiding this comment.
1 issue found across 16 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Fixes #5166
What
Makes Feed an opt-in Beta Feature gated exactly like Dock, instead of being unconditionally available in the right-sidebar mode switcher. Feed is now hidden until enabled under Settings → Beta Features, using the same logic and default (
false) as Dock.Why
rightSidebar.beta.dock.enabled, default off). Feed used to be too, until Enable Feed by default #3854 ("Enable Feed by default",5829da2d9) removed its gating.How
This reinstates only the gating-removal hunks of #3854 while preserving that PR's Feed focus-handling bugfixes (and the "Activity" → "All Activity" rename). Since #3854, the Settings layer was refactored into Swift packages, so Dock's gating now lives in two parallel registrations — Feed is mirrored in both:
Runtime gating
RightSidebarBetaFeatureSettings(WorkspaceRuntimeSettings.swift): addsfeedEnabledKey/defaultFeedEnabled/isFeedEnabled(defaults:)mirroring the Dock members. New keyrightSidebar.beta.feed.enabled, defaultfalse.RightSidebarMode+Availability.swift:.feedis gated onfeedEnabled, threaded throughavailableModes/isAvailablenext todockEnabled(reverts to the pre-Enable Feed by default #3854 shape).FileExplorerState's mode clamping andmodeShortcut(_:)pick this up automatically via the defaults-based overloads.RightSidebarPanelView.swift: readsfeedEnabledvia@AppStorageand feeds it intoavailableModes+ refresh-on-change.Settings UI / search / config
CmuxSettings/BetaFeaturesCatalogSection: adds therightSidebarFeedcatalog key (so it'scmux.json-configurable, default off).CmuxSettingsUI/BetaFeaturesSection: re-adds the Feed toggle row (SettingsBetaFeedToggle) with on/off subtitle. The plural beta warning ("These features are experimental…") already covers >1 feature (Dock + Extensions), so it's unchanged.SettingsNavigation,SettingsSearchAliases) and package index (CuratedSettingEntry+Default,SettingsSectionID): register thefeedsetting, search anchor, and aliases mirroringdock.CommandPaletteSettingsToggle: adds thebetaFeatures.feedtoggle command.Localizable.xcstrings: restoressettings.betaFeatures.feed/.subtitleOn/.subtitleOff(en + ja).Decision: feed hooks are NOT gated on this flag
The issue flags an open question (out of scope / follow-up): should disabling Feed also skip installing the per-tool-use feed hooks (
CLI/CMUXCLI+AgentHookDefinitions.swiftfeedHookEvents, the #5146 driver)?I deliberately left the feed hooks untouched in this PR — they are not gated on
rightSidebar.beta.feed.enabled. Rationale:feed.pushpopulatesFeedCoordinator.shared.store, which also backs the Dock-hosted Feed TUI (cmux feed tui, exercised byFeedSidebarUITests). Gating hook installation on the right-sidebar Feed flag would silently break the Feed TUI for users who enabled Dock but not Feed.cmuxCLI inside workspace shells (including remote / cloud VMs), where the app'sUserDefaultsbeta flag isn't an appropriate or reliable signal.Reducing feed-hook traffic is better handled holistically in #5146. This PR shrinks the opt-in surface (Feed is hidden by default) without risking the Dock Feed TUI.
Testing
All compile + behavioral verification done locally (per repo policy, full E2E/UI runs happen in CI):
cmux) build, unit-test target (cmux-unit) build, and UI-test target (cmuxbuild-for-testing) all succeed.CmuxSettingsUIpackage tests pass (12 tests) — includingeveryCuratedSettingEntryIsReachable(confirms the newsetting:betaFeatures:feedanchor resolves) androwAnchorsAreUniqueAcrossRows.FileExplorerStateModePersistenceTests(disabled Feed clamps to Files; default command-palette modes exclude Feed) andRightSidebarCommandPaletteTests.RightSidebarChromeHeightUITests(feed secondary bar reachable again) and added a Feed toggle derived-subtitle test toSettingsSidebarBetaBehaviorUITestsmirroring the Dock one.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Note
Low Risk
UI/settings and mode-availability gating only; users with a saved Feed mode may be clamped to Files until they opt in. Feed hooks and data paths are untouched.
Overview
Makes Feed an opt-in Beta Feature (default off), matching Dock:
rightSidebar.beta.feed.enabledgates whether Feed appears in the right-sidebar mode switcher and whether stored/selected modes can stay on Feed.Adds the Feed toggle in Settings → Beta Features (catalog, search/command palette, localization) and wires runtime availability through
RightSidebarBetaFeatureSettings,RightSidebarModeavailability, andRightSidebarPanelView(@AppStorage+ refresh when the flag changes). Persisted Feed mode falls back to Files when the flag is off; tests/UI coverage updated accordingly.Feed agent hooks are unchanged — disabling the beta flag only hides the sidebar mode, not hook installation.
Reviewed by Cursor Bugbot for commit 5688dc4. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Gates the right‑sidebar Feed behind Beta Features, default off, mirroring Dock. Feed is hidden until enabled in Settings → Beta Features; feed hooks remain installed and are not gated by this flag.
rightSidebar.beta.feed.enabled(default false) and gated.feedavailability on it.@AppStorage, updates available modes, and refreshes on change.Written for commit 5688dc4. Summary will update on new commits.
Summary by CodeRabbit
New Features
Search & Navigation
Localization
Tests