Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(sidebar): follow up - dismiss try options, conversations and workspace sections (#4716)

Seamusaa63a2519431
diff --git a/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx b/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
index 6efa3de045..d960c29356 100644
--- a/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
+++ b/js/app/packages/app/component/app-sidebar/channels-unread-widget.tsx
@@ -8,7 +8,6 @@ import {
useGlobalBlockOrchestrator,
useGlobalNotificationSource,
} from '@app/component/GlobalAppState';
-import { useSplitLayout } from '@app/component/split-layout/layout';
import { globalSplitManager } from '@app/signal/splitLayout';
import { navigateToChannelMessage } from '@block-channel/utils/link';
import { ReadonlyThread } from '@channel/StandaloneThread';
@@ -418,7 +417,6 @@ export const ChannelsUnreadWidget = (props: {
onDropdownOpenChange?: (open: boolean) => void;
}) => {
const notificationSource = useGlobalNotificationSource();
- const layout = useSplitLayout();
const allNotifications = () => [...notificationSource.notifications()];
const filteredNotifications = () => filterUnreadNotDone(allNotifications());
@@ -474,18 +472,6 @@ export const ChannelsUnreadWidget = (props: {
}))
);
- const openChannels = () => {
- layout.openWithSplit(
- { type: 'component', id: 'channels' },
- {
- allowDuplicate: true,
- mergeHistory: false,
- referredFrom: 'sidebar',
- }
- );
- globalSplitManager()?.returnFocus();
- };
-
return (
<Show when={channelGroups().length > 0}>
<Show
@@ -508,18 +494,7 @@ export const ChannelsUnreadWidget = (props: {
<CollapsibleSidebarSection
label="Unread"
items={sectionItems()}
- visibleCount={3}
- dropdownMax={10}
onOpenChange={() => props.onSectionOpenChange?.()}
- onDropdownOpenChange={props.onDropdownOpenChange}
- dropdownFooter={() => (
- <Dropdown.Item
- class="min-h-8 gap-2 px-2.5 text-[13px]"
- onSelect={openChannels}
- >
- <span class="flex-1 text-ink">Go to channels</span>
- </Dropdown.Item>
- )}
/>
</Show>
</Show>
diff --git a/js/app/packages/app/component/app-sidebar/collapsible-sidebar-section.tsx b/js/app/packages/app/component/app-sidebar/collapsible-sidebar-section.tsx
index 392aead49a..5113839aeb 100644
--- a/js/app/packages/app/component/app-sidebar/collapsible-sidebar-section.tsx
+++ b/js/app/packages/app/component/app-sidebar/collapsible-sidebar-section.tsx
@@ -1,6 +1,5 @@
import CaretDownIcon from '@phosphor/caret-down.svg';
-import DotsIcon from '@phosphor/dots-three.svg';
-import { cn, Dropdown, NavRow } from '@ui';
+import { cn } from '@ui';
import { createSignal, For, type JSX, onCleanup, Show } from 'solid-js';
export type CollapsibleSidebarSectionItem = {
@@ -12,23 +11,12 @@ export type CollapsibleSidebarSectionItem = {
export function CollapsibleSidebarSection(props: {
label: string;
items: readonly CollapsibleSidebarSectionItem[];
- visibleCount: number;
- dropdownMax?: number;
- dropdownFooter?: () => JSX.Element;
+ headerMenu?: () => JSX.Element;
defaultOpen?: boolean;
onOpenChange?: (open: boolean) => void;
- onDropdownOpenChange?: (open: boolean) => void;
- dropdownInteractionDisabled?: boolean;
}) {
const [open, setOpen] = createSignal(props.defaultOpen ?? true);
let openChangeTimer: ReturnType<typeof setTimeout> | undefined;
- const visibleItems = () => props.items.slice(0, props.visibleCount);
- const overflowItems = () => {
- const items = props.items.slice(props.visibleCount);
- return props.dropdownMax === undefined
- ? items
- : items.slice(0, props.dropdownMax);
- };
onCleanup(() => {
if (openChangeTimer !== undefined) clearTimeout(openChangeTimer);
@@ -47,10 +35,10 @@ export function CollapsibleSidebarSection(props: {
return (
<section class="w-full flex flex-col">
- <header>
+ <header class="group/section relative">
<button
type="button"
- class="group/section flex h-7 w-full items-center justify-start gap-1 rounded-md px-2 text-left text-[13px] font-medium text-ink-extra-muted/60 transition-colors hover:bg-ink/3 hover:text-ink-muted"
+ class="flex h-7 w-full min-w-0 items-center justify-start gap-1 rounded-md px-2 pr-9 text-left text-[13px] font-medium text-ink-extra-muted/60 transition-colors group-hover/section:bg-ink/3 group-hover/section:text-ink-muted"
aria-expanded={open()}
onClick={toggleOpen}
>
@@ -62,6 +50,13 @@ export function CollapsibleSidebarSection(props: {
)}
/>
</button>
+ <Show when={props.headerMenu}>
+ {(headerMenu) => (
+ <div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center">
+ {headerMenu()()}
+ </div>
+ )}
+ </Show>
</header>
<div
class={cn('grid overflow-hidden', !open() && 'pointer-events-none')}
@@ -77,48 +72,9 @@ export function CollapsibleSidebarSection(props: {
}}
>
<div class="min-h-0 overflow-hidden flex flex-col gap-0.5">
- <For each={visibleItems()}>
+ <For each={props.items}>
{(item) => <div class="w-full">{item.visible()}</div>}
</For>
- <Show when={overflowItems().length > 0}>
- <Dropdown
- placement="right-start"
- gutter={8}
- onOpenChange={props.onDropdownOpenChange}
- >
- <Dropdown.Trigger
- as={NavRow}
- class="h-7 border-0! text-[13px] focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0"
- fullWidth
- label={`${props.label} more`}
- tooltipPlacement="right"
- onMouseDown={(e: MouseEvent) => {
- if (e.button !== 0) return;
- e.preventDefault();
- }}
- >
- <div class="size-5 shrink-0 flex items-center justify-center">
- <DotsIcon class="size-3.5" />
- </div>
- <span class="whitespace-nowrap">More</span>
- </Dropdown.Trigger>
- <Dropdown.Content
- class={cn(
- 'min-w-52 shadow-menu',
- props.dropdownInteractionDisabled &&
- 'pointer-events-none [&_[data-highlighted]]:bg-transparent!'
- )}
- inert={props.dropdownInteractionDisabled || undefined}
- >
- <Dropdown.Group>
- <For each={overflowItems()}>{(item) => item.dropdown()}</For>
- <Show when={props.dropdownFooter}>
- {(footer) => footer()()}
- </Show>
- </Dropdown.Group>
- </Dropdown.Content>
- </Dropdown>
- </Show>
</div>
</div>
</section>
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index 30f1291d6b..74a40031c6 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -72,6 +72,7 @@ import { AnimatedTaskIcon } from '@icon/wide-task';
import { ContextMenu } from '@kobalte/core/context-menu';
import CaretRightIcon from '@phosphor/caret-right.svg';
import CaretUpIcon from '@phosphor/caret-up.svg';
+import DotsThreeIcon from '@phosphor/dots-three.svg';
import GearIcon from '@phosphor/gear.svg';
import HomeIcon from '@phosphor/house.svg';
import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';
@@ -112,6 +113,45 @@ interface SidebarItem {
hiddenFromSidebar?: boolean;
}
+type SidebarSectionLinkId =
+ | 'mail'
+ | 'channels'
+ | 'calls'
+ | 'documents'
+ | 'tasks'
+ | 'agents'
+ | 'companies';
+
+type SidebarSectionVisibility = Record<SidebarSectionLinkId, boolean>;
+
+type TryItemId = 'connect' | 'invite' | 'mobile';
+
+type TryItemVisibility = Record<TryItemId, boolean>;
+
+const COMMUNICATIONS_LINK_IDS = ['mail', 'channels', 'calls'] as const;
+const WORKSPACE_LINK_IDS = [
+ 'documents',
+ 'tasks',
+ 'agents',
+ 'companies',
+] as const;
+
+const DEFAULT_SECTION_VISIBILITY: SidebarSectionVisibility = {
+ mail: true,
+ channels: true,
+ calls: true,
+ documents: true,
+ tasks: true,
+ agents: true,
+ companies: true,
+};
+
+const DEFAULT_TRY_VISIBILITY: TryItemVisibility = {
+ connect: true,
+ invite: true,
+ mobile: true,
+};
+
const markdownDocumentsQuery = buildDocumentTypeQuery(['doc-markdown']);
const SIDEBAR_LINKS = [
@@ -183,10 +223,10 @@ const SIDEBAR_LINKS = [
},
{
id: 'channels',
- label: 'Messages',
+ label: 'Channels',
href: LIST_VIEW_PATHS.channels,
icon: AnimatedChannelIcon,
- hotkey: 'm',
+ hotkey: 'c',
hotkeyToken: TOKENS.sidebar.goTo.channels,
},
...(ENABLE_CRM
@@ -474,36 +514,127 @@ type SidebarShortcutLinkProps = {
icon: Component<{ triggerAnimation?: boolean; class?: string }>;
onClick: () => void;
isSlim: () => boolean;
+ trailing?: JSX.Element;
};
const SidebarShortcutLink = (props: SidebarShortcutLinkProps) => {
const [isHovering, setIsHovering] = createSignal(false);
return (
- <NavRow
- draggable={false}
- class="h-7"
- fullWidth
- tooltipPlacement="right"
- label={props.isSlim() ? props.label : undefined}
- onMouseEnter={() => setIsHovering(true)}
- onMouseLeave={() => setIsHovering(false)}
- onMouseDown={(e) => {
+ <div class="group/shortcut relative w-full">
+ <NavRow
+ draggable={false}
+ class={cn(
+ 'h-7 group-hover/shortcut:bg-ink/3 group-hover/shortcut:text-ink',
+ props.trailing && !props.isSlim() && 'pr-8'
+ )}
+ fullWidth
+ tooltipPlacement="right"
+ label={props.isSlim() ? props.label : undefined}
+ onMouseEnter={() => setIsHovering(true)}
+ onMouseLeave={() => setIsHovering(false)}
+ onMouseDown={(e) => {
+ if (e.button !== 0) return;
+ e.preventDefault();
+ props.onClick();
+ }}
+ >
+ <div class="relative size-5 shrink-0 flex items-center justify-center [&_svg]:size-3.5">
+ <Dynamic component={props.icon} triggerAnimation={isHovering()} />
+ </div>
+
+ <div class="flex items-center gap-1 group-data-[slim=true]/sidebar:hidden">
+ <span class="flex-1 min-w-0 whitespace-nowrap">{props.label}</span>
+ </div>
+ </NavRow>
+
+ <Show when={props.trailing && !props.isSlim()}>
+ <div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center">
+ {props.trailing}
+ </div>
+ </Show>
+ </div>
+ );
+};
+
+const SidebarSectionMenu = (props: {
+ label: string;
+ options: { id: SidebarSectionLinkId; label: string; checked: boolean }[];
+ onToggle: (id: SidebarSectionLinkId) => void;
+ onOpenChange?: (open: boolean) => void;
+}) => (
+ <Dropdown
+ placement="right-start"
+ gutter={8}
+ onOpenChange={props.onOpenChange}
+ >
+ <Dropdown.Trigger
+ variant="ghost"
+ class="opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100 transition-opacity rounded-md size-5 min-h-0 p-0 bg-transparent hover:bg-ink/6 [&_svg]:size-3.5"
+ label={`Customize ${props.label}`}
+ onMouseDown={(e: MouseEvent) => {
if (e.button !== 0) return;
e.preventDefault();
- props.onClick();
+ e.stopPropagation();
}}
+ onClick={(e: MouseEvent) => e.stopPropagation()}
>
- <div class="relative size-5 shrink-0 flex items-center justify-center [&_svg]:size-3.5">
- <Dynamic component={props.icon} triggerAnimation={isHovering()} />
- </div>
+ <DotsThreeIcon />
+ </Dropdown.Trigger>
+ <Dropdown.Content class="w-56 shadow-menu">
+ <Dropdown.Group>
+ <Dropdown.GroupLabel>Customize</Dropdown.GroupLabel>
+ <For each={props.options}>
+ {(option) => (
+ <Dropdown.CheckboxItem
+ checked={option.checked}
+ onChange={() => props.onToggle(option.id)}
+ closeOnSelect={false}
+ >
+ <span class="flex-1 truncate">{option.label}</span>
+ </Dropdown.CheckboxItem>
+ )}
+ </For>
+ </Dropdown.Group>
+ </Dropdown.Content>
+ </Dropdown>
+);
- <div class="flex items-center gap-1 group-data-[slim=true]/sidebar:hidden">
- <span class="whitespace-nowrap">{props.label}</span>
- </div>
- </NavRow>
- );
-};
+const SidebarTryItemMenu = (props: {
+ label: string;
+ onDismiss: () => void;
+ onOpenChange?: (open: boolean) => void;
+}) => (
+ <Dropdown
+ placement="right-start"
+ gutter={8}
+ onOpenChange={props.onOpenChange}
+ >
+ <Dropdown.Trigger
+ variant="ghost"
+ class="shrink-0 opacity-0 group-hover/shortcut:pointer-events-auto group-hover/shortcut:opacity-100 focus-visible:opacity-100 transition-opacity rounded-md size-5 min-h-0 p-0 bg-transparent hover:bg-ink/6 [&_svg]:size-3.5 pointer-events-none"
+ label={`${props.label} options`}
+ onMouseDown={(e: MouseEvent) => {
+ if (e.button !== 0) return;
+ e.preventDefault();
+ e.stopPropagation();
+ }}
+ onClick={(e: MouseEvent) => e.stopPropagation()}
+ >
+ <DotsThreeIcon />
+ </Dropdown.Trigger>
+ <Dropdown.Content class="w-40 shadow-menu">
+ <Dropdown.Group>
+ <Dropdown.Item
+ class="min-h-8 gap-2 px-2.5 text-[13px]"
+ onSelect={props.onDismiss}
+ >
+ <span class="flex-1 truncate text-ink">Dismiss</span>
+ </Dropdown.Item>
+ </Dropdown.Group>
+ </Dropdown.Content>
+ </Dropdown>
+);
const SidebarDropdownLink = (
props: SidebarItem & {
@@ -811,6 +942,14 @@ export const AppSidebar = (props: AppSidebarProps) => {
const { openSettings, selectTab, settingsOpen } = useSettingsState();
const isTabAvailable = useSettingsTabAvailable();
const currentTeamQuery = useCurrentTeamQuery();
+ const [sectionVisibility, setSectionVisibility] = makePersisted(
+ createSignal<SidebarSectionVisibility>(DEFAULT_SECTION_VISIBILITY),
+ { name: 'sidebar-section-visibility' }
+ );
+ const [tryVisibility, setTryVisibility] = makePersisted(
+ createSignal<TryItemVisibility>(DEFAULT_TRY_VISIBILITY),
+ { name: 'sidebar-try-visibility' }
+ );
const callCtx = useCallContextOptional();
const hasPaidAccess = useHasPaidAccess();
@@ -852,8 +991,7 @@ export const AppSidebar = (props: AppSidebarProps) => {
const middleScrollSize = createElementSize(middleScrollRef);
const [overlayPointerInside, setOverlayPointerInside] = createSignal(false);
const [overlayDropdownOpen, setOverlayDropdownOpen] = createSignal(false);
- const [workspaceContextMenuOpen, setWorkspaceContextMenuOpen] =
- createSignal(false);
+ const [, setWorkspaceContextMenuOpen] = createSignal(false);
let middleScrollFrame: number | undefined;
let middleScrollObserver: MutationObserver | undefined;
let overlayCloseTimer: ReturnType<typeof setTimeout> | undefined;
@@ -974,79 +1112,98 @@ export const AppSidebar = (props: AppSidebarProps) => {
.filter((link): link is SidebarItem => link !== undefined)
);
- const workspaceItems = createMemo(() =>
- ['mail', 'documents', 'channels', 'tasks', 'calls', 'agents', 'companies']
+ const sectionItemsFor = (ids: readonly SidebarSectionLinkId[]) =>
+ ids
+ .filter((id) => sectionVisibility()[id])
.map((id) => findLink(id))
.filter((link): link is SidebarItem => link !== undefined)
- .map(toSectionItem)
+ .map(toSectionItem);
+
+ const communicationsItems = createMemo(() =>
+ sectionItemsFor(COMMUNICATIONS_LINK_IDS)
);
+ const workspaceItems = createMemo(() => sectionItemsFor(WORKSPACE_LINK_IDS));
+
+ const toggleSectionVisibility = (id: SidebarSectionLinkId) => {
+ setSectionVisibility({
+ ...sectionVisibility(),
+ [id]: !sectionVisibility()[id],
+ });
+ scheduleMiddleScrollUpdate();
+ };
+
+ const dismissTryItem = (id: TryItemId) => {
+ setTryVisibility({ ...tryVisibility(), [id]: false });
+ scheduleMiddleScrollUpdate();
+ };
+
+ const sectionMenuOptionsFor = (ids: readonly SidebarSectionLinkId[]) =>
+ ids
+ .map((id) => findLink(id))
+ .filter((link): link is SidebarItem => link !== undefined)
+ .map((link) => ({
+ id: link.id as SidebarSectionLinkId,
+ label: link.label,
+ checked: sectionVisibility()[link.id as SidebarSectionLinkId],
+ }));
const tryItems = createMemo<CollapsibleSidebarSectionItem[]>(() => {
const items: CollapsibleSidebarSectionItem[] = [];
- const connected = getSettingsTabItem('Connected');
- if (connected && isTabAvailable('Connected')) {
+ const addTryItem = (
+ id: TryItemId,
+ label: string,
+ icon: Component<{ triggerAnimation?: boolean; class?: string }>,
+ onClick: () => void
+ ) => {
+ if (!tryVisibility()[id]) return;
+
+ const trailing = (
+ <SidebarTryItemMenu
+ label={label}
+ onDismiss={() => dismissTryItem(id)}
+ onOpenChange={handleWorkspaceContextMenuOpenChange}
+ />
+ );
+
items.push({
- id: 'connect',
+ id,
visible: () => (
<SidebarShortcutLink
- label="Connect"
+ label={label}
isSlim={isSlim}
- onClick={() => openSettingsTab('Connected')}
- icon={connected.icon}
+ onClick={onClick}
+ icon={icon}
+ trailing={trailing}
/>
),
dropdown: () => (
<SidebarShortcutLink
- label="Connect"
+ label={label}
isSlim={isSlim}
- onClick={() => openSettingsTab('Connected')}
- icon={connected.icon}
+ onClick={onClick}
+ icon={icon}
+ trailing={trailing}
/>
),
});
+ };
+
+ const connected = getSettingsTabItem('Connected');
+ if (connected && isTabAvailable('Connected')) {
+ addTryItem('connect', 'Connect', connected.icon, () =>
+ openSettingsTab('Connected')
+ );
}
- items.push({
- id: 'invite',
- visible: () => (
- <SidebarShortcutLink
- label="Invite"
- isSlim={isSlim}
- onClick={() => setInviteModalOpen(true)}
- icon={UsersThreeIcon}
- />
- ),
- dropdown: () => (
- <SidebarShortcutLink
- label="Invite"
- isSlim={isSlim}
- onClick={() => setInviteModalOpen(true)}
- icon={UsersThreeIcon}
- />
- ),
- });
+ addTryItem('invite', 'Invite', UsersThreeIcon, () =>
+ setInviteModalOpen(true)
+ );
const mobile = getSettingsTabItem('Mobile App');
if (mobile && isTabAvailable('Mobile App')) {
- items.push({
- id: 'mobile',
- visible: () => (
- <SidebarShortcutLink
- label="Mobile"
- isSlim={isSlim}
- onClick={() => openSettingsTab('Mobile App')}
- icon={mobile.icon}
- />
- ),
- dropdown: () => (
- <SidebarShortcutLink
- label="Mobile"
- isSlim={isSlim}
- onClick={() => openSettingsTab('Mobile App')}
- icon={mobile.icon}
- />
- ),
- });
+ addTryItem('mobile', 'Mobile', mobile.icon, () =>
+ openSettingsTab('Mobile App')
+ );
}
return items;
});
@@ -1054,6 +1211,7 @@ export const AppSidebar = (props: AppSidebarProps) => {
createEffect(() => {
middleScrollSize.width;
middleScrollSize.height;
+ communicationsItems().length;
workspaceItems().length;
tryItems().length;
props.overlayOpen;
@@ -1146,14 +1304,39 @@ export const AppSidebar = (props: AppSidebarProps) => {
onScroll={updateMiddleScrollShadows}
class="size-full overflow-y-auto flex flex-col gap-3"
>
- <CollapsibleSidebarSection
- label="Workspace"
- items={workspaceItems()}
- visibleCount={3}
- onOpenChange={scheduleMiddleScrollUpdate}
- onDropdownOpenChange={handleOverlayDropdownOpenChange}
- dropdownInteractionDisabled={workspaceContextMenuOpen()}
- />
+ <Show
+ when={sectionMenuOptionsFor(COMMUNICATIONS_LINK_IDS).length > 0}
+ >
+ <CollapsibleSidebarSection
+ label="Conversations"
+ items={communicationsItems()}
+ headerMenu={() => (
+ <SidebarSectionMenu
+ label="Conversations"
+ options={sectionMenuOptionsFor(COMMUNICATIONS_LINK_IDS)}
+ onToggle={toggleSectionVisibility}
+ onOpenChange={handleWorkspaceContextMenuOpenChange}
+ />
+ )}
+ onOpenChange={scheduleMiddleScrollUpdate}
+ />
+ </Show>
+
+ <Show when={sectionMenuOptionsFor(WORKSPACE_LINK_IDS).length > 0}>
+ <CollapsibleSidebarSection
+ label="Workspace"
+ items={workspaceItems()}
+ headerMenu={() => (
+ <SidebarSectionMenu
+ label="Workspace"
+ options={sectionMenuOptionsFor(WORKSPACE_LINK_IDS)}
+ onToggle={toggleSectionVisibility}
+ onOpenChange={handleWorkspaceContextMenuOpenChange}
+ />
+ )}
+ onOpenChange={scheduleMiddleScrollUpdate}
+ />
+ </Show>
<Suspense>
<FavoritesSection
@@ -1168,64 +1351,12 @@ export const AppSidebar = (props: AppSidebarProps) => {
onDropdownOpenChange={handleOverlayDropdownOpenChange}
/>
- <CollapsibleSidebarSection
- label="Try"
- items={tryItems()}
- visibleCount={3}
- onOpenChange={scheduleMiddleScrollUpdate}
- onDropdownOpenChange={handleOverlayDropdownOpenChange}
- />
-
- <Show
- when={
- !hasPaidAccess() &&
- isExpandedView() &&
- !premiumCardDismissed() &&
- newPricingFF().enabled
- }
- >
- <div class="w-full px-2">
- <SidebarPromoCard
- label="Upgrade to Premium"
- description="Unlock MCP integrations, better AI models, and team collaboration."
- onDismiss={() => {
- setPremiumCardDismissed(true);
- setPremiumHintVisible(true);
- }}
- primaryAction={{
- label: 'Upgrade',
- onClick: () => openSettingsTab('Billing'),
- }}
- secondaryAction={{
- label: 'Later',
- onClick: () => {
- setPremiumCardDismissed(true);
- setPremiumHintVisible(true);
- },
- }}
- />
- </div>
- </Show>
- <Show
- when={
- !hasPaidAccess() &&
- isExpandedView() &&
- premiumHintVisible() &&
- premiumCardDismissed() &&
- newPricingFF().enabled
- }
- >
- <div class="w-full px-2">
- <SidebarPromoHint
- title="Maybe later"
- message="You can upgrade anytime from Account settings."
- onDone={() => setPremiumHintVisible(false)}
- secondaryAction={{
- label: 'Take me there',
- onClick: () => openSettingsTab('Account'),
- }}
- />
- </div>
+ <Show when={tryItems().length > 0}>
+ <CollapsibleSidebarSection
+ label="Try"
+ items={tryItems()}
+ onOpenChange={scheduleMiddleScrollUpdate}
+ />
</Show>
</div>
<div
@@ -1248,6 +1379,53 @@ export const AppSidebar = (props: AppSidebarProps) => {
<InCallPanel isSlim={() => false} />
</div>
</Show>
+ <Show
+ when={
+ !hasPaidAccess() &&
+ isExpandedView() &&
+ !premiumCardDismissed() &&
+ newPricingFF().enabled
+ }
+ >
+ <SidebarPromoCard
+ label="Upgrade to Premium"
+ description="Unlock MCP integrations, better AI models, and team collaboration."
+ onDismiss={() => {
+ setPremiumCardDismissed(true);
+ setPremiumHintVisible(true);
+ }}
+ primaryAction={{
+ label: 'Upgrade',
+ onClick: () => openSettingsTab('Billing'),
+ }}
+ secondaryAction={{
+ label: 'Later',
+ onClick: () => {
+ setPremiumCardDismissed(true);
+ setPremiumHintVisible(true);
+ },
+ }}
+ />
+ </Show>
+ <Show
+ when={
+ !hasPaidAccess() &&
+ isExpandedView() &&
+ premiumHintVisible() &&
+ premiumCardDismissed() &&
+ newPricingFF().enabled
+ }
+ >
+ <SidebarPromoHint
+ title="Maybe later"
+ message="You can upgrade anytime from Account settings."
+ onDone={() => setPremiumHintVisible(false)}
+ secondaryAction={{
+ label: 'Take me there',
+ onClick: () => openSettingsTab('Account'),
+ }}
+ />
+ </Show>
<SidebarSettingsWidget
isSlim={isSlim}
onSelect={openSettingsTab}