Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(email): compact stacked rows for narrow email lists (#8242)
teo54d6af686f7c
diff --git a/apps/web/src/features/entity/composed/ListEntity.tsx b/apps/web/src/features/entity/composed/ListEntity.tsxindex 71f395d10c..71c0aef2d5 100644--- a/apps/web/src/features/entity/composed/ListEntity.tsx+++ b/apps/web/src/features/entity/composed/ListEntity.tsx@@ -48,6 +48,7 @@ import {} from '../utils/notification';import { useIsShared } from '../utils/shared';import { NarrowCondensedLayout } from './list-entity/narrow-condensed-layout';+import { NarrowEmailLayout } from './list-entity/narrow-email-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';@@ -195,8 +196,13 @@ export function ListEntity(props: ListEntityProps) {const usesCondensedNarrowLayout = () => !isWide() && isCondensedVariant();const isSingleLineVariant = () =>listLayout?.narrowLayout() === 'single-line';- const stacksNarrowEmail = () =>- isTouchDevice() || listLayout?.narrowLayout() === 'inbox';+ // Compact email rows (a narrow Email list, beside the reading pane) span the+ // list edge to edge like a mail client's, so the highlight is a full-bleed+ // band and the open row's accent bar runs its whole height.+ const isNarrowEmail = () =>+ !isWide() &&+ listLayout?.narrowLayout() === 'inbox' &&+ isEmailEntity(props.entity);const mobileStacks = createMemo(() => {if (!isTouchDevice()) return [];@@ -229,15 +235,18 @@ export function ListEntity(props: ListEntityProps) {// 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-xl @container/entity w-[calc(100%-0.5rem)] mr-1 relative group/narrow flex flex-col py-0.5',+ 'soup-list-entity @container/entity relative group/narrow flex flex-col py-0.5',+ isNarrowEmail()+ ? // The gutter moves inside, so text still lines up with the headers.+ 'w-full px-(--soup-row-gutter)'+ : 'rounded-xl w-[calc(100%-0.5rem)] mr-1',// Keep avatar-group separators in sync with the row background so they// blend into it instead of creating visible rings.'[--avatar-group-separator:var(--color-panel)]',{- 'min-h-10 mx-(--soup-row-gutter)':- !isMobile() && !usesCondensedNarrowLayout(),- 'min-h-9 mx-(--soup-row-gutter)':- !isMobile() && usesCondensedNarrowLayout(),+ 'min-h-10': !isMobile() && !usesCondensedNarrowLayout(),+ 'min-h-9': !isMobile() && usesCondensedNarrowLayout(),+ 'mx-(--soup-row-gutter)': !isMobile() && !isNarrowEmail(),'bg-list-selected [--avatar-group-separator:var(--color-list-selected)]':props.checked,'bg-list-selected-highlighted [--avatar-group-separator:var(--color-list-selected-highlighted)]':@@ -248,8 +257,11 @@ export function ListEntity(props: ListEntityProps) {!props.highlighted && !props.checked && !isTouchDevice(),'focus-within:bg-list-hover focus-within:[--avatar-group-separator:var(--color-list-hover)]':!!rowActions() && !props.highlighted && !props.checked,- 'before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-accent':+ 'before:absolute before:left-0 before:w-0.5 before:bg-accent':props.current,+ 'before:inset-y-2 before:rounded-full':+ props.current && !isNarrowEmail(),+ 'before:inset-y-0': props.current && isNarrowEmail(),})}aria-current={props.current ? 'true' : undefined}@@ -274,6 +286,24 @@ export function ListEntity(props: ListEntityProps) {<NarrowSingleLineLayout {...layoutProps()} /></MaybeEntityRow></Match>+ {/* Email lists stack their rows compactly; mixed lists keep the+ per-type icon that tells their rows apart. */}+ <Match+ when={+ listLayout?.narrowLayout() === 'inbox' &&+ isEmailEntity(props.entity) &&+ props.entity+ }+ >+ {(entity) => (+ <MaybeEntityRow+ entityId={props.entity.id}+ config={props.entityRowConfig}+ >+ <NarrowEmailLayout {...layoutProps()} entity={entity()} />+ </MaybeEntityRow>+ )}+ </Match><Match when={isTouchDevice() && mobileStacks().length > 0}><Entity.Notification.MobileStackRowsstacks={mobileStacks()}@@ -284,10 +314,10 @@ export function ListEntity(props: ListEntityProps) {</Match><Matchwhen={- (isTouchDevice() &&- ((isChannelEntity(props.entity) && !isCondensedVariant()) ||- props.showUnrollNotifications)) ||- (stacksNarrowEmail() && isEmailEntity(props.entity))+ isTouchDevice() &&+ ((isChannelEntity(props.entity) && !isCondensedVariant()) ||+ props.showUnrollNotifications ||+ isEmailEntity(props.entity))}><MaybeEntityRowdiff --git a/apps/web/src/features/entity/composed/list-entity/email.tsx b/apps/web/src/features/entity/composed/list-entity/email.tsxindex 98403d789e..2afe72ffdd 100644--- a/apps/web/src/features/entity/composed/list-entity/email.tsx+++ b/apps/web/src/features/entity/composed/list-entity/email.tsx@@ -117,6 +117,28 @@ export function EmailNarrowBody(props: {);}+/** The narrow email row's one-line preview. */+export function EmailNarrowSnippet(props: {+ entity: EmailEntity;+ chars: number;+ showHitSnippet: boolean;+ setContainerRef: (el: HTMLElement) => void;+}) {+ return (+ <Entity.Slot+ placement="body"+ ref={props.setContainerRef}+ class="ph-no-capture min-w-0 truncate pr-3 pb-2.5 text-ink/50"+ >+ <EmailSnippet+ entity={props.entity}+ showHitSnippet={props.showHitSnippet}+ chars={props.chars}+ />+ </Entity.Slot>+ );+}+export function EmailWideContent(props: {entity: EmailEntity;chars: number;diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-email-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-email-layout.tsxnew file mode 100644index 0000000000..e5e05d8d47--- /dev/null+++ b/apps/web/src/features/entity/composed/list-entity/narrow-email-layout.tsx@@ -0,0 +1,107 @@+import { cn } from '@ui';+import { Show } from 'solid-js';+import { MultiSelectCheckbox } from '../../components/MultiSelectCheckbox';+import { UnreadIndicator } from '../../components/UnreadIndicator';+import { Entity } from '../../entity';+import type { EmailEntity } from '../../types/entity';+import { EmailIdentity, EmailInboxChip, EmailNarrowSnippet } from './email';+import { RowEnd } from './row-end';+import { InboxDivider, type LayoutProps } from './shared';++/**+ * An email row stacked for narrow lists (phones, the reading pane's list):+ * senders and date, then subject, then one line of preview. The unread dot+ * sits in a slim gutter instead of a per-type icon, which is the same on+ * every email row, so the text keeps the width.+ */+export function NarrowEmailLayout(+ props: LayoutProps & { entity: EmailEntity }+) {+ const weight = () => (props.unread ? 'font-semibold' : 'font-normal');++ return (+ <Entity.Layout+ class="grid w-full text-sm"+ style={{+ 'grid-template-columns': 'var(--soup-inbox-unread) 1fr auto',+ 'grid-template-areas':+ '"icon title timestamp" ". subject subject" ". body body"',+ // The divider starts at the text, with no icon column before it.+ '--soup-inbox-left-of-content': 'var(--soup-inbox-unread)',+ }}+ >+ <Entity.Slot+ placement="icon"+ class="group/check grid place-items-center self-center pt-2.5"+ >+ <Show+ when={!props.hideCheckbox && props.checked}+ fallback={+ <>+ <UnreadIndicator+ class={cn(+ '[grid-area:1/1] size-2',+ !props.hideCheckbox && 'not-touch:group-hover/check:hidden'+ )}+ active={props.unread}+ />+ <Show when={!props.hideCheckbox}>+ <div class="[grid-area:1/1] hidden not-touch:group-hover/check:block">+ <MultiSelectCheckbox+ checked={props.checked}+ onChecked={props.onChecked}+ />+ </div>+ </Show>+ </>+ }+ >+ <MultiSelectCheckbox+ checked={props.checked}+ onChecked={props.onChecked}+ />+ </Show>+ </Entity.Slot>++ <Entity.Slot+ placement="title"+ class={cn(+ 'ph-no-capture flex min-w-0 items-center gap-2 pt-2.5 text-ink',+ weight()+ )}+ >+ <EmailIdentity entity={props.entity} />+ <EmailInboxChip entity={props.entity} class="ml-auto" />+ </Entity.Slot>++ <Entity.Slot+ placement="timestamp"+ class="flex items-center justify-end pt-2.5 pr-3 pl-2 text-xs text-ink-extra-muted"+ >+ <RowEnd actions={props.actions} leadingAction={props.leadingAction}>+ <span class="flex items-center gap-1">+ {props.scheduleStatus}+ <Show when={!props.hasNotifications}>+ <Entity.Timestamp entity={props.entity} />+ </Show>+ </span>+ </RowEnd>+ </Entity.Slot>++ <Entity.Slot+ placement="subject"+ class={cn('ph-no-capture min-w-0 truncate pr-3 text-ink', weight())}+ >+ <Entity.Title entity={props.entity} />+ </Entity.Slot>++ <EmailNarrowSnippet+ entity={props.entity}+ chars={props.chars}+ showHitSnippet={props.showHitSnippet}+ setContainerRef={props.setSnippetContainerRef}+ />+ <InboxDivider />+ </Entity.Layout>+ );+}diff --git a/docs/agent-guide/email.md b/docs/agent-guide/email.mdindex d5ebeef57a..c3d6d4fed6 100644--- a/docs/agent-guide/email.md+++ b/docs/agent-guide/email.md@@ -256,14 +256,18 @@ pane follows it (replacing history rather than adding entries) while the listkeeps focus, even if the thread is still loading; Mark done onthe open row follows the next row (an action on another row, such as the oneunder the pointer, leaves the pane alone), and the open row keeps an accent-marker while the pointer highlights others. Enter or a click opens the row and-moves the keyboard into the reader, as does any click inside the reader. Its-keys live in a child hotkey scope so they never replace the list's, and while-it has the keyboard the list's keys stand down, so `x`, `Cmd+A`, `End` or-`Shift+Enter` in the reader never act on the list. j/k in the reader step-threads and move the list cursor with them, replacing history. Escape in the-reader, once there is nothing to unwind, hands the keyboard back to the list-without closing the thread. Narrow rows stack sender, subject and snippet.+marker while the pointer highlights others. Rows there are full-bleed bands, not+rounded insets, and the open row's accent bar runs the row's full height. Enter+or a click opens the row and moves the keyboard into the reader, as does any+click inside the reader. Its keys live in a child hotkey scope so they never+replace the list's, and while it has the keyboard the list's keys stand down,+so `x`, `Cmd+A`, `End` or `Shift+Enter` in the reader never act on the list.+j/k in the reader step threads and move the list cursor with them, replacing+history. Escape in the reader, once there is nothing to unwind, hands the+keyboard back to the list without closing the thread. Narrow email rows, here+and on phones, stack senders and date, subject, and one preview line beside a+slim unread-dot gutter (no per-type icon); unread rows are bold, hovering swaps+the date for the row actions, and hovering the gutter shows the select checkbox.Without room for both (narrow split, collapsed window) the pane folds away anda thread replaces the list as usual; the thread remounts, but a reply draftsurvives. The divider can be dragged; the list width is remembered. Verify that