Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chg(ui): not toolbars on split, move functionality to new menus and buttons (#4362)
Seamus29089690a52d
diff --git a/js/app/packages/app/component/ChatWithAgentButton.tsx b/js/app/packages/app/component/ChatWithAgentButton.tsxindex 2d6a45a54b..e275ce343e 100644--- a/js/app/packages/app/component/ChatWithAgentButton.tsx+++ b/js/app/packages/app/component/ChatWithAgentButton.tsx@@ -121,3 +121,22 @@ export function ChatWithAgentButton(props: { entity: ChatWithAgentEntity }) {</Button>);}++export function AskMacroButton(props: { entity: ChatWithAgentEntity }) {+ const [hovering, setHovering] = createSignal(false);++ return (+ <Button+ onClick={() => openChatWithAgent(props.entity)}+ onMouseEnter={() => setHovering(true)}+ onMouseLeave={() => setHovering(false)}+ variant="ghost"+ size="sm"+ depth={2}+ class="gap-1.5 rounded-full bg-hover/20 px-2 text-ink-extra-muted ring ring-edge-muted"+ >+ <AnimatedStarIcon triggerAnimation={hovering()} />+ <span class="text-xs font-medium">Ask Macro</span>+ </Button>+ );+}diff --git a/js/app/packages/app/component/ResponsiveBlockToolbar.tsx b/js/app/packages/app/component/ResponsiveBlockToolbar.tsxindex 62f7f6273c..489b12d940 100644--- a/js/app/packages/app/component/ResponsiveBlockToolbar.tsx+++ b/js/app/packages/app/component/ResponsiveBlockToolbar.tsx@@ -13,11 +13,11 @@ import {SplitHeaderLeft,SplitHeaderRight,} from './split-layout/components/SplitHeader';-import { SplitPermissionsBadge } from './split-layout/components/SplitLabel';import {- SplitToolbarLeft,- SplitToolbarRight,-} from './split-layout/components/SplitToolbar';+ SplitPermissionsBadge,+ SplitTitleFileMenu,+} from './split-layout/components/SplitLabel';+import { SplitToolbarRight } from './split-layout/components/SplitToolbar';export type BlockTool = {label: string | (() => string);@@ -56,6 +56,10 @@ export function ToolButton(props: { tool: BlockTool }) {);}+function getToolLabel(tool: BlockTool) {+ return typeof tool.label === 'function' ? tool.label() : tool.label;+}+export function ResponsivePermissionsBadge() {return (<Show@@ -88,13 +92,44 @@ interface BlockToolbarProps {* Handles the standard arrangement of file ops and block tools on desktop and mobile. On mobile, they are condensed together into a dropdown menu in the SplitHeader.*/export function ResponsiveBlockToolbar(props: BlockToolbarProps) {+ const isShareTool = (tool: BlockTool) => getToolLabel(tool) === 'Share';+ const isHiddenTool = (tool: BlockTool) => {+ const label = getToolLabel(tool);+ return (+ label === 'Chat' ||+ label === 'Dispatch to Agent' ||+ label === 'References'+ );+ };+ const visibleTools = () => props.tools.filter((tool) => !isHiddenTool(tool));+ const headerTools = () => visibleTools().filter(isShareTool);+ const toolbarTools = () =>+ visibleTools().filter((tool) => !isShareTool(tool));+ const activeToolbarTools = () =>+ toolbarTools().filter((tool) => !tool.condition || tool.condition());+return (<Showwhen={isMobile()}fallback={<>+ <SplitHeaderRight>+ <div class="order-[1000] flex items-center gap-1">+ <For each={headerTools()}>+ {(tool) => (+ <Show when={!tool.condition || tool.condition()}>+ {tool.buttonComponent ? (+ <tool.buttonComponent />+ ) : (+ <ToolButton tool={tool} />+ )}+ </Show>+ )}+ </For>+ </div>+ </SplitHeaderRight><Show when={props.ops.length > 0}>- <SplitToolbarLeft>+ <SplitTitleFileMenu><SplitFileMenuid={props.id}itemType={props.itemType}@@ -103,37 +138,39 @@ export function ResponsiveBlockToolbar(props: BlockToolbarProps) {ops={props.ops}buttonClass="order-first"/>- </SplitToolbarLeft>+ </SplitTitleFileMenu>+ </Show>+ <Show when={activeToolbarTools().length > 0}>+ <SplitToolbarRight>+ <For each={activeToolbarTools()}>+ {(tool) => (+ <>+ {tool.buttonComponent ? (+ <tool.buttonComponent />+ ) : (+ <ToolButton tool={tool} />+ )}+ </>+ )}+ </For>+ </SplitToolbarRight></Show>- <SplitToolbarRight>- <For each={props.tools}>- {(tool) => (- <Show when={!tool.condition || tool.condition()}>- {tool.buttonComponent ? (- <tool.buttonComponent />- ) : (- <ToolButton tool={tool} />- )}- </Show>- )}- </For>- </SplitToolbarRight></>}>- <SplitHeaderRight>- <HeaderIsland>+ <SplitTitleFileMenu>+ <Show when={props.ops.length > 0}><SplitFileMenuid={props.id}itemType={props.itemType}name={props.name}formattedName={props.formattedName}ops={props.ops}- tools={props.tools}+ tools={visibleTools()}buttonClass="order-last"/>- </HeaderIsland>- </SplitHeaderRight>+ </Show>+ </SplitTitleFileMenu></Show>);}diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsxindex 1c639df333..7ea4ec69ed 100644--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx@@ -574,7 +574,7 @@ export const SoupView = (props: SoupViewProps) => {><Show when={!isMobile() && !narrowSearchExpanded()}><div class="flex items-center gap-1">- <span class="text-base font-bold">{props.viewName}</span>+ <span class="text-sm font-semibold">{props.viewName}</span><Show when={docsUrl()}>{(url) => (<Buttondiff --git a/js/app/packages/app/component/side-panel/SidePanel.tsx b/js/app/packages/app/component/side-panel/SidePanel.tsxindex 854448be3e..ceef0a4643 100644--- a/js/app/packages/app/component/side-panel/SidePanel.tsx+++ b/js/app/packages/app/component/side-panel/SidePanel.tsx@@ -1,10 +1,13 @@import { Resize, ResizeZoneContext } from '@core/component/Resize/Resize';-import { TabsInset } from '@core/component/TabsInset';+import { TOKENS } from '@core/hotkey/tokens';import { isMobile } from '@core/mobile/isMobile';+import SidePanelIcon from '@icon/square-half-filled.svg';import { Accordion } from '@kobalte/core/accordion';+import ArrowLeft from '@phosphor/arrow-left.svg';import CaretRight from '@phosphor/caret-right.svg';import CircleDashedEmpty from '@phosphor/circle-dashed.svg';-import { Layer, Panel, Scroll } from '@ui';+import InfoIcon from '@phosphor/info.svg';+import { Button, Layer, Panel, Scroll } from '@ui';import { cn } from '@ui/utils/classname';import {type Accessor,@@ -22,6 +25,8 @@ import {Suspense,useContext,} from 'solid-js';+import { HeaderIsland } from '../split-layout/components/HeaderIsland';+import { SplitHeaderRight } from '../split-layout/components/SplitHeader';import {SidePanelContext,type SidePanelContextType,@@ -101,12 +106,14 @@ function Layout(props: ParentProps) {return (<SidePanelContext.Provider value={ctx}>+ <SidePanelHeaderToggle /><Resize.Zone direction="horizontal" gutter={0} resizable={false}><SidePanelLayoutInnersections={sections}openIds={openIds}setOpenIds={setOpenIds}isOpen={isOpen}+ setIsOpen={setIsOpen}setIsNarrow={setIsNarrow}>{props.children}@@ -122,6 +129,7 @@ function SidePanelLayoutInner(openIds: Accessor<string[]>;setOpenIds: (ids: string[]) => void;isOpen: Accessor<boolean>;+ setIsOpen: (next: boolean | ((prev: boolean) => boolean)) => void;setIsNarrow: Setter<boolean>;}>) {@@ -171,6 +179,17 @@ function SidePanelLayoutInner({/* Full-frame mobile: the overlay spans the whole panel, so thecontent must clear the floating header islands + status bar. */}<div class="w-full max-w-2xl mx-auto min-w-0 mobile:pt-(--mobile-content-inset-top)">+ <div class="px-2 pt-2">+ <Button+ variant="ghost"+ size="sm"+ class="gap-2 px-2 text-ink-muted"+ onClick={() => props.setIsOpen(false)}+ >+ <ArrowLeft class="size-4" />+ Back to content+ </Button>+ </div><SidePanelOutletsections={props.sections}openIds={props.openIds}@@ -184,6 +203,54 @@ function SidePanelLayoutInner();}+function SidePanelHeaderToggle() {+ const ctx = useContext(SidePanelContext);+ if (!ctx) return null;++ const ToggleButton = () => (+ <Button+ depth={2}+ variant="base"+ size="icon-sm"+ class={cn(+ !isMobile() && 'bg-surface',+ isMobile() &&+ 'hover:bg-transparent! active:bg-transparent! focus-visible:bg-transparent! active:text-accent',+ isMobile() && ctx.isOpen() && 'text-accent'+ )}+ tooltip={ctx.isOpen() ? 'Hide Side Panel' : 'Show Side Panel'}+ hotkey={TOKENS.block.toggleSidePanel}+ onClick={() => ctx.toggle()}+ >+ <Show+ when={ctx.isNarrow()}+ fallback={<SidePanelIcon class={cn(ctx.isOpen() && 'text-accent')} />}+ >+ <InfoIcon+ class={cn('size-4', !isMobile() && ctx.isOpen() && 'text-accent')}+ />+ </Show>+ </Button>+ );++ return (+ <Show when={ctx.hasSections()}>+ <SplitHeaderRight>+ <div class="order-last flex items-center">+ <HeaderIsland+ class={cn(+ 'size-10 justify-center !px-0',+ ctx.isOpen() && 'text-accent'+ )}+ >+ <ToggleButton />+ </HeaderIsland>+ </div>+ </SplitHeaderRight>+ </Show>+ );+}+function SidePanelOutlet(props: {sections: Accessor<SidePanelSectionEntry[]>;openIds: Accessor<string[]>;@@ -283,34 +350,6 @@ function useSidePanel() {};}-/**- * Pill-style tabs that switch between the main content and the side panel- * overlay in narrow mode. Renders nothing when the layout is wide or when no- * sections are registered, so it's safe to mount unconditionally.- *- * Hidden on mobile, where the header title island doubles as the- * Content/Info switcher instead (see BlockItemSplitLabel).- */-function NarrowTabs(props: { contentLabel?: string; infoLabel?: string }) {- const ctx = useContext(SidePanelContext);- if (!ctx) return null;-- const value = () => (ctx.isOpen() ? 'info' : 'content');-- return (- <Show when={ctx.isNarrow() && ctx.hasSections() && !isMobile()}>- <TabsInset- list={[- { value: 'content', label: props.contentLabel ?? 'Content' },- { value: 'info', label: props.infoLabel ?? 'Info' },- ]}- value={value()}- onChange={(v) => ctx.setIsOpen(v === 'info')}- />- </Show>- );-}-/** Indicates whether the current subtree has a SidePanel.Layout ancestor. */function _useHasSidePanel(): boolean {return useContext(SidePanelContext) !== undefined;@@ -436,7 +475,6 @@ export const SidePanel = {EmptyPill,Loading,CountTitle,- NarrowTabs,Card,};export { useSidePanel };diff --git a/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx b/js/app/packages/app/component/split-layout/components/HeaderIsland.tsxindex f2785e02c2..8da046c49f 100644--- a/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx+++ b/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx@@ -1,6 +1,6 @@import { isMobile } from '@core/mobile/isMobile';import { cn, Layer } from '@ui';-import { type ParentProps, Show } from 'solid-js';+import { type ComponentProps, Show, splitProps } from 'solid-js';/*** Marks an island boundary inside a SplitHeader contribution. Every header@@ -15,18 +15,21 @@ import { type ParentProps, Show } from 'solid-js';** Note: crossing the mobile breakpoint remounts children.*/-export function HeaderIsland(props: ParentProps<{ class?: string }>) {+export function HeaderIsland(props: ComponentProps<'div'>) {+ const [local, rest] = splitProps(props, ['class', 'children']);+return (- <Show when={isMobile()} fallback={props.children}>+ <Show when={isMobile()} fallback={local.children}><Layer depth={3}><div+ {...rest}data-header-islandclass={cn('island pointer-events-auto flex h-10 min-w-0 shrink-0 items-center gap-1 rounded-full px-3 empty:hidden',- props.class+ local.class)}>- {props.children}+ {local.children}</div></Layer></Show>diff --git a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsxindex 89c62bd3db..1288d152db 100644--- a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx+++ b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx@@ -4,7 +4,11 @@ import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';import { Dialog, Panel } from '@ui';import { createMemo, createSignal, For, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';-import { SplitPanelContext, type SplitPanelContextType } from '../context';+import {+ type SplitFileMenuActionGroups,+ SplitPanelContext,+ type SplitPanelContextType,+} from '../context';import type {PopoverSplitOptions,SplitContent,@@ -49,6 +53,12 @@ function PopoverSplitModal(props: {const [panelRef, setPanelRef] = createSignal<HTMLElement | null>(null);const [contentOffsetTop, setContentOffsetTop] = createSignal(0);const [previewState, setPreviewState] = createSignal(false);+ const [titleFileMenuRef, setTitleFileMenuRef] =+ createSignal<HTMLDivElement>();+ const [titleFileMenuTrigger, setTitleFileMenuTrigger] =+ createSignal<() => void>();+ const [titleFileMenuActions, setTitleFileMenuActions] =+ createSignal<SplitFileMenuActionGroups>();const stubHandle: SplitHandle = {id: props.popover.id as SplitId,@@ -106,6 +116,12 @@ function PopoverSplitModal(props: {typeof setPreviewState,],layoutRefs: {},+ titleFileMenuRef,+ setTitleFileMenuRef,+ titleFileMenuTrigger,+ setTitleFileMenuTrigger,+ titleFileMenuActions,+ setTitleFileMenuActions,headerCollapser: { register: () => () => {} },};diff --git a/js/app/packages/app/component/split-layout/components/SplitFileMenu.tsx b/js/app/packages/app/component/split-layout/components/SplitFileMenu.tsxindex 6976f387a2..d97acfe8c2 100644--- a/js/app/packages/app/component/split-layout/components/SplitFileMenu.tsx+++ b/js/app/packages/app/component/split-layout/components/SplitFileMenu.tsx@@ -8,24 +8,26 @@ import { triggerFocusInput } from '@core/directive/focusInput';import { isTouchDevice } from '@core/mobile/isTouchDevice';import { useIsDocumentOwner } from '@core/signal/permissions';import { buildEntityData } from '@entity';+import DotsThree from '@icon/dots-three-large.svg';import ArrowRight from '@phosphor/arrow-right.svg';import Copy from '@phosphor/copy.svg';-import ThreeDots from '@phosphor/list.svg';import Rename from '@phosphor/pencil-line.svg';import Trash from '@phosphor/trash-simple.svg';import { blockNameToItemType, type ItemType } from '@service-storage/client';-import { Button, Dropdown } from '@ui';+import { cn, Dropdown } from '@ui';import {type Component,+ createEffect,createMemo,createSignal,For,type JSX,+ onCleanup,Show,useContext,} from 'solid-js';import { Dynamic } from 'solid-js/web';-import { SplitPanelContext } from '../context';+import { type SplitFileMenuAction, SplitPanelContext } from '../context';import { useSplitLayout } from '../layout';export type FileOperationName = 'delete' | 'rename' | 'copy' | 'moveToProject';@@ -48,14 +50,9 @@ const isDefaultFileOperation = (export type FileOperation = DefaultFileOperation | CustomFileOperation;-type SplitMenuAction = {- label: string | JSX.Element;- icon: Component;- action: (e?: MouseEvent) => void;- group?: 'delete';-};--function SplitMenuItemContent(props: Pick<SplitMenuAction, 'icon' | 'label'>) {+function SplitMenuItemContent(+ props: Pick<SplitFileMenuAction, 'icon' | 'label'>+) {return (<><Dynamic@@ -71,15 +68,15 @@ type SplitFileMenuRenderProps = {open: boolean;onOpenChange: (open: boolean) => void;triggerClass?: string;- ops: SplitMenuAction[];- tools: SplitMenuAction[];+ ops: SplitFileMenuAction[];+ tools: SplitFileMenuAction[];};function DesktopRender(props: SplitFileMenuRenderProps) {const primaryOps = () => props.ops.filter((op) => op.group !== 'delete');const deleteOps = () => props.ops.filter((op) => op.group === 'delete');- const item = (action: SplitMenuAction) => (+ const item = (action: SplitFileMenuAction) => (<Dropdown.ItemonSelect={() => {action.action();@@ -93,11 +90,11 @@ function DesktopRender(props: SplitFileMenuRenderProps) {return (<Dropdown open={props.open} onOpenChange={props.onOpenChange}><Dropdown.Trigger- class={props.triggerClass}+ class={cn(props.triggerClass)}size="icon-sm"variant="ghost">- <ThreeDots />+ <DotsThree /></Dropdown.Trigger><Dropdown.Content class="w-fit"><Show when={primaryOps().length > 0}>@@ -121,7 +118,7 @@ function DesktopRender(props: SplitFileMenuRenderProps) {}function MobileRender(props: SplitFileMenuRenderProps) {- const item = (action: SplitMenuAction) => (+ const item = (action: SplitFileMenuAction) => (<buttontype="button"class="w-full bg-surface flex items-center gap-3 px-4 py-3 text-sm hover:bg-hover hover-transition-bg text-left not-last:mb-px text-ink"@@ -142,14 +139,6 @@ function MobileRender(props: SplitFileMenuRenderProps) {preventScroll={false}preventScrollbarShift={false}>- <MobileDrawer.Trigger- as={Button}- class={props.triggerClass}- size="icon-sm"- variant="ghost"- >- <ThreeDots />- </MobileDrawer.Trigger><MobileDrawer.Portal><MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" /><MobileDrawer.Content aria-label="File actions">@@ -197,7 +186,13 @@ export function SplitFileMenu(props: {const { replaceOrInsertSplit, resetSplit } = useSplitLayout();- const ops = createMemo<CustomFileOperation[]>(() => {+ createEffect(() => {+ const openMenu = () => setOpen(true);+ ctx.setTitleFileMenuTrigger(() => openMenu);+ onCleanup(() => ctx.setTitleFileMenuTrigger(undefined));+ });++ const ops = createMemo<SplitFileMenuAction[]>(() => {return props.ops.map((op) => {if (isDefaultFileOperation(op)) {@@ -217,7 +212,7 @@ export function SplitFileMenu(props: {}},icon: Trash,- group: 'delete',+ group: 'delete' as const,};case 'rename':@@ -303,7 +298,7 @@ export function SplitFileMenu(props: {(props.tools ?? []).filter((t) => !t.condition || t.condition()));- const tools = createMemo<SplitMenuAction[]>(() =>+ const tools = createMemo<SplitFileMenuAction[]>(() =>filteredTools().map((tool) => ({label: typeof tool.label === 'function' ? tool.label() : tool.label,icon: tool.icon,@@ -320,6 +315,18 @@ export function SplitFileMenu(props: {})));+ const actionGroups = createMemo(() => ({+ primaryOps: ops().filter((op) => op.group !== 'delete'),+ tools: tools(),+ deleteOps: ops().filter((op) => op.group === 'delete'),+ }));++ createEffect(() => {+ ctx.setTitleFileMenuActions(actionGroups());+ });++ onCleanup(() => ctx.setTitleFileMenuActions(undefined));+return (<Showwhen={isTouchDevice()}diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsxindex 9060d8f3d0..ae7d61a2ac 100644--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx@@ -1,18 +1,28 @@import { useSoup } from '@app/component/next-soup/soup-context';import { openEntityInSplitFromUnifiedList } from '@app/component/next-soup/utils';-import { isListViewID } from '@app/constants/list-views';+import { isListViewID, LIST_VIEW_ID } from '@app/constants/list-views';import type { BlockName } from '@core/block';+import {+ ContextMenuContent,+ MenuItem,+ MenuSeparator,+} from '@core/component/ContextMenu';+import { toast } from '@core/component/Toast/Toast';import { fileTypeToBlockName } from '@core/constant/allBlocks';import { TOKENS } from '@core/hotkey/tokens';import { isMobile } from '@core/mobile/isMobile';import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';import type { EntityDragEvent } from '@entity';+import { ContextMenu } from '@kobalte/core/context-menu';+import ArrowClockwise from '@phosphor/arrow-clockwise.svg';import CollapseIcon from '@phosphor/arrows-in.svg';import ExpandIcon from '@phosphor/arrows-out.svg';import CaretDown from '@phosphor/caret-down.svg';import CaretLeft from '@phosphor/caret-left.svg';import CaretRight from '@phosphor/caret-right.svg';import CaretUp from '@phosphor/caret-up.svg';+import CopyIcon from '@phosphor/copy.svg';+import SplitIcon from '@phosphor/square-half.svg';import CloseIcon from '@phosphor/x.svg';import { mergeRefs } from '@solid-primitives/refs';import { createDroppable, useDragDropContext } from '@thisbeyond/solid-dnd';@@ -217,6 +227,142 @@ function SoupNavigationButtons() {);}+function SplitHeaderContextMenu(props: ParentProps) {+ const panel = useContext(SplitPanelContext);+ const layout = useContext(SplitLayoutContext);+ if (!panel || !layout) return props.children;++ const splitIndex = createMemo(() =>+ layout.manager.splits().findIndex((split) => split.id === panel.handle.id)+ );+ const hasOtherSplits = createMemo(() => layout.manager.splits().length > 1);+ const canDuplicateSplit = createMemo(+ () => panel.handle.content().type === 'component'+ );+ const canToggleSpotlight = createMemo(() => canSpotlight(layout.manager));++ const newSplitContent = () => ({+ type: 'component' as const,+ id: LIST_VIEW_ID.inbox,+ });++ const duplicateContent = (): SplitContent => ({ ...panel.handle.content() });++ const insertSplitBeside = (side: 'left' | 'right', content: SplitContent) => {+ const index = splitIndex();+ if (index < 0) return;++ const nextContents = layout.manager+ .splits()+ .map((split) => ({ ...split.content }));+ const insertIndex = side === 'left' ? index : index + 1;++ nextContents.splice(insertIndex, 0, content);+ layout.manager.reconcile(nextContents);+ layout.manager.splits()[insertIndex]?.id &&+ layout.manager.activateSplit(layout.manager.splits()[insertIndex].id);+ };++ const copyDebugInfo = async () => {+ try {+ const splits = layout.manager.splits();+ await navigator.clipboard.writeText(+ JSON.stringify(+ {+ activeSplitId: layout.manager.activeSplitId(),+ currentSplitId: panel.handle.id,+ currentSplitIndex: splitIndex(),+ currentSplitUrl: panel.handle.getUrl(),+ splits: splits.map((split, index) => ({+ index,+ id: split.id,+ content: split.content,+ referredFrom: split.referredFrom,+ isCurrent: split.id === panel.handle.id,+ })),+ },+ null,+ 2+ )+ );+ toast.success('Debug info copied to clipboard');+ } catch (error) {+ console.error('Failed to copy split debug info', error);+ toast.failure('Failed to copy debug info');+ }+ };++ return (+ <ContextMenu>+ <ContextMenu.Trigger class="contents">+ {props.children}+ </ContextMenu.Trigger>+ <ContextMenu.Portal>+ <ContextMenuContent width="md">+ <MenuItem+ icon={SplitIcon}+ text="New split left"+ disabled={!layout.manager.canAppendSplit()}+ onClick={() => insertSplitBeside('left', newSplitContent())}+ />+ <MenuItem+ icon={SplitIcon}+ text="New split right"+ disabled={!layout.manager.canAppendSplit()}+ onClick={() => insertSplitBeside('right', newSplitContent())}+ />+ <MenuItem+ icon={CopyIcon}+ text="Duplicate split"+ disabled={!layout.manager.canAppendSplit() || !canDuplicateSplit()}+ onClick={() => insertSplitBeside('right', duplicateContent())}+ />+ <MenuSeparator />+ <MenuItem+ icon={panel.handle.isSpotLight() ? CollapseIcon : ExpandIcon}+ text={+ panel.handle.isSpotLight() ? 'Minimize split' : 'Spotlight split'+ }+ disabled={!canToggleSpotlight()}+ onClick={() => panel.handle.toggleSpotlight()}+ />+ <MenuSeparator />+ <MenuItem+ icon={CloseIcon}+ text="Close other splits"+ disabled={!hasOtherSplits()}+ onClick={() => {+ const currentSplitId = panel.handle.id;+ const otherSplitIds = layout.manager+ .splits()+ .map((split) => split.id)+ .filter((id) => id !== currentSplitId);++ for (const splitId of otherSplitIds) {+ layout.manager.removeSplit(splitId);+ }++ layout.manager.activateSplit(currentSplitId);+ }}+ />+ <MenuItem+ icon={ArrowClockwise}+ text="Reset sizes"+ disabled={!hasOtherSplits()}+ onClick={() => layout.manager.resizeContext()?.reset()}+ />+ <MenuSeparator />+ <MenuItem+ icon={CopyIcon}+ text="Copy debug info"+ onClick={copyDebugInfo}+ />+ </ContextMenuContent>+ </ContextMenu.Portal>+ </ContextMenu>+ );+}+export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {const panel = useContext(SplitPanelContext);if (!panel) {@@ -258,91 +404,83 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {});return (- <div- class={cn(- 'isolate relative w-full h-full overflow-clip text-ink',- // On mobile the header overlays the panel body as a transparent strip- // of floating islands- 'mobile:absolute mobile:inset-x-0 mobile:top-(--safe-top) mobile:z-mobile-nav-bar mobile:h-11.25 mobile:overflow-visible mobile:pointer-events-none',- isMobile() && isListViewID(panel.handle.content().id) && 'hidden',- isMobile() &&- !isNativeMobilePlatform() &&- 'mobile:top-[calc(var(--safe-top)+6px)]',- isEntityDraggingOver() && 'bg-active/50'- )}- data-split-header- ref={mergeRefs(droppable, props.ref)}- >- <Show when={panel.panelRef()}>- {(panelRef) => (- <Portal mount={panelRef()}>- <Show when={isEntityDraggingOver()}>- <div- class="pointer-events-none absolute inset-0 rounded-xl z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted flex items-center justify-center"- data-split-header-drop-overlay- >- <div class="max-w-[min(28rem,calc(100%-3rem))] min-w-0 bg-surface border border-edge rounded-lg shadow-lg shadow-drop-shadow px-4 py-3 flex items-center gap-2 text-sm text-ink">- <span class="shrink-0 text-ink-muted">- Open in this split- </span>- </div>- </div>- </Show>- </Portal>+ <SplitHeaderContextMenu>+ <div+ class={cn(+ 'isolate relative w-full h-full overflow-clip text-ink',+ // On mobile the header overlays the panel body as a transparent strip+ // of floating islands+ 'mobile:absolute mobile:inset-x-0 mobile:top-(--safe-top) mobile:z-mobile-nav-bar mobile:h-11.25 mobile:overflow-visible mobile:pointer-events-none',+ isMobile() && isListViewID(panel.handle.content().id) && 'hidden',+ isMobile() &&+ !isNativeMobilePlatform() &&+ 'mobile:top-[calc(var(--safe-top)+6px)]',+ isEntityDraggingOver() && 'bg-active/50')}- </Show>- <div class="absolute inset-0 flex justify-start items-center mobile:px-(--mobile-chrome-gutter) mobile:gap-2">- <Show- when={isMobile()}- fallback={- <div class="relative flex items-center pl-2 h-full">- <SplitCloseButton />- <SplitBackButton />- <SplitForwardButton />- </div>- }- >- {/* Back/forward island. */}- <HeaderIsland- class={cn(- 'relative gap-0 px-1',- !panel.handle.canGoBack() && 'hidden'- )}- >- <Show when={!isListViewID(panel.handle.content().id)}>- <SplitBackButton />- </Show>- </HeaderIsland>+ data-split-header+ ref={mergeRefs(droppable, props.ref)}+ >+ <Show when={panel.panelRef()}>+ {(panelRef) => (+ <Portal mount={panelRef()}>+ <Show when={isEntityDraggingOver()}>+ <div+ class="pointer-events-none absolute inset-0 rounded-xl z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted flex items-center justify-center"+ data-split-header-drop-overlay+ >+ <div class="max-w-[min(28rem,calc(100%-3rem))] min-w-0 bg-surface border border-edge rounded-lg shadow-lg shadow-drop-shadow px-4 py-3 flex items-center gap-2 text-sm text-ink">+ <span class="shrink-0 text-ink-muted">+ Open in this split+ </span>+ </div>+ </div>+ </Show>+ </Portal>+ )}</Show>-- <div- class="relative min-w-0 h-full shrink pl-2 flex items-center gap-0.5 mobile:pl-0 mobile:gap-2"- ref={(ref) => {- panel.layoutRefs.headerLeft = ref;- }}- />-- {/*<Show when={shouldShowRightmost()}>- <div- class={- 'pl-2 z-annotation-layer relative flex items-center gap-0.5 h-full'+ <div class="absolute inset-0 flex justify-start items-center mobile:px-(--mobile-chrome-gutter) mobile:gap-2">+ <Show+ when={isMobile()}+ fallback={+ <div class="relative flex items-center pl-2 h-full">+ <SplitCloseButton />+ <SplitBackButton />+ <SplitForwardButton />+ </div>}>- <SplitSpotlightButton />- </div>- </Show>*/}+ {/* Back/forward island. */}+ <HeaderIsland+ class={cn(+ 'relative gap-0 px-1',+ !panel.handle.canGoBack() && 'hidden'+ )}+ >+ <Show when={!isListViewID(panel.handle.content().id)}>+ <SplitBackButton />+ </Show>+ </HeaderIsland>+ </Show>- <div class="h-full grow shrink flex items-center justify-end gap-0.5 px-2 mobile:px-0 mobile:gap-2"><div- class="contents"+ class="relative min-w-0 h-full shrink pl-2 flex items-center gap-0.5 mobile:pl-0 mobile:gap-2"ref={(ref) => {- panel.layoutRefs.headerRight = ref;+ panel.layoutRefs.headerLeft = ref;}}/>- <SoupNavigationButtons />++ <div class="h-full grow shrink flex items-center justify-end gap-0.5 px-2 mobile:px-0 mobile:gap-2">+ <div+ class="contents"+ ref={(ref) => {+ panel.layoutRefs.headerRight = ref;+ }}+ />+ <SoupNavigationButtons />+ </div></div></div>- </div>+ </SplitHeaderContextMenu>);}diff --git a/js/app/packages/app/component/split-layout/components/SplitLabel.tsx b/js/app/packages/app/component/split-layout/components/SplitLabel.tsxindex c5439daed9..5c17c965f4 100644--- a/js/app/packages/app/component/split-layout/components/SplitLabel.tsx+++ b/js/app/packages/app/component/split-layout/components/SplitLabel.tsx@@ -1,12 +1,14 @@-import { openBulkEditModal } from '@app/component/bulk-edit-entity/BulkEditEntityModal';-import { useSidePanel } from '@app/component/side-panel/SidePanel';-import { isInBlock, useBlockAliasedName, useBlockId } from '@core/block';+import { isInBlock, useBlockAliasedName } from '@core/block';+import {+ ContextMenuContent,+ MenuItem,+ MenuSeparator,+} from '@core/component/ContextMenu';import {EntityIcon,type EntityIconSelector,isArchiveType,} from '@core/component/EntityIcon';-import { toast } from '@core/component/Toast/Toast';import { isMobile } from '@core/mobile/isMobile';import { blockMetadataSignal } from '@core/signal/load';import {@@ -16,14 +18,23 @@ import {useIsDocumentOwner,} from '@core/signal/permissions';import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';-import { type BuildEntityDataArgs, buildEntityData } from '@entity';-import ArticleIcon from '@phosphor/article.svg';-import InfoIcon from '@phosphor/info.svg';+import type { BuildEntityDataArgs } from '@entity';+import { ContextMenu } from '@kobalte/core/context-menu';+import CaretDownIcon from '@phosphor/caret-down.svg';import { cn, Tooltip } from '@ui';-import { type Accessor, createEffect, type JSX, Show } from 'solid-js';+import {+ type Accessor,+ type Component,+ createEffect,+ createMemo,+ For,+ type JSX,+ type ParentProps,+ Show,+} from 'solid-js';+import { Portal } from 'solid-js/web';import { useSplitPanelOrThrow } from '../layoutUtils';import { HeaderIsland } from './HeaderIsland';-import { HeaderTitleMenu, type HeaderTitleMenuItem } from './HeaderTitleMenu';export function StaticSplitLabel(props: {label: string;@@ -37,31 +48,55 @@ export function StaticSplitLabel(props: {createEffect(() => {panel.handle.setDisplayName(props.label);});+ const openTitleFileMenu = (e: MouseEvent) => {+ if (!isMobile()) return;+ const trigger = panel.titleFileMenuTrigger();+ if (!trigger) return;+ e.preventDefault();+ e.stopPropagation();+ trigger();+ };return (- <HeaderIsland class="shrink">- <div- class={cn(- 'z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink',- props.class- )}+ <SplitLabelContextMenu>+ <HeaderIsland+ class={cn('shrink', panel.titleFileMenuTrigger() && 'cursor-pointer')}+ onClick={openTitleFileMenu}>- <Show when={props.iconType}>- <EntityIcon- class="shrink-0"- targetType={props.iconType}- size="xs"- theme={props.colorIcon ? undefined : 'monochrome'}+ <div+ class={cn(+ 'z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink',+ props.class+ )}+ >+ <Show when={props.iconType}>+ <EntityIcon+ class="shrink-0"+ targetType={props.iconType}+ size="xs"+ theme={props.colorIcon ? undefined : 'monochrome'}+ />+ </Show>+ <Show when={props.icon}>+ <div class="shrink-0">{props.icon}</div>+ </Show>+ <Show when={props.badges}>{props.badges}</Show>+ <span class="inline-flex min-w-0 items-center gap-1">+ <span class="inline-block truncate text-sm font-semibold">+ {props.label}+ </span>+ <Show when={panel.titleFileMenuTrigger()}>+ <CaretDownIcon class="hidden size-3.5 shrink-0 text-ink-muted mobile:block" />+ </Show>+ </span>+ <div+ class="shrink-0 flex items-center h-full"+ ref={(ref) => {+ panel.setTitleFileMenuRef(ref);+ }}/>- </Show>- <Show when={props.icon}>- <div class="shrink-0">{props.icon}</div>- </Show>- <Show when={props.badges}>{props.badges}</Show>- <span class="inline-block text-sm font-semibold truncate">- {props.label}- </span>- </div>- </HeaderIsland>+ </div>+ </HeaderIsland>+ </SplitLabelContextMenu>);}@@ -74,8 +109,6 @@ export function SplitLabel(props: {maxDisplayLength?: number;}) {const panel = useSplitPanelOrThrow();- const blockId = useBlockId();- const aliasedBlockName = useBlockAliasedName();createEffect(() => {panel.handle.setDisplayName(props.label);@@ -87,33 +120,23 @@ export function SplitLabel(props: {return props.label.slice(0, props.maxDisplayLength - 3) + '...';};- const startEditing = (e: MouseEvent) => {- if (props.lockRename) return;- if (e.type === 'contextmenu') e.preventDefault();-- const entity = buildEntityData({- id: blockId,- name: props.label,- blockName: aliasedBlockName,- ...props.renameOverrides,- });- if (!entity) return;-- openBulkEditModal({- view: 'rename',- entities: [entity],- onFinish: () => toast.success('Renamed'),- onError: () => toast.failure('Failed to rename'),- });+ const openTitleFileMenu = (e: MouseEvent) => {+ if (!isMobile()) return;+ const trigger = panel.titleFileMenuTrigger();+ if (!trigger) return;+ e.preventDefault();+ e.stopPropagation();+ trigger();};return (- <span- class="inline-block text-sm font-semibold truncate"- onContextMenu={startEditing}- onDblClick={startEditing}- >- {truncatedLabel()}+ <span class="flex min-w-0 items-center gap-1" onClick={openTitleFileMenu}>+ <span class="inline-block truncate text-sm font-semibold">+ {truncatedLabel()}+ </span>+ <Show when={panel.titleFileMenuTrigger()}>+ <CaretDownIcon class="hidden size-4 shrink-0 text-ink-muted mobile:block" />+ </Show></span>);}@@ -183,43 +206,140 @@ export function BlockItemSplitLabel(props: {panel.handle.setDisplayName(displayName());});- const sidePanel = useSidePanel();+ const openTitleFileMenu = (e: MouseEvent) => {+ if (!isMobile()) return;+ const trigger = panel.titleFileMenuTrigger();+ if (!trigger) return;+ e.preventDefault();+ e.stopPropagation();+ trigger();+ };return (- <HeaderIsland class="shrink">- <Show- when={isMobile() && sidePanel?.hasSections()}- fallback={- <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 min-w-0 max-w-full h-full shrink">- <EntityIcon class="shrink-0" targetType={targetType()} size="xs" />- <Show when={props.badges}>{props.badges}</Show>- <SplitLabel- label={displayName() ?? ''}- lockRename={!isOwner() || props.lockRename}- />- </div>- }+ <SplitLabelContextMenu>+ <HeaderIsland+ class={cn('shrink', panel.titleFileMenuTrigger() && 'cursor-pointer')}+ onClick={openTitleFileMenu}>- {/* Mobile: the side-panel tabs hide behind the title — tapping it- opens a menu switching between Content and Info. */}- <HeaderTitleMenu- items={SIDE_PANEL_VIEWS}- active={sidePanel?.isOpen() ? 'info' : 'content'}- onSelect={(value) => sidePanel?.setIsOpen(value === 'info')}- >+ <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 min-w-0 max-w-full h-full shrink"><EntityIcon class="shrink-0" targetType={targetType()} size="xs" /><Show when={props.badges}>{props.badges}</Show><SplitLabellabel={displayName() ?? ''}lockRename={!isOwner() || props.lockRename}/>- </HeaderTitleMenu>- </Show>- </HeaderIsland>+ <div+ class="shrink-0 flex items-center h-full"+ ref={(ref) => {+ panel.setTitleFileMenuRef(ref);+ }}+ />+ </div>+ </HeaderIsland>+ </SplitLabelContextMenu>);}-const SIDE_PANEL_VIEWS: HeaderTitleMenuItem[] = [- { value: 'content', label: 'Content', icon: ArticleIcon },- { value: 'info', label: 'Info', icon: InfoIcon },-];+function SplitLabelContextMenu(props: ParentProps) {+ const panel = useSplitPanelOrThrow();+ const actions = () => panel.titleFileMenuActions();+ const hasActions = createMemo(() => {+ const groups = actions();+ if (!groups) return false;+ return (+ groups.primaryOps.length > 0 ||+ groups.tools.length > 0 ||+ groups.deleteOps.length > 0+ );+ });++ const item = (+ action: NonNullable<ReturnType<typeof actions>>['tools'][0]+ ) => (+ <MenuItem+ icon={action.icon as Component<JSX.SvgSVGAttributes<SVGSVGElement>>}+ text={action.label}+ onClick={() => action.action()}+ />+ );++ const openOnDoubleClick = (e: MouseEvent) => {+ if (!hasActions()) return;+ const target = e.currentTarget;+ if (!target) return;+ e.preventDefault();+ e.stopPropagation();+ target.dispatchEvent(+ new MouseEvent('contextmenu', {+ bubbles: true,+ cancelable: true,+ clientX: e.clientX,+ clientY: e.clientY,+ button: 2,+ })+ );+ };++ return (+ <Show when={hasActions()} fallback={props.children}>+ <ContextMenu>+ <ContextMenu.Trigger class="contents" onDblClick={openOnDoubleClick}>+ {props.children}+ </ContextMenu.Trigger>+ <ContextMenu.Portal>+ <ContextMenuContent width="w-fit">+ <Show when={actions()}>+ {(groups) => (+ <>+ <Show when={groups().primaryOps.length > 0}>+ <For each={groups().primaryOps}>{item}</For>+ </Show>+ <Show+ when={+ groups().tools.length > 0 &&+ groups().primaryOps.length > 0+ }+ >+ <MenuSeparator />+ </Show>+ <Show when={groups().tools.length > 0}>+ <For each={groups().tools}>{item}</For>+ </Show>+ <Show+ when={+ groups().deleteOps.length > 0 &&+ (groups().primaryOps.length > 0 ||+ groups().tools.length > 0)+ }+ >+ <MenuSeparator />+ </Show>+ <Show when={groups().deleteOps.length > 0}>+ <For each={groups().deleteOps}>{item}</For>+ </Show>+ </>+ )}+ </Show>+ </ContextMenuContent>+ </ContextMenu.Portal>+ </ContextMenu>+ </Show>+ );+}++export function SplitTitleFileMenu(props: ParentProps) {+ const panel = useSplitPanelOrThrow();++ return (+ <Show when={panel.titleFileMenuRef()}>+ <Portal+ mount={panel.titleFileMenuRef()}+ ref={(div) => {+ div.style.display = 'contents';+ }}+ >+ {props.children}+ </Portal>+ </Show>+ );+}diff --git a/js/app/packages/app/component/split-layout/components/SplitPanel.tsx b/js/app/packages/app/component/split-layout/components/SplitPanel.tsxindex 87a20de7eb..7a4ec05117 100644--- a/js/app/packages/app/component/split-layout/components/SplitPanel.tsx+++ b/js/app/packages/app/component/split-layout/components/SplitPanel.tsx@@ -24,6 +24,7 @@ import {import { Dynamic } from 'solid-js/web';import {type SplitBottomPanelRegistration,+ type SplitFileMenuActionGroups,SplitPanelContext,type SplitPanelContextType,} from '../context';@@ -50,6 +51,12 @@ export function SplitPanel(props: SplitPanelProps) {const [panelRef, setPanelRef] = createSignal<HTMLDivElement | null>(null);const [contentOffsetTop, setContentOffsetTop] = createSignal(0);const [previewState, setPreviewState] = createSignal(false);+ const [titleFileMenuRef, setTitleFileMenuRef] =+ createSignal<HTMLDivElement>();+ const [titleFileMenuTrigger, setTitleFileMenuTrigger] =+ createSignal<() => void>();+ const [titleFileMenuActions, setTitleFileMenuActions] =+ createSignal<SplitFileMenuActionGroups>();const [bottomPanel, setBottomPanel] =createSignal<SplitBottomPanelRegistration>();const panelSize = createElementSize(panelRef);@@ -162,6 +169,12 @@ export function SplitPanel(props: SplitPanelProps) {},headerCollapser,layoutRefs,+ titleFileMenuRef,+ setTitleFileMenuRef,+ titleFileMenuTrigger,+ setTitleFileMenuTrigger,+ titleFileMenuActions,+ setTitleFileMenuActions,panelSize,panelRef,}}@@ -213,7 +226,7 @@ export function SplitPanel(props: SplitPanelProps) {><Panel.Headerclass={cn(- 'block min-h-10.25 touch:min-h-11.25 p-0 overflow-visible',+ 'block min-h-10.25 touch:min-h-11.25 p-0 overflow-visible border-b-0!',// On mobile the header collapses to a zero-height grid row;// SplitHeader overlays the body as floating islands.'mobile:min-h-0 mobile:border-b-0',diff --git a/js/app/packages/app/component/split-layout/context.ts b/js/app/packages/app/component/split-layout/context.tsindex 14f3b5eecc..2291000f6a 100644--- a/js/app/packages/app/component/split-layout/context.ts+++ b/js/app/packages/app/component/split-layout/context.ts@@ -1,6 +1,7 @@import type { NullableSize } from '@solid-primitives/resize-observer';import {type Accessor,+ type Component,createContext,type JSX,type Setter,@@ -45,6 +46,19 @@ export type SplitBottomPanelRegistration = {onClose?: () => void;};+export type SplitFileMenuAction = {+ label: string | JSX.Element;+ icon: Component;+ action: (e?: MouseEvent) => void;+ group?: 'delete';+};++export type SplitFileMenuActionGroups = {+ primaryOps: SplitFileMenuAction[];+ tools: SplitFileMenuAction[];+ deleteOps: SplitFileMenuAction[];+};+export type SplitPanelContextType = {handle: SplitHandle;splitHotkeyScope: string;@@ -63,6 +77,12 @@ export type SplitPanelContextType = {toolbarLeft?: HTMLDivElement;toolbarRight?: HTMLDivElement;};+ titleFileMenuRef: Accessor<HTMLDivElement | undefined>;+ setTitleFileMenuRef: Setter<HTMLDivElement | undefined>;+ titleFileMenuTrigger: Accessor<(() => void) | undefined>;+ setTitleFileMenuTrigger: Setter<(() => void) | undefined>;+ titleFileMenuActions: Accessor<SplitFileMenuActionGroups | undefined>;+ setTitleFileMenuActions: Setter<SplitFileMenuActionGroups | undefined>;headerCollapser: HeaderCollapser;};diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.cssindex 5f47003b1d..5cea50e6d5 100644--- a/js/app/packages/app/index.css+++ b/js/app/packages/app/index.css@@ -184,11 +184,10 @@--font-serif: "Playfair Display Variable", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono: "Roboto Mono Variable", monospace;--text-xxs: 0.625rem;- --text-sm: 0.8125rem;/* Animations */--animate-slide-in: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);- --animate-menu-open: menu-open 140ms cubic-bezier(0.16, 1, 0.3, 1);+ --animate-menu-open: menu-open 120ms cubic-bezier(0.16, 1, 0.3, 1);--animate-typing-dot: typing-dot 1s infinite;--animate-swipe-out: swipeOut 100ms ease-out;--animate-indeterminate-bar: indeterminate-bar 1.1s ease-in-out infinite;@@ -319,7 +318,7 @@@keyframes menu-open {from {opacity: 0;- transform: translateY(-4px) scale(0.96);+ transform: translateY(-2px) scale(0.96);}to {opacity: 1;diff --git a/js/app/packages/block-call/component/CallRecording/CallRecordingBody.tsx b/js/app/packages/block-call/component/CallRecording/CallRecordingBody.tsxindex a74e16b02f..9cbea7ff3b 100644--- a/js/app/packages/block-call/component/CallRecording/CallRecordingBody.tsx+++ b/js/app/packages/block-call/component/CallRecording/CallRecordingBody.tsx@@ -1,4 +1,8 @@+import { AskMacroButton } from '@app/component/ChatWithAgentButton';+import { useBlockId } from '@core/block';import { CustomScrollbar } from '@core/component/CustomScrollbar';+import { ScopedPortal } from '@core/component/ScopedPortal';+import { isMobile } from '@core/mobile/isMobile';import type { CallRecord } from '@service-storage/generated/schemas/callRecord';import { format } from 'date-fns';import type { Accessor } from 'solid-js';@@ -25,6 +29,7 @@ export function CallRecordingBody(props: {transcriptTarget?: Accessor<CallTranscriptTarget | undefined>;}) {const record = props.data;+ const blockId = useBlockId();const hasTranscripts = createMemo(() => record().transcript.length > 0);const [playbackSeconds, setPlaybackSeconds] = createSignal(0);const [allowFutureLead, setAllowFutureLead] = createSignal(true);@@ -134,13 +139,28 @@ export function CallRecordingBody(props: {<><CallRecordingSplitHeader record={record} /><div class="relative flex-1 min-h-0 overflow-hidden">+ <ScopedPortal scope="block">+ <div class="flex items-center gap-2 mobile:hidden p-2 absolute top-0 left-0">+ <AskMacroButton+ entity={{+ type: 'document',+ id: blockId,+ name: callTitle(),+ fileType: 'call',+ }}+ />+ </div>+ </ScopedPortal><divclass="h-full min-h-0 overflow-y-auto scrollbar-hidden"ref={setScrollRef}>- <div class="mx-auto max-w-3xl min-w-0 px-6 pt-10 pb-16">+ <div class="mx-auto max-w-3xl min-w-0 px-6 pt-12 pb-16"><div class="flex flex-col gap-10"><header>+ <Show when={!isMobile()}>+ <div class="h-8 mb-4" />+ </Show><h1 class="text-2xl font-semibold text-ink text-balance">{callTitle()}</h1>diff --git a/js/app/packages/block-call/component/CallRecording/CallRecordingSplitHeader.tsx b/js/app/packages/block-call/component/CallRecording/CallRecordingSplitHeader.tsxindex 6f7768c64a..91e1dd69f6 100644--- a/js/app/packages/block-call/component/CallRecording/CallRecordingSplitHeader.tsx+++ b/js/app/packages/block-call/component/CallRecording/CallRecordingSplitHeader.tsx@@ -8,13 +8,12 @@ import {ResponsiveBlockToolbar,ResponsivePermissionsBadge,} from '@app/component/ResponsiveBlockToolbar';-import { SidePanel } from '@app/component/side-panel';+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';import {SplitHeaderLeft,SplitHeaderRight,} from '@app/component/split-layout/components/SplitHeader';import { StaticSplitLabel } from '@app/component/split-layout/components/SplitLabel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useCall } from '@channel/Call/use-call';import { useBlockId } from '@core/block';import { BlockLiveIndicators } from '@core/component/LiveIndicators';@@ -23,10 +22,12 @@ import {ShareTrigger,useShareDialogContext,} from '@core/component/TopBar/ShareButton';+import { isMobile } from '@core/mobile/isMobile';import PhoneCallIcon from '@icon/wide-call.svg';import IconShared from '@icon/wide-share.svg';import type { CallRecord } from '@service-storage/generated/schemas/callRecord';-import type { Accessor } from 'solid-js';+import { Button } from '@ui';+import { type Accessor, Show } from 'solid-js';export function CallRecordingSplitHeaderLoading() {return (@@ -56,10 +57,16 @@ export function CallRecordingSplitHeader(props: {const tools: BlockTool[] = [{- label: 'Call Again',- icon: PhoneCallIcon,- action: () => call.joinCall(),- condition: () => !record().isActive,+ label: 'Ask Macro',+ icon: ChatWithAgentIcon,+ action: () =>+ openChatWithAgent({+ type: 'document',+ id: blockId,+ name: callName(),+ fileType: 'call',+ }),+ condition: isMobile,},{label: 'Chat',@@ -110,6 +117,22 @@ export function CallRecordingSplitHeader(props: {<div class="-order-1"><BlockLiveIndicators /></div>+ <Show when={!record().isActive}>+ <div class="order-[900] flex items-center">+ <HeaderIsland>+ <Button+ depth={2}+ variant="base"+ size="icon-sm"+ class="bg-surface"+ tooltip="Call Again"+ onClick={() => call.joinCall()}+ >+ <PhoneCallIcon class="size-4" />+ </Button>+ </HeaderIsland>+ </div>+ </Show></SplitHeaderRight><ResponsivePermissionsBadge />@@ -121,9 +144,6 @@ export function CallRecordingSplitHeader(props: {itemType="call"name={callName()}/>- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft></>);}diff --git a/js/app/packages/block-chat/component/Chat.tsx b/js/app/packages/block-chat/component/Chat.tsxindex 41d47b1919..3257697b01 100644--- a/js/app/packages/block-chat/component/Chat.tsx+++ b/js/app/packages/block-chat/component/Chat.tsx@@ -1,7 +1,6 @@import { useAnalytics } from '@app/component/analytics-context';import { FloatRegionOrInline } from '@app/component/mobile/float-regions/FloatRegion';import { useMaybePreviewPanel } from '@app/component/PreviewPanel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useNavigatedFromJK } from '@app/component/useNavigatedFromJK';import type { SendBuilder } from '@block-chat/blockClient';import { TopBar } from '@block-chat/component/TopBar';@@ -34,7 +33,6 @@ import {storeChatState,} from '@core/component/AI/util/storage';import { CustomScrollbar } from '@core/component/CustomScrollbar';-import { DEV_MODE_ENV } from '@core/constant/featureFlags';import { usePaywallState } from '@core/constant/PaywallState';import { TOKENS } from '@core/hotkey/tokens';import { registerScopeSignalHotkey } from '@core/hotkey/utils';@@ -46,11 +44,9 @@ import {import { blockHandleSignal } from '@core/signal/load';import { useCanEdit } from '@core/signal/permissions';import { createRenameDssEntityMutation } from '@macro-entity';-import ChatDebugIcon from '@phosphor/chat-text.svg';import { invalidateUserQuota } from '@queries/auth';import { cognitionApiServiceClient } from '@service-cognition/client';import { createCallback } from '@solid-primitives/rootless';-import { Button } from '@ui';import { ChatInput } from 'core/component/AI/component/input/ChatInput';import { createEffect, createSignal, getOwner, Show, Suspense } from 'solid-js';@@ -276,23 +272,12 @@ function ChatInner(props: {><Show when={!isNestedBlock}><Suspense>- <TopBar />+ <TopBar+ showStreamDebug={showStreamDebug}+ toggleStreamDebug={() => setShowStreamDebug((p) => !p)}+ /></Suspense></Show>- <SplitToolbarLeft>- <Show when={DEV_MODE_ENV}>- <Button- size="icon-sm"- class="rounded-xs"- onClick={() => setShowStreamDebug((p) => !p)}- tooltip={- showStreamDebug() ? 'Hide Stream Debug' : 'Show Stream Debug'- }- >- <ChatDebugIcon />- </Button>- </Show>- </SplitToolbarLeft><Show when={showStreamDebug()}><div class="px-2 py-1 bg-surface border-b border-edge text-ink font-mono text-sm"><Show when={chat.stream()} fallback={<div>No active stream</div>}>diff --git a/js/app/packages/block-chat/component/TopBar.tsx b/js/app/packages/block-chat/component/TopBar.tsxindex 19224f023a..075fac36a2 100644--- a/js/app/packages/block-chat/component/TopBar.tsx+++ b/js/app/packages/block-chat/component/TopBar.tsx@@ -9,28 +9,26 @@ import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeaimport { BlockItemSplitLabel } from '@app/component/split-layout/components/SplitLabel';import { DEFAULT_CHAT_NAME } from '@block-chat/definition';-import { useIsAuthenticated } from '@core/auth';import { useBlockId } from '@core/block';import { DETAILS_DRAWER_ID } from '@core/component/DetailsDrawer';-import {- REFERENCES_DRAWER_ID,- ReferencesButton,-} from '@core/component/ReferencesModal';import {getShareDrawerRecipientInput,ShareTrigger,useShareDialogContext,} from '@core/component/TopBar/ShareButton';-import { ENABLE_REFERENCES_MODAL } from '@core/constant/featureFlags';+import { DEV_MODE_ENV } from '@core/constant/featureFlags';import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';import IconShared from '@icon/wide-share.svg';+import ChatDebugIcon from '@phosphor/chat-text.svg';import Info from '@phosphor/info.svg';import Notepad from '@phosphor/notepad.svg';-import Quotes from '@phosphor/quotes.svg';import { useOpenInstructionsMd } from 'core/component/AI/util/instructions';+import type { Accessor } from 'solid-js';-export function TopBar() {- const isAuth = useIsAuthenticated();+export function TopBar(props: {+ showStreamDebug?: Accessor<boolean>;+ toggleStreamDebug?: () => void;+}) {const blockId = useBlockId();const name = useBlockDocumentName(DEFAULT_CHAT_NAME);@@ -38,7 +36,6 @@ export function TopBar() {const openInstructions = useOpenInstructionsMd();- const referencesControl = useDrawerControl(REFERENCES_DRAWER_ID);const detailsControl = useDrawerControl(DETAILS_DRAWER_ID);const shareCtx = useShareDialogContext();@@ -48,6 +45,22 @@ export function TopBar() {icon: Info,action: detailsControl.toggle,},+ {+ label: 'Edit AI Instructions',+ icon: Notepad,+ action: openInstructions,+ },+ ...(DEV_MODE_ENV && props.toggleStreamDebug+ ? [+ {+ label: props.showStreamDebug?.()+ ? 'Hide Stream Debug'+ : 'Show Stream Debug',+ icon: ChatDebugIcon,+ action: props.toggleStreamDebug,+ } satisfies FileOperation,+ ]+ : []),{ op: 'rename' },{ op: 'copy' },{ op: 'moveToProject' },@@ -55,25 +68,6 @@ export function TopBar() {];const tools: BlockTool[] = [- {- label: 'Edit AI Instructions',- icon: Notepad,- action: openInstructions,- },- {- label: 'References',- icon: Quotes,- action: referencesControl.toggle,- condition: () => !!isAuth() && ENABLE_REFERENCES_MODAL,- buttonComponent: () => (- <ReferencesButton- documentId={blockId}- documentName={chatName()}- buttonSize="sm"- entityType="chat"- />- ),- },{label: 'Share',icon: IconShared,diff --git a/js/app/packages/block-email/component/Email.tsx b/js/app/packages/block-email/component/Email.tsxindex 1a617cbd6c..116162e9c2 100644--- a/js/app/packages/block-email/component/Email.tsx+++ b/js/app/packages/block-email/component/Email.tsx@@ -1,4 +1,6 @@+import { AskMacroButton } from '@app/component/ChatWithAgentButton';import { SidePanel } from '@app/component/side-panel';+import { useSplitLayout } from '@app/component/split-layout/layout';import { useSplitPanel } from '@app/component/split-layout/layoutUtils';import { EmailCompose } from '@block-email/component/compose/Compose';import {@@ -8,6 +10,7 @@ import {import { EmailInput } from '@block-email/component/EmailInput';import { CustomScrollbar } from '@core/component/CustomScrollbar';import { FloatingInputLoader } from '@core/component/FloatingInputLoader';+import { ScopedPortal } from '@core/component/ScopedPortal';import { useUserContext } from '@core/context/user';import { TOKENS } from '@core/hotkey/tokens';import { registerScopeSignalHotkey } from '@core/hotkey/utils';@@ -17,9 +20,11 @@ import {blockElementSignal,blockHotkeyScopeSignal,} from '@core/signal/blockElement';+import { AnimatedTaskIcon } from '@icon/wide-task';+import { buildMentionMarkdownString } from '@lexical-core';import type { ApiMessage } from '@service-email/generated/schemas';import { createCallback } from '@solid-primitives/rootless';-import { cn } from '@ui';+import { Button, cn } from '@ui';import {type Accessor,createEffect,@@ -67,6 +72,7 @@ export function EmailView(props: EmailViewProps) {function EmailContent(props: EmailViewProps) {const scopeId = blockHotkeyScopeSignal.get;+ const { popoverSplit } = useSplitLayout();const setIsScrollingToMessage = isScrollingToMessage.set;const blockElement = blockElementSignal.get;@@ -81,6 +87,26 @@ function EmailContent(props: EmailViewProps) {setIsScrolled(scrollFromTop > 1);};+ const openTaskCompose = () => {+ const threadId = context.thread()?.db_id;+ if (!threadId) return;+ const title =+ props.title.length > 70 ? `${props.title.slice(0, 70)}...` : props.title;+ popoverSplit({+ type: 'component',+ id: 'task-compose',+ params: {+ initialTitle: title,+ initialContent: buildMentionMarkdownString({+ type: 'document',+ documentId: threadId,+ documentName: props.title,+ blockName: 'email',+ }),+ },+ });+ };+/*** Waits for the query to finish fetching*/@@ -555,6 +581,24 @@ function EmailContent(props: EmailViewProps) {emailReplyInfo()?.draft !== null}/>+ <ScopedPortal scope="block">+ <div class="flex items-center gap-2 mobile:hidden p-2 absolute top-0 left-0">+ <Show when={context.thread()?.db_id}>+ {(threadId) => (+ <AskMacroButton+ entity={{+ type: 'email',+ id: threadId(),+ name: props.title,+ }}+ />+ )}+ </Show>+ <Show when={context.thread()?.db_id}>+ <EmailTaskButton onClick={openTaskCompose} />+ </Show>+ </div>+ </ScopedPortal><divclass="w-full flex-1 flex flex-col items-center overflow-hidden"ref={context.registerMessagesContainer}@@ -568,7 +612,10 @@ function EmailContent(props: EmailViewProps) {'border-transparent': !isScrolled(),}}>- <h1 class="ph-no-capture text-2xl font-semibold text-ink pt-3 pb-1.5 tracking-tight text-balance">+ <div class="pt-12">+ <div class="h-8 mb-4" />+ </div>+ <h1 class="ph-no-capture text-2xl font-semibold text-ink pb-1.5 tracking-tight text-balance">{props.title}</h1><div class="pb-2.5">@@ -646,3 +693,23 @@ function EmailContent(props: EmailViewProps) {</ModalsProvider>);}++function EmailTaskButton(props: { onClick: () => void }) {+ const [hovering, setHovering] = createSignal(false);++ return (+ <Button+ tooltip="Create Task"+ variant="ghost"+ size="sm"+ onMouseEnter={() => setHovering(true)}+ onMouseLeave={() => setHovering(false)}+ onClick={props.onClick}+ depth={2}+ class="gap-1.5 rounded-full bg-hover/20 px-2 text-ink-extra-muted ring ring-edge-muted"+ >+ <AnimatedTaskIcon triggerAnimation={hovering()} />+ <span class="text-xs font-semibold">Task</span>+ </Button>+ );+}diff --git a/js/app/packages/block-email/component/TopBar.tsx b/js/app/packages/block-email/component/TopBar.tsxindex a33d0698cf..e2cd9fef09 100644--- a/js/app/packages/block-email/component/TopBar.tsx+++ b/js/app/packages/block-email/component/TopBar.tsx@@ -10,14 +10,14 @@ import {} from '@app/component/next-soup/utils';import type { BlockTool } from '@app/component/ResponsiveBlockToolbar';import { ResponsiveBlockToolbar } from '@app/component/ResponsiveBlockToolbar';-import { SidePanel, useSidePanel } from '@app/component/side-panel';+import { useSidePanel } from '@app/component/side-panel';+import { SplitFileMenu } from '@app/component/split-layout/components/SplitFileMenu';import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';import {SplitHeaderBadge,+ SplitTitleFileMenu,StaticSplitLabel,} from '@app/component/split-layout/components/SplitLabel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';-import { useSplitLayout } from '@app/component/split-layout/layout';import { useSplitPanel } from '@app/component/split-layout/layoutUtils';import { toast } from '@core/component/Toast/Toast';import {@@ -31,16 +31,12 @@ import { TOKENS } from '@core/hotkey/tokens';import { getActiveCommandByToken, runCommand } from '@core/hotkey/utils';import { isMobile } from '@core/mobile/isMobile';import IconShared from '@icon/wide-share.svg';-import { AnimatedTaskIcon } from '@icon/wide-task';-import { buildMentionMarkdownString } from '@lexical-core';import CheckIcon from '@phosphor/check.svg';import ProhibitIcon from '@phosphor/prohibit.svg';-import SidePanelIcon from '@phosphor/square-half.svg';import TrashIcon from '@phosphor/trash.svg';import ArrowCounterClockwise from '@phosphor-icons/core/regular/arrow-counter-clockwise.svg?component-solid';import { useEmailLinksQuery } from '@queries/email/link';-import { Button, cn } from '@ui';-import { createSignal, onCleanup, Show } from 'solid-js';+import { onCleanup, Show } from 'solid-js';import { useEmailContext } from './EmailContext';export function TopBar(props: {@@ -48,7 +44,6 @@ export function TopBar(props: {title: string;isDraft?: boolean;}) {- const { popoverSplit } = useSplitLayout();const splitPanel = useSplitPanel();const shareCtx = useShareDialogContext();const emailCtx = useEmailContext();@@ -126,29 +121,28 @@ export function TopBar(props: {});};- const openTaskCompose = () => {- const threadId = emailCtx.thread()?.db_id;- if (!threadId) return;- const title =- props.title.length > 70 ? `${props.title.slice(0, 70)}...` : props.title;- popoverSplit({- type: 'component',- id: 'task-compose',- params: {- initialTitle: title,- initialContent: buildMentionMarkdownString({- type: 'document',- documentId: threadId,- documentName: props.title,- blockName: 'email',- }),- },- });+ const shareTool: BlockTool = {+ label: 'Share',+ icon: IconShared,+ action: () => shareCtx.open(),+ condition: () => ENABLE_EMAIL_SHARING,+ buttonComponent: () => <ShareTrigger />,+ focusTarget: getShareDrawerRecipientInput,};- const tools: BlockTool[] = [+ const emailActions: BlockTool[] = [+ {+ label: 'Ask Macro',+ icon: ChatWithAgentIcon,+ action: () => {+ const threadId = emailCtx.thread()?.db_id;+ if (!threadId) return;+ openChatWithAgent({ type: 'email', id: threadId, name: props.title });+ },+ condition: () => isMobile() && !!emailCtx.thread()?.db_id,+ },{- label: 'Done',+ label: 'Mark done',icon: CheckIcon,action: () => {const command = getActiveCommandByToken(TOKENS.entity.action.markDone);@@ -161,7 +155,7 @@ export function TopBar(props: {condition: isOwnThread,},{- label: 'Trash',+ label: 'Delete',icon: TrashIcon,action: trashThread,condition: isOwnThread,@@ -172,29 +166,10 @@ export function TopBar(props: {action: () => emailCtx.blockSender(),condition: isOwnThread,},- {- label: 'Create Task',- icon: AnimatedTaskIcon,- action: openTaskCompose,- buttonComponent: () => {- const [hovering, setHovering] = createSignal(false);- return (- <Button- tooltip="Create Task"- variant="base"- size="sm"- onMouseEnter={() => setHovering(true)}- onMouseLeave={() => setHovering(false)}- onClick={openTaskCompose}- depth={2}- class="bg-surface text-ink-muted"- >- <AnimatedTaskIcon triggerAnimation={hovering()} />- <span class="text-xs text-ink-extra-muted">Task</span>- </Button>- );- },- },+ shareTool,+ ];++ const tools: BlockTool[] = [{label: 'Chat',icon: ChatWithAgentIcon,@@ -213,45 +188,7 @@ export function TopBar(props: {) : null;},},- {- label: 'Share',- icon: IconShared,- action: () => shareCtx.open(),- condition: () => ENABLE_EMAIL_SHARING,- buttonComponent: () => <ShareTrigger />,- focusTarget: getShareDrawerRecipientInput,- },- {- label: () =>- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel',- icon: SidePanelIcon,- action: () => sidePanel?.toggle(),- isActive: () => sidePanel?.isOpen() ?? false,- condition: () => !(sidePanel?.isNarrow() ?? isMobile()),- buttonComponent: () => (- <Show when={sidePanel}>- {(panel) => (- <Button- depth={2}- variant="base"- size="icon-sm"- class={cn('bg-surface order-20', {- 'bg-active': sidePanel?.isOpen(),- })}- tooltip={- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel'- }- hotkey={TOKENS.block.toggleSidePanel}- onClick={() => {- panel().toggle();- }}- >- <SidePanelIcon />- </Button>- )}- </Show>- ),- },+ shareTool,];return (@@ -275,6 +212,22 @@ export function TopBar(props: {/></SplitHeaderLeft>+ <SplitTitleFileMenu>+ <Show+ when={emailActions.some(+ (action) => !action.condition || action.condition()+ )}+ >+ <SplitFileMenu+ id={props.id}+ itemType="email"+ name={props.title}+ ops={[]}+ tools={emailActions}+ />+ </Show>+ </SplitTitleFileMenu>+<ResponsiveBlockToolbartools={tools}ops={[]}@@ -282,9 +235,6 @@ export function TopBar(props: {itemType="email"name={props.title}/>- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft></>);}diff --git a/js/app/packages/block-md/component/CollabStatus.tsx b/js/app/packages/block-md/component/CollabStatus.tsxindex 7aa3835df4..616353ee4e 100644--- a/js/app/packages/block-md/component/CollabStatus.tsx+++ b/js/app/packages/block-md/component/CollabStatus.tsx@@ -1,48 +1,52 @@-import { SplitToolbarRight } from '@app/component/split-layout/components/SplitToolbar';+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';+import { SplitHeaderRight } from '@app/component/split-layout/components/SplitHeader';import { SyncSourceStatus } from '@core/collab/source';import { blockSyncSourceSignal } from '@core/signal/load';import CloudIcon from '@phosphor/cloud.svg';import CloudWarningIcon from '@phosphor/cloud-warning.svg';import { Button } from '@ui';-import { Match, Switch } from 'solid-js';+import { Match, Show, Switch } from 'solid-js';export function CollabStatus() {const syncSource = blockSyncSourceSignal.get;const status = () => syncSource()?.status() ?? SyncSourceStatus.Disconnected;+ const showStatus = () =>+ status() === SyncSourceStatus.Disconnected ||+ status() === SyncSourceStatus.Connecting;return (- <SplitToolbarRight>+ <SplitHeaderRight>{/* `mode="outin"` so a state fully fades out before the next fades in(one toolbar slot). The <Switch> renders nothing when Connected,which the Transition treats as an exit (fade out). */}- <Switch>- <Match when={status() === SyncSourceStatus.Disconnected}>- <div class="-order-1 flex items-center">- <Button- variant="base"- size="icon-sm"- aria-label="Offline"- tooltip="You're offline. Changes will sync when you reconnect."- class="bg-alert-bg border-alert/20"- >- <CloudWarningIcon class="text-alert-ink" />- </Button>- </div>- </Match>- <Match when={status() === SyncSourceStatus.Connecting}>- <div class="-order-1 flex items-center">- <Button- variant="ghost"- size="icon-sm"- aria-label="Reconnecting"- tooltip="Reconnecting to the document…"- >- <CloudIcon class="ink-text-extra-mutes animate-pulse" />- </Button>- </div>- </Match>- </Switch>- </SplitToolbarRight>+ <Show when={showStatus()}>+ <HeaderIsland class="-order-1">+ <Switch>+ <Match when={status() === SyncSourceStatus.Disconnected}>+ <Button+ variant="base"+ size="icon-sm"+ aria-label="Offline"+ tooltip="You're offline. Changes will sync when you reconnect."+ class="bg-alert-bg border-alert/20"+ >+ <CloudWarningIcon class="text-alert-ink" />+ </Button>+ </Match>+ <Match when={status() === SyncSourceStatus.Connecting}>+ <Button+ variant="ghost"+ size="icon-sm"+ aria-label="Reconnecting"+ tooltip="Reconnecting to the document…"+ >+ <CloudIcon class="text-ink-extra-muted animate-pulse" />+ </Button>+ </Match>+ </Switch>+ </HeaderIsland>+ </Show>+ </SplitHeaderRight>);}diff --git a/js/app/packages/block-md/component/DispatchAgentMenu.tsx b/js/app/packages/block-md/component/DispatchAgentMenu.tsxindex 6801cbf826..df8b0efb00 100644--- a/js/app/packages/block-md/component/DispatchAgentMenu.tsx+++ b/js/app/packages/block-md/component/DispatchAgentMenu.tsx@@ -198,15 +198,27 @@ export function DispatchAgentButton() {return (<Dropdown open={open()} onOpenChange={setOpen}>- <ButtonGroup variant="base" size="icon-sm" depth={2} class="bg-surface">- <Button onClick={handlePrimaryClick} tooltip={lastUsed().name}>+ <ButtonGroup+ variant="ghost"+ size="icon-sm"+ depth={2}+ class="rounded-full bg-hover/20 text-ink-extra-muted ring ring-edge-muted"+ >+ <Button+ onClick={handlePrimaryClick}+ tooltip={lastUsed().name}+ class="bg-transparent hover:bg-ink/[0.04]"+ ><Dynamiccomponent={lastUsed().buttonIcon ?? lastUsed().icon}class="size-3!"/></Button><ButtonGroup.Divider />- <Dropdown.Trigger class="p-1">+ <Dropdown.Trigger+ class="bg-transparent p-1 hover:bg-ink/[0.04]"+ label="Agent options"+ ><CaretDown class="size-3.5!" /></Dropdown.Trigger></ButtonGroup>diff --git a/js/app/packages/block-md/component/Notebook.tsx b/js/app/packages/block-md/component/Notebook.tsxindex 1f533a84da..a43460789f 100644--- a/js/app/packages/block-md/component/Notebook.tsx+++ b/js/app/packages/block-md/component/Notebook.tsx@@ -1,3 +1,4 @@+import { AskMacroButton } from '@app/component/ChatWithAgentButton';import { useNavigatedFromJK } from '@app/component/useNavigatedFromJK';import { CommentMargin } from '@block-md/comments/CommentMargin';import {@@ -6,10 +7,11 @@ import {} from '@block-md/comments/commentStore';import { useGoToTempRedirect } from '@block-md/signal/location';import { mdStore } from '@block-md/signal/markdownBlockData';-import { useBlockId } from '@core/block';+import { useBlockAliasedName, useBlockId } from '@core/block';import type { LoroManager } from '@core/collab/manager';import { editorFocusSignal } from '@core/component/LexicalMarkdown/utils';import { ParamsProvider } from '@core/component/ParamsProvider';+import { ScopedPortal } from '@core/component/ScopedPortal';import {DEV_MODE_ENV,ENABLE_MARKDOWN_COMMENTS,@@ -18,6 +20,7 @@ import {import { useIsMacroTeam } from '@core/context/team';import { registerHotkey } from '@core/hotkey/hotkeys';import { TOKENS } from '@core/hotkey/tokens';+import { isMobile } from '@core/mobile/isMobile';import {blockElementSignal,blockHotkeyScopeSignal,@@ -32,8 +35,10 @@ import {createSignal,onCleanup,onMount,+ Show,untrack,} from 'solid-js';+import { DispatchAgentButton } from './DispatchAgentMenu';import { DocumentDiscussion } from './DocumentDiscussion';import { InlineTaskGithubPullRequests } from './InlineTaskGithubPullRequests';import { InlineTaskProperties } from './InlineTaskProperties';@@ -92,6 +97,8 @@ function useCanUseLexicalStateDebugger() {export function Notebook(props: { loroManager: LoroManager }) {const blockElement = blockElementSignal.get;+ const blockId = useBlockId();+ const blockAliasedName = useBlockAliasedName();const setStore = mdStore.set;const setWideEnoughForComments = commentWidthSignal.set;const documentName = useBlockDocumentName();@@ -141,7 +148,7 @@ export function Notebook(props: { loroManager: LoroManager }) {createEffect(() => {const goToTempRedirect = useGoToTempRedirect();- const documentId = useBlockId();+ const documentId = blockId;const recentState = tempRedirectLocation();if (!documentId || !recentState) return;@@ -285,6 +292,21 @@ export function Notebook(props: { loroManager: LoroManager }) {return (<div class={containerClasses()} ref={notebookRef}><div class={contentDivClasses()} ref={contentRef}>+ <ScopedPortal scope="block">+ <div class="flex items-center gap-2 mobile:hidden p-2 absolute top-0 left-0">+ <AskMacroButton+ entity={{+ type: 'document',+ id: blockId,+ name: documentName(),+ fileType: 'md',+ }}+ />+ <Show when={blockAliasedName === 'task' && !isMobile()}>+ <DispatchAgentButton />+ </Show>+ </div>+ </ScopedPortal><TitleEditor autoFocusOnMount={!navigatedFromJK()} /><div class="spacer h-3" /><div class="mb-6 flex flex-row flex-wrap items-center gap-2 text-sm empty:hidden">diff --git a/js/app/packages/block-md/component/TopBar.tsx b/js/app/packages/block-md/component/TopBar.tsxindex 9e86bf0586..2b73fd41f5 100644--- a/js/app/packages/block-md/component/TopBar.tsx+++ b/js/app/packages/block-md/component/TopBar.tsx@@ -9,7 +9,7 @@ import {ResponsivePermissionsBadge,ToolButton,} from '@app/component/ResponsiveBlockToolbar';-import { SidePanel, useSidePanel } from '@app/component/side-panel';+import { useSidePanel } from '@app/component/side-panel';import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';import type { FileOperation } from '@app/component/split-layout/components/SplitFileMenu';import {@@ -20,7 +20,6 @@ import {BlockItemSplitLabel,StaticSplitLabel,} from '@app/component/split-layout/components/SplitLabel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useSplitPanel } from '@app/component/split-layout/layoutUtils';import { useDownloadDocumentAsMarkdownText } from '@block-md/signal/save';import { useBlockAliasedName, useBlockId, useBlockName } from '@core/block';@@ -34,7 +33,6 @@ import {import {ENABLE_HISTORY_COMPONENT,ENABLE_MARKDOWN_LIVE_COLLABORATION,- ENABLE_MARKDOWN_SIDE_PANEL,} from '@core/constant/featureFlags';import { registerHotkey } from '@core/hotkey/hotkeys';import { TOKENS } from '@core/hotkey/tokens';@@ -44,15 +42,12 @@ import { useCanEdit } from '@core/signal/permissions';import { copyBranchNameToClipboard } from '@core/util/branchName';import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';import { buildSimpleEntityUrl } from '@core/util/url';-import IconShared from '@icon/wide-share.svg';import ClockIcon from '@phosphor/clock-counter-clockwise.svg';import Download from '@phosphor/download.svg';import GitBranch from '@phosphor/git-branch.svg';import IconLink from '@phosphor/link.svg';-import SidePanelIcon from '@phosphor/square-half.svg';import TerminalWindowIcon from '@phosphor/terminal-window.svg';import { blockNameToItemType } from '@service-storage/client';-import { Button, cn } from '@ui';import {type Accessor,createEffect,@@ -158,6 +153,18 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {}const tools: BlockTool[] = [+ {+ label: 'Ask Macro',+ icon: ChatWithAgentIcon,+ action: () =>+ openChatWithAgent({+ type: 'document',+ id: blockId,+ name: name(),+ fileType: 'md',+ }),+ condition: isMobile,+ },{label: 'History',icon: ClockIcon,@@ -205,7 +212,7 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {},{label: 'Share',- icon: IconShared,+ icon: IconLink,action: () => shareCtx.open(),buttonComponent: () => <ShareTrigger />,focusTarget: getShareDrawerRecipientInput,@@ -216,38 +223,6 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {action: copyLink,condition: isMobile,},- {- label: () =>- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel',- icon: SidePanelIcon,- action: () => sidePanel?.toggle(),- isActive: () => sidePanel?.isOpen() ?? false,- condition: () =>- ENABLE_MARKDOWN_SIDE_PANEL && !(sidePanel?.isNarrow() ?? isMobile()),- buttonComponent: () => (- <Show when={sidePanel}>- {(panel) => (- <Button- depth={2}- variant="base"- size="icon-sm"- class={cn('bg-surface order-20', {- 'bg-active': sidePanel?.isOpen(),- })}- tooltip={- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel'- }- hotkey={TOKENS.block.toggleSidePanel}- onClick={() => {- panel().toggle();- }}- >- <SidePanelIcon />- </Button>- )}- </Show>- ),- },];return (@@ -272,9 +247,6 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {itemType={itemType}name={name()}/>- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft></>);}diff --git a/js/app/packages/block-pr/component/PrSplitHeader.tsx b/js/app/packages/block-pr/component/PrSplitHeader.tsxindex adb0e60efc..ee53df077c 100644--- a/js/app/packages/block-pr/component/PrSplitHeader.tsx+++ b/js/app/packages/block-pr/component/PrSplitHeader.tsx@@ -2,22 +2,18 @@ import {type BlockTool,ResponsiveBlockToolbar,} from '@app/component/ResponsiveBlockToolbar';-import { SidePanel, useSidePanel } from '@app/component/side-panel';import type { FileOperation } from '@app/component/split-layout/components/SplitFileMenu';import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';import { StaticSplitLabel } from '@app/component/split-layout/components/SplitLabel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useBlockId } from '@core/block';import { toast } from '@core/component/Toast/Toast';-import { TOKENS } from '@core/hotkey/tokens';import { buildSimpleEntityUrl, openExternalUrl } from '@core/util/url';import GithubIcon from '@icon/mcp-github.svg';import GitMerge from '@phosphor/git-merge.svg';import GitPullRequest from '@phosphor/git-pull-request.svg';import LinkIcon from '@phosphor/link.svg';-import SidePanelIcon from '@phosphor/square-half.svg';import type { GithubPullRequest } from '@service-storage/generated/schemas';-import { Button, cn, Layer } from '@ui';+import { cn, Layer } from '@ui';import { Show } from 'solid-js';import type { PrRef } from '../util/prKey';@@ -89,7 +85,6 @@ export function PrSplitHeader(props: {enrichment: GithubPullRequest | undefined;}) {const blockId = useBlockId();- const sidePanel = useSidePanel();const title = () => props.enrichment?.name ?? prDisplayName(props.prRef);const githubUrl = () => props.enrichment?.url ?? prHtmlUrl(props.prRef);@@ -114,37 +109,6 @@ export function PrSplitHeader(props: {icon: LinkIcon,action: copyLink,},- {- label: () =>- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel',- icon: SidePanelIcon,- action: () => sidePanel?.toggle(),- isActive: () => sidePanel?.isOpen() ?? false,- condition: () => !(sidePanel?.isNarrow() ?? false),- buttonComponent: () => (- <Show when={sidePanel}>- {(panel) => (- <Button- depth={2}- variant="base"- size="icon-sm"- class={cn('bg-surface order-20', {- 'bg-active': sidePanel?.isOpen(),- })}- tooltip={- sidePanel?.isOpen() ? 'Hide Side Panel' : 'Show Side Panel'- }- hotkey={TOKENS.block.toggleSidePanel}- onClick={() => {- panel().toggle();- }}- >- <SidePanelIcon />- </Button>- )}- </Show>- ),- },];return (@@ -168,10 +132,6 @@ export function PrSplitHeader(props: {itemType="foreign"name={title()}/>-- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft></>);}diff --git a/js/app/packages/block-project/component/TopBar.tsx b/js/app/packages/block-project/component/TopBar.tsxindex 95011e1b18..34dfa09518 100644--- a/js/app/packages/block-project/component/TopBar.tsx+++ b/js/app/packages/block-project/component/TopBar.tsx@@ -8,7 +8,6 @@ import {ResponsivePermissionsBadge,ToolButton,} from '@app/component/ResponsiveBlockToolbar';-import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';import {type FileOperation,@@ -18,7 +17,10 @@ import {SplitHeaderLeft,SplitHeaderRight,} from '@app/component/split-layout/components/SplitHeader';-import { BlockItemSplitLabel } from '@app/component/split-layout/components/SplitLabel';+import {+ BlockItemSplitLabel,+ SplitTitleFileMenu,+} from '@app/component/split-layout/components/SplitLabel';import {SplitToolbarLeft,SplitToolbarRight,@@ -122,64 +124,58 @@ export function TopBar() {focusTarget: getShareDrawerRecipientInput,},];+ const toolbarTools = () => tools.filter((tool) => tool.label !== 'Share');+ const showShare = () => ENABLE_PROJECT_SHARING && !isSpecialProject;return (<><SplitHeaderLeft><BlockItemSplitLabel fallbackName={name()} /></SplitHeaderLeft>+ <SplitHeaderRight>+ <div class="order-[1000] flex items-center gap-1">+ <Show when={showShare()}>+ <ShareTrigger copyLink={handleCopyLink} />+ </Show>+ </div>+ </SplitHeaderRight><ResponsivePermissionsBadge />- <Show- when={isMobile()}- fallback={- <>- <SplitToolbarLeft class="flex-0">- <div class="flex gap-2 p-1">- <Show when={ops().length > 0}>- <SplitFileMenu- id={id}- itemType="project"- name={name()}- ops={ops()}- />- <Show when={canEdit()}>- <ProjectCreateMenu id={id} />- </Show>- </Show>- </div>- </SplitToolbarLeft>- <Show when={showToolbarRight()}>- <SplitToolbarRight>- <For each={tools}>- {(tool) => (- <Show when={!tool.condition || tool.condition()}>- {tool.buttonComponent ? (- <tool.buttonComponent />- ) : (- <ToolButton tool={tool} />- )}- </Show>- )}- </For>- </SplitToolbarRight>+ <SplitTitleFileMenu>+ <Show when={ops().length > 0 || (isMobile() && !isSpecialProject)}>+ <SplitFileMenu+ id={id}+ itemType="project"+ name={name()}+ ops={ops()}+ tools={isMobile() ? [...toolbarTools(), ...createTools] : undefined}+ />+ </Show>+ </SplitTitleFileMenu>+ <Show when={!isMobile()}>+ <SplitToolbarLeft class="flex-0">+ <div class="flex gap-2 p-1">+ <Show when={ops().length > 0}>+ <Show when={canEdit()}>+ <ProjectCreateMenu id={id} />+ </Show></Show>- </>- }- >- {/* Mobile layout */}- <SplitHeaderRight>- <Show when={ops().length > 0 || !isSpecialProject}>- <HeaderIsland>- <SplitFileMenu- id={id}- itemType="project"- name={name()}- ops={ops()}- tools={[...tools, ...createTools]}- />- </HeaderIsland>- </Show>- </SplitHeaderRight>+ </div>+ </SplitToolbarLeft>+ <Show when={showToolbarRight()}>+ <SplitToolbarRight>+ <For each={toolbarTools()}>+ {(tool) => (+ <Show when={!tool.condition || tool.condition()}>+ {tool.buttonComponent ? (+ <tool.buttonComponent />+ ) : (+ <ToolButton tool={tool} />+ )}+ </Show>+ )}+ </For>+ </SplitToolbarRight>+ </Show></Show><CreateDialog /></>diff --git a/js/app/packages/companies/Company/Company.tsx b/js/app/packages/companies/Company/Company.tsxindex 4693fe8169..82dd8325e0 100644--- a/js/app/packages/companies/Company/Company.tsx+++ b/js/app/packages/companies/Company/Company.tsx@@ -1,5 +1,4 @@import { SidePanel } from '@app/component/side-panel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useCompanyQuery } from '@queries/crm/companies';import { CompanyContactsSection } from './CompanyContactsSection';import { CompanyDiscussionSection } from './CompanyDiscussionSection';@@ -19,13 +18,6 @@ export function Company(props: { companyId: string }) {return (<SidePanel.Layout>- {/* Narrow-mode Content/Info tabs. Portaled into the split's toolbar- slot so they sit above the content (and outside the scroll area)- without restructuring the block's layout. Self-hides in wide- mode. Mirrors how block-call / block-md mount it. */}- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft><div class="flex h-full flex-col overflow-y-auto scrollbar-hidden"><div class="mx-auto flex w-full max-w-3xl min-w-0 grow flex-col gap-6 px-6 pt-12 pb-12"><CompanyHeader company={company()} />diff --git a/js/app/packages/contacts/Contact/Contact.tsx b/js/app/packages/contacts/Contact/Contact.tsxindex 462505429a..1835bdc532 100644--- a/js/app/packages/contacts/Contact/Contact.tsx+++ b/js/app/packages/contacts/Contact/Contact.tsx@@ -1,5 +1,4 @@import { SidePanel } from '@app/component/side-panel';-import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';import { useContactQuery } from '@queries/crm/contacts';import { useIsTeamAdmin } from '@queries/team/teams';import { Show } from 'solid-js';@@ -12,9 +11,8 @@ import { ContactSharingSection } from './ContactSharingSection';/*** Root of the contact detail view. Owns the contact query and pushes the* resolved entity down to presentational children. Layout mirrors the- * company block: middle content constrained to a centered column,- * additional info in the right-hand SidePanel, Content/Info pill tabs- * in narrow mode via SplitToolbarLeft.+ * company block: middle content constrained to a centered column, with+ * additional info in the right-hand SidePanel.*/export function Contact(props: { contactId: string }) {const contactQuery = useContactQuery(() => props.contactId);@@ -23,9 +21,6 @@ export function Contact(props: { contactId: string }) {return (<SidePanel.Layout>- <SplitToolbarLeft>- <SidePanel.NarrowTabs />- </SplitToolbarLeft><div class="flex h-full flex-col overflow-y-auto scrollbar-hidden"><div class="mx-auto flex w-full max-w-3xl min-w-0 grow flex-col gap-6 px-6 pt-12 pb-12"><ContactHeader contact={contact()} />diff --git a/js/app/packages/core/component/Resize/Resize.tsx b/js/app/packages/core/component/Resize/Resize.tsxindex 771469cc15..584ab9c899 100644--- a/js/app/packages/core/component/Resize/Resize.tsx+++ b/js/app/packages/core/component/Resize/Resize.tsx@@ -138,6 +138,7 @@ function Zone(props: ParentProps<ZoneProps>) {hide: solver.hide,show: solver.show,isHidden: solver.isHidden,+ reset: solver.reset,};createEffect(() => {diff --git a/js/app/packages/core/component/Resize/types.ts b/js/app/packages/core/component/Resize/types.tsindex b553111e03..d0a4b6ed34 100644--- a/js/app/packages/core/component/Resize/types.ts+++ b/js/app/packages/core/component/Resize/types.ts@@ -45,4 +45,5 @@ export type ResizeZoneCtx = {hide: (id: PanelId) => void;show: (id: PanelId) => void;isHidden: (id: PanelId) => boolean;+ reset: () => void;};diff --git a/js/app/packages/icon/dots-three-large.svg b/js/app/packages/icon/dots-three-large.svgnew file mode 100644index 0000000000..e429d29742--- /dev/null+++ b/js/app/packages/icon/dots-three-large.svg@@ -0,0 +1,5 @@+<svg width="100%" height="100%" viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg">+<circle cx="60" cy="128" r="18"/>+<circle cx="128" cy="128" r="18"/>+<circle cx="196" cy="128" r="18"/>+</svg>diff --git a/js/app/packages/icon/square-half-filled.svg b/js/app/packages/icon/square-half-filled.svgnew file mode 100644index 0000000000..67c482e0ca--- /dev/null+++ b/js/app/packages/icon/square-half-filled.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h72V200H56Z"></path></svg>