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): support shift-click for hidden sidebar items (#8078)

gbirmana039e3317781
diff --git a/apps/web/src/components/app/sidebar-next/more-menu.tsx b/apps/web/src/components/app/sidebar-next/more-menu.tsx
index 028b7ab707..218a7cdc5f 100644
--- a/apps/web/src/components/app/sidebar-next/more-menu.tsx
+++ b/apps/web/src/components/app/sidebar-next/more-menu.tsx
@@ -23,13 +23,14 @@ export type MoreMenuProps = {
function navigateToItem(
item: SidebarNextNavItem,
openWithSplit: ReturnType<typeof useSplitLayout>['openWithSplit'],
- analytics: ReturnType<typeof useAnalytics>
+ analytics: ReturnType<typeof useAnalytics>,
+ shiftKey: boolean
) {
analytics.track('sidebar_click', { view: item.id });
navigateToSidebarView({
viewId: item.id,
params: item.params,
- shiftKey: false,
+ shiftKey,
openWithSplit,
referredFrom: 'sidebar',
});
@@ -48,6 +49,12 @@ export function MoreMenu(props: MoreMenuProps) {
layout.preloadContent(sidebarContent(item.id, item.params));
const hiddenItems = () => moreMenuItems(props.gates);
+ // Capture shift key before onSelect fires (which omits the event)
+ let shiftHeld = false;
+ const captureSplitIntent = (event: PointerEvent | KeyboardEvent) => {
+ shiftHeld = event.shiftKey;
+ };
+
return (
<>
<Dropdown placement="right-start" gutter={6}>
@@ -72,8 +79,15 @@ export function MoreMenu(props: MoreMenuProps) {
class="gap-2"
onMouseEnter={() => preloadItem(item)}
onFocus={() => preloadItem(item)}
+ onPointerDown={captureSplitIntent}
+ onKeyDown={captureSplitIntent}
onSelect={() =>
- navigateToItem(item, layout.openWithSplit, analytics)
+ navigateToItem(
+ item,
+ layout.openWithSplit,
+ analytics,
+ shiftHeld
+ )
}
>
<Dynamic