feat(desktop): graduate community rail (#1995)

Signed-off-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Bradley Axen
2026-07-16 16:10:19 -07:00
committed by GitHub
parent 249492685c
commit f06b59ff13
4 changed files with 18 additions and 24 deletions

View File

@@ -75,7 +75,6 @@ import { useCommunities } from "@/features/communities/useCommunities";
import { useAddCommunityDialogState } from "@/features/communities/addCommunityPrefill";
import { useApplyTemplate } from "@/features/channel-templates/useApplyTemplate";
import { relayClient } from "@/shared/api/relayClient";
import { useFeatureEnabled } from "@/shared/features";
import { useIdentityQuery } from "@/shared/api/hooks";
import { useRelayAutoHeal } from "@/shared/api/useRelayAutoHeal";
import { useDeferredStartup } from "@/shared/hooks/useDeferredStartup";
@@ -103,7 +102,7 @@ export function AppShell() {
useWebviewScrollBoundaryLock();
const communitiesHook = useCommunities();
const communityRailEnabled = useFeatureEnabled("workspaceRail");
const hasCommunityRail = communitiesHook.communities.length > 1;
const addCommunityDialog = useAddCommunityDialogState();
const [isChannelManagementOpen, setIsChannelManagementOpen] =
React.useState(false);
@@ -762,7 +761,7 @@ export function AppShell() {
isHuddleDrawerOpen && "buzz-huddle-app-surface-open",
)}
>
{communityRailEnabled ? (
{hasCommunityRail ? (
<CommunityRail
activeCommunityId={
communitiesHook.activeCommunity?.id ?? null
@@ -779,10 +778,7 @@ export function AppShell() {
<AppTopChrome
canGoBack={canGoBack}
canGoForward={canGoForward}
hasCommunityRail={
communityRailEnabled &&
communitiesHook.communities.length > 1
}
hasCommunityRail={hasCommunityRail}
onGoBack={goBack}
onGoForward={goForward}
/>
@@ -935,10 +931,7 @@ export function AppShell() {
<RelayConnectionOverlay
card={relayConnectionCard}
errorMessage={channelsErrorMessage}
hasCommunityRail={
communityRailEnabled &&
communitiesHook.communities.length > 1
}
hasCommunityRail={hasCommunityRail}
isHuddleDrawerOpen={isHuddleDrawerOpen}
/>
</div>

View File

@@ -13,12 +13,12 @@ describe("resolveEnabled (preview-only)", () => {
});
it("uses an enabled manifest default when no override exists", () => {
assert.equal(resolveEnabled("workspaceRail", {}, true), true);
assert.equal(resolveEnabled("defaultOnFeature", {}, true), true);
});
it("lets an explicit opt-out override an enabled default", () => {
assert.equal(
resolveEnabled("workspaceRail", { workspaceRail: false }, true),
resolveEnabled("defaultOnFeature", { defaultOnFeature: false }, true),
false,
);
});