#130 ui light mobile: native-first Communication & Triage

Keyboard-First Inbox Triage

Split-pane email triage built for J/K navigation, single-key Archive/Snooze/Reply, undo toasts, and mobile action bars.

Inspired by Shortwave ↗

Download .html
Fullscreen ↗

WHY THIS AESTHETIC IS UNIQUE

Combines zero-mouse desktop triage velocity (J/K, E, S, U, R, Z) with an unmistakable mobile list-to-reader drill-down where primary actions stay visible at thumb reach.

BEST FOR

Email and support ticket queuesModeration and approval inboxesRecruiting applicant triage toolsCustomer feedback and bug triage streams

TAGS

COLOR PALETTE (CLICK TO COPY HEX)

TYPOGRAPHY

Display
Inter
Body
Inter
Mono
JetBrains Mono
Scale
20px message subject, 15px/1.7 readable message prose, 14px bold unread senders, 11px mono shortcut keycaps.

Google Fonts Stylesheet ↗

ARCHITECTURE & MOBILE NOTES

LAYOUT

380px message list + fluid split preview reader on desktop with persistent bottom shortcut HUD; full-screen list/reader toggle below 820px.

INTERACTION

J/K advances selection, E archives, S snoozes, U toggles unread, R opens inline quick reply, and Z triggers instant undo from the floating toast.

MOBILE

Hides keyboard shortcut hints on mobile, promotes the action bar with >=40px tap targets to the top of the reader, and auto-returns to the list after Archive/Snooze.

AI AGENT GUARDRAILS

DO

  • Always guard single-letter keyboard shortcuts when focus is inside an input or textarea.
  • Auto-advance selection to the next item after Archive or Snooze and provide an Undo toast.
  • Expose every keyboard action as a visible button so touch users have 100% feature parity.

DON'T

  • Never require hidden swipe gestures as the only way to archive or snooze on mobile.
  • Avoid triggering destructive deletions without a one-click Undo window.
STANDALONE SOURCE · demos/keyboard-inbox-triage.html (16.1 KB)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Keyboard-First Inbox Triage — Fastmail-Inspired Pattern</title>
<style>
  :root {
    --canvas: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #eef2f9;
    --border: #dde3ee;
    --ink: #161f33;
    --muted: #5d6a82;
    --accent: #2457d6;
    --accent-soft: rgba(36,87,214,0.1);
    --amber: #d97706;
    --emerald: #059669;
    --rose: #dc2626;
    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; background: var(--canvas); color: var(--ink); font-family: var(--font); overflow-x: hidden; }
  .app { display: flex; flex-direction: column; height: 100vh; min-height: 560px; }
  .topbar {
    min-height: 56px;
    padding: 8px 16px;
    background: #16223d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; }
  .count-pill { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,0.15); }
  .tabs { display: flex; gap: 6px; }
  .tab {
    min-height: 36px; padding: 0 12px; border-radius: 8px; border: none;
    background: transparent; color: rgba(255,255,255,0.72); font: 600 13px var(--font); cursor: pointer;
  }
  .tab.active { background: rgba(255,255,255,0.16); color: #fff; }

  .split { flex: 1; display: grid; grid-template-columns: 380px 1fr; min-height: 0; }
  .list-pane { border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
  .msg-row {
    width: 100%;
    text-align: left;
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    background: var(--surface);
    cursor: pointer;
    display: grid;
    gap: 4px;
    font-family: var(--font);
  }
  .msg-row:hover { background: #f8faff; }
  .msg-row.selected { background: var(--accent-soft); border-left-color: var(--accent); }
  .msg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .sender { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
  .msg-row.read .dot { opacity: 0; }
  .msg-row.read .sender, .msg-row.read .subject { font-weight: 500; color: var(--muted); }
  .time { font: 500 11px var(--mono); color: var(--muted); }
  .subject { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .snippet { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .reader-pane { display: flex; flex-direction: column; min-width: 0; background: var(--canvas); }
  .action-bar {
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .act-btn {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font: 600 13px var(--font);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .act-btn:hover { border-color: var(--accent); color: var(--accent); }
  .act-btn.archive:hover { border-color: var(--emerald); color: var(--emerald); }
  .act-btn.snooze:hover { border-color: var(--amber); color: var(--amber); }
  .act-btn.danger:hover { border-color: var(--rose); color: var(--rose); }
  .mobile-back { display: none; }
  kbd {
    font: 600 11px var(--mono);
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
  }
  .reader-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
  .mail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    max-width: 760px;
  }
  .mail-subject { font-size: 20px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
  .mail-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
  .mail-text { font-size: 15px; line-height: 1.7; color: #263147; white-space: pre-line; }
  .reply-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: none;
  }
  .reply-box.open { display: block; }
  .reply-box textarea {
    width: 100%; min-height: 86px; padding: 12px; border-radius: 10px;
    border: 1px solid var(--border); font: 14px var(--font); color: var(--ink); margin-bottom: 10px;
  }
  .shortcut-hud {
    padding: 8px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
  }
  .toast {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    background: #16223d; color: #fff; padding: 10px 16px; border-radius: 10px;
    display: none; align-items: center; gap: 12px; font-size: 13px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28); z-index: 50;
  }
  .toast.show { display: flex; }
  .toast button {
    min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
    background: transparent; color: #93c5fd; font: 600 12px var(--font); cursor: pointer;
  }

  @media (max-width: 820px) {
    .split { display: block; position: relative; }
    .list-pane, .reader-pane { position: absolute; inset: 0; border-right: none; }
    .app[data-mobile="list"] .reader-pane { display: none; }
    .app[data-mobile="reader"] .list-pane { display: none; }
    .mobile-back { display: inline-flex; }
    .reader-body { padding: 14px; }
    .mail-card { padding: 16px; }
    .shortcut-hud { display: none; }
    kbd { display: none; }
  }
</style>
</head>
<body>
<div class="app" id="app" data-mobile="list">
  <header class="topbar">
    <div class="brand">
      <span>⚡ Fastmail-Style Triage</span>
      <span class="count-pill" id="inboxCount">6</span>
    </div>
    <div class="tabs" id="folderTabs">
      <button class="tab active" data-folder="inbox" type="button">Inbox</button>
      <button class="tab" data-folder="snoozed" type="button">Snoozed</button>
      <button class="tab" data-folder="archived" type="button">Archived</button>
    </div>
  </header>

  <div class="split">
    <aside class="list-pane" id="listPane" aria-label="Message list"></aside>
    <main class="reader-pane" aria-label="Message preview">
      <div class="action-bar">
        <button class="act-btn mobile-back" id="backBtn" type="button">← Inbox</button>
        <button class="act-btn archive" id="btnArchive" type="button">Archive <kbd>E</kbd></button>
        <button class="act-btn snooze" id="btnSnooze" type="button">Snooze <kbd>S</kbd></button>
        <button class="act-btn" id="btnUnread" type="button">Unread <kbd>U</kbd></button>
        <button class="act-btn" id="btnReply" type="button">Reply <kbd>R</kbd></button>
      </div>
      <div class="reader-body" id="readerBody"></div>
    </main>
  </div>

  <footer class="shortcut-hud">
    <span><kbd>J</kbd> / <kbd>K</kbd> Next / Prev</span>
    <span><kbd>E</kbd> Archive</span>
    <span><kbd>S</kbd> Snooze 3h</span>
    <span><kbd>U</kbd> Toggle Unread</span>
    <span><kbd>R</kbd> Quick Reply</span>
    <span><kbd>Z</kbd> Undo</span>
  </footer>
</div>

<div class="toast" id="toast" role="status">
  <span id="toastText"></span>
  <button id="undoBtn" type="button">Undo (Z)</button>
</div>

<script>
const MESSAGES = [
  { id: 'm1', folder: 'inbox', unread: true, sender: 'Elena Rostova', email: 'elena@foundry.design', time: '09:42', subject: 'Final sign-off on responsive typography tokens', body: 'Hi team,\n\nWe finished auditing the 390px and 1280px breakpoints across the workspace templates. All touch targets meet the 44px minimum and the new tabular numeral scale prevents layout jitter in financial tables.\n\nCan we merge branch feat/tokens-v3 before noon?\n\nBest,\nElena' },
  { id: 'm2', folder: 'inbox', unread: true, sender: 'Stripe Billing', email: 'receipts@stripe.com', time: '09:15', subject: 'Invoice #INV-9042 paid — Edge Compute Cluster', body: 'Payment of $420.00 USD for Edge Compute Cluster (us-east + eu-central) has been processed successfully.\n\nYour next billing cycle begins on January 1.' },
  { id: 'm3', folder: 'inbox', unread: false, sender: 'Marcus Chen', email: 'marcus@infra.dev', time: '08:50', subject: 'P95 API latency dropped to 38ms after Brotli switch', body: 'Quick update from last night\'s deploy:\n\nSwitching static HTML demos to pre-compressed Brotli cut median transfer size by 64% and brought P95 TTFB down to 38ms globally. No elevated error rates observed.' },
  { id: 'm4', folder: 'inbox', unread: true, sender: 'Priya Nair', email: 'priya@research.co', time: 'Yesterday', subject: 'User test highlights: Keyboard triage vs. swipe gestures', body: '14 of 16 power-user participants immediately tried J/K and E on desktop, while 100% of mobile testers used the top action bar rather than hidden swipe gestures.\n\nRecommendation: keep primary triage actions explicitly visible on mobile detail view.' },
  { id: 'm5', folder: 'inbox', unread: false, sender: 'GitHub Security', email: 'noreply@github.com', time: 'Yesterday', subject: 'Zero high-severity advisories in weekly dependency scan', body: 'Your repository passed the automated dependency audit with 0 critical or high advisories across 42 packages.' },
  { id: 'm6', folder: 'inbox', unread: false, sender: 'Tomasz Zielinski', email: 'tomasz@typecraft.eu', time: 'Dec 03', subject: 'Updated variable serif subset (18 KB WOFF2)', body: 'Attached is the Latin-subset variable font build. We trimmed unused alternates so first contentful paint stays under 180ms on 4G connections.' }
];

let folder = 'inbox';
let selectedId = 'm1';
let lastUndo = null;
let replyOpen = false;

const app = document.getElementById('app');
const listPane = document.getElementById('listPane');
const readerBody = document.getElementById('readerBody');
const inboxCount = document.getElementById('inboxCount');
const toast = document.getElementById('toast');
const toastText = document.getElementById('toastText');

function visibleMessages() { return MESSAGES.filter(m => m.folder === folder); }

function showToast(text, undoFn) {
  toastText.textContent = text;
  lastUndo = undoFn;
  toast.classList.add('show');
  clearTimeout(showToast._t);
  showToast._t = setTimeout(() => toast.classList.remove('show'), 4500);
}

function render() {
  const inboxItems = MESSAGES.filter(m => m.folder === 'inbox');
  inboxCount.textContent = inboxItems.length;

  const list = visibleMessages();
  if (!list.find(m => m.id === selectedId)) selectedId = list[0]?.id || null;

  listPane.innerHTML = list.length ? list.map(m => `
    <button type="button" class="msg-row ${m.id === selectedId ? 'selected' : ''} ${m.unread ? '' : 'read'}" data-id="${m.id}">
      <div class="msg-top">
        <span class="sender"><span class="dot"></span>${m.sender}</span>
        <span class="time">${m.time}</span>
      </div>
      <div class="subject">${m.subject}</div>
      <div class="snippet">${m.body.replace(/\n+/g, ' ')}</div>
    </button>
  `).join('') : `<div style="padding:48px 20px;text-align:center;color:var(--muted);">
    <div style="font-size:28px;margin-bottom:8px;">✨</div>
    <div style="font-weight:600;color:var(--ink);margin-bottom:4px;">Inbox Zero in ${folder}</div>
    <div style="font-size:13px;">Press Z to undo or switch folders above.</div>
  </div>`;

  listPane.querySelectorAll('.msg-row').forEach(btn => {
    btn.addEventListener('click', () => {
      selectedId = btn.dataset.id;
      const msg = MESSAGES.find(m => m.id === selectedId);
      if (msg) msg.unread = false;
      replyOpen = false;
      render();
      if (window.innerWidth <= 820) app.dataset.mobile = 'reader';
    });
  });

  const cur = list.find(m => m.id === selectedId);
  if (!cur) {
    readerBody.innerHTML = `<div style="padding:48px 20px;text-align:center;color:var(--muted);">No message selected.</div>`;
    return;
  }

  readerBody.innerHTML = `
    <article class="mail-card">
      <h1 class="mail-subject">${cur.subject}</h1>
      <div class="mail-meta">
        <span><strong>${cur.sender}</strong> &lt;${cur.email}&gt;</span>
        <span>${cur.time} · ${cur.folder}</span>
      </div>
      <div class="mail-text">${cur.body}</div>
      <div class="reply-box ${replyOpen ? 'open' : ''}" id="replyBox">
        <textarea id="replyText" placeholder="Write a quick reply to ${cur.sender}..."></textarea>
        <button class="act-btn" id="sendReplyBtn" type="button" style="background:var(--accent);color:#fff;border-color:var(--accent);">Send Reply</button>
      </div>
    </article>
  `;

  if (replyOpen) {
    const ta = document.getElementById('replyText');
    ta?.focus();
    document.getElementById('sendReplyBtn')?.addEventListener('click', () => {
      const txt = ta.value.trim();
      if (!txt) return;
      cur.body += `\n\n--- You replied just now ---\n${txt}`;
      replyOpen = false;
      render();
      showToast(`Reply sent to ${cur.sender}`, null);
    });
  }
}

function moveSelected(targetFolder, label) {
  const list = visibleMessages();
  const idx = list.findIndex(m => m.id === selectedId);
  const msg = list[idx];
  if (!msg) return;
  const prevFolder = msg.folder;
  msg.folder = targetFolder;
  const nextList = visibleMessages();
  selectedId = nextList[Math.min(idx, nextList.length - 1)]?.id || null;
  replyOpen = false;
  if (window.innerWidth <= 820) app.dataset.mobile = 'list';
  render();
  showToast(`${label}: "${msg.subject.slice(0, 32)}…"`, () => {
    msg.folder = prevFolder;
    selectedId = msg.id;
    render();
  });
}

function toggleUnread() {
  const msg = MESSAGES.find(m => m.id === selectedId);
  if (!msg) return;
  msg.unread = !msg.unread;
  render();
  showToast(msg.unread ? 'Marked as unread' : 'Marked as read', () => { msg.unread = !msg.unread; render(); });
}

document.getElementById('btnArchive').addEventListener('click', () => moveSelected('archived', 'Archived'));
document.getElementById('btnSnooze').addEventListener('click', () => moveSelected('snoozed', 'Snoozed 3h'));
document.getElementById('btnUnread').addEventListener('click', toggleUnread);
document.getElementById('btnReply').addEventListener('click', () => { replyOpen = !replyOpen; render(); });
document.getElementById('backBtn').addEventListener('click', () => { app.dataset.mobile = 'list'; });
document.getElementById('undoBtn').addEventListener('click', () => { if (lastUndo) { lastUndo(); toast.classList.remove('show'); lastUndo = null; } });

document.getElementById('folderTabs').addEventListener('click', e => {
  const btn = e.target.closest('.tab');
  if (!btn) return;
  folder = btn.dataset.folder;
  document.querySelectorAll('.tab').forEach(t => t.classList.toggle('active', t === btn));
  replyOpen = false;
  app.dataset.mobile = 'list';
  render();
});

window.addEventListener('keydown', e => {
  if (['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName)) return;
  const k = e.key.toLowerCase();
  const list = visibleMessages();
  const idx = list.findIndex(m => m.id === selectedId);
  if (k === 'j' && list.length) {
    selectedId = list[Math.min(list.length - 1, idx + 1)].id;
    render();
  } else if (k === 'k' && list.length) {
    selectedId = list[Math.max(0, idx - 1)].id;
    render();
  } else if (k === 'e') {
    moveSelected('archived', 'Archived');
  } else if (k === 's') {
    moveSelected('snoozed', 'Snoozed 3h');
  } else if (k === 'u') {
    toggleUnread();
  } else if (k === 'r') {
    e.preventDefault();
    replyOpen = true;
    render();
  } else if (k === 'z' && lastUndo) {
    lastUndo();
    toast.classList.remove('show');
    lastUndo = null;
  }
});

render();
</script>
</body>
</html>