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.

fix(email): show the sender picture in mobile email rows again (#8262)

teoaa6798d90294
diff --git a/apps/web/src/features/entity/composed/ListEntity.tsx b/apps/web/src/features/entity/composed/ListEntity.tsx
index 71c0aef2d5..cbe264f73a 100644
--- a/apps/web/src/features/entity/composed/ListEntity.tsx
+++ b/apps/web/src/features/entity/composed/ListEntity.tsx
@@ -47,6 +47,7 @@ import {
filterValidNotifications,
} from '../utils/notification';
import { useIsShared } from '../utils/shared';
+import { usesCompactEmailRow } from './list-entity/email-row-layout';
import { NarrowCondensedLayout } from './list-entity/narrow-condensed-layout';
import { NarrowEmailLayout } from './list-entity/narrow-email-layout';
import { NarrowInboxLayout } from './list-entity/narrow-inbox-layout';
@@ -196,13 +197,16 @@ export function ListEntity(props: ListEntityProps) {
const usesCondensedNarrowLayout = () => !isWide() && isCondensedVariant();
const isSingleLineVariant = () =>
listLayout?.narrowLayout() === 'single-line';
- // 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.
+ // Compact email rows 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);
+ usesCompactEmailRow({
+ wide: isWide(),
+ touch: isTouchDevice(),
+ narrowLayout: listLayout?.narrowLayout(),
+ email: isEmailEntity(props.entity),
+ });
const mobileStacks = createMemo(() => {
if (!isTouchDevice()) return [];
@@ -286,14 +290,10 @@ 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. */}
+ {/* Email lists on desktop 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
- }
+ when={isNarrowEmail() && isEmailEntity(props.entity) && props.entity}
>
{(entity) => (
<MaybeEntityRow
diff --git a/apps/web/src/features/entity/composed/list-entity/email-row-layout.test.ts b/apps/web/src/features/entity/composed/list-entity/email-row-layout.test.ts
new file mode 100644
index 0000000000..ecf4b3f8ba
--- /dev/null
+++ b/apps/web/src/features/entity/composed/list-entity/email-row-layout.test.ts
@@ -0,0 +1,34 @@
+import { expect, it } from 'vitest';
+import { usesCompactEmailRow } from './email-row-layout';
+
+const narrowDesktopEmail = {
+ wide: false,
+ touch: false,
+ narrowLayout: 'inbox',
+ email: true,
+} as const;
+
+it('gives a narrow desktop Email list the compact row', () => {
+ expect(usesCompactEmailRow(narrowDesktopEmail)).toBe(true);
+});
+
+it('keeps the touch email row, with the sender picture', () => {
+ expect(usesCompactEmailRow({ ...narrowDesktopEmail, touch: true })).toBe(
+ false
+ );
+});
+
+it('leaves wide lists, other narrow layouts and other entities alone', () => {
+ expect(usesCompactEmailRow({ ...narrowDesktopEmail, wide: true })).toBe(
+ false
+ );
+ expect(
+ usesCompactEmailRow({ ...narrowDesktopEmail, narrowLayout: 'standard' })
+ ).toBe(false);
+ expect(
+ usesCompactEmailRow({ ...narrowDesktopEmail, narrowLayout: undefined })
+ ).toBe(false);
+ expect(usesCompactEmailRow({ ...narrowDesktopEmail, email: false })).toBe(
+ false
+ );
+});
diff --git a/apps/web/src/features/entity/composed/list-entity/email-row-layout.ts b/apps/web/src/features/entity/composed/list-entity/email-row-layout.ts
new file mode 100644
index 0000000000..94395970b6
--- /dev/null
+++ b/apps/web/src/features/entity/composed/list-entity/email-row-layout.ts
@@ -0,0 +1,15 @@
+import type { NarrowLayoutVariant } from './shared';
+
+/**
+ * Whether an email row uses the compact stacked layout: a narrow desktop list
+ * in the `inbox` layout, such as Email beside its reading pane. Touch devices
+ * keep their own email rows, with the sender's picture.
+ */
+export function usesCompactEmailRow(row: {
+ wide: boolean;
+ touch: boolean;
+ narrowLayout: NarrowLayoutVariant | undefined;
+ email: boolean;
+}): boolean {
+ return !row.wide && !row.touch && row.narrowLayout === 'inbox' && row.email;
+}
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.tsx
index e5e05d8d47..d905b33cd4 100644
--- 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.tsx
@@ -9,10 +9,11 @@ import { RowEnd } from './row-end';
import { InboxDivider, type LayoutProps } from './shared';
/**
- * An email row stacked for narrow lists (phones, the reading pane's list):
+ * An email row stacked for narrow desktop lists (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.
+ * every email row, so the text keeps the width. Narrow lists on touch devices
+ * (phones) use `NarrowInboxLayout`, with the sender's picture.
*/
export function NarrowEmailLayout(
props: LayoutProps & { entity: EmailEntity }
diff --git a/apps/web/src/features/entity/composed/list-entity/shared.tsx b/apps/web/src/features/entity/composed/list-entity/shared.tsx
index 70a62fc99a..91f4fc53bd 100644
--- a/apps/web/src/features/entity/composed/list-entity/shared.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/shared.tsx
@@ -108,9 +108,10 @@ export interface LayoutProps {
}
/**
- * How rows render once the list is too narrow for columns. `inbox` stacks
- * email rows (sender, subject, snippet) as touch devices do, for lists that
- * sit beside a reading pane.
+ * How rows render once the list is too narrow for columns. `inbox` gives
+ * email rows the compact stacked layout (sender, subject, snippet) on desktop,
+ * for lists that sit beside a reading pane; touch devices keep their own email
+ * rows, with the sender's picture.
*/
export type NarrowLayoutVariant =
| 'standard'
diff --git a/docs/agent-guide/email.md b/docs/agent-guide/email.md
index c3d6d4fed6..0781de931e 100644
--- a/docs/agent-guide/email.md
+++ b/docs/agent-guide/email.md
@@ -264,10 +264,11 @@ 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.
+keyboard back to the list without closing the thread. Narrow email rows here
+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. Phones keep
+their own touch email rows, with the sender's picture on the left.
Without room for both (narrow split, collapsed window) the pane folds away and
a thread replaces the list as usual; the thread remounts, but a reply draft
survives. The divider can be dragged; the list width is remembered. Verify that