Skip to content

fix: icons for the tick, arrows and close; autofocus on search and text fields - #32

Merged
adammharris merged 2 commits into
mainfrom
fix/icon-glyphs
Nov 26, 2026
Merged

adammharris merged 2 commits into
mainfrom
fix/icon-glyphs

Conversation

@adammharris

Copy link
Copy Markdown
Member

Two changes found building Redox's launcher on unit (orbital-ui, Blitz on Orbital).

Icons, not characters. A checkbox's ✓, a menu's tick and submenu ▸, a select's ▾, a disclosure's ▸/▾ and a toast's ✕ were text, drawn only where the system's font has those characters. Redox's font (Fira) has none of them, so each drew as a missing-glyph box. They are unit's own icons now (paths::CHECK, CHEVRON_RIGHT, CHEVRON_DOWN, CLOSE), stroked in currentColor, so they keep the colour the text had. In a menu row, a tick and a submenu arrow keep no gap after them (.unit-item .unit-svg's margin). The Blitz test that found the "Heading" submenu row by "Heading▸" finds it by "Heading".

autofocus on SearchField and TextField, written as the element's attribute: Blitz (with its autofocus feature) and a browser give that field the keys when the page opens. Defaults to off.

Checked on Redox: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and cargo test -p unit (79 passed). The gallery's Blitz tests don't link there (OpenSSL's static libcrypto wants zlib), so those are CI's to run. On Orbital, a launcher using SearchField { autofocus: true } takes typing at once, and the search and clear icons draw.

Behavioural-change: those marks are SVG icons instead of text; autofocus is a new optional prop.

A checkbox's ✓, a menu's tick and its submenu's ▸, a select's ▾, a disclosure's
▸ and ▾ and a toast's ✕ were text, drawn only where the system's font has those
characters. Redox's (Fira) has none of them: each drew as a missing glyph's
box. They are unit's own icons now (`paths::CHECK`, `CHEVRON_RIGHT`,
`CHEVRON_DOWN`, `CLOSE`), stroked in the colour the text there had, so they look
the same with every font. A tick and a submenu's arrow keep no gap after them
in a menu row.

Behavioural-change: those marks are SVG icons; a test that found a submenu's
row by its text with the arrow ("Heading▸") finds it by its label alone.
…ge opens

`autofocus` on SearchField and TextField, written as the element's `autofocus`
attribute, which Blitz (with its `autofocus` feature) and a browser honour: a
launcher's search takes what is typed as soon as its window opens.
@adammharris
adammharris merged commit 0672725 into main Nov 26, 2026
13 of 14 checks passed
@adammharris
adammharris deleted the fix/icon-glyphs branch November 26, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant