# Human-Flow Heuristics: Mouse + Keyboard Intuition This document defines the core detection rules and "why it hurts humans" reasoning for the human-flow scanner. **Guiding Principle**: A human with a mouse and keyboard expects: - Obvious targets that are big enough to hit reliably (even when in a hurry or on a trackpad). - Actions that are visible without having to hunt with the pointer. - Every mouse action to have a reasonable, discoverable keyboard equivalent. - Immediate, unambiguous feedback on every interaction. - Workflows that don't require pixel-perfect precision or constant context switching. - The ability to recover gracefully from near-misses. Anything that violates these creates "friction" — small delays, errors, or cognitive load that add up in real use. --- ## 1. Target Size & Precision (Fitts's Law Violations) **Anti-patterns to detect**: - Icon-only buttons or actions with visual size < 32px (ideally 44px minimum for reliable mouse). - "sm" sized buttons used for primary or frequent actions in lists/tables. - Clickable areas defined only by text or thin icons without generous padding. - Dense table rows or toolbars where interactive elements are crammed together (risk of mis-clicks). - Custom controls (fake checkboxes, row clicks) that have smaller effective hit areas than native ones. **Why unintuitive for humans**: - Small targets require slowing down and careful aiming. Under time pressure or with imperfect motor control (fatigue, trackpad, accessibility needs), this leads to errors and frustration. - Frequent actions (view/control a session, end session, delete) should be the *easiest* to hit, not the hardest. **Better human workflow**: - Use at least `min-height: 32px; min-width: 32px;` (preferably 44px) for any actionable icon or compact button. - Add invisible padding or use the `dt__checkwrap` pattern (generous hit area around small visual control). - For row-level actions, make the entire "action zone" larger or always visible with good visual weight instead of tiny icons. - Provide a clear "primary" large target per row/card and de-emphasize (but don't hide) secondary ones. **Detection hints**: - Look for `size="sm"`, `btn--sm`, heights like 28px/24px/20px on interactive elements. - CSS rules with `width: 14px`, `height: 14px` on buttons/icons inside lists. - `padding: 0` or very tight padding on actionable elements in data views. - Lack of `min-height` / `min-width` or `padding` on icon buttons. --- ## 2. Hover-Only / Low-Visibility Actions (Discoverability Failures) **Anti-patterns**: - Row actions, kebab menus, or secondary buttons that are `opacity: 0.3–0.6` at rest and only reach full opacity on `:hover` or `:focus-within`. - Controls that only appear on hover (classic "hover-revealed actions"). - Important status or actions communicated only via subtle hover tooltips or color changes without text. - "More actions" that require mousing to the edge of a row. **Why unintuitive for humans**: - A person scanning a list with their eyes + mouse doesn't want to "paint" every row with the pointer just to see what they can do. - Keyboard users may never discover the actions (even if `focus-within` helps a bit). - It creates a "hunting" workflow instead of a "glancing + acting" workflow. - On touch or with imprecise pointing devices, the actions flicker or stay hidden. **Better human workflow**: - Make secondary actions *dimmed but always legible* (e.g. 70-85% opacity) so they are scannable at a glance. - Or move them into a consistent, always-visible "Actions" column or a "..." menu that is obvious. - Use progressive disclosure only for *rare* actions, not frequent ones. - For keyboard: ensure `focus-within` or explicit focus styles surface the group, and document keyboard activation. **Detection hints**: - `.rowactions`, `.actions` with `opacity: 0.5` (or lower) + transition on hover only. - Comments like "hover-revealed", "shown on hover". - CSS that uses `:hover` to control visibility/opacity of interactive elements in lists/tables. - Absence of always-visible text labels next to icon actions. --- ## 3. Missing or Weak Keyboard Parity & Activation **Anti-patterns**: - Clickable rows, cards, or custom elements that only have `onClick` with no `tabIndex`, `onKeyDown` (Enter/Space), or `role`. - Icon buttons or custom controls without `aria-label` / `title` that are reachable by Tab. - Row selection or activation that works with mouse but has no keyboard story (or only works if you tab into every cell). - Modals, drawers, or popovers opened by mouse that don't trap focus or provide clear Esc/close keyboard path. - Drag-and-drop or multi-select that has no keyboard equivalent (arrow keys, Space to select, etc.). **Why unintuitive for humans**: - A keyboard user (or someone who prefers keyboard for speed) hits a wall — they can see the thing but can't reach or activate it efficiently. - It forces context switching between input methods or makes power users slower. - In data tables (very common in operator consoles), the expectation is "I can arrow or Tab through, Enter to act." **Better human workflow**: - Every mouse-activated element that is not a native control must be keyboard-focusable and activatable with standard keys (Enter for primary action, Space for toggle/selection). - Provide visible focus states that are strong (not just the browser default if it's invisible on dark themes). - For tables: support row activation via keyboard in addition to (or instead of) cell-by-cell navigation. - Always offer a non-mouse way to do the primary task. **Detection hints**: - `onClick` handlers on `
`, ``, or custom components without accompanying `tabIndex={0}`, `onKeyDown`, or `role="button"`. - Custom checkboxes/radios without proper keyboard handling. - Absence of `aria-label` on icon-only `