Choices show which is picked with ◉/○, not only by colour

In plain mode, for screen readers, or in a terminal without colours,
every option looked the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vvvomitandClaude Opus 5.5 committed 2026-10-29 14:48:20 +03:30
1 parent cd5ddf6f81
commit 5565945803
8 files changed
+30 -25

No files matched your search

+3 -2
View File
@@ -459,9 +459,10 @@ func (f *form) renderField(fl *field, idx int, focused bool, width int) string {
if fl.labels != nil {
name = fl.labels[i]
}
opt := sMuted.Padding(0, 2).Render(name)
// The marker says which is chosen without colour (plain mode, screen readers).
opt := sMuted.Padding(0, 1).Render("○ " + name)
if i == fl.choice {
opt = lipgloss.NewStyle().Foreground(cOnAccent).Background(cPurple).Bold(true).Padding(0, 2).Render(name)
opt = lipgloss.NewStyle().Foreground(cOnAccent).Background(cPurple).Bold(true).Padding(0, 1).Render("◉ " + name)
}
parts = append(parts, mark(f.id+"c"+strconv.Itoa(idx)+"."+strconv.Itoa(i), opt))
}
+4
View File
@@ -22,6 +22,10 @@ func TestPlain(t *testing.T) {
t.Fatalf("a line grew: %q", l)
}
}
a.jump(a.index("Server"))
if v := a.View(); !strings.Contains(v, "* This machine") || !strings.Contains(v, "o A remote server") {
t.Errorf("the chosen option can't be told without colour:\n%s", v)
}
if sp := newSpinner(); len(sp.Spinner.Frames) != 1 {
t.Error("the spinner still turns")
}
+5 -5
View File
@@ -4,15 +4,15 @@
│ ││ Maintenance │
│ ▾ Manage example.org ││ │
│ ⌂ Overview ││ ▌ Task │
│ @ Users ││ ▌ Services Disk Vacuum Upgrade Compress Tags │
│ # Rooms ││ ▌ Uninstall │
│ @ Users ││ ▌ ○ Services ○ Disk ◉ Vacuum ○ Upgrade ○ Compress ○ Tags │
│ # Rooms ││ ▌ ○ Uninstall │
│ ▦ Dashboard ││ ▌ Give the disk space of deleted rows back (Postgres VACUUM). Do it after deleting │
│ ↻ Updates ││ ▌ a lot, e.g. after compressing Synapse's state. │
│ ◷ Backups ││ │
│ ⚑ Alerts ││ Kind of vacuum │
│ ↺ Restore ││ Complete (FULL, ANALYZE; services stop) Full (services stop) │
│ ↶ Rollback ││ Plain (services keep running) Plain + ANALYZE (services keep running) │
│ ✎ Fine-tune ││ ANALYZE only (fastest) │
│ ↺ Restore ││ ◉ Complete (FULL, ANALYZE; services stop) ○ Full (services stop) │
│ ↶ Rollback ││ ○ Plain (services keep running) ○ Plain + ANALYZE (services keep running) │
│ ✎ Fine-tune ││ ○ ANALYZE only (fastest) │
│ ▌ ⚒ Maintenance ││ │
│ ⇢ Move server ││ │
│ ▤ Servers ││ │
+8 -8
View File
@@ -2,20 +2,20 @@
Maintenance
▌ Task
▌ Services Disk Vacuum
▌ Upgrade Compress Tags
▌ Uninstall
▌ ○ Services ○ Disk ◉ Vacuum
▌ ○ Upgrade ○ Compress ○ Tags
▌ ○ Uninstall
▌ Give the disk space of deleted rows
▌ back (Postgres VACUUM). Do it after
▌ deleting a lot, e.g. after compressing
▌ Synapse's state.
Kind of vacuum
Complete (FULL, ANALYZE; services stop)
Full (services stop)
Plain (services keep running)
Plain + ANALYZE (services keep running)
ANALYZE only (fastest)
◉ Complete (FULL, ANALYZE; services stop
○ Full (services stop)
○ Plain (services keep running)
○ Plain + ANALYZE (services keep running
○ ANALYZE only (fastest)
+3 -3
View File
@@ -1,9 +1,9 @@
◢◤ ◆ Manage › Maintenance
Maintenance
▌ Task
▌ Services Disk Vacuum
▌ Upgrade Compress Tags
▌ Uninstall
▌ ○ Services ○ Disk ◉ Vacuum
▌ ○ Upgrade ○ Compress ○ Tags
▌ ○ Uninstall
▌ Give the disk space of deleted rows back
▌ (Postgres VACUUM). Do it after deleting a
▌ lot, e.g. after compressing Synapse's
+2 -2
View File
@@ -8,7 +8,7 @@
│ ○ Review ││ ▌ User IDs look like @alice:<domain>. Point matrix.<domain> at your server. │
│ ○ Deploy ││ │
│ ││ Install where? │
│ ▸ Manage example.org ││ This machine A remote server over SSH │
│ ▸ Manage example.org ││ ◉ This machine ○ A remote server over SSH │
│ ││ │
│ ▸ Mirrors ││ sudo password │
│ ││ › │
@@ -17,7 +17,7 @@
│ ▾ Servers ││ ◆ Downloads ────────────────────────────────────────────────────────────────────────── │
│ ● example.org ││ │
│ ││ Network situation │
│ ││ Normal internet Blackout: in-country mirrors only │
│ ││ ◉ Normal internet ○ Blackout: in-country mirrors only │
│ ││ │
│ ││ Playbook git repository │
│ ││ › https://itsjustadream.g0th.ir/spantaleev/matrix-docker-ansible-deploy │
+4 -4
View File
@@ -7,8 +7,8 @@
▌ Point matrix.<domain> at your server.
Install where?
This machine
A remote server over SSH
◉ This machine
○ A remote server over SSH
sudo password
›
@@ -17,8 +17,8 @@
◆ Downloads ────────────────────────────────
Network situation
Normal internet
Blackout: in-country mirrors only
◉ Normal internet
○ Blackout: in-country mirrors only
Playbook git repository
› https://itsjustadream.g0th.ir/spant…
+1 -1
View File
@@ -248,7 +248,7 @@ func SetPlain() {
// sparklines become digits, 1 low to 8 full.
var plainText = strings.NewReplacer(
"╭", "+", "╮", "+", "╰", "+", "╯", "+", "┌", "+", "┐", "+", "└", "+", "┘", "+", "├", "+", "┤", "+", "┬", "+", "┴", "+", "┼", "+",
"│", "|", "─", "-", "▌", ">", "░", ".", "▸", ">", "▾", "v", "›", ">", "●", "*", "○", "o",
"│", "|", "─", "-", "▌", ">", "░", ".", "▸", ">", "▾", "v", "›", ">", "●", "*", "○", "o", "◉", "*",
"▁", "1", "▂", "2", "▃", "3", "▄", "4", "▅", "5", "▆", "6", "▇", "7", "█", "8",
"◢◤", " ",
)