Settings
Stake presets, risk limits, theme and notifications (/settings). Backed by
GET/PUT /settings (Settings in api/openapi.yaml); field names below are the
contract’s.
Sections
Safety is a section of its own, with the same heading level as the others, in the desktop
nav and in the phone list (
?section=safety). It shares the Risk limits form, so a switch
and a limit still save one at a time.
Layout
- One rhythm from the spacing scale: 24 px between sections with one divider, 16 px between rows, 8 px between a label and its description. Every section heading has the same top spacing; the first has none, so it lines up with the page title.
- A limit or switch row: the label (14 px semibold) and its one-line description (13 px muted) on the left; the control in a 160 px right column, centred on the label block. The ceiling note sits 4 px under the field, in a column exactly the field’s width, right aligned, so field and note share one right edge on every row. A note longer than the field (an error) runs on to the left.
Desktop
- Section nav: 200 px, links scroll to the section (smooth jump); the section in view
is marked with a 2 px
--foregroundbar. - Stake presets save as the limits do, with no Save button: the whole list saves when Enter
is pressed in a chip or the chip is left (blur), and when a chip is removed, then shows the
toast
Stake presets saved.Add presetadds an empty chip with focus; a chip left empty is dropped. While a chip fails a field rule, or the list would be empty, nothing is saved and the errors are listed under the chip row (Preset 2: Must be more than 0,At least one preset,Not saved · …); a refused list stays in the chips. - Risk limits and Safety save one field at a time, with no Save button: a limit saves when
Enter is pressed or its field is left (blur, which includes leaving the page), a switch
when it is flipped. Each save sends the saved limits with that one value changed.
- A tighter value applies at once, with no password, and shows the toast
<Limit> saved(Max order notional saved). - A looser value (a higher cap, a shorter duplicate window, a safety switch turned off)
opens the password prompt at once (
Raising the max order notional needs the UI password).Cancel, or leaving the page before the prompt is done, puts the saved value back in the field and shows the toast<Limit> not raised(Max order notional not raised;not loweredfor the duplicate window,not turned offfor a switch). Leaving the page is never blocked. - While a typed value differs from the saved one, the note under the field reads
Unsaved · Enter to savein place of the ceiling. A value that fails a field rule or the save keeps its note in red (Above the ceiling ($50,000),Not saved · …) until it is changed. A field never shows a value as saved that the backend did not accept. - Saves run one at a time; each starts from the limits the previous one returned.
- A tighter value applies at once, with no password, and shows the toast
- Notifications save each change on their own, with no Save button (notifications.md).
- Inputs:
--control-h(32 px desktop, 44 px touch), one width (160 px desktop, the full content width on the phone), numeric (tabular), right-aligned, one 1 px--inputborder on the page surface with no fill, and the focus ring. Every unit is a muted affix inside the field:$before a USD amount;orders,/min,ticks,ms,minorlegsafter a count. At rest a value shows thousands separators (25,000); while the field has focus it shows the raw digits, and separators typed or pasted are dropped. Ceilings and preset values come fromlib/formatwithout trailing zeros ($50,000,10,000 ms,120/min). Decimals are typed and sent as strings; the browser does no arithmetic on them. - Switches: off is an outlined track with a muted thumb, on a filled
--primarytrack with a light thumb.
Field rules
- Stake presets are chips styled as the limit fields (
$inside, thousands separators at rest, 128 px; two columns on the phone), withAdd presetas a ghost button at the control height in the same row. The[x]icon button inside a chip removes one (disabled on the last one);Addis disabled at 6. Drag to reorder: the order is the order of the stake selector and hotkeys1–6. - Theme applies immediately on click (preview) and is part of the save.
Mobile
/settingsshows the section list (52 px rows with chevrons). Each section opens as a full-screen page with a back button.- The same fields, stacked: label and description above a full-width 44 px input (16 px text), the ceiling 4 px under it, right-aligned. The section heading sits 16 px under the header.
- Stake presets and risk limits save on the keyboard’s Done key (Enter) or when the field is left, as on desktop.
- Notifications: the channel table, permission flow and test are in notifications.md.