# Finding UI fixes from gaze

A method for turning Orion's gaze into a short list of interface changes, each backed by how many people it touched and by clips that show it. It uses only the Orion tools. Most of the work is in step 4: most patterns that look like problems turn out to be ordinary looking, and the checks there are what separate the two.

What you end up with: three to six findings. Each one says what people did (how many of how many people, and shares of their gaze), why that holds them up, the change to make, and two short clips.

## Before you start
- Choose the site and the period: list_sites, then get_overview.
- Desktop and phone visits are read apart and never pooled (list_sessions device). Phone gaze has no pointer to go on.
- Count people, not visits. Every visit has a visitor (list_sessions, get_session): the visits of one person share it. list_sessions with visitor gives one person's visits in order. Where visitor is missing (an import without people), count visits and say so.
- Gaze time in every tool already leaves out time away from the page (another tab or window, waiting for the next page) and stretches 10 s or more after the last input.

## 1. Map the journey
- list_pages: every page with its visits and gaze. Keep pages with gaze from at least 5 people.
- For a flow (sign-up, onboarding, checkout), put the pages in the order people reach them: get_session gives each visit's pages in order.
- Note where people come back to a page, and where they leave.

## 2. Read each page
- get_page_attention with the page: each element's share of the page's gaze, the visits that looked at it (looked_at_in) and the people (seen_by). With element: that element's gaze visit by visit.
- get_gaze_dwell with a session and page: one visit's gaze-seconds and share per element, and when it held the gaze most.
- What was on screen but never looked at: get_gaze_map with the session, page, min_share 0 and max_elements 300 lists every element on each screen, with its share (0 = no look).
- The order of looks: get_gaze_timeline with mode "sequence" (first look, returns, back and forth between two elements).
- What happened: get_events (clicks with the element clicked, dead and rage clicks, time away) and with kind "input" every pointer move, click, scroll and key press.
- Split visits by what the page showed, and read each state apart: a list or table empty against one with items in it, a step before and after an action (a download started, an account connected). Empty lists, tables and searches are where pages most often name an action without showing it, so check every one. The same page in two states is often where the finding is.

## 3. Patterns worth a finding
Each of these is a gaze pattern with a defect behind it that can be fixed.
- A message names an action, but its button is somewhere else. People read the message, then their gaze leaves for the menu or the page edges, looking for the way forward.
- A step that is done still pulls the eyes. After an action has worked (a download started, an account connected), people keep looking at its control, and the control for the next step gets little gaze.
- A confirmation the eyes never reach. The page says something worked ("Connected", "Saved") where few people look, and their gaze goes back to the control they just used, which still looks the same.
- Choices already made for people draw more gaze than the one thing they have to do. Options already ticked or filled in take more gaze than the field left to fill.
- Options that can't be used draw gaze like ones that can. "Soon" or disabled tiles get as much gaze as live options next to them.
- A control that is locked when it shouldn't be. People look at it and click it, and nothing happens (dead clicks on it, clicks with no page change after).
- A next step nobody sees. The control that moves people on is on screen, but few visits ever look at it.

## 4. Check each candidate
A candidate becomes a finding only if it passes every check. Write down the ones that fail and why: they are part of the result.

1. Someone was looking. Besides the time Orion already leaves out, leave out a screen standing still after a click or a page change: the person is waiting, and the gaze map stops moving. From get_gaze_timeline (step_s 0.25), a stretch of 1 s or more in which the centroid moves less than 1% of the screen's width per second, with no input (get_events kind "input": key presses and scrolls as well as the pointer) within 0.5 s either side, doesn't count. Long looks shrink most under this rule. The exact version uses the raw gaze frames (replay_gaze.npz) and input (engine_events.json.gz): get_download_links gives plain links any script can fetch.
2. Not just the pointer. The gaze model reads the pointer, so gaze near the pointer can be the pointer. The pattern must also hold in the steps where the pointer is more than 80 px from the gaze's peak (get_gaze_timeline gives both in every row). Looking where you are about to click is normal.
3. Not ordinary looking. Eyes on the next button before pressing it, on the field being typed into, on text being read, or moving between options being compared are how people use a page. A finding needs a defect you can point at in the clip.
4. Not people exploring a new page. Compare like with like: first visits to the page in the problem state against first visits in the ordinary state (an empty list against a list with items in it), or the same visits before and after the moment that matters (before and after a download). If the pattern is as strong in both, it is exploring, or the page's layout in general, not the state. A page that always opens the same way has nothing to compare with: then say this check could not be run, which is not a fail, and let the finding stand or fall on checks 3 and 5.
5. Who it touches. There are two kinds of finding, counted differently.
   - A pattern of attention (who looks at what, shares of gaze) is about what is typical, so it needs several people: give it as "7 of 9 people". One heavy user can tilt shares, so check it still holds with each person counted once, and without the person with the most visits.
   - A defect (a control that does nothing, a loop that keeps sending someone back, a dialog that closes itself) is a finding even if one person hit it. Say what happened, how often, how many people it reached, and show it. One person stuck 30 times is a serious problem.
6. It doesn't hang on the settings. Run it again with the pointer distance at 50 and 120 px, with and without the standing-still rule of check 1, and on each half of the people. Drop a finding that flips; keep one that only changes size.
7. The screen showed what people saw. Video players and canvases rebuild blank, so gaze on them can't be read, and phone visits never go into a desktop finding.

## 5. Rank them
By how many people it touches, by what it costs them (stuck, then slowed, then distracted) and by how early in the journey it comes (the first steps of sign-up and onboarding first). Keep every finding separate: don't fold two into one.

## 6. Show them
Per finding:
- A title that is the change, in plain words: "Put the upload button inside the empty list".
- Two or three numbers: how many of how many people, and the share of gaze that makes the point.
- One sentence on why it is a problem, when that isn't obvious: eyes on the menu after reading the message are hunting for a next step the page didn't show.
- The change, concrete enough to build: "turn the button they used into a confirmation".
- Two clips. get_gaze_video gives the visit's gaze video and segments, the map from video time to replay time, so the moments can be cut out (ffmpeg -ss and -t). get_gaze_snapshot gives a still with the element outlined. Every clip must show what its title says: watch each one. Start inside the finding's moments, not across a page change.
Use few words, and plain ones: "already ticked", not "default". Say what the gaze shows as where people looked; say once, at the end, that the gaze comes from Orion's model of where people look.

## Traps
- A small text change ("Connecting" to "Connected") can lag behind in the rebuilt pictures: check that the frame shows what the element list says.
- The same element can have a different selector in another visit: match elements by role and text.
- A page someone only passes through (a redirect, up for under 3 s) is not a visit to it.
- In imported visits, clicks are tied to the element at their position on the rebuilt screen.
- Use whole session ids: two sessions can begin with the same characters.
- With no input for long stretches, the gaze follows changes on the screen, not a person: check 1 removes most of it.

## Example of a finished finding (made-up numbers)
Put the upload button inside the empty list
- N of M people with an empty list read its message; N of M then look to the menu; few ever look at the upload button.
- On a first visit, people with an empty list give the menu X% of their gaze, against Y% when the list has items: not exploring, the empty list.
- Why: the message says to upload, but the button is in a corner and the menu has none, so the eyes hunt for the next step.
- Change: put "Upload" right under the message, where the eyes already are.
- Clips: two visits, each showing the message read and the eyes moving to the menu.
