Draw dividers with box-drawing, from the same charset as borders#515
Merged
DROOdotFOO merged 3 commits intoJul 13, 2026
Merged
Conversation
`divider/1` defaulted to an ASCII hyphen, so every divider rendered as `-----------` next to properly-drawn `┌────┐` borders. A divider is a border's horizontal run, so draw it from the same charset: `variant: :single` now matches a `:single` border exactly (─), `:double` gives ═, `:ascii` keeps -. An explicit `char:` still wins. Unknown variants resolve to `:single` rather than being passed through to BorderRenderer, whose catch-all maps anything unrecognised to `:none` -- whose horizontal run is a space, so a typo would have silently rendered an invisible divider.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
divider/1defaulted to an ASCII hyphen, so every divider in the playground renders as-----------sitting right next to properly-drawn┌────┐borders. It reads as unfinished, and it was — the boxes got the box-drawing treatment and the divider never did.A divider is a border's horizontal run, so it should draw from the same charset rather than inventing its own:
:single(default)─:singleborder:double═:doubleborder:rounded─:roundedborder:ascii-:asciiborder:none:noneborderAn explicit
char:still wins, so callers can draw a divider out of anything.Guard worth calling out: unknown variants resolve to
:singleinstead of being passed straight toBorderRenderer, whose catch-all maps anything unrecognised to:none— and:none's horizontal run is a space. Without the guard,variant: :heavy(or any typo) would silently render an invisible divider.Also fixes the engine's own fallback (
engine.ex, for:dividerelements built by hand rather than via the DSL), which had the same hyphen default.Tests: default matches
BorderRenderer.get_border_chars(:single).horizontalby construction; every variant matches its border; unknown variants draw:single, never blank; explicitchar:wins. 4/4. Wider sweep (ui + cross_terminal + playground + renderer): 1795/1795 — nothing pinned the old hyphen.