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): better group by date ui (#6033)

Peter Chinmanf01ac4c8fbc5
diff --git a/apps/web/src/features/entity/composed/ListEntity.css b/apps/web/src/features/entity/composed/ListEntity.css
index fb9e65a20c..399e78af7a 100644
--- a/apps/web/src/features/entity/composed/ListEntity.css
+++ b/apps/web/src/features/entity/composed/ListEntity.css
@@ -1,4 +1,7 @@
-/* Variables for x-axis alignment of mobile soup inbox Entities */
+/* Variables for x-axis alignment of mobile soup inbox Entities. Also declared
+ on the list container so the soup group headers, which sit beside rows rather
+ than inside one, inherit them. */
+.soup-list,
.soup-list-entity {
--soup-inbox-unread-indicator-diameter: 11px;
--soup-inbox-unread-indicator-padding-x: 7px;
@@ -28,3 +31,69 @@
var(--soup-stack-row-border-l)
);
}
+
+/* Row geometry. These are the source of truth for a row's leading edge: the row
+ layouts below consume them for their own margin, padding, indicator column
+ and column gap, and --soup-row-content-inset (their sum) is what the soup
+ group headers pad by to line their label up with row content. Change a number
+ here, not in the layout.
+
+ The family class goes on whatever needs the geometry — each row, and the
+ soup group headers, which are siblings of the rows inside the virtualizer and
+ so can't read a row's own variables. Soup's per-view registry names the
+ family and hands it to the header; the `row` family splits into wide and
+ narrow by container width, which rows and headers take from the same
+ `isWide` signal. */
+.soup-row-wide,
+.soup-row-narrow,
+.soup-row-card {
+ --soup-row-content-inset: calc(
+ var(--soup-row-gutter) + var(--soup-row-padding-l) +
+ var(--soup-row-indicator-width) + var(--soup-row-column-gap)
+ );
+}
+
+/* The `row` family, wide: WideLayout inside ListEntity. */
+.soup-row-wide {
+ --soup-row-gutter: 0.25rem;
+ --soup-row-padding-l: 0.5rem;
+ --soup-row-indicator-width: 1rem;
+ --soup-row-column-gap: 0.5rem;
+}
+
+/* The `row` family, narrow: NarrowLayout, NarrowCondensedLayout and
+ NarrowSingleLineLayout share one leading edge; on touch they give way to
+ NarrowInboxLayout's rail below. */
+.soup-row-narrow {
+ --soup-row-gutter: 0.25rem;
+ --soup-row-padding-l: 0.25rem;
+ --soup-row-indicator-width: 1rem;
+ --soup-row-column-gap: 0.25rem;
+}
+
+/* The `card` family: InboxCard reserves its checkbox gutter as plain left
+ padding and positions the checkbox inside it, so it has no indicator column
+ of its own. */
+.soup-row-card {
+ --soup-row-gutter: 0.5rem;
+ --soup-row-padding-l: 2.25rem;
+ --soup-row-indicator-width: 0px;
+ --soup-row-column-gap: 0px;
+}
+
+/* Full-frame mobile: rows go full-bleed and lead with the unread rail, which
+ each family builds differently — the card as its own left padding, the narrow
+ rows as the indicator cell that holds the dot. */
+@media (max-width: 639px) {
+ html[data-touch-device='true'] .soup-row-card {
+ --soup-row-gutter: 0px;
+ --soup-row-padding-l: var(--soup-inbox-unread);
+ }
+
+ html[data-touch-device='true'] .soup-row-narrow {
+ --soup-row-gutter: 0px;
+ --soup-row-padding-l: 0px;
+ --soup-row-indicator-width: var(--soup-inbox-unread);
+ --soup-row-column-gap: 0px;
+ }
+}
diff --git a/apps/web/src/features/entity/composed/ListEntity.tsx b/apps/web/src/features/entity/composed/ListEntity.tsx
index 288ca579a3..f186acbd41 100644
--- a/apps/web/src/features/entity/composed/ListEntity.tsx
+++ b/apps/web/src/features/entity/composed/ListEntity.tsx
@@ -49,6 +49,7 @@ import { NarrowCondensedLayout } from './list-entity/narrow-condensed-layout';
import { NarrowInboxLayout } from './list-entity/narrow-inbox-layout';
import { NarrowLayout } from './list-entity/narrow-layout';
import { NarrowSingleLineLayout } from './list-entity/narrow-single-line-layout';
+import { SOUP_ROW_CLASS } from './list-entity/row-geometry';
import {
type BaseListEntityProps,
hasSearchContentHits,
@@ -188,10 +189,16 @@ export function ListEntity(props: ListEntityProps) {
}}
ref={mergeRefs(props.ref, draggable)}
class={cn(
+ // The row family class carries the --soup-row-* geometry (ListEntity.css)
+ // that the layouts below and the soup group headers both read, so it has
+ // to track which layout the Switch actually renders.
+ isWide() ? SOUP_ROW_CLASS.wide : SOUP_ROW_CLASS.narrow,
'soup-list-entity rounded-lg @container/entity w-[calc(100%-0.5rem)] mr-1 relative group/narrow flex flex-col py-0.5',
{
- 'min-h-10 mx-1': !isMobile() && !usesCondensedNarrowLayout(),
- 'min-h-9 mx-1': !isMobile() && usesCondensedNarrowLayout(),
+ 'min-h-10 mx-(--soup-row-gutter)':
+ !isMobile() && !usesCondensedNarrowLayout(),
+ 'min-h-9 mx-(--soup-row-gutter)':
+ !isMobile() && usesCondensedNarrowLayout(),
'bg-list-selected': props.checked,
'bg-list-selected-highlighted': props.checked && props.highlighted,
'bg-list-highlighted':
diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-condensed-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-condensed-layout.tsx
index 1bc2b38078..de6a06c2d1 100644
--- a/apps/web/src/features/entity/composed/list-entity/narrow-condensed-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/narrow-condensed-layout.tsx
@@ -1,16 +1,21 @@
+import { cn } from '@ui';
import { Show } from 'solid-js';
import { Entity } from '../../entity';
import { isChannelEntity } from '../../types/entity';
import { ChannelActiveCallBadge, ChannelJoinButton } from './channel';
+import { SOUP_ROW_CLASS } from './row-geometry';
import { type LayoutProps, RowIndicator } from './shared';
/** Condensed row used for maximum density. */
export function NarrowCondensedLayout(props: LayoutProps) {
return (
<Entity.Layout
- class="w-full gap-x-1 items-center pr-2 pl-1 grid text-sm"
+ class={cn(
+ SOUP_ROW_CLASS.narrow,
+ 'w-full gap-x-(--soup-row-column-gap) items-center pr-2 pl-(--soup-row-padding-l) grid text-sm'
+ )}
style={{
- 'grid-template-columns': 'auto 1fr',
+ 'grid-template-columns': 'var(--soup-row-indicator-width) 1fr',
'grid-template-rows': '36px',
'grid-template-areas': '"indicator title"',
}}
diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
index a78eee48e1..4eb0fa2ba4 100644
--- a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
@@ -1,3 +1,4 @@
+import { cn } from '@ui';
import { Show } from 'solid-js';
import { Entity } from '../../entity';
import {
@@ -13,14 +14,19 @@ import {
ChannelMessageSingleLine,
} from './channel';
import { EmailInboxChip } from './email';
+import { SOUP_ROW_CLASS } from './row-geometry';
import { type LayoutProps, RowIndicator } from './shared';
export function NarrowLayout(props: LayoutProps) {
return (
<Entity.Layout
- class="w-full gap-x-1 items-center text-sm pr-2 pl-1 grid"
+ class={cn(
+ SOUP_ROW_CLASS.narrow,
+ 'w-full gap-x-(--soup-row-column-gap) items-center text-sm pr-2 pl-(--soup-row-padding-l) grid'
+ )}
style={{
- 'grid-template-columns': 'auto 1fr max-content',
+ 'grid-template-columns':
+ 'var(--soup-row-indicator-width) 1fr max-content',
'grid-template-rows': '44px',
'grid-template-areas': '"indicator title timestamp"',
}}
diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx
index 8ae3ba74e0..63bfd4a7b0 100644
--- a/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx
@@ -1,3 +1,4 @@
+import { cn } from '@ui';
import { Match, Show, Switch } from 'solid-js';
import { Entity } from '../../entity';
import {
@@ -14,6 +15,7 @@ import {
ChannelMessageSingleLine,
} from './channel';
import { EmailIdentity, EmailInboxChip } from './email';
+import { SOUP_ROW_CLASS } from './row-geometry';
import { type LayoutProps, RowIndicator } from './shared';
/**
@@ -29,9 +31,13 @@ import { type LayoutProps, RowIndicator } from './shared';
export function NarrowSingleLineLayout(props: LayoutProps) {
return (
<Entity.Layout
- class="w-full gap-x-1 items-center text-sm pr-2 pl-1 grid"
+ class={cn(
+ SOUP_ROW_CLASS.narrow,
+ 'w-full gap-x-(--soup-row-column-gap) items-center text-sm pr-2 pl-(--soup-row-padding-l) grid'
+ )}
style={{
- 'grid-template-columns': 'auto 1fr max-content',
+ 'grid-template-columns':
+ 'var(--soup-row-indicator-width) 1fr max-content',
'grid-template-rows': '44px',
'grid-template-areas': '"indicator title timestamp"',
}}
diff --git a/apps/web/src/features/entity/composed/list-entity/row-geometry.ts b/apps/web/src/features/entity/composed/list-entity/row-geometry.ts
new file mode 100644
index 0000000000..7c9d6a87de
--- /dev/null
+++ b/apps/web/src/features/entity/composed/list-entity/row-geometry.ts
@@ -0,0 +1,28 @@
+/**
+ * The row geometry contract shared by list rows and the soup group headers that
+ * have to line up with them. The values themselves live in the --soup-row-*
+ * blocks in ListEntity.css; this module owns the names that select them, so the
+ * stylesheet and its consumers can't drift apart.
+ */
+
+/**
+ * Which geometry a row renders with: a full-bleed `row` (WideLayout and the
+ * narrow layouts, which lead with an indicator column) or a `card` (InboxCard,
+ * which reserves its leading gutter as padding). Soup's per-view row registry
+ * pairs each row component with its family and hands it to the group headers.
+ */
+export type SoupRowFamily = 'row' | 'card';
+
+/**
+ * Class that puts a family's --soup-row-* values on an element. Each layout
+ * carries the one it is, so its own geometry always resolves no matter who
+ * renders it; row roots carry theirs too, for the outer gutter that sits
+ * outside the layout; and group headers carry the one matching the rows they
+ * sit among. The `row` family splits into `wide` and `narrow` by container
+ * width — the same `isWide` its rows read — while `card` has a single form.
+ */
+export const SOUP_ROW_CLASS = {
+ wide: 'soup-row-wide',
+ narrow: 'soup-row-narrow',
+ card: 'soup-row-card',
+} as const;
diff --git a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
index ffb411c33b..922c1f78be 100644
--- a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
@@ -44,6 +44,7 @@ import {
GithubPullRequestPills,
} from './foreign';
import { ReminderWideContent } from './reminder';
+import { SOUP_ROW_CLASS } from './row-geometry';
import type { LayoutProps } from './shared';
function RowTags(props: {
@@ -71,13 +72,17 @@ export function WideLayout(props: LayoutProps) {
return (
<Entity.Layout
class={cn(
- 'w-full min-h-[inherit] items-center text-sm px-2',
- 'gap-2 grid grid-rows-[1fr]',
+ // Leading edge (left padding, indicator column, column gap) comes from
+ // the --soup-row-* geometry in ListEntity.css so group headers can line
+ // their label up with this row's content.
+ SOUP_ROW_CLASS.wide,
+ 'w-full min-h-[inherit] items-center text-sm pl-(--soup-row-padding-l) pr-2',
+ 'gap-y-2 gap-x-(--soup-row-column-gap) grid grid-rows-[1fr]',
// Drop the indicator column entirely when the checkbox is hidden so the
- // content isn't indented by an empty 1rem gutter.
+ // content isn't indented by an empty gutter.
props.hideCheckbox
? 'grid-cols-[1fr_auto_8ch]'
- : 'grid-cols-[1rem_1fr_auto_8ch]',
+ : 'grid-cols-[var(--soup-row-indicator-width)_1fr_auto_8ch]',
'[--title-width:10rem]'
)}
style={{
diff --git a/apps/web/src/features/next-soup/create-soup-state.ts b/apps/web/src/features/next-soup/create-soup-state.ts
index fc939a1b6d..8a9d3b66f6 100644
--- a/apps/web/src/features/next-soup/create-soup-state.ts
+++ b/apps/web/src/features/next-soup/create-soup-state.ts
@@ -13,6 +13,7 @@ import { SORT_CONFIGS } from '@app/features/next-soup/soup-view/sort-options';
import { isModality } from '@core/mobile/inputModality';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import type { EntityData, WithNotification, WithSearch } from '@entity';
+import type { SoupRowFamily } from '@entity/composed/list-entity/row-geometry';
import { batch, createMemo, createSignal, type JSX } from 'solid-js';
import { createStore, reconcile } from 'solid-js/store';
@@ -32,6 +33,13 @@ export type SoupEntity = WithNotification<EntityData | WithSearch<EntityData>>;
export type GroupHeaderProps = {
group: GroupMeta;
highlighted?: boolean;
+ /** True for the header at the very top of the list (row index 0). */
+ isFirst?: boolean;
+ /**
+ * The geometry family of the rows this header sits among, so it can line its
+ * label up with their content. See SoupRowFamily.
+ */
+ rowFamily?: SoupRowFamily;
};
export type GroupMeta = {
diff --git a/apps/web/src/features/next-soup/soup-view/date-group-header.tsx b/apps/web/src/features/next-soup/soup-view/date-group-header.tsx
new file mode 100644
index 0000000000..2710ffe11a
--- /dev/null
+++ b/apps/web/src/features/next-soup/soup-view/date-group-header.tsx
@@ -0,0 +1,36 @@
+import type { GroupHeaderProps } from '@app/features/next-soup/create-soup-state';
+import { SoupSectionHeader } from '@app/features/next-soup/soup-view/section-header';
+import { SOUP_ROW_CLASS } from '@entity/composed/list-entity/row-geometry';
+import { useListLayout } from '@entity/composed/list-entity/shared';
+import { cn } from '@ui';
+
+export const DateGroupHeader = (props: GroupHeaderProps) => {
+ const listLayout = useListLayout();
+
+ // Take the geometry of the rows this header sits among: `card` has one form,
+ // `row` splits by container width off the same `isWide` its rows read.
+ const geometryClass = () => {
+ if (props.rowFamily === 'card') return SOUP_ROW_CLASS.card;
+ return (listLayout?.isWide() ?? true)
+ ? SOUP_ROW_CLASS.wide
+ : SOUP_ROW_CLASS.narrow;
+ };
+
+ return (
+ <SoupSectionHeader
+ highlighted={props.highlighted}
+ class={cn(
+ // Take the geometry of the rows this header sits among, so the label
+ // starts exactly where their content does — just past the
+ // unread/checkbox gutter — in every soup view.
+ geometryClass(),
+ 'border-none my-0 bg-panel text-ink-extra-muted/80',
+ 'mx-(--soup-row-gutter) w-[calc(100%-2*var(--soup-row-gutter))]',
+ 'pl-[calc(var(--soup-row-content-inset)-var(--soup-row-gutter))]',
+ !props.isFirst && 'pt-5'
+ )}
+ >
+ <span class="truncate">{props.group.label}</span>
+ </SoupSectionHeader>
+ );
+};
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx
index 2a8409e5f2..0e3e31bea0 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx
@@ -618,7 +618,10 @@ export const SoupViewContextProvider: FlowComponent<
// backend date grouping is unreliable, and we'd rather keep paginating the
// single flat list and regenerate buckets from whatever's loaded.
const isClientDateGroup = createMemo(
- () => soup.grouping.activeGroupId() === 'date'
+ () =>
+ soup.grouping.activeGroupId() === 'date' &&
+ // The inbox shouldn't have any date-grouping on mobile/tablet.
+ !(activeListView() === 'inbox' && isTouchDevice())
);
const groupByField = createMemo((): GroupByField | undefined => {
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
index 285482abc2..4729f92ad9 100644
--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx
+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx
@@ -15,6 +15,7 @@ import type { Query } from '@app/features/next-soup/filters/filter-store';
import type { SetPredicatesInput } from '@app/features/next-soup/filters/filter-store/predicates-store';
import { VIEW_TAB_PRESETS } from '@app/features/next-soup/sidebar/soup-filter-presets';
import { useSoup } from '@app/features/next-soup/soup-context';
+import { DateGroupHeader } from '@app/features/next-soup/soup-view/date-group-header';
import { registerDocumentsFilterSplit } from '@app/features/next-soup/soup-view/documents-filter-controllers';
import {
EmptyState,
@@ -46,7 +47,6 @@ import { CompanyKanban } from '@app/features/next-soup/soup-view/views/companies
import { CompanyListEntity } from '@app/features/next-soup/soup-view/views/companies/CompanyListEntity';
import { ResponsiveCompanyListHeader } from '@app/features/next-soup/soup-view/views/companies/CompanyListHeader';
import { CrmDefaultViewLoader } from '@app/features/next-soup/soup-view/views/companies/CrmDefaultView';
-import { DateGroupHeader } from '@app/features/next-soup/soup-view/views/inbox/date-group-header';
import { InboxListEntity } from '@app/features/next-soup/soup-view/views/inbox/InboxListEntity';
import { TaskListEntity } from '@app/features/next-soup/soup-view/views/tasks/TaskListEntity';
import { ResponsiveTaskListHeader } from '@app/features/next-soup/soup-view/views/tasks/TaskListHeader';
@@ -97,6 +97,7 @@ import {
type ProjectEntity,
type SearchLocation,
} from '@entity';
+import type { SoupRowFamily } from '@entity/composed/list-entity/row-geometry';
import SearchIcon from '@icon/macro-magnifying-glass.svg';
import CaretDownIcon from '@phosphor/caret-down.svg';
import ChevronRightIcon from '@phosphor/caret-right.svg';
@@ -210,6 +211,36 @@ const MobileTabLoadingBar = () => (
const SOUP_LIST_STATE_ENTRY_KEY = 'soup.listState';
const DEFAULT_PREVIEW_VIEWS = new Set(['inbox', 'channels']);
+/** The row components a soup view can render. */
+type SoupRowComponent =
+ | typeof ListEntity
+ | typeof InboxListEntity
+ | typeof TaskListEntity
+ | typeof CompanyListEntity;
+
+type SoupRowEntry = {
+ component: SoupRowComponent;
+ /**
+ * The --soup-row-* geometry the component renders with (ListEntity.css).
+ * SoupList stamps it on the list container so group headers can line their
+ * label up with row content.
+ */
+ family: SoupRowFamily;
+};
+
+/**
+ * Per-view row config. A view absent from the table gets DEFAULT_SOUP_ROW.
+ * Adding a row component means adding it here — the entry can't omit its
+ * geometry family, so the two can't drift apart.
+ */
+const SOUP_ROW_BY_VIEW: Partial<Record<ListView, SoupRowEntry>> = {
+ inbox: { component: InboxListEntity, family: 'card' },
+ tasks: { component: TaskListEntity, family: 'row' },
+ companies: { component: CompanyListEntity, family: 'row' },
+};
+
+const DEFAULT_SOUP_ROW: SoupRowEntry = { component: ListEntity, family: 'row' };
+
const CONDENSED_NARROW_LIST_VIEWS: ReadonlySet<ListView> = new Set([
'channels',
]);
@@ -901,14 +932,11 @@ const SoupViewListContent = (props: SoupViewListProps) => {
// Register soup view hotkeys (jump navigation, enter, escape, cmd+k, etc.)
const { applyTabPreset } = useApplyPreset();
- const isInboxView = useIsInboxView();
-
- // The per-row component depends on the active view.
- const listEntityComponent = () => {
- if (currentView() === 'tasks') return TaskListEntity;
- if (currentView() === 'companies') return CompanyListEntity;
- if (isInboxView()) return InboxListEntity;
- return ListEntity;
+ // The row component and its geometry family both come from one per-view
+ // lookup, so the list container can't disagree with the rows it renders.
+ const rowEntry = (): SoupRowEntry => {
+ const view = currentView();
+ return (view && SOUP_ROW_BY_VIEW[view]) ?? DEFAULT_SOUP_ROW;
};
const groupHeaderComponent = () => {
@@ -1427,6 +1455,8 @@ const SoupViewListContent = (props: SoupViewListProps) => {
}
group={group()}
highlighted={row.isFocused()}
+ isFirst={row.index === 0}
+ rowFamily={rowEntry().family}
/>
)}
</Match>
@@ -1499,7 +1529,7 @@ const SoupViewListContent = (props: SoupViewListProps) => {
>
<SoupEntityContextMenu entity={row.original}>
<Dynamic
- component={listEntityComponent()}
+ component={rowEntry().component}
entity={row.original}
timestamp={timestamp()}
highlighted={row.isFocused()}
@@ -1655,6 +1685,7 @@ const SoupList = (props: SoupListProps) => {
createSignal<VirtualizerHandle>();
const overscan = createMemo(() => props.overscan ?? DEFAULT_OVERSCAN);
+
const [topSpacerRef, setTopSpacerRef] = createSignal<HTMLDivElement>();
const topSpacerSize = createElementSize(topSpacerRef);
@@ -1695,8 +1726,11 @@ const SoupList = (props: SoupListProps) => {
return (
<div
ref={props.ref}
+ // `soup-list` scopes the --soup-inbox-* metrics (ListEntity.css) for
+ // everything in the list; the row geometry itself travels with the rows
+ // and the group headers, which each carry their own family class.
class={cn(
- 'unified-table-body w-full flex-1 min-h-0 relative',
+ 'soup-list unified-table-body w-full flex-1 min-h-0 relative',
props.class
)}
>
diff --git a/apps/web/src/features/next-soup/soup-view/views/companies/CompanyListEntity.tsx b/apps/web/src/features/next-soup/soup-view/views/companies/CompanyListEntity.tsx
index d9382b8354..5c94d9fc00 100644
--- a/apps/web/src/features/next-soup/soup-view/views/companies/CompanyListEntity.tsx
+++ b/apps/web/src/features/next-soup/soup-view/views/companies/CompanyListEntity.tsx
@@ -8,6 +8,7 @@ import { isMobile } from '@core/mobile/isMobile';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { createEntityDraggable, Entity, unreadFilterFn } from '@entity';
import { NarrowLayout } from '@entity/composed/list-entity/narrow-layout';
+import { SOUP_ROW_CLASS } from '@entity/composed/list-entity/row-geometry';
import {
type BaseListEntityProps,
type LayoutProps,
@@ -82,9 +83,12 @@ export function CompanyListEntity(props: BaseListEntityProps) {
}}
ref={mergeRefs(props.ref, draggable)}
class={cn(
+ // Carries the --soup-row-* geometry (ListEntity.css) that the narrow
+ // layout below reads for its leading edge.
+ isWide() ? SOUP_ROW_CLASS.wide : SOUP_ROW_CLASS.narrow,
'soup-list-entity @container/entity w-[calc(100%-0.5rem)] mr-1 relative group/narrow flex flex-col py-0.5 rounded-lg',
{
- 'min-h-10 mx-1': !isMobile(),
+ 'min-h-10 mx-(--soup-row-gutter)': !isMobile(),
'bg-list-selected': props.checked,
'bg-list-selected-highlighted':
props.checked && props.highlighted && !isTouchDevice(),
diff --git a/apps/web/src/features/next-soup/soup-view/views/inbox/InboxCard.tsx b/apps/web/src/features/next-soup/soup-view/views/inbox/InboxCard.tsx
index 44136144b3..167c16c961 100644
--- a/apps/web/src/features/next-soup/soup-view/views/inbox/InboxCard.tsx
+++ b/apps/web/src/features/next-soup/soup-view/views/inbox/InboxCard.tsx
@@ -38,15 +38,18 @@ function Root(props: RootProps): JSX.Element {
return (
<div
class={cn(
- // `pl-9` reserves a fixed left column for the select checkbox (rendered
- // by the row wrapper) so content never reflows when it appears on hover.
- 'group/inbox-item relative min-h-16 grid w-full grid-cols-[2rem_minmax(0,1fr)_max-content] grid-rows-[min-content_min-content] items-start gap-x-3 rounded-lg py-2.5 pr-2 pl-9',
+ // The left padding reserves a fixed column for the select checkbox
+ // (rendered by the row wrapper) so content never reflows when it
+ // appears on hover. It comes from the --soup-row-* geometry in
+ // ListEntity.css — which also carries the mobile rail value — so group
+ // headers can line their label up with this card's content.
+ 'group/inbox-item relative min-h-16 grid w-full grid-cols-[2rem_minmax(0,1fr)_max-content] grid-rows-[min-content_min-content] items-start gap-x-3 rounded-lg py-2.5 pr-2 pl-(--soup-row-padding-l)',
// Mobile renders the same cards in slightly different visual
// language: a full-bleed row whose left rail holds the unread dot
// (see the span below) instead of the checkbox gutter, with the
// avatar column centered against the content. The --soup-inbox-*
// vars come from `.soup-list-entity` on the row wrapper.
- 'mobile:rounded-none mobile:grid-cols-[auto_minmax(0,1fr)_max-content] mobile:items-center mobile:content-center mobile:pl-(--soup-inbox-unread) mobile:pr-3',
+ 'mobile:rounded-none mobile:grid-cols-[auto_minmax(0,1fr)_max-content] mobile:items-center mobile:content-center mobile:pr-3',
{
'bg-list-selected': props.selected,
'bg-list-selected-highlighted': props.selected && props.highlighted,
diff --git a/apps/web/src/features/next-soup/soup-view/views/inbox/InboxListEntity.tsx b/apps/web/src/features/next-soup/soup-view/views/inbox/InboxListEntity.tsx
index a53a2d136e..9ae491e122 100644
--- a/apps/web/src/features/next-soup/soup-view/views/inbox/InboxListEntity.tsx
+++ b/apps/web/src/features/next-soup/soup-view/views/inbox/InboxListEntity.tsx
@@ -1,6 +1,7 @@
import { useChannelsContext } from '@core/context/channels';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { MaybeEntityRow, MultiSelectCheckbox, UnreadIndicator } from '@entity';
+import { SOUP_ROW_CLASS } from '@entity/composed/list-entity/row-geometry';
import {
type BaseListEntityProps,
InboxDivider,
@@ -38,7 +39,10 @@ export function InboxListEntity(props: BaseListEntityProps) {
// reads, and opts the row into the shared touch-press highlight. On
// mobile the row is full-bleed with a hairline divider, like
// NarrowInboxLayout.
- class="group/inbox-item soup-list-entity relative mx-2 mobile:mx-0"
+ class={cn(
+ 'group/inbox-item soup-list-entity relative mx-(--soup-row-gutter)',
+ SOUP_ROW_CLASS.card
+ )}
ref={props.ref}
onMouseMove={props.onMouseMove}
>
@@ -50,10 +54,11 @@ export function InboxListEntity(props: BaseListEntityProps) {
onClick={props.onClick}
/>
</MaybeEntityRow>
- <Show when={!props.isLastInGroup}>
+ <Show when={isTouchDevice() && !props.isLastInGroup}>
<InboxDivider />
</Show>
- {/* Select checkbox lives in the gutter reserved by the card's `pl-9`;
+ {/* Select checkbox lives in the gutter the card reserves as its
+ `--soup-row-padding-l` left padding;
mobile has no gutter — the rail shows the unread dot instead. */}
<Show when={!isTouchDevice() && !props.hideCheckbox}>
<div class="group/select-control absolute left-1 top-2.5 z-10 grid size-8 place-items-center">
diff --git a/apps/web/src/features/next-soup/soup-view/views/inbox/date-group-header.tsx b/apps/web/src/features/next-soup/soup-view/views/inbox/date-group-header.tsx
deleted file mode 100644
index 871a48493f..0000000000
--- a/apps/web/src/features/next-soup/soup-view/views/inbox/date-group-header.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { GroupHeaderProps } from '@app/features/next-soup/create-soup-state';
-import { SoupSectionHeader } from '@app/features/next-soup/soup-view/section-header';
-import ChevronRightIcon from '@phosphor/caret-right.svg';
-import { cn, Layer } from '@ui';
-
-export const DateGroupHeader = (
- props: GroupHeaderProps & { highlighted?: boolean }
-) => {
- return (
- <SoupSectionHeader
- onClick={() => props.group.toggle()}
- highlighted={props.highlighted}
- >
- <Layer depth={3}>
- <div class="flex items-center justify-center size-4.5 rounded-xs group-hover/header:bg-ink/5">
- <ChevronRightIcon
- class={cn('size-2.5', {
- 'rotate-90': props.group.isExpanded(),
- })}
- />
- </div>
- </Layer>
-
- <span class="truncate">{props.group.label}</span>
- </SoupSectionHeader>
- );
-};
diff --git a/apps/web/src/features/next-soup/soup-view/views/tasks/TaskListEntity.tsx b/apps/web/src/features/next-soup/soup-view/views/tasks/TaskListEntity.tsx
index d9500d8e20..117758daf1 100644
--- a/apps/web/src/features/next-soup/soup-view/views/tasks/TaskListEntity.tsx
+++ b/apps/web/src/features/next-soup/soup-view/views/tasks/TaskListEntity.tsx
@@ -17,6 +17,7 @@ import {
useIsShared,
} from '@entity';
import { NarrowLayout } from '@entity/composed/list-entity/narrow-layout';
+import { SOUP_ROW_CLASS } from '@entity/composed/list-entity/row-geometry';
import {
type BaseListEntityProps,
hasSearchContentHits,
@@ -145,9 +146,12 @@ export function TaskListEntity(props: TaskListEntityProps) {
}}
ref={mergeRefs(props.ref, draggable)}
class={cn(
+ // Carries the --soup-row-* geometry (ListEntity.css) that the narrow
+ // layout below reads for its leading edge.
+ isWide() ? SOUP_ROW_CLASS.wide : SOUP_ROW_CLASS.narrow,
'soup-list-entity @container/entity w-[calc(100%-0.5rem)] mr-1 relative group/narrow flex flex-col py-0.5 rounded-lg',
{
- 'min-h-10 mx-1': !isMobile(),
+ 'min-h-10 mx-(--soup-row-gutter)': !isMobile(),
'bg-list-selected': props.checked,
'bg-list-selected-highlighted':
props.checked && props.highlighted && !isTouchDevice(),