Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/extension/src/newtab/ExtensionTopBanners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const ShortcutsIllustration = (): ReactElement => {
type UseShortcutsOnboardingResult = {
shouldShow: boolean;
onAddClick: () => void;
onClose: () => void;
};

const useShortcutsOnboarding = (): UseShortcutsOnboardingResult => {
Expand All @@ -98,7 +99,8 @@ const useShortcutsOnboarding = (): UseShortcutsOnboardingResult => {
const { shortcutLinks } = useShortcutLinks();

const hasShortcuts = (shortcutLinks?.length ?? 0) > 0;
const shouldShow = !hasShortcuts;
const hasClosedBanner = checkHasCompleted(ActionType.ClosedShortcutsBanner);
const shouldShow = !hasShortcuts && !hasClosedBanner;

const completeFirstSession = () => {
if (!checkHasCompleted(ActionType.FirstShortcutsSession)) {
Expand All @@ -116,7 +118,9 @@ const useShortcutsOnboarding = (): UseShortcutsOnboardingResult => {
});
};

return { shouldShow, onAddClick };
const onClose = () => completeAction(ActionType.ClosedShortcutsBanner);

return { shouldShow, onAddClick, onClose };
};

export const ExtensionTopBanners = (): ReactElement | null => {
Expand Down Expand Up @@ -177,6 +181,7 @@ export const ExtensionTopBanners = (): ReactElement | null => {
ctaLabel="Add shortcuts"
illustration={<ShortcutsIllustration />}
onCtaClick={shortcuts.onAddClick}
onClose={shortcuts.onClose}
/>,
);
}
Expand Down
23 changes: 0 additions & 23 deletions packages/shared/src/components/sidebar/SidebarDesktopV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1139,25 +1139,6 @@ export const SidebarDesktopV2 = ({
const isHoverExpanded = isCollapsedHoverMode && isRailHovered;
const isExpanded = sidebarExpanded || forceExpanded || isHoverExpanded;

// ChatGPT-style affordance: while collapsed, the whole sidebar reads as a
// resize handle (ew cursor). Clicking the empty surface pins it open — same
// as the toggle — while clicks on nav items / avatar / toggle keep their own
// behavior.
const pinFromEmptyClick = (event: React.MouseEvent<HTMLElement>) => {
if (!isCollapsedHoverMode) {
return;
}
const target = event.target as HTMLElement;
if (
target.closest(
'a, button, input, select, textarea, [role="tab"], [role="button"], [role="menuitem"]',
)
) {
return;
}
onToggleExpanded();
};

const renderCategoryTab = (
categoryId: SidebarCategoryId,
): ReactElement | null => {
Expand Down Expand Up @@ -1324,7 +1305,6 @@ export const SidebarDesktopV2 = ({
onMouseEnter={handleRailMouseEnter}
onMouseLeave={handleRailMouseLeave}
onMouseMove={handleRailMouseMove}
onClick={pinFromEmptyClick}
className={classNames(
'laptop:bottom-0 laptop:h-dvh laptop:min-h-dvh laptop:flex-row laptop:border-r-0',
isExpanded ? railExpandedWidth : railCollapsedWidth,
Expand All @@ -1341,9 +1321,6 @@ export const SidebarDesktopV2 = ({
// its edge reads clearly against the content behind it.
isHoverExpanded &&
'laptop:!border-r laptop:border-border-subtlest-tertiary',
// Collapsed sidebar reads as a resize handle: click the empty surface
// to pin it open.
isCollapsedHoverMode && 'laptop:cursor-ew-resize',
featureTheme && 'bg-transparent',
suppressTransition,
)}
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/graphql/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export enum ActionType {
AskUpsellSearch = 'ask_upsell_search',
DismissCompanionDemoWidget = 'dismiss_companion_demo_widget',
ClickedNewStripCta = 'click_new_strip_cta',
ClosedShortcutsBanner = 'closed_shortcuts_banner',
}

export const cvActions = [
Expand Down
Loading