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(tasks): give group headers the email card chrome (#8306)

Jacob Beckerman10d7cc5358e8
diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskGroupHeader.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskGroupHeader.tsx
index ead7cdb48f..abb149cb4c 100644
--- a/apps/web/src/features/tasks-view/components/task-list/TaskGroupHeader.tsx
+++ b/apps/web/src/features/tasks-view/components/task-list/TaskGroupHeader.tsx
@@ -1,6 +1,7 @@
import type { SoupGroupHeaderRow } from '@app/features/soup';
import { UserIcon } from '@core/component/UserIcon';
import { isBotPrincipalId } from '@core/constant/macroAgent';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { getDisplayName, tryMacroId } from '@core/user';
import { getPropertyOptionLabel } from '@entity';
import CaretRightIcon from '@phosphor/caret-right.svg';
@@ -9,7 +10,7 @@ import FolderIcon from '@phosphor/folder-simple.svg';
import { PROPERTY_OPTION_IDS } from '@property';
import { PropertyValueIcon } from '@property/component/propertyValue';
import { usePropertyUserDisplay } from '@property/hooks/usePropertyUserDisplay';
-import { cn, Layer, Surface } from '@ui';
+import { ComposerSurface, cn, Layer } from '@ui';
import { createMemo, Match, Show, Switch } from 'solid-js';
import type { TaskGroupBy } from '../../types';
@@ -69,68 +70,73 @@ export function TaskGroupHeader(props: {
return (
<div id={props.row.id} role="row">
<div role="gridcell" aria-colspan={props.columnCount}>
- <Surface
- depth={3}
- hideBorder
- data-highlighted={props.focused || undefined}
- class={cn(
- 'group/header mx-1 my-0.5 h-auto w-[calc(100%-0.5rem)] rounded-lg border border-edge-muted text-ink-muted hover:bg-active',
- statusTint(),
- props.focused && 'bg-active'
- )}
- >
- <button
- type="button"
- tabIndex={-1}
- class="flex w-full items-center gap-2.5 rounded-[inherit] px-2 py-1.5 text-left text-xs font-semibold tracking-tight"
- aria-expanded={props.expanded}
- onMouseMove={props.onFocus}
- onClick={props.onToggle}
+ {/* Desktop shares the email card's composer chrome: soft shadow in
+ light mode, glass rim in dark mode. */}
+ <Layer depth={3}>
+ <ComposerSurface
+ as="div"
+ data-highlighted={props.focused || undefined}
+ class={cn(
+ 'group/header relative mx-1 my-0.5 w-[calc(100%-0.5rem)] rounded-xl text-ink-muted hover:bg-active',
+ isTouchDevice() &&
+ 'rounded-lg border border-edge-muted bg-surface',
+ statusTint(),
+ props.focused && 'bg-active'
+ )}
>
- <Layer depth={3}>
- <span class="flex size-4.5 items-center justify-center rounded-xs group-hover/header:bg-ink/5">
- <CaretRightIcon
- class={cn(
- 'size-2.5 transition-transform',
- props.expanded && 'rotate-90'
- )}
- />
- </span>
- </Layer>
- <Switch>
- <Match when={!props.row.groupId}>
- <CircleDashedIcon class="size-3.5 text-ink-extra-muted" />
- </Match>
- <Match
- when={
- props.groupBy === 'status' || props.groupBy === 'priority'
- }
- >
- <PropertyValueIcon
- optionId={props.row.groupId}
- class="size-3.5"
- />
- </Match>
- <Match when={props.groupBy === 'assignee'}>
- <UserIcon
- id={props.row.groupId}
- size="sm"
- suppressClick
- showTooltip={false}
- />
- </Match>
- <Match when={props.groupBy === 'project'}>
- <FolderIcon class="size-3.5 shrink-0" />
- </Match>
- </Switch>
- <span class="truncate">{label()}</span>
- <Show when={props.row.count !== undefined}>
- <span class="shrink-0 rounded-full bg-ink/10 px-1.5 py-px text-xs font-medium tabular-nums text-ink-extra-muted">
- {props.row.count}
- </span>
- </Show>
- </button>
- </Surface>
+ <button
+ type="button"
+ tabIndex={-1}
+ class="flex w-full items-center gap-2.5 rounded-[inherit] px-2 py-1.5 text-left text-xs font-semibold tracking-tight"
+ aria-expanded={props.expanded}
+ onMouseMove={props.onFocus}
+ onClick={props.onToggle}
+ >
+ <Layer depth={3}>
+ <span class="flex size-4.5 items-center justify-center rounded-xs group-hover/header:bg-ink/5">
+ <CaretRightIcon
+ class={cn(
+ 'size-2.5 transition-transform',
+ props.expanded && 'rotate-90'
+ )}
+ />
+ </span>
+ </Layer>
+ <Switch>
+ <Match when={!props.row.groupId}>
+ <CircleDashedIcon class="size-3.5 text-ink-extra-muted" />
+ </Match>
+ <Match
+ when={
+ props.groupBy === 'status' || props.groupBy === 'priority'
+ }
+ >
+ <PropertyValueIcon
+ optionId={props.row.groupId}
+ class="size-3.5"
+ />
+ </Match>
+ <Match when={props.groupBy === 'assignee'}>
+ <UserIcon
+ id={props.row.groupId}
+ size="sm"
+ suppressClick
+ showTooltip={false}
+ />
+ </Match>
+ <Match when={props.groupBy === 'project'}>
+ <FolderIcon class="size-3.5 shrink-0" />
+ </Match>
+ </Switch>
+ <span class="truncate">{label()}</span>
+ <Show when={props.row.count !== undefined}>
+ <span class="shrink-0 rounded-full bg-ink/10 px-1.5 py-px text-xs font-medium tabular-nums text-ink-extra-muted">
+ {props.row.count}
+ </span>
+ </Show>
+ </button>
+ </ComposerSurface>
+ </Layer>
</div>
</div>
);