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
fix(ui): split header / search (#3142)
Fake-User444a25f6d94c
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsxindex e75b7d58c0..e9554dd134 100644--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx@@ -37,7 +37,7 @@ interface SoupSearchbarProps {const variantStyles: Record<SearchbarVariant, string> = {filled:- 'bg-ink/5 text-ink-muted hover:bg-ink/7 hover:text-ink border-transparent focus-within:bg-ink/7 focus-within:text-ink',+ 'bg-ink/5 text-ink-muted hover:bg-ink/7 hover:text-ink border-edge-muted focus-within:bg-ink/7 focus-within:text-ink',secondary:'bg-transparent text-ink-muted border-edge-muted hover:bg-input hover:text-ink focus-within:bg-input focus-within:text-ink',};@@ -163,14 +163,14 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {><divclass={cn(- 'w-full relative flex items-center gap-1 rounded-xs py-1.5 mobile:h-9 pl-2 pr-1 mobile:min-w-35 border text-xs',+ 'group w-full relative flex items-center gap-1 rounded-sm h-7 mobile:h-9 pl-2 pr-1 mobile:min-w-35 border text-xs',variantStyles[props.variant ?? 'secondary'])}><SearchIcon class="size-4 shrink-0" /><divdata-soup-search- class="flex-1 min-w-0 **:[[contenteditable]]:outline-none **:[[contenteditable]]:p-0 [&_p]:my-0"+ class="flex-1 min-w-0 whitespace-nowrap overflow-hidden **:[[contenteditable]]:outline-none **:[[contenteditable]]:p-0 **:[[contenteditable]]:whitespace-nowrap [&_p]:my-0 [&_p]:whitespace-nowrap"><MarkdownShellconfig={editor}@@ -181,8 +181,8 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {/></div><Show when={!hasContent() && !props.onDismiss}>- <div class="absolute -right-2 top-1/2 -translate-1/2 flex border border-edge-muted text-xs rounded-md items-center px-1 py-px">- <Hotkey shortcut="cmd+f" />+ <div class="shrink-0 text-xxs text-ink-extra-muted/50 rounded-sm border border-ink/5 px-1.5 py-px group-focus-within:hidden">+ <Hotkey shortcut="cmd+f" class="flex gap-1" /></div></Show><Show when={hasContent() || props.onDismiss}>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 7ad8f8a5ae..d0bbb57d10 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@@ -332,7 +332,7 @@ export const SoupView = (props: SoupViewProps) => {<Showwhen={!isComponentListView('search')}fallback={- <div class="w-60">+ <div class="grow ml-2"><SoupSearchbarvariant="secondary"placeholder="Search, @mention contacts"diff --git a/js/app/packages/app/component/settings/Account.tsx b/js/app/packages/app/component/settings/Account.tsxindex 04bb999459..be33cb50f8 100644--- a/js/app/packages/app/component/settings/Account.tsx+++ b/js/app/packages/app/component/settings/Account.tsx@@ -184,18 +184,21 @@ export function Account() {<Panel.Header class="px-6"><div class="text-sm font-semibold">Account</div></Panel.Header>++ <Panel.Toolbar class="h-full w-full">+ <Show when={permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()}>+ <div class="bg-panel px-6 py-2 w-full">+ <PaywallComponent+ hideCloseButton+ cb={() => {}}+ handleGuest={() => toggleSettings()}+ />+ </div>+ </Show>+ </Panel.Toolbar>+<Panel.Body class="text-ink"><div class="grid gap-px bg-edge-muted border-b border-edge-muted">- <Show when={permissions()?.includes('write:stripe_subscription') && !isNativeMobilePlatform()}>- <div class="bg-panel px-6 py-2">- <PaywallComponent- hideCloseButton- cb={() => {}}- handleGuest={() => toggleSettings()}- />- </div>- </Show>-<Show when={ENABLE_PROFILE_PICTURES && userId()}><Row label="Profile Picture"><div@@ -439,29 +442,29 @@ export function Account() {class="w-120"><Panel active depth={2}>- <Panel.Header class="px-6">- <Dialog.Title class="text-ink text-sm font-semibold">- Delete Account- </Dialog.Title>- </Panel.Header>- <Panel.Body class="p-6 font-sans flex flex-col gap-3">- <Dialog.Description class="text-ink-muted text-sm/tight font-normal">- Are you sure you want to delete your account? This action is- permanent and cannot be undone.- </Dialog.Description>- <div class="pt-3 justify-end items-center gap-3 inline-flex">- <Button variant="base" depth={3} onClick={() => setShowDeleteModal(false)}>- Cancel- </Button>- <Button variant="danger" depth={3} onClick={() => {- setShowDeleteModal(false);- setShowDeleteConfirmModal(true);- }}>- Delete- </Button>- </div>- </Panel.Body>- </Panel>+ <Panel.Header class="px-6">+ <Dialog.Title class="text-ink text-sm font-semibold">+ Delete Account+ </Dialog.Title>+ </Panel.Header>+ <Panel.Body class="p-6 font-sans flex flex-col gap-3">+ <Dialog.Description class="text-ink-muted text-sm/tight font-normal">+ Are you sure you want to delete your account? This action is+ permanent and cannot be undone.+ </Dialog.Description>+ <div class="pt-3 justify-end items-center gap-3 inline-flex">+ <Button variant="base" depth={3} onClick={() => setShowDeleteModal(false)}>+ Cancel+ </Button>+ <Button variant="danger" depth={3} onClick={() => {+ setShowDeleteModal(false);+ setShowDeleteConfirmModal(true);+ }}>+ Delete+ </Button>+ </div>+ </Panel.Body>+ </Panel></Dialog><Dialogopen={showDeleteConfirmModal()}@@ -470,26 +473,26 @@ export function Account() {class="w-120"><Panel active depth={2}>- <Panel.Header class="px-6">- <Dialog.Title class="text-ink text-sm font-semibold">- Are you absolutely sure?- </Dialog.Title>- </Panel.Header>- <Panel.Body class="p-6 font-sans flex flex-col gap-3">- <Dialog.Description class="text-ink-muted text-sm/tight font-normal">- This will permanently delete your account and all associated- data. This cannot be undone.- </Dialog.Description>- <div class="pt-3 justify-end items-center gap-3 inline-flex">- <Button variant="base" depth={3} onClick={() => setShowDeleteConfirmModal(false)}>- Cancel- </Button>- <Button variant="danger" depth={3} onClick={deleteAccountHandler}>- Delete My Account- </Button>- </div>- </Panel.Body>- </Panel>+ <Panel.Header class="px-6">+ <Dialog.Title class="text-ink text-sm font-semibold">+ Are you absolutely sure?+ </Dialog.Title>+ </Panel.Header>+ <Panel.Body class="p-6 font-sans flex flex-col gap-3">+ <Dialog.Description class="text-ink-muted text-sm/tight font-normal">+ This will permanently delete your account and all associated+ data. This cannot be undone.+ </Dialog.Description>+ <div class="pt-3 justify-end items-center gap-3 inline-flex">+ <Button variant="base" depth={3} onClick={() => setShowDeleteConfirmModal(false)}>+ Cancel+ </Button>+ <Button variant="danger" depth={3} onClick={deleteAccountHandler}>+ Delete My Account+ </Button>+ </div>+ </Panel.Body>+ </Panel></Dialog></div></Show>diff --git a/js/app/packages/app/component/settings/Appearance.tsx b/js/app/packages/app/component/settings/Appearance.tsxindex fb80734b02..037a8ffe92 100644--- a/js/app/packages/app/component/settings/Appearance.tsx+++ b/js/app/packages/app/component/settings/Appearance.tsx@@ -23,7 +23,7 @@ export function Appearance() {<divclass="max-w-200 size-full"style={{- 'grid-template-rows': 'min-content 1fr',+ 'grid-template-rows': `${isMobile() ? '322.5px' : '432.5px'} 1fr`,'grid-template-columns': '1fr','overflow': 'hidden','display': 'grid',@@ -60,8 +60,8 @@ export function Appearance() {</Panel><Panel depth={2}>- <ThemeList />- </Panel>+ <ThemeList />+ </Panel></div></div>);diff --git a/js/app/packages/app/component/settings/Shortcuts.tsx b/js/app/packages/app/component/settings/Shortcuts.tsxindex e706246cf8..5b3628384c 100644--- a/js/app/packages/app/component/settings/Shortcuts.tsx+++ b/js/app/packages/app/component/settings/Shortcuts.tsx@@ -24,42 +24,42 @@ const shortcutSections: ShortcutSection[] = [{title: 'Core',items: [- { keys: ['c'] , codes: ['KeyC'] , description: 'Open the create menu' },{ keys: [`${cmdOrCtrl}+k`], codes: [CmdOrCtrl, 'KeyK'] , description: 'Open the command menu' },- { keys: ['g'] , codes: ['KeyG'] , description: 'Go to a view' },- { keys: ['/'] , codes: ['Slash'] , description: 'Go to search view' },{ keys: [`${cmdOrCtrl}+f`], codes: [CmdOrCtrl, 'KeyF'] , description: 'Search in current view' },- { keys: [`${cmdOrCtrl}+j`], codes: [CmdOrCtrl, 'KeyJ'] , description: 'Focus AI chat' },+ { keys: ['c'] , codes: ['KeyC'] , description: 'Open the create menu' },{ keys: [`${cmdOrCtrl}+;`], codes: [CmdOrCtrl, 'Semicolon'] , description: 'Open settings panel' },+ { keys: ['/'] , codes: ['Slash'] , description: 'Go to search view' },+ { keys: [`${cmdOrCtrl}+j`], codes: [CmdOrCtrl, 'KeyJ'] , description: 'Focus AI chat' },+ { keys: ['g'] , codes: ['KeyG'] , description: 'Go to a view' },],},{title: 'Splits',items: [- { keys: ['\\'] , codes: ['Backslash'] , description: 'Create a split' },+ { keys: ['opt+]'] , codes: ['AltLeft', 'BracketRight'] , description: 'Go forward in current split' },{ keys: ['cmd+escape'] , codes: ['MetaLeft', 'Escape'] , description: 'Go home / close split' },- { keys: ['shift+escape'] , codes: ['ShiftLeft', 'Escape'] , description: 'Spotlight split' },- { keys: ['shift+arrowleft'] , codes: ['ShiftLeft', 'ArrowLeft'] , description: 'Focus split to the left' },- { keys: ['shift+arrowright'], codes: ['ShiftLeft', 'ArrowRight'] , description: 'Focus split to the right' },{ keys: ['opt+['] , codes: ['AltLeft', 'BracketLeft'] , description: 'Go back in current split' },- { keys: ['opt+]'] , codes: ['AltLeft', 'BracketRight'] , description: 'Go forward in current split' },+ { keys: ['shift+arrowright'], codes: ['ShiftLeft', 'ArrowRight'] , description: 'Focus split to the right' },+ { keys: ['shift+arrowleft'] , codes: ['ShiftLeft', 'ArrowLeft'] , description: 'Focus split to the left' },+ { keys: ['shift+escape'] , codes: ['ShiftLeft', 'Escape'] , description: 'Spotlight split' },+ { keys: ['\\'] , codes: ['Backslash'] , description: 'Create a split' },],},{title: 'Unified List',items: [- { keys: ['arrowdown'] , codes: ['ArrowDown'] , description: 'Move down' },- { keys: ['arrowup'] , codes: ['ArrowUp'] , description: 'Move up' },+ { keys: ['enter'] , codes: ['Enter'] , description: 'Open item in current split' },+ { keys: ['shift+enter'] , codes: ['ShiftLeft', 'Enter'] , description: 'Open item in a new split' },+ { keys: ['space'] , codes: ['Space'] , description: 'Preview item' },{ keys: ['shift+arrowdown'], codes: ['ShiftLeft', 'ArrowDown'] , description: 'Select down' },- { keys: ['shift+arrowup'] , codes: ['ShiftLeft', 'ArrowUp'] , description: 'Select up' },- { keys: ['e'] , codes: ['KeyE'] , description: 'Mark done' },- { keys: ['x'] , codes: ['KeyX'] , description: 'Select items' },{ keys: ['f'] , codes: ['KeyF'] , description: 'Open filter menu' },+ { keys: ['x'] , codes: ['KeyX'] , description: 'Select items' },{ keys: ['arrowleft'] , codes: ['ArrowLeft'] , description: 'Collapse item' },+ { keys: ['arrowdown'] , codes: ['ArrowDown'] , description: 'Move down' },+ { keys: ['e'] , codes: ['KeyE'] , description: 'Mark done' },+ { keys: ['arrowup'] , codes: ['ArrowUp'] , description: 'Move up' },+ { keys: ['shift+arrowup'] , codes: ['ShiftLeft', 'ArrowUp'] , description: 'Select up' },{ keys: ['arrowright'] , codes: ['ArrowRight'] , description: 'Expand item' },- { keys: ['space'] , codes: ['Space'] , description: 'Preview item' },- { keys: ['enter'] , codes: ['Enter'] , description: 'Open item in current split' },- { keys: ['shift+enter'] , codes: ['ShiftLeft', 'Enter'] , description: 'Open item in a new split' },],},];@@ -129,19 +129,21 @@ function ShortcutsContent() {<div class="text-sm font-semibold">Keyboard Shortcuts</div></Panel.Header>- <Panel.Body scroll class="px-6 py-2 @container">+ <Panel.Toolbar class="h-full px-6 py-2"><Keyboard keys={hoveredCodes()} />+ </Panel.Toolbar>- <div class="grid grid-cols-1 @[600px]:grid-cols-2 gap-x-6">- {/* Core - left column */}- <ShortcutSectionComponent section={shortcutSections[0]} />+ <Panel.Body scroll>+ <div class="px-6 py-2 @container">+ <div class="grid grid-cols-1 @[600px]:grid-cols-2 gap-x-6">+ {/* Core - left column */}+ <ShortcutSectionComponent section={shortcutSections[0]} />- {/* Splits - right column */}- <ShortcutSectionComponent section={shortcutSections[1]} />+ {/* Splits - right column */}+ <ShortcutSectionComponent section={shortcutSections[1]} />- {/* Unified List - spans both columns with its own 2-column layout */}- <div class="@[600px]:col-span-2">- <div class="mb-3">+ {/* Unified List - spans both columns with its own 2-column layout */}+ <div class="@[600px]:col-span-2"><h3 class="font-medium text-lg mb-2 flex items-center gap-2">{shortcutSections[2].title}</h3>diff --git a/js/app/packages/app/component/settings/Team.tsx b/js/app/packages/app/component/settings/Team.tsxindex 0df2904fa3..5b64627301 100644--- a/js/app/packages/app/component/settings/Team.tsx+++ b/js/app/packages/app/component/settings/Team.tsx@@ -694,70 +694,70 @@ function CreateTeamDialog(props: { open: boolean; onClose: () => void }) {Create Team</Dialog.Title></Panel.Header>- <Panel.Body scroll class="p-3 flex flex-col gap-3">- <div class="flex flex-col gap-1">- <div class="flex items-center justify-between">- <label class="text-sm text-ink-muted">Team name</label>- <span class={cn('text-xs', charCountColor())}>- {teamName().length}/{TEAM_NAME_MAX_LENGTH}- </span>- </div>- <input- ref={teamNameInputRef}- type="text"- value={teamName()}- onInput={(e) => handleTeamNameChange(e.currentTarget.value)}- onBlur={() => validateTeamName()}- placeholder="My Team"- class={cn(- 'w-full px-3 py-2 text-sm border rounded-xs bg-input text-ink placeholder:text-ink/30 outline-none',- teamNameError()- ? 'border-failure focus:border-failure'- : 'border-edge-muted focus:border-accent/50'- )}- />- <Show when={teamNameError()}>- <p class="text-xs text-failure-ink">{teamNameError()}</p>- </Show>- </div>- <div class="flex flex-col gap-1">- <label class="text-sm text-ink-muted">- Invite members (optional)- </label>- <InviteEmailsInput- invites={invites()}- onChange={setInvites}- errors={inviteErrors()}- onErrorsChange={setInviteErrors}- />- </div>- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={createTeamMutation.isPending}- onClick={props.onClose}- >- Cancel- </Button>- <Button- variant="active"- class="rounded-xs"- disabled={- createTeamMutation.isPending ||- !!teamNameError() ||- inviteErrors().some((e) => e !== undefined)- }- onClick={handleCreate}- >- <Show- when={createTeamMutation.isPending}- fallback="Create Team"- >- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>+ <Panel.Body class="p-3 flex flex-col gap-3">+ <div class="flex flex-col gap-1">+ <div class="flex items-center justify-between">+ <label class="text-sm text-ink-muted">Team name</label>+ <span class={cn('text-xs', charCountColor())}>+ {teamName().length}/{TEAM_NAME_MAX_LENGTH}+ </span>+ </div>+ <input+ ref={teamNameInputRef}+ type="text"+ value={teamName()}+ onInput={(e) => handleTeamNameChange(e.currentTarget.value)}+ onBlur={() => validateTeamName()}+ placeholder="My Team"+ class={cn(+ 'w-full px-3 py-2 text-sm border rounded-xs bg-input text-ink placeholder:text-ink/30 outline-none',+ teamNameError()+ ? 'border-failure focus:border-failure'+ : 'border-edge-muted focus:border-accent/50'+ )}+ />+ <Show when={teamNameError()}>+ <p class="text-xs text-failure-ink">{teamNameError()}</p>+ </Show>+ </div>+ <div class="flex flex-col gap-1">+ <label class="text-sm text-ink-muted">+ Invite members (optional)+ </label>+ <InviteEmailsInput+ invites={invites()}+ onChange={setInvites}+ errors={inviteErrors()}+ onErrorsChange={setInviteErrors}+ />+ </div>+ <div class="flex justify-end gap-1 pt-2">+ <Button+ variant="ghost"+ class="rounded-xs"+ disabled={createTeamMutation.isPending}+ onClick={props.onClose}+ >+ Cancel+ </Button>+ <Button+ variant="active"+ class="rounded-xs"+ disabled={+ createTeamMutation.isPending ||+ !!teamNameError() ||+ inviteErrors().some((e) => e !== undefined)+ }+ onClick={handleCreate}+ >+ <Show+ when={createTeamMutation.isPending}+ fallback="Create Team"+ >+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ </Button>+ </div></Panel.Body></Panel></Dialog>@@ -1009,130 +1009,129 @@ function TeamManagement(props: {</Show></Panel.Header>- <Panel.Body class="flex flex-col h-full overflow-hidden">-- <div class="flex items-center px-2 h-15.25 border-b border-edge-muted shrink-0">- <div class="flex items-center justify-between w-full border border-edge rounded-sm px-4 py-2">- <span class="text-sm text-ink-muted">Name</span>- <Show- when={isOwner()}- fallback={<span class="text-sm text-ink">{props.teamName}</span>}- >- <div class="flex items-center gap-2">- <input- type="text"- value={teamNameValue()}- onInput={(e) => setEditingTeamName(e.currentTarget.value)}- placeholder="Enter team name"- class="text-sm bg-input border-none outline-none text-ink text-right w-48"- />- <Show when={hasTeamNameChanged()}>- <div class="flex items-center gap-1 shrink-0">- <Tooltip tooltip="Save">- <Button- variant="active"- size="icon-sm"- class="rounded-xs"- disabled={- patchTeamMutation.isPending ||- !editingTeamName()?.trim()- }- onClick={handleSaveTeamName}- >- <Show- when={patchTeamMutation.isPending}- fallback={<CheckIcon class="size-4" />}- >- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </Tooltip>- <Tooltip tooltip="Cancel">- <Button- variant="ghost"- size="icon-sm"- class="rounded-xs"- disabled={patchTeamMutation.isPending}- onClick={handleCancelTeamNameEdit}- >- <XIcon class="size-4" />- </Button>- </Tooltip>+ <Panel.Body scroll>+ <div class="flex items-center px-2 h-15.25 border-b border-edge-muted shrink-0">+ <div class="flex items-center justify-between w-full border border-edge rounded-sm px-4 py-2">+ <span class="text-sm text-ink-muted">Name</span>+ <Show+ when={isOwner()}+ fallback={<span class="text-sm text-ink">{props.teamName}</span>}+ >+ <div class="flex items-center gap-2">+ <input+ type="text"+ value={teamNameValue()}+ onInput={(e) => setEditingTeamName(e.currentTarget.value)}+ placeholder="Enter team name"+ class="text-sm bg-input border-none outline-none text-ink text-right w-48"+ />+ <Show when={hasTeamNameChanged()}>+ <div class="flex items-center gap-1 shrink-0">+ <Tooltip tooltip="Save">+ <Button+ variant="active"+ size="icon-sm"+ class="rounded-xs"+ disabled={+ patchTeamMutation.isPending ||+ !editingTeamName()?.trim()+ }+ onClick={handleSaveTeamName}+ >+ <Show+ when={patchTeamMutation.isPending}+ fallback={<CheckIcon class="size-4" />}+ >+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ </Button>+ </Tooltip>+ <Tooltip tooltip="Cancel">+ <Button+ variant="ghost"+ size="icon-sm"+ class="rounded-xs"+ disabled={patchTeamMutation.isPending}+ onClick={handleCancelTeamNameEdit}+ >+ <XIcon class="size-4" />+ </Button>+ </Tooltip>+ </div>+ </Show></div></Show></div>- </Show>- </div>- </div>+ </div>- <div class="flex flex-col flex-1 overflow-hidden">- <section class="flex flex-col min-h-0 flex-1">- <Show- when={!teamQuery.isLoading}- fallback={- <div class="animate-pulse bg-ink-extra-muted rounded h-16" />- }- >- <div class="overflow-y-auto min-h-0" style="scrollbar-width: none;">- <For each={members()}>- {(member) => (- <MemberRow- member={member}- isOwner={isOwner()}- isCurrentUser={member.user_id === userId()}- onRemove={() => setShowRemoveModal(member)}- onTierChange={(newTier) => {- if (!props.teamId) return;- void toast.promise(- patchTierMutation.mutateAsync({+ <div class="flex flex-col">+ <section class="flex flex-col">+ <Show+ when={!teamQuery.isLoading}+ fallback={+ <div class="animate-pulse bg-ink-extra-muted rounded h-16" />+ }+ >+ <div>+ <For each={members()}>+ {(member) => (+ <MemberRow+ member={member}+ isOwner={isOwner()}+ isCurrentUser={member.user_id === userId()}+ onRemove={() => setShowRemoveModal(member)}+ onTierChange={(newTier) => {+ if (!props.teamId) return;+ void toast.promise(+ patchTierMutation.mutateAsync({+ teamId: props.teamId,+ request: {+ team_user_id: member.user_id,+ new_tier: newTier,+ },+ }),+ {+ loading: 'Updating member tier...',+ success: 'Member tier updated',+ error: 'Failed to update member tier',+ }+ );+ }}+ onRoleChange={(newRole) => {+ if (!props.teamId) return;+ patchTeamMutation.mutate({teamId: props.teamId,request: {- team_user_id: member.user_id,- new_tier: newTier,+ user_role_updates: [+ { team_user_id: member.user_id, role: newRole },+ ],},- }),- {- loading: 'Updating member tier...',- success: 'Member tier updated',- error: 'Failed to update member tier',- }- );- }}- onRoleChange={(newRole) => {- if (!props.teamId) return;- patchTeamMutation.mutate({- teamId: props.teamId,- request: {- user_role_updates: [- { team_user_id: member.user_id, role: newRole },- ],- },- });- }}- />- )}- </For>- </div>- </Show>- </section>-- <Show when={isOwner() && (invitesQuery.data?.invites?.length ?? 0) > 0}>- <section class="px-6 py-4 shrink-0 border-t border-edge-muted">- <h3 class="text-sm font-medium mb-2">Pending Invites</h3>- <div class="border border-edge rounded-sm px-3">- <For each={invitesQuery.data?.invites ?? []}>- {(invite) => (- <InviteRow- invite={invite}- isOwner={isOwner()}- onCancel={() => setShowCancelInviteModal(invite)}- />- )}- </For>- </div>+ });+ }}+ />+ )}+ </For>+ </div>+ </Show></section>- </Show>- </div>++ <Show when={isOwner() && (invitesQuery.data?.invites?.length ?? 0) > 0}>+ <section class="px-6 py-4 border-t border-edge-muted">+ <h3 class="text-sm font-medium mb-2">Pending Invites</h3>+ <div class="border border-edge rounded-sm px-3">+ <For each={invitesQuery.data?.invites ?? []}>+ {(invite) => (+ <InviteRow+ invite={invite}+ isOwner={isOwner()}+ onCancel={() => setShowCancelInviteModal(invite)}+ />+ )}+ </For>+ </div>+ </section>+ </Show>+ </div></Panel.Body><Dialog@@ -1152,49 +1151,49 @@ function TeamManagement(props: {Delete Team</Dialog.Title></Panel.Header>- <Panel.Body scroll class="p-3 flex flex-col gap-3">- <p>- Are you sure you want to delete{' '}- <span class="font-medium">{props.teamName}</span>? This action- cannot be undone and all team members will lose access.- </p>- <p class="text-sm text-ink-muted">- Type{' '}- <span class="font-medium text-ink">- {deleteConfirmationPhrase()}- </span>{' '}- to confirm.- </p>- <input- type="text"- value={deleteConfirmation()}- onInput={(e) => setDeleteConfirmation(e.currentTarget.value)}- placeholder={deleteConfirmationPhrase()}- class="w-full px-3 py-2 text-sm border border-edge-muted rounded-xs bg-input text-ink placeholder:text-ink/30 outline-none focus:border-accent/50"- />- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={deleteTeamMutation.isPending}- onClick={() => handleDeleteTeamModalClose(false)}- >- Cancel- </Button>- <Button- variant="danger"- class="rounded-xs"- disabled={!canDeleteTeam() || deleteTeamMutation.isPending}- onClick={handleDeleteTeam}- >- <Show- when={deleteTeamMutation.isPending}- fallback="Delete Team"- >- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>+ <Panel.Body class="p-3 flex flex-col gap-3">+ <p>+ Are you sure you want to delete{' '}+ <span class="font-medium">{props.teamName}</span>? This action+ cannot be undone and all team members will lose access.+ </p>+ <p class="text-sm text-ink-muted">+ Type{' '}+ <span class="font-medium text-ink">+ {deleteConfirmationPhrase()}+ </span>{' '}+ to confirm.+ </p>+ <input+ type="text"+ value={deleteConfirmation()}+ onInput={(e) => setDeleteConfirmation(e.currentTarget.value)}+ placeholder={deleteConfirmationPhrase()}+ class="w-full px-3 py-2 text-sm border border-edge-muted rounded-xs bg-input text-ink placeholder:text-ink/30 outline-none focus:border-accent/50"+ />+ <div class="flex justify-end gap-1 pt-2">+ <Button+ variant="ghost"+ class="rounded-xs"+ disabled={deleteTeamMutation.isPending}+ onClick={() => handleDeleteTeamModalClose(false)}+ >+ Cancel+ </Button>+ <Button+ variant="danger"+ class="rounded-xs"+ disabled={!canDeleteTeam() || deleteTeamMutation.isPending}+ onClick={handleDeleteTeam}+ >+ <Show+ when={deleteTeamMutation.isPending}+ fallback="Delete Team"+ >+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ </Button>+ </div></Panel.Body></Panel></Dialog>@@ -1216,34 +1215,34 @@ function TeamManagement(props: {Remove Member</Dialog.Title></Panel.Header>- <Panel.Body scroll class="p-3 flex flex-col gap-3">- <p>- Are you sure you want to remove{' '}- <Show when={showRemoveModal()}>- {(member) => <MemberName memberId={member().user_id} />}- </Show>{' '}- from the team?- </p>- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={removeUserMutation.isPending}- onClick={() => setShowRemoveModal(null)}- >- Cancel- </Button>- <Button- variant="danger"- class="rounded-xs"- disabled={removeUserMutation.isPending}- onClick={handleRemoveMember}- >- <Show when={removeUserMutation.isPending} fallback="Remove">- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>+ <Panel.Body class="p-3 flex flex-col gap-3">+ <p>+ Are you sure you want to remove{' '}+ <Show when={showRemoveModal()}>+ {(member) => <MemberName memberId={member().user_id} />}+ </Show>{' '}+ from the team?+ </p>+ <div class="flex justify-end gap-1 pt-2">+ <Button+ variant="ghost"+ class="rounded-xs"+ disabled={removeUserMutation.isPending}+ onClick={() => setShowRemoveModal(null)}+ >+ Cancel+ </Button>+ <Button+ variant="danger"+ class="rounded-xs"+ disabled={removeUserMutation.isPending}+ onClick={handleRemoveMember}+ >+ <Show when={removeUserMutation.isPending} fallback="Remove">+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ </Button>+ </div></Panel.Body></Panel></Dialog>@@ -1265,7 +1264,7 @@ function TeamManagement(props: {Cancel Invitation</Dialog.Title></Panel.Header>- <Panel.Body scroll class="p-3 flex flex-col gap-3">+ <Panel.Body class="p-3 flex flex-col gap-3"><p>Are you sure you want to cancel the invitation for{' '}<span class="font-medium">@@ -1317,42 +1316,43 @@ function TeamManagement(props: {Invite to Team</Dialog.Title></Panel.Header>- <Panel.Body scroll class="p-3 flex flex-col gap-3">- <InviteEmailsInput- invites={invites()}- onChange={setInvites}- errors={inviteErrors()}- onErrorsChange={setInviteErrors}- />- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={inviteToTeamMutation.isPending}- onClick={() => handleInviteModalClose(false)}- >- Cancel- </Button>- <Button- variant={hasValidInvites() ? 'active' : 'ghost'}- class="rounded-xs"- disabled={- !hasValidInvites() || inviteToTeamMutation.isPending- }- onClick={handleInvite}- >- <Show- when={inviteToTeamMutation.isPending}- fallback={- invites().length > 1- ? `Send ${invites().length} Invites`- : 'Send Invite'- }- >- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>++ <Panel.Body class="p-3 flex flex-col gap-3">+ <InviteEmailsInput+ invites={invites()}+ onChange={setInvites}+ errors={inviteErrors()}+ onErrorsChange={setInviteErrors}+ />+ <div class="flex justify-end gap-1 pt-2">+ <Button+ variant="ghost"+ class="rounded-xs"+ disabled={inviteToTeamMutation.isPending}+ onClick={() => handleInviteModalClose(false)}+ >+ Cancel+ </Button>+ <Button+ variant={hasValidInvites() ? 'active' : 'ghost'}+ class="rounded-xs"+ disabled={+ !hasValidInvites() || inviteToTeamMutation.isPending+ }+ onClick={handleInvite}+ >+ <Show+ when={inviteToTeamMutation.isPending}+ fallback={+ invites().length > 1+ ? `Send ${invites().length} Invites`+ : 'Send Invite'+ }+ >+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ </Button>+ </div></Panel.Body></Panel></Dialog>@@ -1395,15 +1395,13 @@ function TeamContent() {export function Team() {return (- <div- class="h-full overflow-hidden flex justify-center p-2"- >+ <div class="h-full overflow-hidden flex justify-center p-2"><div class="max-w-200 size-full"><Panel depth={2} class="h-full overflow-hidden text-ink">- <Suspense fallback={<div class="animate-pulse bg-ink-extra-muted rounded h-4 w-32 m-6" />}>- <TeamContent />- </Suspense>- </Panel>+ <Suspense fallback={<div class="animate-pulse bg-ink-extra-muted rounded h-4 w-32 m-6" />}>+ <TeamContent />+ </Suspense>+ </Panel></div></div>);diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsxindex f9f898e98f..f2fc3e6fef 100644--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx@@ -72,7 +72,7 @@ function SplitSpotlightButton() {return (<Show when={canSpotlight(layout.manager)}><Button- class="p-1 rounded-xs"+ class="p-1 rounded-xs hidden"tooltip={<LabelAndHotKeylabel={@@ -196,31 +196,28 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {</Show></div><div- class="relative min-w-0 h-full grow shrink pl-2 flex items-center gap-0.5"+ class="relative min-w-0 h-full shrink pl-2 flex items-center gap-0.5"ref={(ref) => {panel.layoutRefs.headerLeft = ref;}}/>- <div- class={cn(- 'min-w-4 h-full shrink-0 flex items-center gap-0.5 pl-2',- !shouldShowRightmost() && 'pr-2'- )}- ref={(ref) => {- panel.layoutRefs.headerRight = ref;- }}- />-<Show when={shouldShowRightmost()}><divclass={- 'pl-0.5 pr-2 z-annotation-layer relative flex items-center gap-0.5 h-full order-last'+ 'pl-2 z-annotation-layer relative flex items-center gap-0.5 h-full'}><SplitSpotlightButton /></div></Show>++ <div+ class="min-w-4 h-full grow shrink flex items-center justify-end gap-0.5 pl-2 pr-2"+ ref={(ref) => {+ panel.layoutRefs.headerRight = ref;+ }}+ /></div></div>);diff --git a/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts b/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.tsindex ebef8f7fd4..a7b4967304 100644--- a/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts+++ b/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts@@ -5,13 +5,6 @@ import type { CollapsibleRegistration, HeaderCollapser } from '../context';const OVERFLOW_EPSILON_PX = 2;const UNCOLLAPSE_HYSTERESIS_PX = 12;-/**- * Returns the actual rendered content width of a container's children.- *- * Layout-transparent wrapper elements- * (e.g. Portal divs with `display: contents`) are skipped and their real- * children are measured directly.- */function getContentWidth(container: HTMLElement): number {let itemTotal = 0;let itemCount = 0;@@ -26,7 +19,6 @@ function getContentWidth(container: HTMLElement): number {itemCount++;}}- // Include padding and flex gap so spare matches scrollWidth-based overflow detection.const style = getComputedStyle(container);const paddingLeft = parseFloat(style.paddingLeft) || 0;const paddingRight = parseFloat(style.paddingRight) || 0;@@ -41,11 +33,10 @@ export function createHeaderCollapser(panelSizeWidth: Accessor<number | null | undefined>): HeaderCollapser {const [items, setItems] = createStore<CollapsibleRegistration[]>([]);- const naturalWidths = new Map<string, number>();- const collapsedWidths = new Map<string, number>();let observer: ResizeObserver | null = null;let rafId: number | null = null;let evaluateQueued = false;+ let requiredPanelWidth: number | null = null;const scheduleEvaluate = () => {if (evaluateQueued) return;@@ -57,73 +48,55 @@ export function createHeaderCollapser(});};+ const setAllCollapsed = (value: boolean) => {+ for (const item of items) {+ if (item.collapsed() !== value) item.setCollapsed(value);+ }+ };+const evaluate = () => {const headerLeft = getContainer();if (!headerLeft) return;- // Attach ResizeObserver lazily on first call when headerLeft existsif (!observer) {observer = new ResizeObserver(() => scheduleEvaluate());observer.observe(headerLeft);}- // Measure widths of items in their current state- for (const item of items) {- if (!item.collapsed()) {- const el = item.ref();- if (el) naturalWidths.set(item.id, el.offsetWidth);- } else {- const el = item.collapsedRef?.();- if (el) collapsedWidths.set(item.id, el.offsetWidth);- }- }+ if (items.length === 0) return;const contentWidth = getContentWidth(headerLeft);const availableWidth = headerLeft.offsetWidth;const overflowAmount = contentWidth - availableWidth;- const spare = availableWidth - contentWidth;const overflow = overflowAmount > OVERFLOW_EPSILON_PX;+ const panelWidth = panelSizeWidth() ?? availableWidth;- if (overflow) {- // Collapse the first uncollapsed item (lowest priority number)- const uncollapsed = [...items]- .filter((item) => !item.collapsed())- .sort((a, b) => a.priority - b.priority);- if (uncollapsed.length > 0) {- uncollapsed[0].setCollapsed(true);- scheduleEvaluate();- }- } else {- // Try to uncollapse the last-collapsed item (highest priority number = collapsed last)- const collapsed = [...items]- .filter((item) => item.collapsed())- .sort((a, b) => b.priority - a.priority);- if (collapsed.length > 0) {- const item = collapsed[0];- // Use Infinity if we've never measured this item — don't uncollapse blindly- const naturalWidth = naturalWidths.get(item.id) ?? Infinity;- // The net extra space headerRight needs = naturalWidth minus the collapsed- // element's current footprint (the icon button that will disappear on uncollapse).- const collapsedWidth = collapsedWidths.get(item.id) ?? 0;- const needed = naturalWidth - collapsedWidth;- // Require real spare room before uncollapsing so widths near the- // threshold do not bounce between states on every resize/layout pass.- if (spare >= needed + UNCOLLAPSE_HYSTERESIS_PX) {- item.setCollapsed(false);- scheduleEvaluate();- }- }+ const anyUncollapsed = items.some((i) => !i.collapsed());+ const anyCollapsed = items.some((i) => i.collapsed());++ if (overflow && anyUncollapsed) {+ requiredPanelWidth = panelWidth + Math.max(0, overflowAmount);+ setAllCollapsed(true);+ scheduleEvaluate();+ return;+ }++ if (+ anyCollapsed &&+ requiredPanelWidth !== null &&+ panelWidth >= requiredPanelWidth + UNCOLLAPSE_HYSTERESIS_PX+ ) {+ setAllCollapsed(false);+ requiredPanelWidth = null;+ scheduleEvaluate();}};- // Re-evaluate when panel width changescreateEffect(() => {panelSizeWidth();scheduleEvaluate();});- // Re-evaluate when any item's collapsed state changes- // (scrollWidth changes but ResizeObserver doesn't fire for this)createEffect(() => {for (const item of items) {item.collapsed();@@ -146,8 +119,6 @@ export function createHeaderCollapser(if (idx !== -1) arr.splice(idx, 1);}));- naturalWidths.delete(reg.id);- collapsedWidths.delete(reg.id);};},};diff --git a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx b/js/app/packages/theme/components/ThemeEditorAdvanced.tsxindex baaf9f1063..e788e30593 100644--- a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx+++ b/js/app/packages/theme/components/ThemeEditorAdvanced.tsx@@ -3,8 +3,6 @@ import { convertOklchTo, getOklch, validateColor } from '../utils/colorUtil';import type { ThemeReactiveColor } from '../types/themeTypes';import { themeReactive } from '../signals/themeReactive';import { ColorSwatch } from './ColorSwatch';-import { isMobile } from '@core/mobile/isMobile';-import { Scroll } from '@ui';const displayType = () => 'hex';@@ -42,25 +40,21 @@ export function ThemeEditorAdvanced(){<divstyle={{- 'height': isMobile() ? '280px' : '390px', /* match themeEditorBasic height */'font-size': 'var(--text-xs)',- 'position': 'relative',- 'overflow': 'hidden','font-weight': 300,'display': 'block',}}>- <Scroll style={{ 'overscroll-behavior': 'none' }}>- <div- style="- background-color: var(--b3);- box-sizing: border-box;- overflow-x: hidden;- display: grid;- gap: 1px;- "- >- <For each={Object.entries(themeReactive)}>+ <div+ style="+ background-color: var(--b3);+ box-sizing: border-box;+ overflow-x: hidden;+ display: grid;+ gap: 1px;+ "+ >+ <For each={Object.entries(themeReactive)}>{([colorKey, colorValue]) => {// a1 thru a4 are not currently being used, so we will hide themif (['a1', 'a2', 'a3', 'a4'].includes(colorKey)) return null;@@ -177,9 +171,8 @@ export function ThemeEditorAdvanced(){</div>);}}- </For>- </div>- </Scroll>+ </For>+ </div></div></>);diff --git a/js/app/packages/ui/components/Keyboard.tsx b/js/app/packages/ui/components/Keyboard.tsxindex 4b78815e61..dfe25e8cad 100644--- a/js/app/packages/ui/components/Keyboard.tsx+++ b/js/app/packages/ui/components/Keyboard.tsx@@ -142,7 +142,6 @@ export function Keyboard(props: { keys?: string[] }): JSX.Element {'box-sizing': 'border-box','stroke-linecap': 'round','stroke-width': '0.0572',- 'margin-bottom': '12px','display': 'block','width': '100%','fill': 'none',diff --git a/js/app/packages/ui/components/Panel.tsx b/js/app/packages/ui/components/Panel.tsxindex f4a0f375d6..ae4634828b 100644--- a/js/app/packages/ui/components/Panel.tsx+++ b/js/app/packages/ui/components/Panel.tsx@@ -1,9 +1,9 @@+import type { SurfaceProps } from './Surface';import type { ParentProps } from 'solid-js';import { Show, splitProps } from 'solid-js';-import type { SurfaceProps } from './Surface';import { cn } from '../utils/classname';-import { Scroll } from './Scroll';import { Surface } from './Surface';+import { Scroll } from './Scroll';/*** ```tsx@@ -16,9 +16,11 @@ import { Surface } from './Surface';* ```*/-export type PanelProps = SurfaceProps;+type BodyProps = ParentProps<{ class?: string; scroll?: boolean }>;+type SlotProps = ParentProps<{ class?: string }>;+type PanelProps = SurfaceProps;-export function Panel(props: PanelProps) {+function PanelRoot(props: PanelProps) {const [local, surfaceProps] = splitProps(props, ['children', 'class']);return (@@ -36,59 +38,70 @@ export function Panel(props: PanelProps) {);}-type SlotProps = ParentProps<{ class?: string }>;--Panel.Header = (props: SlotProps) => (- <Show when={props.children}>- <div- class={cn('flex h-10 items-center gap-1 border-b border-edge-muted px-5', props.class)}- style={{ 'grid-area': 'header' }}- >- {props.children}- </div>- </Show>-);--Panel.Toolbar = (props: SlotProps) => (- <Show when={props.children}>- <div- class={cn('flex h-10 items-center gap-1 border-b border-edge-muted px-5', props.class)}- style={{ 'grid-area': 'toolbar' }}- >- {props.children}- </div>- </Show>-);+function PanelHeader(props: SlotProps) {+ return (+ <Show when={props.children}>+ <div+ class={cn('flex flex-none items-center min-h-10 px-2 overflow-x-hidden border-b border-edge-muted overflow-hidden', props.class)}+ style={{ 'grid-area': 'header' }}+ >+ {props.children}+ </div>+ </Show>+ );+}-type BodyProps = ParentProps<{ class?: string; scroll?: boolean }>;+function PanelToolbar(props: SlotProps) {+ return (+ <Show when={props.children}>+ <div+ class={cn('flex flex-none items-center min-h-10 px-2 overflow-x-hidden border-b border-edge-muted overflow-hidden', props.class)}+ style={{ 'grid-area': 'toolbar' }}+ >+ {props.children}+ </div>+ </Show>+ );+}-Panel.Body = (props: BodyProps) => (- <Show when={props.children}>- <Show- when={props.scroll}- fallback={- <div- class={cn('relative min-h-0 min-w-0 overflow-hidden', props.class)}- style={{ 'grid-area': 'body' }}- >+function PanelBody(props: BodyProps) {+ return (+ <Show when={props.children}>+ <Show+ when={props.scroll}+ fallback={+ <div+ class={cn('relative min-h-0 min-w-0 overflow-hidden', props.class)}+ style={{ 'grid-area': 'body' }}+ >+ {props.children}+ </div>+ }+ >+ <Scroll class={props.class} style={{ 'grid-area': 'body' }}>{props.children}- </div>- }- >- <Scroll class={props.class} style={{ 'grid-area': 'body' }}>+ </Scroll>+ </Show>+ </Show>+ );+}++function PanelFooter(props: SlotProps) {+ return (+ <Show when={props.children}>+ <div+ class={cn('flex flex-none items-center min-h-10 px-2 overflow-x-hidden border-t border-edge-muted overflow-hidden', props.class)}+ style={{ 'grid-area': 'footer' }}+ >{props.children}- </Scroll>+ </div></Show>- </Show>-);+ );+}-Panel.Footer = (props: SlotProps) => (- <Show when={props.children}>- <div- class={cn('flex h-10 items-center gap-1 border-t border-edge-muted px-5', props.class)}- style={{ 'grid-area': 'footer' }}- >- {props.children}- </div>- </Show>-);+export const Panel = Object.assign(PanelRoot, {+ Toolbar: PanelToolbar,+ Header: PanelHeader,+ Footer: PanelFooter,+ Body: PanelBody,+});diff --git a/js/app/packages/ui/components/Scroll.tsx b/js/app/packages/ui/components/Scroll.tsxindex a7bb087fa5..9358eed2cf 100644--- a/js/app/packages/ui/components/Scroll.tsx+++ b/js/app/packages/ui/components/Scroll.tsx@@ -8,8 +8,9 @@ const THUMB_HEIGHT = 200;const THUMB_INSET = (GUTTER_WIDTH - THUMB_WIDTH) * 0.5;export function Scroll(props: JSX.HTMLAttributes<HTMLDivElement>) {- const [visible, setVisible] = createSignal(false);const [translateY, setTranslateY] = createSignal(THUMB_INSET);+ const [visible, setVisible] = createSignal(false);+let hideTimer: ReturnType<typeof setTimeout> | undefined;let contentRef!: HTMLDivElement;let gutterRef!: HTMLDivElement;@@ -22,6 +23,7 @@ export function Scroll(props: JSX.HTMLAttributes<HTMLDivElement>) {}function reveal() {+ if (scrollRef.scrollHeight <= scrollRef.clientHeight) { return; }setVisible(true);clearTimeout(hideTimer);hideTimer = setTimeout(() => setVisible(false), HIDE_DELAY);diff --git a/js/app/packages/ui/index.ts b/js/app/packages/ui/index.tsindex f7153f2f17..2e1398873c 100644--- a/js/app/packages/ui/index.ts+++ b/js/app/packages/ui/index.ts@@ -13,7 +13,6 @@ export { Layer } from './components/Layer';/* types */export type { AvatarSize, AvatarProps, AvatarGroupSize, AvatarGroupProps } from './components/Avatar';export type { DialogProps } from './components/Dialog';-export type { PanelProps } from './components/Panel';export type { ButtonProps } from './components/Button';/* utils */