Skip to content

Hide empty option Add controls - #293

Merged
max-sixty merged 3 commits into
mainfrom
codex/hide-empty-option-add
Sep 5, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/hide-empty-option-add

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 5, 2026 •

Copy link
Copy Markdown
Owner

Empty free-form option rows currently show a disabled Add button before the reader has typed anything. Hide that control until the draft contains text, while preserving its reserved space so typing does not reflow the field.

The active button keeps Leaf's shared ordinary-action styling. If the field empties while Add has focus, the field takes focus before the button hides. Browser coverage checks the empty and active states, alignment, keyboard submission and focus, minimum target size, and the shared button face.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hiding the Add button takes the reader's focus with it. aria-disabled kept the control focusable, so a keyboard add left the reader standing on it; visibility: hidden makes it unfocusable, and Chromium drops focus to <body> — the next Tab restarts from the top of the document.

I ran it both ways on DECISION_PAGE: fill the field, Tab to Add, Enter, round_trip. On cd5025f the active element afterwards is BUTTON:Add option; on this branch it is BODY. The same happens whenever the draft empties while the button holds focus, including a clear mirrored in from another tab through watchDraft.

The inline suggestion returns the reader to the field, which is also where they'd want to be to add another option. It needs focused added to the widget-api.js import list — outside the diff, so not suggestable inline. With both edits tests/test_render_options_addition.py still passes, and the probe reports INPUT:Another option.

Nothing else came up: clippedControls skips absolutely-positioned controls and coveredWords skips visibility: hidden text, so neither render gate changes here, and test_render_options{,_addition,_settled}.py, test_render_aim.py, and test_render_drafts.py are otherwise green on the merged tree.

Happy to push the fix (widget edit plus a focus assertion in the existing test) if you'd like.

@max-sixty
max-sixty merged commit e84dcf2 into main Sep 5, 2026
12 checks passed
@max-sixty
max-sixty deleted the codex/hide-empty-option-add branch September 5, 2026 05:59
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.

2 participants