fix: misalignement in graphs with some fonts
by replacing ◆ (U+25C6) with ♦ (U+2666)
This should help properly rendering the jj graphs on all the systems on online documentation, instant discussion, …
Here is an screenshot example in a github comment:
Checklist
If applicable:
- [ ] I have updated
CHANGELOG.md - [ ] I have updated the documentation (
README.md,docs/,demos/) - [ ] I have updated the config schema (
cli/src/config-schema.json) - [ ] I have added/updated tests to cover my changes
I'm having trouble seeing the latter symbol on Android .
Firefox
Termux
GitHub app
Oh, I've checked on linux and mac, didn't think to check on my phone. Probably not the best "fix" then
Some (most?) unicode characters, to check how visible and well aligned they are on various systems.
◆ Black Diamond
◇ White Diamond
◈ White Diamond Containing Black Small Diamond
♢ White Diamond Suit
♦ Black Diamond Suit
❖ Black Diamond Minus White X
⟐ White Diamond With Centred Dot
⟡ White Concave-sided Diamond
⟢ White Concave-sided Diamond With Leftwards Tick
⟣ White Concave-sided Diamond With Rightwards Tick
⧰ Error-barred White Diamond
⧱ Error-barred Black Diamond
⬖ Diamond With Left Half Black
⬗ Diamond With Right Half Black
⬘ Diamond With Top Half Black
⬙ Diamond With Bottom Half Black
⬥ Black Medium Diamond
⬦ White Medium Diamond
⬩ Black Small Diamond
⯁ Black Diamond Centred
| All the labels should be aligned on that pipe sign
Here's Android
Termux
App
Firefox
Some (most?) unicode characters, to check how visible and well aligned they are on various systems.
◆ Black Diamond ◇ White Diamond ◈ White Diamond Containing Black Small Diamond ♢ White Diamond Suit ♦ Black Diamond Suit ❖ Black Diamond Minus White X ⟐ White Diamond With Centred Dot ⟡ White Concave-sided Diamond ⟢ White Concave-sided Diamond With Leftwards Tick ⟣ White Concave-sided Diamond With Rightwards Tick ⧰ Error-barred White Diamond ⧱ Error-barred Black Diamond ⬖ Diamond With Left Half Black ⬗ Diamond With Right Half Black ⬘ Diamond With Top Half Black ⬙ Diamond With Bottom Half Black ⬥ Black Medium Diamond ⬦ White Medium Diamond ⬩ Black Small Diamond ⯁ Black Diamond Centred | All the labels should be aligned on that pipe sign
windows 11, edge3:
Some (most?) unicode characters, to check how visible and well aligned they are on various systems.
◆ Black Diamond ◇ White Diamond ◈ White Diamond Containing Black Small Diamond ♢ White Diamond Suit ♦ Black Diamond Suit ❖ Black Diamond Minus White X ⟐ White Diamond With Centred Dot ⟡ White Concave-sided Diamond ⟢ White Concave-sided Diamond With Leftwards Tick ⟣ White Concave-sided Diamond With Rightwards Tick ⧰ Error-barred White Diamond ⧱ Error-barred Black Diamond ⬖ Diamond With Left Half Black ⬗ Diamond With Right Half Black ⬘ Diamond With Top Half Black ⬙ Diamond With Bottom Half Black ⬥ Black Medium Diamond ⬦ White Medium Diamond ⬩ Black Small Diamond ⯁ Black Diamond Centred | All the labels should be aligned on that pipe sign
iphone 15
Currently ♦ Black Diamond Suit seems to be the best option for the browsers, but is broken with ghostty on linux, because it falls back on a nerd font for that glyph. It works properly in the other terminals I tried so far.
See https://discordapp.com/channels/968932220549103686/968932220549103689/1381009627319369831 for details.
Confusingly, it shows up red in my email (GMail on Firefox on macOS, with whatever random fonts I have installed on top of the defaults). Seems like a bug somewhere. This does not happen for ♦ in GitHub on Firefox on macOS. If this is the only issue, it might not be a big deal.
The original U+2BC1 does even worse for Firefox on macOS, BTW (GMail or GitHub). The other symbols do fine, though.
Full list as shown by Gmail, for reference:
Probably less relevant examples with Ghostty and various configs
Perhaps the red symbol is similar to what you saw with ~~Kitty~~ Ghostty (Update: I originally typed Kitty, but I always meant Ghostty). On macOS, ~~Kitty~~ Ghostty does fine:
Or, with my config
font-family=""
font-family="JetBrains Mono"
font-family="Symbols Nerd Font Mono"
I get the similar-but-not-quite-the-same (worse aligned):
I don't remember why I wanted this config; I think there was some symbol that wasn't shown without it.
Here's the diff (in red):
Update: After mistakenly saying "Kitty" above, I tried it in actual Kitty, and the result is quite different from Ghostty. Initially, Kitty looked much better to me, but maybe it's only because of the way the list was ordered. In any case, here's 🐈 on macOS:
Here's before and after for me with FiraCode Nerd Font Mono:
I think it looks less aligned with the new symbol. It's also harder to tell that it's a diamond because it's smaller.
I think it looks less aligned with the new symbol. It's also harder to tell that it's a diamond because it's smaller.
It looks worse after, but it doesn't look well-aligned before either. Which terminal do you use?
iTerm2
collecting how it's displayed by various terminals.
Each line is with the current symbol◆ (U+25C6) / the proposed one ♦ (U+2666)
Linux
Alacritty
Gnome terminal
Ghostty
Jetbrains (PyCharm)
Kitty
Konsole
LXTerminal
Visual Studio Code
macOS
Ghostty
iTerm2
Jetbrains (PyCharm)
Terminal
Visual Studio Code
WezTerm
Warp
Windows
Alacritty
Tabby
Terminal
Visual Studio Code
I tried to make a comprehensive overview of the most common terminals that I know. I'm really not a windows guy, so I may have missed an important one. Please complete the screenshot collection if you think that's the case!
Overall, I'm surprised by the number of configurations that appear misaligned with the current symbol. The new proposal, though not perfect, shows a significant global improvement across the tested configurations.
Is there an objection to that change? As shown by the collected screenshots, the display is significantly better in the terminals and in the web browsers, yet not perfect in all the terminals.
IMO it would be interesting to merge that commit shortly after a release and gather feedback from the community.
(I don't use unicode node symbols, so I personally don't have opinion, but ...)
As shown by the collected screenshots, the display is significantly better in the terminals and in the web browsers, yet not perfect in all the terminals.
Is it strictly better? A bigger emoji might be easier to spot than well-aligned tiny symbol.
Is it strictly better? A bigger emoji might be easier to spot than well-aligned tiny symbol.
Indeed, that's a drawback I forgot to mention — because it's a minor one for me — while I should have. The new symbol is not exactly tiny either and is very different from the others, as visible in the screenshots.
That lets us with:
- a much better alignment in web browsers, instant messaging applications, …
- a better alignment in some of the most-used terminals
but
- a worse alignment in a few terminals
- a smaller symbol, which could impact visibility
While not a perfect solution, I believe the trade-off is worthwhile. I'm keen to hear others' thoughts.
Isn't it a diamond because it was copied from some other VCS? If so, copy the character they used also. If not, use a different symbol ?
Isn't it a diamond because it was copied from some other VCS? If so, copy the character they used also. If not, use a different symbol ?
I think it was copied from git-branchless because a diamond serves as a good visual metaphor for immutability. I like it, I'm just not very pleased with how it's displayed in various contexts, which is why I'm looking for an alternative diamond glyph.
I'm also on the fence. It just so happens that the new symbol looks worse on some of the terminals I use (Termux and Android in general, Kitty), and it looks weird in GMail. So, while I wouldn't oppose this change (I don't think these problems are particularly severe), I'm not enthusiastic about it either.
the new symbol looks worse on some of the terminals I use (Termux and Android in general, Kitty)
worse because it is slightly smaller?
the new symbol looks worse on some of the terminals I use (Termux and Android in general, Kitty)
worse because it is slightly smaller?
Sorry, I meant Ghostty. I keep mixing them up. I was thinking of the first Ghostty screenshot from https://github.com/jj-vcs/jj/pull/6708#issuecomment-2977194201, though it doesn't actually affect me because I use Ghostty on a Mac. I know you filed an issue about that; I think and hope that Ghostty's treatment of such issues hasn't been finalized yet and will change.
For Android, I meant https://github.com/jj-vcs/jj/pull/6708#issuecomment-2952989385.
I'm slightly against it, but mostly for selfish reasons (it will make things uglier for me on iTerm2). Maybe the root cause of the alignment problems is that the diamond symbol is not meant for drawing. Maybe there's something else we can find that's meant for graph drawing.