ui-preview: hold <id or key> <pseudo> - hover, active, focus, focus-visible, checked or disabled held on from the next frame on top of the real input, by the element's key (so through model and load), let go with "" or reset; ludic.ui's held.ludic keeps them and the matcher asks it first; protocol-v1.md and smoke.txt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 22:04:20 +03:00
parent 3d5aaa6f6e
commit aac58ec6fa
10 changed files with 122 additions and 1 deletions

View file

@ -63,6 +63,7 @@ function sel_attr_of(n: UiNode, key: string) -> string {
return null
}
function sel_pseudo_ok(ui_st: mut UiState, p: string, arg: string, n: UiNode) -> bool {
if len(ui_st.ph_keys) > 0 and ph_on(ui_st, p, n) { return true } # held.ludic: a preview's held pseudo-class
if p == "hover" { return n.hovered }
if p == "focus" { return ui_st.fc_key != "" and n.key == ui_st.fc_key }
if p == "focus-visible" { return ui_st.fc_visible and ui_st.fc_key != "" and n.key == ui_st.fc_key }