Skip to content

armgit / macro

Public Imported from GitHub
0

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

feat[soup]: filter menu (#1969)

Peter Chinman0aee1c4baeb9
diff --git a/js/app/packages/app/component/EntityNavigationIndicator.tsx b/js/app/packages/app/component/EntityNavigationIndicator.tsx
index 6c141fbcd7..c583b53270 100644
--- a/js/app/packages/app/component/EntityNavigationIndicator.tsx
+++ b/js/app/packages/app/component/EntityNavigationIndicator.tsx
@@ -7,22 +7,27 @@ import CaretDown from '@icon/regular/caret-down.svg';
import CaretUp from '@icon/regular/caret-up.svg';
import { Show } from 'solid-js';
+export const shouldShowEntityNavigation = (
+ soup: ReturnType<typeof useSoup>,
+ panel: ReturnType<typeof useSplitPanelOrThrow>
+) => {
+ const selectedEntity = () => soup.focus.item();
+ return (
+ panel.handle.referredFrom() === 'list-view' &&
+ soup.data()?.length &&
+ selectedEntity() &&
+ panel.handle.content().type !== 'component' &&
+ panel.handle.content().type !== 'project'
+ );
+};
+
const EntityNavigationIndicator = () => {
const soup = useSoup();
const panel = useSplitPanelOrThrow();
- const selectedEntity = () => soup.focus.item();
const selectedEntityIndex = () => soup.focus.index();
return (
- <Show
- when={
- panel.handle.referredFrom() === 'list-view' &&
- soup.data()?.length &&
- selectedEntity() &&
- panel.handle.content().type !== 'component' &&
- panel.handle.content().type !== 'project'
- }
- >
+ <Show when={shouldShowEntityNavigation(soup, panel)}>
<div class="flex gap-1 items-center font-mono text-xs text-ink/50">
<div>
[<span class="text-ink">{selectedEntityIndex() + 1}</span>/
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx
new file mode 100644
index 0000000000..d700dead3e
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx
@@ -0,0 +1,210 @@
+import { DropdownMenu } from '@kobalte/core/dropdown-menu';
+import { cn } from '@ui/utils/classname';
+import { createSignal, For, type JSX, Show } from 'solid-js';
+import XIcon from '@icon/regular/x.svg';
+import CheckIcon from '@icon/regular/check.svg';
+import type { FilterOption } from './unified-filter-dropdown';
+import { Button } from '@ui/components/Button';
+
+export type ActiveFilter = {
+ categoryLabel: string;
+ optionId: string;
+ optionLabel: string;
+ icon?: () => JSX.Element;
+ /** Available options in this category for replacement */
+ categoryOptions?: FilterOption[];
+ /**
+ * Per-chip remove handler. When present, takes precedence over the shared
+ * `onRemove` prop on `ActiveFilterChips`. Use this for filters that live
+ * outside `soup.filters` (e.g. assigneeFilter).
+ */
+ onRemove?: () => void;
+};
+
+interface ActiveFilterChipsProps {
+ filters: ActiveFilter[];
+ onRemove: (optionId: string) => void;
+ onReplace: (oldOptionId: string, newOptionId: string) => void;
+ onClearAll: () => void;
+ /** Check if a filter option is currently active */
+ isOptionActive: (optionId: string) => boolean;
+}
+
+const FilterChip = (props: {
+ filter: ActiveFilter;
+ onRemove: () => void;
+ onReplace: (newOptionId: string) => void;
+ isOptionActive: (optionId: string) => boolean;
+}) => {
+ const [open, setOpen] = createSignal(false);
+
+ const hasOptions = () =>
+ props.filter.categoryOptions && props.filter.categoryOptions.length > 0;
+
+ return (
+ <div
+ class={cn(
+ 'flex text-xs rounded-xs',
+ 'bg-ink/10 text-ink-muted border border-edge-muted',
+ 'group',
+ 'transition-colors'
+ )}
+ >
+ <Show
+ when={hasOptions()}
+ fallback={
+ <span class="inline-flex items-center gap-1.5 pl-2 pr-1 py-1">
+ <Show when={props.filter.icon}>
+ {(icon) => (
+ <span class="size-3 flex items-center justify-center shrink-0">
+ {icon()()}
+ </span>
+ )}
+ </Show>
+ <span class="font-medium">
+ {props.filter.categoryLabel}: {props.filter.optionLabel}
+ </span>
+ </span>
+ }
+ >
+ <DropdownMenu open={open()} onOpenChange={setOpen} gutter={4}>
+ <DropdownMenu.Trigger
+ class={cn(
+ 'inline-flex items-center gap-1.5 pl-2 pr-1 py-1',
+ 'hover:text-ink hover:bg-edge-muted'
+ )}
+ >
+ <Show when={props.filter.icon}>
+ {(icon) => (
+ <span class="size-3 flex items-center justify-center shrink-0">
+ {icon()()}
+ </span>
+ )}
+ </Show>
+ <span class="font-medium">
+ {props.filter.categoryLabel}: {props.filter.optionLabel}
+ </span>
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.Content class="z-action-menu bg-surface-0 border border-edge-muted rounded-sm shadow-xl min-w-[160px] p-1">
+ <For each={props.filter.categoryOptions}>
+ {(option) => {
+ const active = () => props.isOptionActive(option.id);
+ return (
+ <DropdownMenu.Item
+ class="w-full flex items-center gap-2.5 px-2 py-1.5 rounded-md text-left text-xs transition-colors hover:bg-ink/5 outline-none data-[highlighted]:bg-ink/5 cursor-default"
+ onSelect={() => {
+ if (!active()) {
+ props.onReplace(option.id);
+ }
+ }}
+ >
+ <span
+ class={cn(
+ 'size-4 flex items-center justify-center shrink-0 rounded border transition-colors',
+ active() ? 'bg-accent border-accent' : 'border-edge'
+ )}
+ >
+ <Show when={active()}>
+ <CheckIcon class="size-2.5 text-page" />
+ </Show>
+ </span>
+
+ <Show when={option.icon}>
+ {(icon) => (
+ <span class="size-4 flex items-center justify-center shrink-0">
+ {icon()()}
+ </span>
+ )}
+ </Show>
+
+ <span
+ class={cn(
+ 'flex-1 truncate',
+ active() ? 'text-ink' : 'text-ink-muted'
+ )}
+ >
+ {option.label}
+ </span>
+ </DropdownMenu.Item>
+ );
+ }}
+ </For>
+ </DropdownMenu.Content>
+ </DropdownMenu.Portal>
+ </DropdownMenu>
+ </Show>
+
+ {/* Remove button */}
+ <button
+ type="button"
+ class={cn(
+ 'px-1 min-h-full',
+ 'hover:bg-edge-muted hover:text-ink transition-colors'
+ )}
+ onClick={(e) => {
+ e.stopPropagation();
+ if (props.filter.onRemove) {
+ props.filter.onRemove();
+ } else {
+ props.onRemove();
+ }
+ }}
+ >
+ <XIcon class="size-3" />
+ </button>
+ </div>
+ );
+};
+
+export const ActiveFilterChips = (props: ActiveFilterChipsProps) => {
+ const lastIndex = () => props.filters.length - 1;
+
+ return (
+ <Show when={props.filters.length > 0}>
+ <div class="flex items-center gap-1.5 flex-wrap px-2">
+ <For each={props.filters}>
+ {(filter, index) => (
+ // To make sure that the Clear all button never wraps to a new line on its own, we wrap it with the last FilterChip
+ <Show
+ when={props.filters.length > 1 && index() === lastIndex()}
+ fallback={
+ <FilterChip
+ filter={filter}
+ onRemove={() => props.onRemove(filter.optionId)}
+ onReplace={(newOptionId) =>
+ props.onReplace(filter.optionId, newOptionId)
+ }
+ isOptionActive={props.isOptionActive}
+ />
+ }
+ >
+ <span class="inline-flex items-center gap-1.5">
+ <FilterChip
+ filter={filter}
+ onRemove={() => props.onRemove(filter.optionId)}
+ onReplace={(newOptionId) =>
+ props.onReplace(filter.optionId, newOptionId)
+ }
+ isOptionActive={props.isOptionActive}
+ />
+ <Button
+ class={cn(
+ 'rounded-xs whitespace-nowrap'
+ // 'text-ink-muted hover:text-ink hover:bg-hover transition-colors'
+ )}
+ size="sm"
+ variant="ghost"
+ onClick={() => props.onClearAll()}
+ >
+ Clear all
+ </Button>
+ </span>
+ </Show>
+ )}
+ </For>
+ </div>
+ </Show>
+ );
+};
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx
index cf21b84a41..b99e925dd2 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx
@@ -2,6 +2,7 @@ import { type Component, For, Show } from 'solid-js';
import { DropdownMenu } from '@kobalte/core/dropdown-menu';
import CheckIcon from '@icon/regular/check.svg';
import ChevronDownIcon from '@icon/regular/caret-down.svg';
+import SortIcon from '@macro-icons/wide/sort.svg';
import type {
SortOption,
SystemSortOption,
@@ -24,10 +25,6 @@ export interface SortDropdownProps {
export const SortDropdown: Component<SortDropdownProps> = (props) => {
const options = () => props.options ?? [];
- const currentOption = () => options().find((o) => o.value === props.value());
-
- const currentLabel = () => currentOption()?.label ?? 'Sort';
-
return (
<DropdownMenu
open={props.open}
@@ -39,24 +36,17 @@ export const SortDropdown: Component<SortDropdownProps> = (props) => {
as={Button}
variant="secondary"
size="sm"
- class="whitespace-nowrap rounded-xs"
+ class="whitespace-nowrap rounded-xs [&_svg]:size-4"
>
- <Show when={currentOption()?.icon}>
- {(icon) => (
- <span class="size-3.5 flex items-center justify-center shrink-0">
- {icon()()}
- </span>
- )}
- </Show>
- <span class="font-medium">{currentLabel()}</span>
- <ChevronDownIcon class="size-3" />
+ <SortIcon />
+ <ChevronDownIcon class="size-4" />
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content class="z-action-menu bg-surface-0 border border-edge-muted rounded-sm shadow-sm min-w-[140px] p-1">
<For each={options()}>
{(option) => (
<DropdownMenu.Item
- class="w-full flex items-center gap-2 px-2 py-2 text-left text-xs transition-colors hover:bg-ink/5 focus:bg-ink/5 outline-none cursor-default rounded-md"
+ class="w-full flex items-center gap-2 px-2 py-1.5 text-left text-xs transition-colors hover:bg-ink/5 focus:bg-ink/5 outline-none cursor-default rounded-md"
onSelect={() => props.onChange(option.value)}
>
<Show when={option.icon}>
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
index 5a61f209c2..5bf3fdb455 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
@@ -1,18 +1,54 @@
-import { Button } from '@app/component/next-soup/soup-view/filters-bar/button';
-import { SoupViewContextFilters } from '@app/component/next-soup/soup-view/filters-bar/soup-view-context-filters';
import { SoupViewContextSort } from '@app/component/next-soup/soup-view/filters-bar/soup-view-context-sort';
import { SoupSearchbar } from '@app/component/next-soup/soup-view/filters-bar/soup-view-search-bar';
import { useFilterRefinements } from '@app/component/next-soup/soup-view/filters-bar/use-filter-refinements';
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
import type { ListView } from '@app/constants/list-views';
-import XIcon from '@icon/regular/x.svg';
-import { createMemo, Match, Show, Switch } from 'solid-js';
+import { createMemo, createSignal, Match, Switch } from 'solid-js';
+import { UnifiedFilterDropdown } from '@app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown';
+import { ActiveFilterChips } from '@app/component/next-soup/soup-view/filters-bar/active-filter-chips';
+import { LabelAndHotKey, Tooltip } from '@core/component/Tooltip';
+import { Button } from './button';
+import { AnimatedPreviewIcon } from '@macro-icons/wide/animating/preview';
+import { useSoup } from '../../soup-context';
+import { registerHotkey } from '@core/hotkey/hotkeys';
export const SoupFiltersBar = () => {
- const { hasActiveRefinements, resetToTabDefaults } = useFilterRefinements();
+ const {
+ resetToTabDefaults,
+ activeFiltersList,
+ removeFilter,
+ replaceFilter,
+ isOptionActive,
+ } = useFilterRefinements();
+ const [previewBtnHovering, setPreviewBtnHovering] = createSignal(false);
+ const soup = useSoup();
const panel = useSplitPanelOrThrow();
+ const togglePreview = () => {
+ const currentPreview = soup.previewEntity();
+ if (currentPreview) {
+ soup.setPreviewEntity(undefined);
+ return;
+ }
+
+ const focused = soup.focus.id();
+
+ if (!focused) return;
+
+ soup.setPreviewEntity(focused);
+ };
+
+ registerHotkey({
+ hotkey: 'space',
+ scopeId: panel.splitHotkeyScope,
+ description: 'Toggle preview',
+ keyDownHandler: () => {
+ togglePreview();
+ return true;
+ },
+ });
+
const component = createMemo(() => {
const content = panel.handle.content();
@@ -33,26 +69,30 @@ export const SoupFiltersBar = () => {
</div>
</Match>
<Match when={true}>
- <div class="@container w-full h-full overflow-hidden flex gap-1 flex-wrap p-2 border-b border-edge-muted/50">
- <SoupViewContextFilters />
- <Show when={hasActiveRefinements()}>
+ <div class="flex items-start gap-2 px-2 py-1.5 border-b border-edge-muted w-full">
+ <UnifiedFilterDropdown />
+ <ActiveFilterChips
+ filters={activeFiltersList()}
+ onRemove={removeFilter}
+ onReplace={replaceFilter}
+ onClearAll={resetToTabDefaults}
+ isOptionActive={isOptionActive}
+ />
+ <div class="flex-1" />
+ <Tooltip
+ tooltip={<LabelAndHotKey label="Preview" shortcut="space" />}
+ >
<Button
- variant="secondary"
+ variant={soup.previewEntity() ? 'primary' : 'ghost'}
size="sm"
- class="rounded-xs"
- onClick={resetToTabDefaults}
+ class="rounded-xs [&_svg]:size-4 px-1 border border-transparent"
+ onClick={togglePreview}
+ onMouseEnter={() => setPreviewBtnHovering(true)}
+ onMouseLeave={() => setPreviewBtnHovering(false)}
>
- <XIcon class="size-4 text-failure" />
- <span>Clear all</span>
+ <AnimatedPreviewIcon triggerAnimation={previewBtnHovering()} />
</Button>
- </Show>
-
- <div class="flex-1" />
-
- <div class="max-w-60 w-full">
- <SoupSearchbar />
- </div>
-
+ </Tooltip>
<SoupViewContextSort />
</div>
</Match>
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.tsx
index 346b71a09f..51f9bc8922 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
@@ -13,13 +13,14 @@ type SearchbarVariant = 'filled' | 'secondary';
interface SoupSearchbarProps {
variant?: SearchbarVariant;
autoFocus?: boolean;
+ onDismiss?: () => void;
}
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',
secondary:
- 'bg-transparent text-ink-muted border-edge-muted hover:bg-ink/5 hover:text-ink focus-within:bg-ink/5 focus-within:text-ink',
+ 'bg-transparent text-ink-muted border-edge-muted hover:bg-input hover:text-ink focus-within:bg-input focus-within:text-ink',
};
export const SoupSearchbar = (props: SoupSearchbarProps) => {
@@ -109,6 +110,7 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {
) {
e.preventDefault();
e.currentTarget.blur();
+ if (e.key === 'Escape') props.onDismiss?.();
}
}}
class="peer p-0 bg-transparent border-none outline-none ring-0 focus:outline-none focus:ring-0 cursor-default w-full"
@@ -119,12 +121,12 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {
Search
</span>
</Show>
- <Show when={!searchText()}>
+ <Show when={!searchText() && !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 peer-focus:hidden">
<Hotkey shortcut="cmd+f" />
</div>
</Show>
- <Show when={searchText()}>
+ <Show when={searchText() || props.onDismiss}>
<button
type="button"
class="ml-auto size-4 shrink-0 hover:opacity-60"
@@ -132,6 +134,7 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {
e.preventDefault();
e.stopPropagation();
setSearchText('');
+ props.onDismiss?.();
}}
>
<XIcon class="size-4" />
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
new file mode 100644
index 0000000000..3c815e464b
--- /dev/null
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
@@ -0,0 +1,637 @@
+import { DropdownMenu } from '@kobalte/core/dropdown-menu';
+import { cn } from '@ui/utils/classname';
+import { Button } from '@app/component/next-soup/soup-view/filters-bar/button';
+import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
+import type { ListView } from '@app/constants/list-views';
+import { isListViewID } from '@app/constants/list-views';
+import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-context';
+import {
+ type Accessor,
+ createMemo,
+ createSignal,
+ For,
+ type JSX,
+ Show,
+} from 'solid-js';
+import SlidersHorizontalIcon from '@macro-icons/wide/sliders-horizontal.svg';
+import CaretRightIcon from '@icon/regular/caret-right.svg';
+import CheckIcon from '@icon/regular/check.svg';
+import SearchIcon from '@icon/regular/magnifying-glass.svg';
+import CircleDashedIcon from '@icon/regular/circle-dashed.svg';
+import { EntityIcon } from '@core/component/EntityIcon';
+import { PropertyValueIcon } from '@core/component/Properties/component/propertyValue/PropertyValueIcon';
+import { PROPERTY_OPTION_IDS } from '@core/component/Properties/constants';
+
+import FileCodeIcon from '@icon/regular/file-code.svg';
+import FileImageIcon from '@icon/regular/file-image.svg';
+import FilePdfIcon from '@icon/regular/file-pdf.svg';
+import FileIcon from '@icon/regular/file.svg';
+import { useContacts } from '@queries/contacts/contacts';
+import { useUserId } from '@core/context/user';
+import { UserIcon } from '@core/component/UserIcon';
+import type { FilterID } from '@app/component/next-soup/filters';
+import { NO_ASSIGNEE } from '@app/component/next-soup/soup-view/task-sub-filter-matcher';
+import { registerHotkey } from '@core/hotkey/hotkeys';
+import { LabelAndHotKey, Tooltip } from '@core/component/Tooltip';
+
+export type FilterOption = {
+ id: string;
+ label: string;
+ icon?: () => JSX.Element;
+};
+
+export type FilterCategory = {
+ id: string;
+ label: string;
+ options: FilterOption[];
+ multiple?: boolean;
+};
+
+// Filter categories by view
+const INBOX_FILTER_CATEGORIES: FilterCategory[] = [
+ {
+ id: 'type',
+ label: 'Type',
+ options: [
+ {
+ id: 'document',
+ label: 'Docs',
+ icon: () => <EntityIcon targetType="md" size="xs" />,
+ },
+ {
+ id: 'agent',
+ label: 'Agents',
+ icon: () => <EntityIcon targetType="chat" size="xs" />,
+ },
+ {
+ id: 'people',
+ label: 'People',
+ icon: () => <EntityIcon targetType="direct_message" size="xs" />,
+ },
+ {
+ id: 'teams',
+ label: 'Teams',
+ icon: () => <EntityIcon targetType="channel" size="xs" />,
+ },
+ {
+ id: 'task',
+ label: 'Tasks',
+ icon: () => <EntityIcon targetType="task" size="xs" />,
+ },
+ {
+ id: 'email',
+ label: 'Mail',
+ icon: () => <EntityIcon targetType="email" size="xs" />,
+ },
+ {
+ id: 'file',
+ label: 'Files',
+ icon: () => <EntityIcon targetType="unknown" size="xs" />,
+ },
+ ],
+ multiple: true,
+ },
+];
+
+const MAIL_FILTER_CATEGORIES: FilterCategory[] = [
+ {
+ id: 'status',
+ label: 'Status',
+ options: [
+ { id: 'unread', label: 'Unread' },
+ { id: 'read', label: 'Read' },
+ { id: 'not-done', label: 'Not Done' },
+ { id: 'done', label: 'Done' },
+ ],
+ multiple: true,
+ },
+ {
+ id: 'attachment',
+ label: 'Attachments',
+ options: [
+ {
+ id: 'attachment-pdf',
+ label: 'PDFs',
+ icon: () => <FilePdfIcon class="size-3.5" />,
+ },
+ {
+ id: 'attachment-image',
+ label: 'Images',
+ icon: () => <FileImageIcon class="size-3.5" />,
+ },
+ {
+ id: 'attachment-document',
+ label: 'Documents',
+ icon: () => <FileIcon class="size-3.5" />,
+ },
+ ],
+ multiple: true,
+ },
+ {
+ id: 'calendar',
+ label: 'Calendar',
+ options: [{ id: 'has-calendar-invite', label: 'Has Calendar Invite' }],
+ multiple: false,
+ },
+];
+
+const TASKS_FILTER_CATEGORIES: FilterCategory[] = [
+ {
+ id: 'status',
+ label: 'Status',
+ options: [
+ {
+ id: 'task-not-started',
+ label: 'Not Started',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.STATUS.NOT_STARTED}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-in-progress',
+ label: 'In Progress',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.STATUS.IN_PROGRESS}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-in-review',
+ label: 'In Review',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.STATUS.IN_REVIEW}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-completed',
+ label: 'Completed',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.STATUS.COMPLETED}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-canceled',
+ label: 'Canceled',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.STATUS.CANCELED}
+ class="size-3.5"
+ />
+ ),
+ },
+ ],
+ multiple: true,
+ },
+ {
+ id: 'priority',
+ label: 'Priority',
+ options: [
+ {
+ id: 'task-critical',
+ label: 'Critical',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.PRIORITY.URGENT}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-high-priority',
+ label: 'High Priority',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.PRIORITY.HIGH}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-medium-priority',
+ label: 'Medium Priority',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.PRIORITY.MEDIUM}
+ class="size-3.5"
+ />
+ ),
+ },
+ {
+ id: 'task-low-priority',
+ label: 'Low Priority',
+ icon: () => (
+ <PropertyValueIcon
+ optionId={PROPERTY_OPTION_IDS.PRIORITY.LOW}
+ class="size-3.5"
+ />
+ ),
+ },
+ { id: 'task-no-priority', label: 'No Priority' },
+ ],
+ multiple: true,
+ },
+];
+
+const DOCUMENTS_FILTER_CATEGORIES: FilterCategory[] = [
+ {
+ id: 'type',
+ label: 'Type',
+ options: [
+ { id: 'doc-markdown', label: 'Markdown' },
+ { id: 'doc-canvas', label: 'Canvas' },
+ ],
+ multiple: true,
+ },
+];
+
+const FILES_FILTER_CATEGORIES: FilterCategory[] = [
+ {
+ id: 'type',
+ label: 'Type',
+ options: [
+ {
+ id: 'file-code',
+ label: 'Code',
+ icon: () => <FileCodeIcon class="size-3.5" />,
+ },
+ {
+ id: 'file-image',
+ label: 'Images',
+ icon: () => <FileImageIcon class="size-3.5" />,
+ },
+ {
+ id: 'file-pdf',
+ label: 'PDFs',
+ icon: () => <FilePdfIcon class="size-3.5" />,
+ },
+ {
+ id: 'file-other',
+ label: 'Other',
+ icon: () => <FileIcon class="size-3.5" />,
+ },
+ ],
+ multiple: true,
+ },
+];
+
+export function buildContactLabel(
+ contact: { id: string; name?: string | null },
+ currentUserId: string | undefined
+): string {
+ if (contact.id === currentUserId) {
+ return contact.name ? `${contact.name} (me)` : 'Me';
+ }
+ return contact.name || contact.id;
+}
+
+export const VIEW_FILTER_CATEGORIES: Record<ListView, FilterCategory[]> = {
+ inbox: INBOX_FILTER_CATEGORIES,
+ agents: [],
+ mail: MAIL_FILTER_CATEGORIES,
+ documents: DOCUMENTS_FILTER_CATEGORIES,
+ tasks: TASKS_FILTER_CATEGORIES,
+ channels: [],
+ files: FILES_FILTER_CATEGORIES,
+ search: [],
+};
+
+/** Searchable submenu for filters with many options like assignees */
+const SearchableFilterSubmenu = (props: {
+ label: string;
+ options: Accessor<FilterOption[]>;
+ activeIds: Accessor<string[]>;
+ onToggle: (id: string) => void;
+ placeholder?: string;
+ multiple?: boolean;
+}) => {
+ const [search, setSearch] = createSignal('');
+ const [highlightedIndex, setHighlightedIndex] = createSignal(0);
+ let inputRef: HTMLInputElement | undefined;
+
+ const filteredOptions = createMemo(() => {
+ const query = search().toLowerCase();
+ if (!query) return props.options();
+ return props.options().filter((o) => o.label.toLowerCase().includes(query));
+ });
+
+ const isActive = (id: string) => props.activeIds().includes(id);
+
+ const [isOpen, setIsOpen] = createSignal(false);
+
+ const handleOpenChange = (open: boolean) => {
+ setIsOpen(open);
+ if (!open) return;
+ setSearch('');
+ setHighlightedIndex(0);
+ // Double rAF to run after Kobalte finishes its own focus management
+ requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ inputRef?.focus();
+ });
+ });
+ };
+
+ const handleSubContentFocusOut = (e: FocusEvent) => {
+ const subContentEl = e.currentTarget as HTMLElement;
+ // If focus leaves SubContent while sub is still open (e.g. Kobalte focusing
+ // the SubTrigger on hover), refocus the input
+ if (isOpen() && !subContentEl.contains(e.relatedTarget as Node)) {
+ requestAnimationFrame(() => {
+ if (isOpen()) inputRef?.focus();
+ });
+ }
+ };
+
+ const handleKeyDown = (e: KeyboardEvent) => {
+ const options = filteredOptions();
+ const maxIndex = options.length - 1;
+
+ switch (e.key) {
+ case 'ArrowDown':
+ e.preventDefault();
+ setHighlightedIndex((i) => Math.min(i + 1, maxIndex));
+ break;
+ case 'ArrowUp':
+ e.preventDefault();
+ setHighlightedIndex((i) => Math.max(i - 1, 0));
+ break;
+ case 'Enter':
+ e.preventDefault();
+ const option = options[highlightedIndex()];
+ if (option) {
+ props.onToggle(option.id);
+ }
+ break;
+ case 'ArrowLeft':
+ if (search() === '') {
+ e.preventDefault();
+ setIsOpen(false);
+ }
+ break;
+ default:
+ // Stop propagation for other keys to prevent Kobalte typeahead
+ e.stopPropagation();
+ }
+ };
+
+ return (
+ <DropdownMenu.Sub
+ gutter={4}
+ open={isOpen()}
+ onOpenChange={handleOpenChange}
+ >
+ <DropdownMenu.SubTrigger class="w-full flex items-center justify-between gap-2 px-3 py-2 rounded-xs text-left text-xs transition-colors hover:bg-hover outline-none data-[highlighted]:bg-hover">
+ <span class="text-ink">{props.label}</span>
+ <CaretRightIcon class="size-3 text-ink-muted" />
+ </DropdownMenu.SubTrigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.SubContent
+ class="z-action-menu bg-menu border border-edge-muted rounded-sm shadow-xl min-w-[200px] p-1"
+ onFocusOut={handleSubContentFocusOut}
+ >
+ {/* Search input */}
+ <div class="flex items-center gap-2 px-2 py-2 border-b border-edge-muted mb-2">
+ <SearchIcon class="size-3.5 text-ink-muted shrink-0" />
+ <input
+ ref={inputRef}
+ type="text"
+ value={search()}
+ onInput={(e) => {
+ setSearch(e.currentTarget.value);
+ setHighlightedIndex(0);
+ }}
+ onKeyDown={handleKeyDown}
+ placeholder={props.placeholder ?? 'Search...'}
+ class="flex-1 bg-transparent text-xs outline-none placeholder:text-ink-muted"
+ />
+ </div>
+
+ {/* Options list */}
+ <div class="max-h-48 overflow-y-auto">
+ <For each={filteredOptions()}>
+ {(option, index) => {
+ const active = () => isActive(option.id);
+ const highlighted = () => highlightedIndex() === index();
+ return (
+ <button
+ type="button"
+ class={cn(
+ 'w-full flex items-center gap-2.5 px-3 py-1.5 rounded-xs text-left text-xs transition-colors',
+ highlighted() ? 'bg-hover' : 'hover:bg-hover'
+ )}
+ onClick={() => props.onToggle(option.id)}
+ onMouseEnter={() => setHighlightedIndex(index())}
+ >
+ <span
+ class={cn(
+ 'size-4 flex items-center justify-center shrink-0 rounded border transition-colors',
+ active() ? 'bg-accent border-accent' : 'border-edge'
+ )}
+ >
+ <Show when={active()}>
+ <CheckIcon class="size-2.5 text-page" />
+ </Show>
+ </span>
+
+ <Show when={option.icon}>
+ {(icon) => (
+ <span class="size-4 flex items-center justify-center shrink-0">
+ {icon()()}
+ </span>
+ )}
+ </Show>
+
+ <span
+ class={cn(
+ 'flex-1 truncate',
+ active() ? 'text-ink' : 'text-ink-muted'
+ )}
+ >
+ {option.label}
+ </span>
+ </button>
+ );
+ }}
+ </For>
+
+ <Show when={filteredOptions().length === 0}>
+ <div class="px-3 py-2 text-xs text-ink-muted">No results</div>
+ </Show>
+ </div>
+ </DropdownMenu.SubContent>
+ </DropdownMenu.Portal>
+ </DropdownMenu.Sub>
+ );
+};
+
+export const UnifiedFilterDropdown = () => {
+ const [open, setOpen] = createSignal(false);
+ const panel = useSplitPanelOrThrow();
+ const { soup, assigneeFilter, setAssigneeFilter } = useSoupView();
+ const contacts = useContacts();
+ const userId = useUserId();
+
+ const currentView = createMemo((): ListView | undefined => {
+ const content = panel.handle.content();
+ if (content.type !== 'component' || !isListViewID(content.id))
+ return undefined;
+ return content.id;
+ });
+
+ const categories = createMemo(() => {
+ const view = currentView();
+ if (!view) return [];
+ return VIEW_FILTER_CATEGORIES[view] ?? [];
+ });
+
+ const isOptionActive = (optionId: string) => {
+ return soup.filters.isActive(optionId);
+ };
+
+ const toggleFilter = (optionId: string) => {
+ soup.filters.toggle({ or: [optionId as FilterID] });
+ };
+
+ // Assignee options for tasks view
+ const assigneeOptions = createMemo((): FilterOption[] => {
+ const currentUserId = userId();
+ const noAssigneeOption: FilterOption = {
+ id: NO_ASSIGNEE,
+ label: 'Unassigned',
+ icon: () => <CircleDashedIcon class="size-3.5 text-ink-muted" />,
+ };
+ const contactOptions = contacts().map((contact) => ({
+ id: contact.id,
+ label: buildContactLabel(contact, currentUserId),
+ icon: () => (
+ <UserIcon id={contact.id} size="xs" suppressClick showTooltip={false} />
+ ),
+ }));
+ return [noAssigneeOption, ...contactOptions];
+ });
+
+ const toggleAssignee = (id: string) => {
+ const current = assigneeFilter();
+ if (current.includes(id)) {
+ setAssigneeFilter(current.filter((a) => a !== id));
+ } else {
+ setAssigneeFilter([...current, id]);
+ }
+ };
+
+ const isTasksView = () => currentView() === 'tasks';
+
+ registerHotkey({
+ hotkey: 'f',
+ scopeId: panel.splitHotkeyScope,
+ description: 'Open filter menu',
+ keyDownHandler: () => {
+ setOpen(true);
+ return true;
+ },
+ });
+
+ return (
+ <Show when={categories().length > 0 || isTasksView()}>
+ <DropdownMenu open={open()} onOpenChange={setOpen}>
+ <Tooltip tooltip={<LabelAndHotKey label="Filter" shortcut="F" />}>
+ <DropdownMenu.Trigger
+ as={Button}
+ variant="secondary"
+ size="sm"
+ class="rounded-xs [&_svg]:size-4"
+ >
+ <SlidersHorizontalIcon />
+ <span class="font-medium">Filter</span>
+ </DropdownMenu.Trigger>
+ </Tooltip>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.Content class="z-action-menu bg-menu border border-edge-muted rounded-sm shadow-xl min-w-[180px] p-1">
+ <For each={categories()}>
+ {(category) => (
+ <DropdownMenu.Sub gutter={4}>
+ <DropdownMenu.SubTrigger class="w-full flex items-center justify-between gap-2 px-3 py-1.5 rounded-xs text-left text-xs transition-colors hover:bg-hover outline-none data-[highlighted]:bg-hover">
+ <span class="text-ink">{category.label}</span>
+ <CaretRightIcon class="size-3 text-ink-muted" />
+ </DropdownMenu.SubTrigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.SubContent class="z-action-menu bg-menu border border-edge-muted rounded-sm shadow-xl min-w-[160px] p-1">
+ <For each={category.options}>
+ {(option) => {
+ const active = () => isOptionActive(option.id);
+ return (
+ <DropdownMenu.Item
+ class="w-full flex items-center gap-2.5 px-3 py-1.5 rounded-xs text-left text-xs transition-colors hover:bg-hover outline-none data-[highlighted]:bg-hover cursor-pointer"
+ onSelect={() => toggleFilter(option.id)}
+ closeOnSelect={!category.multiple}
+ >
+ <span
+ class={cn(
+ 'size-4 flex items-center justify-center shrink-0 rounded border transition-colors',
+ active()
+ ? 'bg-accent border-accent'
+ : 'border-edge'
+ )}
+ >
+ <Show when={active()}>
+ <CheckIcon class="size-2.5 text-page" />
+ </Show>
+ </span>
+
+ <Show when={option.icon}>
+ {(icon) => (
+ <span class="size-4 flex items-center justify-center shrink-0">
+ {icon()()}
+ </span>
+ )}
+ </Show>
+
+ <span
+ class={cn(
+ 'flex-1 truncate',
+ active() ? 'text-ink' : 'text-ink-muted'
+ )}
+ >
+ {option.label}
+ </span>
+ </DropdownMenu.Item>
+ );
+ }}
+ </For>
+ </DropdownMenu.SubContent>
+ </DropdownMenu.Portal>
+ </DropdownMenu.Sub>
+ )}
+ </For>
+
+ {/* Assignee filter for tasks view */}
+ <Show when={isTasksView()}>
+ <SearchableFilterSubmenu
+ label="Assignee"
+ options={assigneeOptions}
+ activeIds={assigneeFilter}
+ onToggle={toggleAssignee}
+ placeholder="Search assignees..."
+ multiple
+ />
+ </Show>
+ </DropdownMenu.Content>
+ </DropdownMenu.Portal>
+ </DropdownMenu>
+ </Show>
+ );
+};
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.ts b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.ts
index 1445acce12..0eaf3f83c0 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.ts
@@ -3,12 +3,35 @@ import {
type PresetContext,
} from '@app/component/app-sidebar/soup-filter-presets';
import type { FilterID } from '@app/component/next-soup/filters/configs';
+import { NO_ASSIGNEE } from '@app/component/next-soup/soup-view/task-sub-filter-matcher';
import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-context';
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
+import type { ListView } from '@app/constants/list-views';
import { isListViewID } from '@app/constants/list-views';
-import { useUserContext } from '@core/context/user';
+import { useUserContext, useUserId } from '@core/context/user';
import { deepEqual } from '@core/util/compareUtils';
+import { useContacts } from '@queries/contacts/contacts';
import { batch, createMemo } from 'solid-js';
+import type { ActiveFilter } from './active-filter-chips';
+import {
+ buildContactLabel,
+ VIEW_FILTER_CATEGORIES,
+} from './unified-filter-dropdown';
+
+// Filter IDs that are set by tabs and should not be shown as removable chips
+const TAB_ONLY_FILTERS = new Set([
+ 'signal',
+ 'noise',
+ 'explicit-noise',
+ 'channels',
+ 'file-folder',
+ 'shared-entity',
+ 'shared-agent',
+ 'assigned-to',
+ 'email',
+ 'no-drafts',
+ 'email-drafts',
+]);
/**
* Hook that provides detection of active filter refinements beyond tab defaults,
@@ -25,6 +48,8 @@ export function useFilterRefinements() {
} = useSoupView();
const panel = useSplitPanelOrThrow();
const user = useUserContext();
+ const contacts = useContacts();
+ const currentUserId = useUserId();
const getPresetContext = (): PresetContext => ({
userId: user.userId(),
@@ -75,6 +100,92 @@ export function useFilterRefinements() {
return hasClientFilterDiff || hasQueryFilterDiff || hasSubFilters;
});
+ /**
+ * Human-readable options for the assignee sub-filter, keyed by assignee ID.
+ * Mirrors the same logic used in UnifiedFilterDropdown's assigneeOptions.
+ */
+ const assigneeOptionsMap = createMemo((): Map<string, { label: string }> => {
+ const uid = currentUserId();
+ const map = new Map<string, { label: string }>();
+ map.set(NO_ASSIGNEE, { label: 'Unassigned' });
+ for (const contact of contacts()) {
+ map.set(contact.id, { label: buildContactLabel(contact, uid) });
+ }
+ return map;
+ });
+
+ /**
+ * Get filter categories for the current view
+ */
+ const viewCategories = createMemo(() => {
+ const view = currentView();
+ if (!view) return [];
+ return VIEW_FILTER_CATEGORIES[view as ListView] ?? [];
+ });
+
+ /**
+ * Returns a list of active filters that can be displayed as removable chips.
+ * Excludes filters that are set by tabs (like signal/noise).
+ */
+ const activeFiltersList = createMemo((): ActiveFilter[] => {
+ const preset = currentPreset();
+ const presetFilterIds = new Set([
+ ...(preset?.clientFilters.and ?? []),
+ ...(preset?.clientFilters.or ?? []),
+ ]);
+
+ const filters: ActiveFilter[] = [];
+ for (const category of viewCategories()) {
+ for (const option of category.options) {
+ if (
+ !soup.filters.isActive(option.id) ||
+ TAB_ONLY_FILTERS.has(option.id) ||
+ presetFilterIds.has(option.id as FilterID)
+ ) {
+ continue;
+ }
+ filters.push({
+ categoryLabel: category.label,
+ optionId: option.id,
+ optionLabel: option.label,
+ icon: option.icon,
+ categoryOptions: category.options,
+ });
+ }
+ }
+
+ // Sub-filters: assignee
+ const optionsMap = assigneeOptionsMap();
+ for (const id of assigneeFilter()) {
+ const option = optionsMap.get(id);
+ filters.push({
+ categoryLabel: 'Assignee',
+ optionId: id,
+ optionLabel: option?.label ?? id,
+ onRemove: () =>
+ setAssigneeFilter(assigneeFilter().filter((a) => a !== id)),
+ });
+ }
+
+ return filters;
+ });
+
+ const isOptionActive = (optionId: string) => {
+ return soup.filters.isActive(optionId);
+ };
+
+ const removeFilter = (optionId: string) => {
+ soup.filters.toggle({ or: [optionId as FilterID] });
+ };
+
+ const replaceFilter = (oldOptionId: string, newOptionId: string) => {
+ // Toggle off the old filter and toggle on the new one
+ batch(() => {
+ soup.filters.toggle({ or: [oldOptionId as FilterID] });
+ soup.filters.toggle({ or: [newOptionId as FilterID] });
+ });
+ };
+
const resetToTabDefaults = () => {
const preset = currentPreset();
if (!preset) return;
@@ -90,5 +201,9 @@ export function useFilterRefinements() {
hasActiveRefinements,
resetToTabDefaults,
currentView,
+ activeFiltersList,
+ removeFilter,
+ replaceFilter,
+ isOptionActive,
};
}
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
index 439fd596e9..b0c4fbe8a0 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
@@ -338,7 +338,7 @@ export const SegmentedControl: ParentComponent<
return (
<KSegmentedControl
- class="size-full text-sm rounded-xs border border-edge-muted relative overflow-hidden"
+ class="h-full text-sm rounded-xs border border-edge-muted relative overflow-hidden"
value={props.value}
defaultValue={props.defaultValue ?? props.list[0]?.value}
onChange={onChange}
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.tsx
index 5f580cadc5..6bf4baa93b 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
@@ -1,4 +1,3 @@
-import { AnimatedPreviewIcon } from '@macro-icons/wide/animating/preview';
import CheckIcon from '@icon/bold/check-bold.svg';
import Spinner from '@icon/regular/spinner.svg';
import {
@@ -32,6 +31,7 @@ import {
} from '@app/component/PreviewPanel';
import { SplitPanelContext } from '@app/component/split-layout/context';
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
+import { CollapsibleHeaderItem } from '@app/component/split-layout/components/CollapsibleHeaderItem';
import { LoadingBlock } from '@core/component/LoadingBlock';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { useIsKeyPressActive } from '@core/util/useIsKeyPressActive';
@@ -68,7 +68,7 @@ import { SoupEntitySelectionToolbar } from './soup-entity-selection-toolbar';
import { useUserId } from '@core/context/user';
import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { SoupViewFileDropzone } from '@app/component/next-soup/soup-view/soup-view-file-dropzone';
-import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
+import { useHotkeyDOMScope } from '@core/hotkey/hotkeys';
import { invalidateEntityNotifications } from '@queries/notification/user-notifications';
import type { CacheSnapshot } from 'virtua/unstable_core';
import { EmptyState } from '@app/component/next-soup/soup-view/empty-states';
@@ -84,11 +84,12 @@ import {
SoupViewTabs,
useApplyPreset,
} from '@app/component/next-soup/soup-view/soup-view-tabs';
-import { isListViewID } from '@app/constants/list-views';
+import { isListViewID, type ListView } from '@app/constants/list-views';
import {
SplitHeaderLeft,
SplitHeaderRight,
} from '@app/component/split-layout/components/SplitHeader';
+import { SoupSearchbar } from '@app/component/next-soup/soup-view/filters-bar/soup-view-search-bar';
import { SoupFiltersBar } from '@app/component/next-soup/soup-view/filters-bar/soup-filters-bar';
import { useFilterRefinements } from '@app/component/next-soup/soup-view/filters-bar/use-filter-refinements';
import {
@@ -97,6 +98,7 @@ import {
} from '@queries/soup/normalized-cache';
import { Button } from '@app/component/next-soup/soup-view/filters-bar/button';
import { LabelAndHotKey, Tooltip } from '@core/component/Tooltip';
+import SearchIcon from '@macro-icons/macro-magnifying-glass.svg';
const useSoupNotificationInvalidators = () => {
const notificationSource = useGlobalNotificationSource();
@@ -172,31 +174,19 @@ export const SoupView = (props: SoupViewProps) => {
soup.filters.set(props.initialClientFilters);
});
- const [previewBtnHovering, setPreviewBtnHovering] = createSignal(false);
+ const component = createMemo(() => {
+ const content = panel.handle.content();
- const togglePreview = () => {
- const currentPreview = soup.previewEntity();
- if (currentPreview) {
- soup.setPreviewEntity(undefined);
- return;
- }
+ if (content.type !== 'component') return;
- const focused = soup.focus.id();
-
- if (!focused) return;
+ return content.id;
+ });
- soup.setPreviewEntity(focused);
+ const isComponentListView = (listView: ListView) => {
+ return component() === listView;
};
- registerHotkey({
- hotkey: 'space',
- scopeId: panel.splitHotkeyScope,
- description: 'Toggle preview',
- keyDownHandler: () => {
- togglePreview();
- return true;
- },
- });
+ const [narrowSearchExpanded, setNarrowSearchExpanded] = createSignal(false);
return (
<SplitPanelContext.Provider
@@ -210,35 +200,64 @@ export const SoupView = (props: SoupViewProps) => {
<div class="size-full flex flex-col">
<div class="flex flex-col w-full">
<SplitHeaderLeft>
- <div class="h-full flex gap-3 items-center">
+ <div
+ class={cn('h-full flex gap-3 items-center', {
+ 'shrink-0': !narrowSearchExpanded(),
+ 'flex-1 min-w-0': narrowSearchExpanded(),
+ })}
+ >
<Show when={!isMobile()}>
- <h1 class="font-medium text-ink-muted select-none text-sm">
+ <h1 class="font-medium text-ink-muted select-none text-sm shrink-0">
{props.viewName}
</h1>
- {/*<ChevronRightIcon class="size-4 text-ink-muted select-none" />*/}
</Show>
-
- <SoupViewTabs />
- <SoupViewCreateButton />
+ <Show when={!narrowSearchExpanded()}>
+ <SoupViewCreateButton />
+ <SoupViewTabs />
+ </Show>
+ <Show when={narrowSearchExpanded()}>
+ <div class="flex-1 min-w-0">
+ <SoupSearchbar
+ variant="secondary"
+ autoFocus
+ onDismiss={() => setNarrowSearchExpanded(false)}
+ />
+ </div>
+ </Show>
</div>
</SplitHeaderLeft>
<SplitHeaderRight>
- <Tooltip
- tooltip={<LabelAndHotKey label="Preview" shortcut="space" />}
- >
- <Button
- variant={soup.previewEntity() ? 'primary' : 'ghost'}
- size="icon-sm"
- class="rounded-xs [&_svg]:size-4"
- onClick={togglePreview}
- onMouseEnter={() => setPreviewBtnHovering(true)}
- onMouseLeave={() => setPreviewBtnHovering(false)}
- >
- <AnimatedPreviewIcon
- triggerAnimation={previewBtnHovering()}
- />
- </Button>
- </Tooltip>
+ <Show when={!isComponentListView('search')}>
+ <CollapsibleHeaderItem
+ id="search"
+ priority={0}
+ onCollapsedChange={(isCollapsed) => {
+ if (!isCollapsed) setNarrowSearchExpanded(false);
+ }}
+ expanded={
+ <div class="w-52">
+ <SoupSearchbar variant="secondary" />
+ </div>
+ }
+ collapsed={
+ <Show when={!narrowSearchExpanded()}>
+ <Tooltip
+ tooltip={
+ <LabelAndHotKey label="Search" shortcut="⌘F" />
+ }
+ >
+ <Button
+ variant="ghost"
+ class="p-1 rounded-xs"
+ onClick={() => setNarrowSearchExpanded(true)}
+ >
+ <SearchIcon class="size-4" />
+ </Button>
+ </Tooltip>
+ </Show>
+ }
+ />
+ </Show>
</SplitHeaderRight>
<SoupFiltersBar />
</div>
diff --git a/js/app/packages/app/component/split-layout/SplitLayout.tsx b/js/app/packages/app/component/split-layout/SplitLayout.tsx
index 11be24a680..1086c88dbf 100644
--- a/js/app/packages/app/component/split-layout/SplitLayout.tsx
+++ b/js/app/packages/app/component/split-layout/SplitLayout.tsx
@@ -23,7 +23,11 @@ import {
import { Dynamic } from 'solid-js/web';
import { PopoverSplitRenderer } from './components/PopoverSplitRenderer';
import { SplitContainer } from './components/SplitContainer';
-import { SplitLayoutContext, SplitPanelContext } from './context';
+import {
+ SplitLayoutContext,
+ SplitPanelContext,
+ type SplitPanelContextType,
+} from './context';
import { useSplitLayout } from './layout';
import {
createSplitLayout,
@@ -36,6 +40,7 @@ import {
type SplitState,
} from './layoutManager';
import { decodePairs } from './layoutUtils';
+import { createHeaderCollapser } from './utils/createHeaderCollapser';
import { registerSplitHotkeys } from './registerSplitHotkeys';
import { isListViewID } from '@app/constants/list-views';
import { isMobile } from '@core/mobile/isMobile';
@@ -361,6 +366,12 @@ function SplitPanel(props: SplitPanelProps) {
const [previewState, setPreviewState] = createSignal(false);
+ const layoutRefs: SplitPanelContextType['layoutRefs'] = {};
+ const headerCollapser = createHeaderCollapser(
+ () => layoutRefs.headerLeft,
+ () => panelSize.width
+ );
+
const splitLayoutHelpers = useSplitLayout();
registerSplitHotkeys({
splitHotkeyScope,
@@ -393,10 +404,11 @@ function SplitPanel(props: SplitPanelProps) {
isPanelActive: () => props.active,
panelRef,
panelSize,
- layoutRefs: {},
+ layoutRefs,
contentOffsetTop,
setContentOffsetTop,
previewState: [previewState, setPreviewState],
+ headerCollapser,
}}
>
<SplitContainer
diff --git a/js/app/packages/app/component/split-layout/components/CollapsibleHeaderItem.tsx b/js/app/packages/app/component/split-layout/components/CollapsibleHeaderItem.tsx
new file mode 100644
index 0000000000..9bd854d26c
--- /dev/null
+++ b/js/app/packages/app/component/split-layout/components/CollapsibleHeaderItem.tsx
@@ -0,0 +1,40 @@
+import { createSignal, type JSX, Show } from 'solid-js';
+import { useRegisterCollapsibleHeaderItem } from '../layoutUtils';
+
+type CollapsibleHeaderItemProps = {
+ id: string;
+ priority: number;
+ expanded: JSX.Element;
+ collapsed: JSX.Element;
+ onCollapsedChange?: (isCollapsed: boolean) => void;
+};
+
+export function CollapsibleHeaderItem(props: CollapsibleHeaderItemProps) {
+ const [expandedRef, setExpandedRef] = createSignal<HTMLElement | null>(null);
+ const [collapsedRef, setCollapsedRef] = createSignal<HTMLElement | null>(
+ null
+ );
+
+ const [isCollapsed] = useRegisterCollapsibleHeaderItem({
+ id: props.id,
+ priority: props.priority,
+ ref: expandedRef,
+ collapsedRef: collapsedRef,
+ onCollapsedChange: (v) => props.onCollapsedChange?.(v),
+ });
+
+ return (
+ <>
+ <Show when={!isCollapsed()}>
+ <div ref={setExpandedRef} class="flex items-center">
+ {props.expanded}
+ </div>
+ </Show>
+ <Show when={isCollapsed()}>
+ <div ref={setCollapsedRef} class="flex items-center">
+ {props.collapsed}
+ </div>
+ </Show>
+ </>
+ );
+}
diff --git a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
index 65c71c5d77..32076bb96e 100644
--- a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
+++ b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
@@ -99,6 +99,7 @@ function PopoverSplitModal(props: {
typeof setPreviewState,
],
layoutRefs: {},
+ headerCollapser: { register: () => () => {} },
};
const [bindHotKeyDom, scopeId] = useHotkeyDOMScope(
diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
index 12cc02e1dd..b4332562ee 100644
--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
@@ -1,4 +1,6 @@
-import EntityNavigationIndicator from '@app/component/EntityNavigationIndicator';
+import EntityNavigationIndicator, {
+ shouldShowEntityNavigation,
+} from '@app/component/EntityNavigationIndicator';
import { LabelAndHotKey } from '@core/component/Tooltip';
import {
ENABLE_PREVIEW,
@@ -28,6 +30,7 @@ import { SplitLayoutContext, SplitPanelContext } from '../context';
import { canSpotlight } from '../utils/canSpotlight';
import { cn } from '@ui/utils/classname';
import { isListViewID } from '@app/constants/list-views';
+import { useSoup } from '@app/component/next-soup/soup-context';
function SplitBackButton() {
const context = useContext(SplitPanelContext);
@@ -175,9 +178,11 @@ function _SplitControlButtons() {
}
export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
- const ctx = useContext(SplitPanelContext);
- if (!ctx)
+ const soup = useSoup();
+ const panel = useContext(SplitPanelContext);
+ if (!panel)
throw new Error('<SplitHeader> must be used within a <SplitLayout>');
+ const layout = useContext(SplitLayoutContext);
return (
<div
@@ -196,17 +201,23 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
<div
class="relative min-w-0 h-full grow shrink pl-2 flex items-center gap-0.5"
ref={(ref) => {
- ctx.layoutRefs.headerLeft = ref;
+ panel.layoutRefs.headerLeft = ref;
}}
/>
<div
class="min-w-4 h-full shrink-0 flex items-center gap-0.5 px-2"
ref={(ref) => {
- ctx.layoutRefs.headerRight = ref;
+ panel.layoutRefs.headerRight = ref;
}}
>
- <Show when={!isTouchDevice()}>
+ <Show
+ when={
+ !isTouchDevice() &&
+ (shouldShowEntityNavigation(soup, panel) ||
+ (layout && canSpotlight(layout.manager)))
+ }
+ >
<div class="z-2 relative flex items-center gap-0.5 h-full order-last">
<EntityNavigationIndicator />
<SplitSpotlightButton />
diff --git a/js/app/packages/app/component/split-layout/context.ts b/js/app/packages/app/component/split-layout/context.ts
index 628a020ffa..0cc08139ee 100644
--- a/js/app/packages/app/component/split-layout/context.ts
+++ b/js/app/packages/app/component/split-layout/context.ts
@@ -7,6 +7,26 @@ import {
} from 'solid-js';
import type { SplitHandle, SplitManager } from './layoutManager';
+export type CollapsibleRegistration = {
+ id: string;
+ priority: number; // lower = higher priority to collapse first
+ collapsed: Accessor<boolean>;
+ setCollapsed: Setter<boolean>;
+ ref: Accessor<HTMLElement | null | undefined>; // uncollapsed element — measured before collapse
+ collapsedRef?: Accessor<HTMLElement | null | undefined>; // collapsed element — measured while collapsed
+};
+
+export type CollapsibleItemInput = Omit<
+ CollapsibleRegistration,
+ 'collapsed' | 'setCollapsed'
+> & {
+ onCollapsedChange?: (isCollapsed: boolean) => void;
+};
+
+export type HeaderCollapser = {
+ register: (reg: CollapsibleRegistration) => () => void; // returns cleanup
+};
+
export const SplitLayoutContext = createContext<{
manager: SplitManager;
}>();
@@ -32,6 +52,7 @@ export type SplitPanelContextType = {
toolbarLeft?: HTMLDivElement;
toolbarRight?: HTMLDivElement;
};
+ headerCollapser: HeaderCollapser;
};
export const SplitPanelContext = createContext<SplitPanelContextType>();
diff --git a/js/app/packages/app/component/split-layout/layoutUtils.ts b/js/app/packages/app/component/split-layout/layoutUtils.ts
index 217b9d301b..d5fc606925 100644
--- a/js/app/packages/app/component/split-layout/layoutUtils.ts
+++ b/js/app/packages/app/component/split-layout/layoutUtils.ts
@@ -2,8 +2,20 @@ import { globalSplitManager } from '@app/signal/splitLayout';
import type { BlockAlias, BlockName } from '@core/block';
import { isBlockAlias, resolveBlockAlias } from '@core/constant/allBlocks';
import { createCallback } from '@solid-primitives/rootless';
-import { type Accessor, createMemo, useContext } from 'solid-js';
-import { SplitLayoutContext, SplitPanelContext } from './context';
+import {
+ type Accessor,
+ createMemo,
+ createSignal,
+ onCleanup,
+ type Setter,
+ type Signal,
+ useContext,
+} from 'solid-js';
+import {
+ SplitLayoutContext,
+ SplitPanelContext,
+ type CollapsibleItemInput,
+} from './context';
import type {
SplitContent,
SplitContentType,
@@ -144,3 +156,26 @@ export function createIsActiveSplitContentMemo(
return content?.type === contentType && content.id === id;
});
}
+
+export function useRegisterCollapsibleHeaderItem(
+ input: CollapsibleItemInput
+): Signal<boolean> {
+ const [collapsed, setCollapsedInner] = createSignal(false);
+ const setCollapsed: Setter<boolean> = (
+ next?: boolean | ((prev: boolean) => boolean)
+ ) => {
+ const value =
+ typeof next === 'function' ? next(collapsed()) : (next ?? false);
+ setCollapsedInner(value as boolean);
+ input.onCollapsedChange?.(value as boolean);
+ return value as boolean;
+ };
+ const ctx = useSplitPanelOrThrow();
+ const cleanup = ctx.headerCollapser.register({
+ ...input,
+ collapsed,
+ setCollapsed,
+ });
+ onCleanup(cleanup);
+ return [collapsed, setCollapsed];
+}
diff --git a/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts b/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts
new file mode 100644
index 0000000000..ffaa29cfaa
--- /dev/null
+++ b/js/app/packages/app/component/split-layout/utils/createHeaderCollapser.ts
@@ -0,0 +1,134 @@
+import { type Accessor, createEffect, onCleanup } from 'solid-js';
+import { createStore, produce } from 'solid-js/store';
+import type { CollapsibleRegistration, HeaderCollapser } from '../context';
+
+/**
+ * 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;
+ for (const child of Array.from(container.children) as HTMLElement[]) {
+ if (getComputedStyle(child).display === 'contents') {
+ for (const inner of Array.from(child.children) as HTMLElement[]) {
+ itemTotal += inner.offsetWidth;
+ itemCount++;
+ }
+ } else {
+ itemTotal += child.offsetWidth;
+ 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;
+ const gap = parseFloat(style.columnGap) || 0;
+ return (
+ itemTotal + paddingLeft + paddingRight + gap * Math.max(0, itemCount - 1)
+ );
+}
+
+export function createHeaderCollapser(
+ getContainer: Accessor<HTMLElement | undefined>,
+ 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;
+
+ const evaluate = () => {
+ const headerLeft = getContainer();
+ if (!headerLeft) return;
+
+ // Attach ResizeObserver lazily on first call when headerLeft exists
+ if (!observer) {
+ observer = new ResizeObserver(() => queueMicrotask(evaluate));
+ 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);
+ }
+ }
+
+ const overflow = headerLeft.scrollWidth > headerLeft.offsetWidth;
+
+ 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);
+ queueMicrotask(evaluate);
+ }
+ } 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;
+ // The container is flex-grow so scrollWidth === offsetWidth when no overflow —
+ // measure the actual rendered content width instead.
+ const contentWidth = getContentWidth(headerLeft);
+ const spare = headerLeft.offsetWidth - contentWidth;
+ if (spare >= needed + 1) {
+ item.setCollapsed(false);
+ queueMicrotask(evaluate);
+ }
+ }
+ }
+ };
+
+ // Re-evaluate when panel width changes
+ createEffect(() => {
+ panelSizeWidth();
+ queueMicrotask(evaluate);
+ });
+
+ // 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();
+ }
+ queueMicrotask(evaluate);
+ });
+
+ onCleanup(() => observer?.disconnect());
+
+ return {
+ register(reg: CollapsibleRegistration) {
+ setItems(produce((arr: CollapsibleRegistration[]) => arr.push(reg)));
+ return () => {
+ setItems(
+ produce((arr: CollapsibleRegistration[]) => {
+ const idx = arr.findIndex((i) => i.id === reg.id);
+ if (idx !== -1) arr.splice(idx, 1);
+ })
+ );
+ naturalWidths.delete(reg.id);
+ collapsedWidths.delete(reg.id);
+ };
+ },
+ };
+}
diff --git a/js/app/packages/macro-icons/wide/animating/channel.tsx b/js/app/packages/macro-icons/wide/animating/channel.tsx
index cb2bd7e9c6..65c2711dd4 100644
--- a/js/app/packages/macro-icons/wide/animating/channel.tsx
+++ b/js/app/packages/macro-icons/wide/animating/channel.tsx
@@ -1,4 +1,7 @@
-export const AnimatedChannelIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedChannelIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedChannelIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-channel-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-channel-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated channel icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/chat.tsx b/js/app/packages/macro-icons/wide/animating/chat.tsx
index 91ea859729..bcb03e5361 100644
--- a/js/app/packages/macro-icons/wide/animating/chat.tsx
+++ b/js/app/packages/macro-icons/wide/animating/chat.tsx
@@ -1,4 +1,7 @@
-export const AnimatedChatIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedChatIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedChatIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-chat-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-chat-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated chat icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/diagram.tsx b/js/app/packages/macro-icons/wide/animating/diagram.tsx
index 42cef660e0..5ad9ab251f 100644
--- a/js/app/packages/macro-icons/wide/animating/diagram.tsx
+++ b/js/app/packages/macro-icons/wide/animating/diagram.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedDiagramIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedDiagramIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskId = createUniqueId();
return (
<svg
@@ -11,7 +14,7 @@ export const AnimatedDiagramIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-diagram-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-diagram-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated diagram icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/email.tsx b/js/app/packages/macro-icons/wide/animating/email.tsx
index 9bd149f3fa..15bec8e6e3 100644
--- a/js/app/packages/macro-icons/wide/animating/email.tsx
+++ b/js/app/packages/macro-icons/wide/animating/email.tsx
@@ -34,7 +34,10 @@ function cancelAnim(a: Animation) {
} catch (_) {}
}
-export const AnimatedEmailIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedEmailIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const clipId = createUniqueId();
let bodyAEl!: SVGPathElement;
let bodyBEl!: SVGPathElement;
@@ -168,6 +171,7 @@ export const AnimatedEmailIcon = (props: { triggerAnimation?: boolean }) => {
stroke="currentColor"
stroke-width="1.5"
xmlns="http://www.w3.org/2000/svg"
+ class={props.class}
>
{/*<title>Animated email icon</title>*/}
<defs>
diff --git a/js/app/packages/macro-icons/wide/animating/fileCode.tsx b/js/app/packages/macro-icons/wide/animating/fileCode.tsx
index bde5707a0e..e47b5d389e 100644
--- a/js/app/packages/macro-icons/wide/animating/fileCode.tsx
+++ b/js/app/packages/macro-icons/wide/animating/fileCode.tsx
@@ -1,4 +1,7 @@
-export const AnimatedFileCodeIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedFileCodeIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedFileCodeIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-file-code-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-file-code-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated code file icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/fileMd.tsx b/js/app/packages/macro-icons/wide/animating/fileMd.tsx
index 4a6bec63a1..b998cb8bec 100644
--- a/js/app/packages/macro-icons/wide/animating/fileMd.tsx
+++ b/js/app/packages/macro-icons/wide/animating/fileMd.tsx
@@ -1,4 +1,7 @@
-export const AnimatedFileMdIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedFileMdIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedFileMdIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-file-md-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-file-md-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated markdown file icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/folder.tsx b/js/app/packages/macro-icons/wide/animating/folder.tsx
index 51f80ddec3..a4abe673b0 100644
--- a/js/app/packages/macro-icons/wide/animating/folder.tsx
+++ b/js/app/packages/macro-icons/wide/animating/folder.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedFolderIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedFolderIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskId = createUniqueId();
return (
<svg
@@ -11,7 +14,7 @@ export const AnimatedFolderIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-folder-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-folder-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated folder icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/inbox.tsx b/js/app/packages/macro-icons/wide/animating/inbox.tsx
index 4b5c645333..bba605f021 100644
--- a/js/app/packages/macro-icons/wide/animating/inbox.tsx
+++ b/js/app/packages/macro-icons/wide/animating/inbox.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedInboxIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedInboxIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskId = createUniqueId();
return (
<svg
@@ -11,7 +14,7 @@ export const AnimatedInboxIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-inbox-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-inbox-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated inbox icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/noise.tsx b/js/app/packages/macro-icons/wide/animating/noise.tsx
index 09300bcaec..c04a54fd78 100644
--- a/js/app/packages/macro-icons/wide/animating/noise.tsx
+++ b/js/app/packages/macro-icons/wide/animating/noise.tsx
@@ -1,4 +1,7 @@
-export const AnimatedNoiseIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedNoiseIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedNoiseIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
overflow="visible"
xmlns="http://www.w3.org/2000/svg"
- class={`animated-noise-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-noise-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated noise icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/plus.tsx b/js/app/packages/macro-icons/wide/animating/plus.tsx
index 86d9cfd46d..1693bfa20e 100644
--- a/js/app/packages/macro-icons/wide/animating/plus.tsx
+++ b/js/app/packages/macro-icons/wide/animating/plus.tsx
@@ -1,7 +1,10 @@
const FRAME_A_D = 'M 1.5,0.75 L 17.25,0.75 L 17.25,16.5';
const FRAME_B_D = 'M 16.5,17.25 L 0.75,17.25 L 0.75,1.5';
-export const AnimatedPlusIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedPlusIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -12,7 +15,7 @@ export const AnimatedPlusIcon = (props: { triggerAnimation?: boolean }) => {
stroke-width="1.5"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-plus-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-plus-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated plus icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/preview.tsx b/js/app/packages/macro-icons/wide/animating/preview.tsx
index 764ecfe87c..7c1716ef33 100644
--- a/js/app/packages/macro-icons/wide/animating/preview.tsx
+++ b/js/app/packages/macro-icons/wide/animating/preview.tsx
@@ -1,4 +1,7 @@
-export const AnimatedPreviewIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedPreviewIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
// Eye icon with pupil animation - pupil slides left and right
return (
@@ -10,7 +13,7 @@ export const AnimatedPreviewIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-preview-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-preview-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated preview icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/profile.tsx b/js/app/packages/macro-icons/wide/animating/profile.tsx
index ed111dac7c..540fe8598f 100644
--- a/js/app/packages/macro-icons/wide/animating/profile.tsx
+++ b/js/app/packages/macro-icons/wide/animating/profile.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedProfileIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedProfileIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const frameMaskId = createUniqueId();
const clipBottomId = createUniqueId();
@@ -13,7 +16,7 @@ export const AnimatedProfileIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-profile-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-profile-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated profile icon</title>*/}
<defs>
diff --git a/js/app/packages/macro-icons/wide/animating/search.tsx b/js/app/packages/macro-icons/wide/animating/search.tsx
index 59fb66d00b..b1311e8647 100644
--- a/js/app/packages/macro-icons/wide/animating/search.tsx
+++ b/js/app/packages/macro-icons/wide/animating/search.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedSearchIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedSearchIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const clipId = createUniqueId();
return (
<svg
@@ -11,7 +14,7 @@ export const AnimatedSearchIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-search-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-search-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated search icon</title>*/}
<defs>
diff --git a/js/app/packages/macro-icons/wide/animating/share.tsx b/js/app/packages/macro-icons/wide/animating/share.tsx
index 32be778433..4dba29ad60 100644
--- a/js/app/packages/macro-icons/wide/animating/share.tsx
+++ b/js/app/packages/macro-icons/wide/animating/share.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedShareIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedShareIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskRightPersonId = createUniqueId();
const clipBottomId = createUniqueId();
@@ -13,7 +16,7 @@ export const AnimatedShareIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-share-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-share-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated share icon</title>*/}
<defs>
diff --git a/js/app/packages/macro-icons/wide/animating/sidebar.tsx b/js/app/packages/macro-icons/wide/animating/sidebar.tsx
index 3d691a64d4..2c5ca25929 100644
--- a/js/app/packages/macro-icons/wide/animating/sidebar.tsx
+++ b/js/app/packages/macro-icons/wide/animating/sidebar.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedSidebarIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedSidebarIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const clipId = createUniqueId();
const notchMaskId = createUniqueId();
@@ -13,7 +16,7 @@ export const AnimatedSidebarIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-sidebar-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-sidebar-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated sidebar icon</title>*/}
<defs>
diff --git a/js/app/packages/macro-icons/wide/animating/signal.tsx b/js/app/packages/macro-icons/wide/animating/signal.tsx
index d6648c08ab..05fa62b412 100644
--- a/js/app/packages/macro-icons/wide/animating/signal.tsx
+++ b/js/app/packages/macro-icons/wide/animating/signal.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedSignalIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedSignalIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskId = createUniqueId();
return (
<svg
@@ -10,7 +13,7 @@ export const AnimatedSignalIcon = (props: { triggerAnimation?: boolean }) => {
fill="currentColor"
stroke="none"
xmlns="http://www.w3.org/2000/svg"
- class={`animated-signal-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-signal-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated signal icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/sliders-horizontal.tsx b/js/app/packages/macro-icons/wide/animating/sliders-horizontal.tsx
index b6dc4774bd..50fd075190 100644
--- a/js/app/packages/macro-icons/wide/animating/sliders-horizontal.tsx
+++ b/js/app/packages/macro-icons/wide/animating/sliders-horizontal.tsx
@@ -2,6 +2,7 @@ import { createUniqueId } from 'solid-js';
export const AnimatedSlidersHorizontalIcon = (props: {
triggerAnimation?: boolean;
+ class?: string;
}) => {
const maskId = createUniqueId();
@@ -14,7 +15,7 @@ export const AnimatedSlidersHorizontalIcon = (props: {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-sliders-horizontal-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-sliders-horizontal-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated sliders horizontal icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/sliders.tsx b/js/app/packages/macro-icons/wide/animating/sliders.tsx
index cf20e31123..43fc6c39b7 100644
--- a/js/app/packages/macro-icons/wide/animating/sliders.tsx
+++ b/js/app/packages/macro-icons/wide/animating/sliders.tsx
@@ -1,6 +1,9 @@
import { createUniqueId } from 'solid-js';
-export const AnimatedSlidersIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedSlidersIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
const maskId = createUniqueId();
return (
@@ -12,7 +15,7 @@ export const AnimatedSlidersIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-sliders-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-sliders-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated sliders icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/sort.tsx b/js/app/packages/macro-icons/wide/animating/sort.tsx
index 2611102a45..cd4f6e67f4 100644
--- a/js/app/packages/macro-icons/wide/animating/sort.tsx
+++ b/js/app/packages/macro-icons/wide/animating/sort.tsx
@@ -1,4 +1,7 @@
-export const AnimatedSortIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedSortIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedSortIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-sort-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-sort-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated sort icon</title>*/}
<style>{`
diff --git a/js/app/packages/macro-icons/wide/animating/task.tsx b/js/app/packages/macro-icons/wide/animating/task.tsx
index 816eb6809c..f230bb2d2c 100644
--- a/js/app/packages/macro-icons/wide/animating/task.tsx
+++ b/js/app/packages/macro-icons/wide/animating/task.tsx
@@ -1,4 +1,7 @@
-export const AnimatedTaskIcon = (props: { triggerAnimation?: boolean }) => {
+export const AnimatedTaskIcon = (props: {
+ triggerAnimation?: boolean;
+ class?: string;
+}) => {
return (
<svg
width="100%"
@@ -8,7 +11,7 @@ export const AnimatedTaskIcon = (props: { triggerAnimation?: boolean }) => {
stroke="none"
xmlns="http://www.w3.org/2000/svg"
overflow="visible"
- class={`animated-task-icon ${props.triggerAnimation ? 'animating' : ''}`}
+ class={`animated-task-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
>
{/*<title>Animated task icon</title>*/}
<style>{`