Skip to content

Draw the caret just past a list bullet in the text field - #3694

Merged
max-sixty merged 2 commits into
mainfrom
caret-after-bullet
Oct 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
caret-after-bullet

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

In Firefox and Chromium, the text field drew no caret when it stood right after a new list item's bullet, where the item's words start. It showed again once a space was typed after the bullet.

A new item hides its source marker (- ) behind the platform's bullet, and the caret's place at the marker's end is inside the marker's text. The marker was hidden with color: transparent, and the field's caret-color: currentColor resolves per element, so the caret took the marker's transparent ink. Hiding the glyphs with -webkit-text-fill-color leaves the marker's color the words', so the caret keeps their ink. The same rule hides a code fence's lines while the caret is away.

test_the_caret_after_a_list_bullet_is_drawn reads the caret's ink in Chromium and Firefox after continuing a list, after deleting the marker's space, and after arriving by arrows. All three read transparent before the fix. Playwright's Firefox screenshots never draw a caret (Juggler captures with drawSnapshot), so the visual before/after was taken from Firefox's video frames.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 22, 2026 22:15
The caret vanished when it stood right after a new list item's bullet,
the place where the item's words start, in Firefox and Chromium alike.
With a space typed after the bullet it showed again.

A new item hides its source marker ("- ") behind the platform's bullet,
and the caret's place at the marker's end is inside the marker's text,
where CodeMirror and the browser put it. The marker was hidden with
`color: transparent`, and the field's `caret-color: currentColor`
resolves per element, so the caret was drawn in the marker's transparent
ink. Hiding the glyphs with `-webkit-text-fill-color` instead leaves the
marker's colour the words', so the caret keeps their ink. The same rule
hides a code fence's lines while the caret is away.

`test_the_caret_after_a_list_bullet_is_drawn` reads the caret's ink in
Chromium and Firefox after continuing a list, deleting the marker's
space, and arriving by arrows; all three read transparent before the
fix. The caret reading now shares its walk with the line-end clip test.

> _This was written by Claude Code on behalf of max-sixty_

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 5355cee into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the caret-after-bullet branch October 23, 2026 05:31
leaf-agent added a commit that referenced this pull request Oct 23, 2026
The draft list test now reads the marker's text fill to tell whether its
source glyphs are visible. #3694 changed hidden markers from transparent
`color` to transparent `-webkit-text-fill-color` so the caret remains
visible just past a bullet; the old assertion read the still-opaque
`color` and failed even though the marker remained hidden.

The focused browser test failed on current main before this change and
passed afterward: `uv run pytest -q -n0
tests/browser/test_render_floating_panel.py::test_a_draft_draws_a_list_as_the_message_will`.

This addresses that failure in [main CI run
39906202258](https://github.com/max-sixty/leaf/actions/runs/39906202258).
The run also has separate browser failures under investigation in #3695.

Co-authored-by: leaf-agent <[email protected]>
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