#10

Polish mail browsing and sending surfaces

MergedstylesshOwnermerged intofrom

Summary

  • group nearby messages from the same sender and give sender changes clearer separation
  • add folder counts, focused search with highlighted matches, clearer filters and sorting, reply labels, and a send-now action
  • replace each inbox row's date with its quick actions on hover or keyboard focus without shifting the row layout
  • contain queued-message live regions so sending a reply cannot create document-level scrolling outside the app shell
  • give the list-level pending-send banner breathing room and a tokenized translucent glass surface
  • replace duotone icons with Hugeicons and add geometry-matched skeletons for folders, conversations, domain setup, and pagination
  • refine reply and standalone composer transitions, elevation, alignment, and subject focus
  • add a responsive conversation toolbar with reply actions, overflow options, and previous/next navigation
  • add deterministic, animated Blobatar avatars with borderless, edge-filling crops

Validation

  • pnpm test (19 tests passed)
  • pnpm exec tsc --noEmit
  • ESLint on every changed TypeScript and JavaScript file
  • pnpm build
  • git diff --check origin/main...HEAD
  • browser QA at 1440x900 and narrow mobile widths, including search focus, filters, highlighted matches, message grouping, date-slot action replacement, keyboard action access, reduced-motion loading states, responsive overflow, pagination focus retention, reply-mode transitions, post-send scroll containment, pending-banner glass and spacing, composer focus and alignment, live unread counts, borderless Blobatar crops, conversation-menu keyboard behavior, copy feedback, and previous/next navigation

Known repository lint

pnpm lint still reports three pre-existing errors outside this branch in babel.config.js, postcss.config.js, and components/shell/login-screen.tsx. The changed-file lint passes.

Activity

19
mikeyreviewed3mo ago
mikey3mo ago

Review summary

Reviewed the full diff (24 files, +1323/-527) plus the server-side code paths it depends on: session/auth handling for the new folder counts and "send now" flows, the search-highlighting implementation, and message-grouping logic.

No blocking correctness or security issues found. Specifically verified:

  • loadFolderCounts (lib/mail/server.ts) is gated behind requireSessionUser() and derives its provider from that user, matching the existing loadDomains pattern — no cross-account leakage.
  • "Send now" (lib/mail/use-pending-send.ts) reuses the existing /api/mail/send route, which already enforces session auth; no new server action or auth surface was introduced. The synchronous forget(item.id) at the start of deliver() prevents a manual send and the pending auto-send timer from double-firing.
  • Search-match highlighting (components/mail/thread-list.tsx, HighlightedText) does plain indexOf string matching, not RegExp construction from user input, so there's no ReDoS/crash risk from special characters in the search query.
  • Folder counts are computed over the full matching set server-side before the { limit: 1 } fetch, so badges reflect true totals rather than being an artifact of the 1-item probe (covered by lib/mail/folder-counts.test.mjs).

Non-blocking follow-ups (inline)

Two related staleness issues, both about the sidebar folderCounts prop being fetched once per layout mount and not invalidated by later client-side actions — left as inline comments on the two concrete trigger points (compose-then-navigate-to-Sent, and mark-read/unread). Neither is a regression that breaks anything, just a badge that can go stale until the next full layout refresh/navigation.

Also worth a follow-up (not blocking, no inline anchor): neither sendNow nor the new HighlightedText highlighting logic has dedicated test coverage, unlike the new folder-counts.test.mjs and message-grouping.test.mjs. HighlightedText's toLocaleLowerCase()-based matching could theoretically misalign highlight offsets for locale-sensitive case folding where lowercased length differs from original length (e.g. Turkish İ) — low real-world impact but easy to pin with a unit test given this repo's existing *.test.mjs conventions.

stylessh merged commit bf4730a into main3mo ago

Branch stylessh/improve-mail-surfaces has been merged.

Checking branch