mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 21:03:47 -10:00
116 lines
9.0 KiB
Gherkin
116 lines
9.0 KiB
Gherkin
Feature: the UI conformance suite: the bar the interface is held to
|
|
Status 2026-10-22: decided. The bevy_ui substrate passed the full tier (69/0/0 at 1 frame p50) where the Dioxus/Blitz
|
|
stack scored 6/38/25; it became the legacy app's only UI and the Dioxus path was deleted (docs/ts-native.feature P25). The
|
|
history below is kept as it was.
|
|
Status 2026-10-21: the contract, written before the suite. Shane, 10-21: "theres lots of problems all over the ui
|
|
everywhere ... responsiveness, parity, layouts, responsive layouts, realtime changes updating immediately". Agreed
|
|
plan: write the bar first, then measure the current stack (lite panels + DOM surfaces on dioxus-native/Blitz) and a
|
|
bevy_ui spike of the feed space against it, then decide on the numbers. "Working" means this suite passes, not that
|
|
it looks fine to someone.
|
|
|
|
The suite tests the interface the way a person uses it: real window input in, what the window shows out. It knows
|
|
nothing about lite panels, Blitz or Bevy. Each UI substrate implements the two MCP tools below; every case runs
|
|
unchanged on either one.
|
|
|
|
Rule: It never touches a person's work
|
|
Scenario: A run's world is its own
|
|
Then each run starts the app headless (raea-page-host, which has no window) with its own HOME, its own MCP port, and a throwaway
|
|
copy of a fixture workspace (sdk/ui/conformance/fixture: a few renders, stills, a storyboard, a swipe;
|
|
small files, committed or generated by the suite)
|
|
And no case sends anything to an agent: the chat runs on a stub agent that echoes (RAEA_FEED_AGENT=echo or the
|
|
substrate's equivalent), so a typed message and a review note can be checked without a model or a cost
|
|
And the run stops its app and deletes its copy, pass or fail
|
|
|
|
Rule: Input goes in as the window gets it
|
|
Scenario: The input tool
|
|
Then MCP `input` takes one event in window points and posts it to the app's window as AppKit would deliver it
|
|
(NSEvents through the window, not a panel's private command): move {x,y}; down/up {x,y,button,clicks};
|
|
leave (the pointer leaves the window); wheel {x,y,dy,unit: "pixel"|"line",phase?} with natural scrolling on
|
|
and off (dy in the device's sign, as macOS hands it); key {key, mods} down/up; text {text} (an inserted
|
|
string); ime {marked, commit} (marked text, then committed); resize {w,h}; and returns the frame number it
|
|
landed before
|
|
And the suite drives clicks, double clicks, drags and hovers only through it
|
|
|
|
Rule: What the window shows comes out as a tree
|
|
Scenario: The ui tool
|
|
Then MCP `ui` returns the interface as presented in the latest frame: {frame, window: {w,h}, nodes: [...]}, each
|
|
node {id, role, name, rect: {x,y,w,h} in window points, visible, hovered, focused, pressed, selected, value,
|
|
scroll: {top, max}?, text?}
|
|
And ids are stable test ids the UI declares (data-testid on the current stack; a TestId component in Bevy),
|
|
e.g. left.tab.feeds, left.tab.assets, left.feeds, left.assets, left.feed.<name> (lowercased, dashes; its badge left.feed.<name>.badge),
|
|
feed.list, feed.card.<n>, feed.search, review.back, review.title, review.picture (state playing/paused),
|
|
review.take.<n>/prev/next, review.approve, review.track, review.note, review.board, chat.composer, chat.send,
|
|
chat.transcript, chat.message.<n>, header.toggle.chat, header.toggle.files; and the regions whose
|
|
boxes reflow: left, middle, chat
|
|
And a substrate that composites panels also lists them under `panels`: {name, shown, rect, texture: {w, h,
|
|
scale?}, stale}, the texture it last presented for each
|
|
And the frame number is the presented frame's, the same counter `input` returns, so a latency is frames between
|
|
the event and the first tree that shows its effect
|
|
And a substrate may also answer `frame_png` (the composited window) for the few cases that check pixels
|
|
|
|
Rule: Every case is data: steps, an expectation, a budget
|
|
Scenario: A case
|
|
Then a case is a file under sdk/ui/conformance/cases/ naming: its area (pointer, scroll, text, focus, layout,
|
|
responsive, live, panels, review, chat), the window size, the steps (input events and waits on the tree), the
|
|
expectation (predicates on node fields), and a budget in frames (default 2 at 60 Hz for pointer and text, 1 for
|
|
a live update, 3 for a resize or a panel reflow)
|
|
And a case runs the feed (apps/app) on raea-page-host at its `route` (default /feed/f-ides-all) and names the
|
|
feed's own data-testids (feed, card-*, search, project-*, menu-*, detail-*); a node's aria-current is its
|
|
`current` field, and a boolean data-* flag (data-selected) a state token of its name
|
|
And sdk/ui/conformance/fake-cases/ holds the legacy app's cases, whose tree the runner's fake serves: they test
|
|
the runner, not an app
|
|
And the runner takes the start snapshot, each snap, and each step's targets from a settled tree: no panel stale
|
|
and the same rects on two consecutive frames (stale panels unchanged for 1.5 s count, noted in the result),
|
|
within a bounded wait (a tree that never settles fails the case); that wait comes before the input, so it
|
|
never counts toward a latency
|
|
And a result is pass, fail (the expectation never held: what the tree showed instead), or slow (it held, after
|
|
the budget: by how many frames)
|
|
And the runner prints one line per case and writes results.jsonl; it exits 1 on any fail
|
|
|
|
Rule: The first cases are what's broken today (the 10-21 audit and Shane's reports)
|
|
Scenario: Pointer
|
|
Then a card under the pointer is hovered, and stops being hovered when the pointer leaves it or the window
|
|
And a press on a feed row in the left panel selects that row and no other (hit-test matches what's drawn)
|
|
And a double click on a card opens its review once and pins no note
|
|
And a press on review.back always goes back, whatever buttons the bar has
|
|
And two quick presses on header.toggle.chat open and close the chat and never resize the window
|
|
Scenario: Scroll
|
|
Then a pixel wheel and a line wheel both scroll the feed, the left panel's Assets list and the chat transcript, in the
|
|
direction macOS's natural-scrolling setting says, by at least the distance the device moved (a line ≥ 32 pt)
|
|
And a scroll stops at the content's end (a storyboard has a bottom) and scrolls only what's under the pointer
|
|
Scenario: Text and focus
|
|
Then a press in feed.search or chat.composer focuses it; typed text, Backspace, Esc and Enter do what they say,
|
|
with no key lost however fast, including the first after the press
|
|
And IME marked text shows while composing and commits once
|
|
And with a note open, a press anywhere else commits or drops the note and the press still does what it hit
|
|
Scenario: Layout and responsive
|
|
Then at 1440x900, 1180x820, 900x700 and 700x600 nothing overlaps that shouldn't (no two visible interactive
|
|
nodes intersect), no text is cut to zero width, every interactive node is at least 24 pt and on screen
|
|
And below a breakpoint the side panels give way (collapse or overlay) rather than squeezing the middle under 360 pt
|
|
And take buttons that don't fit fold rather than covering the title
|
|
Scenario: Panels open and close
|
|
Then toggling the chat or the left panel reflows the middle within the budget: its rect and its content's rects
|
|
follow (no stale frame of the old size past the budget)
|
|
And toggling the chat and the files in rounds leaves every shown panel presenting a texture its box's
|
|
size, none stale, after each toggle (10-21: half the toggles drew the other parked size; the dock left with the
|
|
feed direction, Shane 10-22)
|
|
Scenario: Live
|
|
Then a new item arriving in the feed (a file written into the fixture's renders/) shows in the feed and its feed's
|
|
badge within 1 frame of the app noticing it (and the app notices within 1 s)
|
|
And a message arriving in the chat transcript shows the frame it arrives, and the transcript scrolls rather than
|
|
squashing
|
|
Scenario: Review
|
|
Then dragging review.track scrubs (the value follows the drag) and a paused video stays paused after
|
|
And J after Approve opens the next item, not the first; Esc goes back
|
|
|
|
Rule: The suite runs in CI and decides
|
|
Scenario: CI
|
|
Then bench/ci.sh runs the suite in its quick tier on the m5pro runner against the current build, and the nightly
|
|
full tier at every responsive size
|
|
And each substrate's run is recorded side by side (pass count, fail count, p50/p95 frames per area)
|
|
Scenario: The decision
|
|
Then the bevy_ui spike (the legacy app's bevy_ui mode, the feed space only) and the current stack run the same cases; if the
|
|
spike passes more with lower latency, the shell is ported space by space, each port gated by the suite, and the
|
|
old panels stay until the new ones reach parity
|
|
And every new UI failure anyone finds becomes a case before it's fixed
|