Olddevs UI4.14.0

Mail

A three-pane mail client: folders, a message list and a message; j/k and e keyboard shortcuts, a reply in the Editor with “@” mentions.

Open full screen

What it is built from

Try it

  • J and K move to the next and previous message; E archives (in other folders it moves the message back to the inbox); X selects a message; # moves it to the trash.
  • R replies: the Editor opens under the thread. Type “@” and a list of teammates opens at the caret: start typing a name and press Enter to insert the mention. The “@” button on the Toolbar and the mention item of the Slash menu (opened with “/”) do the same. ⌘ Enter sends the reply.
  • Select several messages with the checkboxes to bring up the batch action bar. Hover a sender's name for a contact card.
  • ? opens the keyboard shortcuts dialog. Narrow the window: the panes show one at a time, and the message gets an arrow button labeled “Back to Inbox”.

How it is built

Keyboard shortcuts are the Gallery screen's job. The kit binds no global keyboard shortcuts: ShortcutsHelp opens through its open prop, and a keydown listener on the window lives in the Gallery screen itself. Single-key shortcuts are ignored while focus is in a field or in the Editor (which is a contenteditable element, so that is the element to check); otherwise an “e” typed into a reply would archive the message. The selection checkbox is an input too, but isTyping does not count it as typing, so “j” and “k” keep working after a click on it.

The list and the message are a SplitPanel, but only on a wide window. The panel splits the area into a list and details with a draggable handle, but it has no responsive mode: on a narrow window the Gallery screen decides what to show and renders one pane at a time, the list or the message with a button back to the list. The standard useMediaQuery("(min-width: 1024px)") hook, the lg breakpoint, tells it the width; before hydration it answers “narrow”, so the server's first frame matches the phone layout. AppShell scrolls the document, not <main>, so the two panes with independent scrolling get a height from the Gallery screen: the window minus the header (--topbar-h, which TopBar publishes).

List rows are buttons, not a GridList. A row has two interactive elements: the button that opens the message and the selection checkbox beside it. Interactive content does not belong inside a row of a react-aria GridList, so the row is built from a plain <ul>. SelectionBar renders only when the count is non-zero; on a phone it sticks under the header, and inside the pane's own scrolling area it does not (sticky={false}).

The reply is a RichTextEditor with the Recipe's mention Tool. A mention is built as an inline Atom that carries a teammate's id: the Editor renders it with a node view, and the message thread renders it with an Island, which the Tool description puts into the island property (RichTextView has no engine and would show an empty span). The main way in is typing “@”: the Tool describes a trigger with the character, the items for a query (items) and an onSelect handler that swaps the typed @query for the Atom in one transaction. The kit renders the list, the same list as for the Slash menu: it opens at the start of a Block or after a space and does not open inside a word (ada@mail.com) or in code. The Slash menu (“/”) and the Toolbar button remain as fallbacks and open a popover with a search. The sent reply goes into the thread locally, and RichTextView receives the same tools set.