Introducing a new way to review your PRs.

Read the announcement

crmne / zapfast

ZapFast: a fast, native WhatsApp client in Rust and egui

View on GitHub

19 documents · Updated Nov 18, 2026

docs / navigation-and-accessibility

Navigation gives the desktop app a stable path through rails, panes, lists, and overlays. It keeps pointer, keyboard, and screen-reader use on the same product actions while the application shell changes layout for narrow windows. Account changes and locked states also limit which controls can receive input; see account access and session. Visual focus follows the active settings and theming palette.

The shell presents destinations in a left navigation rail, a chat or call list, and a main content pane. The layout can replace a full list with chat avatars or move the list and detail view through the rail when the window is narrow.

Rails and destinations

The navigation rail is the stable route to Chats, Calls, Starred, Archived, Locked, Settings, and the account switcher. It marks the active destination and keeps conditional destinations available only when they have useful content. When the chat list is hidden, chat avatars fill the rail so the user can still reach a chat without reopening the list.

References: src/…/rail.rs• L1-6 src/…/rail.rs• L62-95 src/…/rail.rs• L154-247

List and detail panes

The chat list and the open conversation are separate navigation surfaces. A full-width window shows them side by side when there is enough room; a narrow window shows one view at a time and uses Back to return from detail to the list. The Calls page follows the same model for call history and an opened chat.

References: src/…/mod.rs• L150-209 src/…/mod.rs• L211-284 src/…/chats.rs• L40-65

Search and secondary panes

Search and information views use a shared pane model. A pane docks beside the conversation when the remaining space stays readable; otherwise it floats over the conversation without changing the underlying chat. The user can close the pane or choose a result to return to the message it names.

References: src/…/pane.rs• L1-5 src/…/pane.rs• L40-69 src/…/pane.rs• L78-172 src/…/pane.rs• L200-220 src/…/pane.rs• L364-369

The main navigation flow is summarized below.

flowchart LR
    Rail[Navigation rail] --> List[Chat or call list]
    List --> Detail[Conversation or call detail]
    Detail --> Search[Search or info pane]
    Search --> Detail
    Detail --> Overlay[Dialog, picker, or viewer]
    Overlay --> Detail
    Detail --> Rail

Focus model

Focus management makes the visual control, keyboard target, and accessibility target agree. The shell records the controls that are present in the current view, then uses that set to move focus without landing on a hidden or removed control.

Tab order

The main view has a deliberate Tab order rather than relying only on draw order. It covers the composer and its controls, the message list, rail destinations, list actions, filters, search, and panel controls. The order is rebuilt from controls that are actually enabled and visible, so hidden sidebars and read-only chats do not leave dead stops.

References: src/…/focus.rs• L7-60 src/…/focus.rs• L80-102 src/…/focus.rs• L158-239 src/…/mod.rs• L62-87

Message list focus

The message transcript is one focus stop. Once focused, arrow keys move a cursor through messages, Home and End move to the first or last item, and Page Up and Page Down move by a page. The cursor names the current message for keyboard actions while the list keeps focus, so a long transcript does not require a separate focus target for every row.

References: src/…/list_nav.rs• L1-6 src/…/list_nav.rs• L23-41 src/…/list_nav.rs• L54-97 src/…/list_nav.rs• L183-212 src/…/keys.rs• L186-220

Focus visibility

Keyboard focus has a visible accent ring and causes the target to come into view. Pointer focus does not force the same global ring, which keeps ordinary mouse use quiet while text fields still show their active state. A list rings its current message rather than the full list container.

References: src/…/mod.rs• L413-523 src/…/focus.rs• L86-99 src/…/list_nav.rs• L157-181 src/…/widgets.rs• L324-346

Keyboard interaction

Keyboard commands are routed by the state that owns the current surface. Text fields keep editor keys, menus take their own input first, and overlays block commands that belong to the content behind them.

Global shortcuts

The core shortcuts move between app areas and focus useful controls. Search focuses the chat list, open-chat search, or settings search based on the current page. Other commands open the composer, switch chats, select a chat by position, show Chats or Calls, collapse the sidebar, open Settings, and display the shortcut list.

AreaMain keyboard actions
SearchCtrl+K or Ctrl+Shift+F for chat search; Ctrl+F for the current area
ComposerCtrl+L to focus it; Enter sends; Shift+Enter adds a line
ChatsAlt+Up/Down or Ctrl+Shift+[ / ] moves between chats; Ctrl+1..9 opens a chat
ShellCtrl+Shift+1 opens Chats; Ctrl+Shift+2 opens Calls; Ctrl+B shows or hides the list; Ctrl+, opens Settings
Message listAlt+2, or Control+2 on macOS, focuses messages

References: src/…/keys.rs• L14-40 src/…/keys.rs• L62-145 src/…/keys.rs• L994-1002 src/…/keys.rs• L1076-1113

Contextual commands

The focused message supports commands that match the actions available from its message menu. R replies, E reacts, C copies, F forwards, G jumps to a quoted message, and Delete opens the matching delete confirmation. Escape dismisses the top active state first, then backs out through search, panels, pages, and the open chat.

References: src/…/keys.rs• L158-220 src/…/keys.rs• L251-335 src/…/keys.rs• L445-557

Reusable widgets provide the common interaction contract for buttons, chips, search fields, menus, avatars, and switches. A widget can expose a label to assistive tools, reveal focus, take a stable Tab position, and preserve the same click action for pointer and keyboard activation. Menus add arrow and Tab movement plus first-letter navigation without sending menu text to a shortcut or editor behind the menu.

References: src/…/widgets.rs• L324-346 src/…/widgets.rs• L605-727 src/…/widgets.rs• L729-771 src/…/widgets.rs• L812-884 src/…/focus.rs• L80-102

Overlay behavior

Overlays take control of input when they cover the app. The overlay focus rules apply to dialogs, media and sticker viewers, the picture editor, emoji and reaction pickers, and similar temporary surfaces.

An overlay opened by keyboard navigation or a screen reader enters on its first usable control. When it closes, dialogs, viewers, stickers, and editors return focus to the control that opened them if the same page and chat still exist. Pickers keep their own return behavior because their selection belongs to the composer or message. Nested overlays return to the outer overlay rather than skipping back to the original page.

References: src/…/overlay.rs• L1-16 src/…/overlay.rs• L48-80 src/…/overlay.rs• L116-131 src/…/overlay.rs• L143-217 src/…/overlay.rs• L220-289

Menus and popups own their keys before global shortcuts run. Escape closes the top menu or overlay first, and the app does not let background actions consume input while a modal surface is active. Pointer-opened overlays preserve pointer behavior, while keyboard- or screen-reader-opened overlays follow focus into the new surface.

References: src/…/keys.rs• L14-30 src/…/keys.rs• L158-171 src/…/keys.rs• L251-273 src/…/overlay.rs• L116-131 src/…/widgets.rs• L812-856

Accessibility structure

Accessibility support gives assistive tools a stable view of the same navigation model. The app uses AccessKit, a platform bridge for accessibility trees, to expose lists, rows, labels, positions, and the active item without turning every visible message into an independent Tab stop.

List semantics

The message transcript is exposed as a labelled list with message rows as its options. Each row has a stable identity and position, and the list names the row currently held by the keyboard cursor as its active descendant. Rows that are not drawn in the current view do not become the active descendant, which keeps the spoken focus inside the visible accessibility tree.

References: src/…/list_nav.rs• L44-81 src/…/list_nav.rs• L100-154 src/…/conversation.rs• L3081-3088 src/…/conversation.rs• L3572-3599 src/…/conversation.rs• L4040-4075

Control labels

Icon-only controls carry spoken labels and widget roles, while selected states and unread counts are included in the accessible description where they affect navigation. Reusable controls use the same names for tooltips, keyboard help, and screen-reader output so a user can identify a control from any input method.

References: src/…/rail.rs• L281-395 src/…/pane.rs• L214-270 src/…/widgets.rs• L633-676 src/…/widgets.rs• L887-895

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the rail destination order, Tab stop order, and numbered shortcut order aligned.
  • When a pane or overlay gains a new entry point, define both its first focus target and its return target.
  • Preserve stable list and row identities when changing virtualization, sorting, or message grouping.
  • Keep visible labels, tooltip text, widget roles, and screen-reader state names aligned for icon-only controls.
  • When a state hides a pane or list, remove its focus stop and prevent shortcuts from reaching the hidden surface.

Important failure modes

TriggerConsequenceGuard
A hidden or disabled control remains in the main Tab orderTab lands on a control that is not usable or visibleBuild the order from controls drawn and enabled in the current pass
A message row gets a new identity when rows above it changeA screen reader repeats or loses the current messageDerive row identity from the chat and message identity
A keyboard-opened overlay has no first focus targetFocus falls to the window between surfacesEnter the overlay on its first usable control
A modal state does not consume background shortcutsKeys act on the chat behind the modal surfaceRoute keys through the topmost active state first
A list reports an off-screen row as activeAssistive tools receive a node that is not in the current treeSet the active descendant only from a row drawn in the current pass

Key files

FileWhy to read it
src/…/mod.rsMain shell layout, narrow-window transitions, focus tracking, and focus-ring policy
src/…/rail.rsRail destinations, conditional routes, and rail keyboard stops
src/…/chats.rsChat-list header, search focus, filters, and list-to-detail entry points
src/…/conversation.rsMessage-list focus, cursor semantics, accessibility rows, and composer flow
src/…/focus.rsDeliberate Tab order for the primary application view
src/…/list_nav.rsShared long-list cursor and accessibility behavior
src/…/keys.rsShortcut routing, Escape behavior, and contextual message commands
src/…/overlay.rsFocus entry and focus return for modal surfaces
src/…/pane.rsDocked and floating search-pane behavior
src/…/widgets.rsShared focus, menu, label, and widget interaction contracts