mirror of
https://github.com/block/buzz.git
synced 2026-11-14 05:12:27 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user