Attempt racePro
One task tried several ways at once: every attempt races as a row with its model, approach and a live bar, finishes with a score, and the best one is marked and used – switch to another if you prefer.
oxyn add attempt-raceBest of 3
Steady the flaky payment test0 of 3 done$0.02The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- One task tried several ways at once.
- Every attempt races as a row; when they finish, the highest score is marked Best and used, and you can switch to another attempt.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Attempt race is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add attempt-raceUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Live
The race plays and loops: bars grow with a shine, the step under each name changes, cost counts up; then scores land, the best is marked and used.
Best of 3
Steady the flaky payment test0 of 3 done$0.02Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Start
Just started: every bar at a sliver, no scores, nothing to pick yet.
Best of 3
Steady the flaky payment test0 of 3 done$0.02Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Running
Mid-race: one attempt has already failed where it stopped; the others are still going.
Best of 3
Steady the flaky payment test0 of 3 done$0.30Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Done
Finished: the best score gets the Best tag, a green bar and a soft green wash; the failure stays dimmed.
Best of 3
Steady the flaky payment test3 of 3 done$0.76Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Own pick
Your own pick: the lower-scoring attempt is in use, the best keeps its tag and offers Use this one.
Best of 3
Steady the flaky payment test3 of 3 done$0.76Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Best of 5
Best of 5 with more models and approaches.
Best of 5
Steady the flaky payment test5 of 5 done$1.38Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Narrow
Below 560 px each progress bar drops to its own line and the approach is hidden.
Best of 3
Steady the flaky payment test3 of 3 done$0.76Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Classic
Classic style: header band, rows joined in one framed list, a green edge on the one in use.
Best of 3
Steady the flaky payment test3 of 3 done$0.76Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
AttemptRace
| Prop | Type | Default | Description |
|---|---|---|---|
attempts | Option<Vec<PaAttempt>> | Default::default() | Attempts as they stand (controlled). When `None` the demo race plays from `scripts`. |
scripts | Option<Vec<PaScript>> | Default::default() | The scripted race for live demos (the built-in one when `None`). |
live | bool | Default::default() | Demo: loop the race; otherwise it shows the end. |
task | String | "Steady the flaky payment test" | The task. |
title | String | Default::default() | Heading; "Best of N" when empty. |
picked | Option<String> | Default::default() | The attempt in use (controlled); the best one when `None`. |
nowrequired | ClockMs | — | The clock. |
style | String | Default::default() | `clean`, `classic`, or empty to follow `data-cstyle`. |
on_pick | EventHandler<String> | — | An attempt was picked (its id). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves between the finished attempts' Use buttons |
| EnterorSpace | Uses the focused attempt |
Accessibility
- The rows form a radiogroup labelled by the heading; a finished attempt's Use control is a radio whose name gives the model and its score.
- Bars are decorative; progress, failure and score are all in text.
- Reduced motion drops the stagger, the shine and the glides.
Responsive behaviour
- Wide: tile, name and approach, bar, score and the use button in one line.
- Under 560 px the bar goes under the name, the approach and the task drop out.
Edge cases (spec)
Container query: under 560 px the bar drops under the name, the approach and the task hide, the score sits beside the name and Use moves to its own line.
Notes for AI
- Import
AttemptRacefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AttemptRaceElinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.