Palette: Gruppen deutlich trennen (Linie mit Namen, Leerzeile davor) (#159)

Claude-Session: https://claude.ai/code/session_018i4GUfdrAng9QNWg2qWwND

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
db9979andClaude authored and GitHub committed 2026-11-13 12:56:21 +01:00
1 parent 23083f4401
commit 3ebba1d2c2
3 files changed
+32 -7

No files matched your search

+26 -1
View File
@@ -1070,6 +1070,15 @@ func (a *App) viewPalette() string {
b.WriteString(promptBlock(st.Accent.Render("$ "), p.in.View()) + "\n")
b.WriteString(lipgloss.NewStyle().Foreground(st.T.Border).Render(strings.Repeat("─", w-4)) + "\n")
maxRows := max(5, a.h-12)
// Leerzeilen zwischen den Gruppen nur, wenn sie Platz haben: jede kostet
// eine Zeile, die sonst ein Eintrag hätte.
groups := 0
for i, it := range items {
if i == 0 || it.group != items[i-1].group {
groups++
}
}
gaps := a.h >= 30 && len(items)+groups <= maxRows
// Fenster um die Auswahl
start := 0
if p.sel >= maxRows {
@@ -1085,7 +1094,7 @@ func (a *App) viewPalette() string {
if it.group == pgConns {
head = a.palConnHeader(p.in.Value())
}
b.WriteString(st.Muted.Render(groupHead(head)) + "\n")
b.WriteString(a.palGroupRule(head, w-4, gaps && rows > 0) + "\n")
}
iconStyle := st.Accent
switch it.group {
@@ -1186,3 +1195,19 @@ func (a *App) viewPalette() string {
}
func ansiPlain(s string) string { return lipgloss.NewStyle().Render(ansi.Strip(s)) }
// palGroupRule: Gruppenkopf der Palette als Linie mit Namen
// („── ALLGEMEIN ─────────“), damit sich die Bereiche deutlich trennen. Ab
// der zweiten Gruppe steht eine Leerzeile davor (gap), wenn Platz ist.
func (a *App) palGroupRule(head string, w int, gap bool) string {
st := a.s
name := head
rule := lipgloss.NewStyle().Foreground(st.T.Border)
label := st.Accent.Bold(true).Render(name)
rest := max(2, w-lipgloss.Width(name)-4)
out := rule.Render("── ") + label + rule.Render(" "+strings.Repeat("─", rest))
if gap {
out = "\n" + out
}
return out
}
+3 -3
View File
@@ -2,20 +2,20 @@
Verbindunge┌─ ◆ Befehlspalette 19 Einträge ────────────────────────────────────── × ─┐
│ $ Ziel, Frage, Befehl, Tunnel, Verbindung oder user@host:port … │
▾ Netzwerk │ ──────────────────────────────────────────────────────────────────────── │
○ # switc│ // häufig │
○ # switc│ ── HÄUFIG ────────────────────────────────────────────────────────────── │
▾ Produktio│ [+] Neue Verbindung n │
▾ Web │ [$] Lokale Shell in neuem Tab Alt+L │
▌ ○ web│ [*] Broadcast: Befehl auf mehreren Hosts m │ft …
▌ ○ web│ [/] Netzwerk-Scan: SSH-Geräte finden f │
▌ ○ db-01│ [#] Sitzungsprotokolle durchsuchen l │s Menü ·
○ nas │ // verbindungen │
○ nas │ ── VERBINDUNGEN ──────────────────────────────────────────────────────── │
○ spark │ [·] nas admin@nas.local │
│ [·] spark dominik@spark.lan │
│ [#] switch-core Netzwerk manager@192.168.1.2 │
│ [·] db-01 Produktion postgres@10.0.1.5 │
│ [·] web-01 Produktion / Web deploy@10.0.0.11 │
│ [=] Alle 6 Verbindungen im Manager Name, Ordner oder #Tag tippen │
│ // alle aktionen │
│ ── ALLE AKTIONEN ─────────────────────────────────────────────────────── │
│ [/] Suchen & Logs › Verlauf, alle Tabs, Log-Blick, Protokolle 3 │
│ [T] Tabs & Ansicht › neu, teilen, Zoom, Arbeitsplätze 2 │
│ [*] Mehrere Hosts & Netzwerk › Broadcast, Scan, Zeitpläne, Switches 5 │
+3 -3
View File
@@ -2,20 +2,20 @@
connections┌─ ◆ Command palette 19 entries ────────────────────────────────────── × ─┐
│ $ Goal, question, command, tunnel, connection or user@host:port … │
▾ Netzwerk │ ──────────────────────────────────────────────────────────────────────── │
○ # switc│ // frequent │
○ # switc│ ── FREQUENT ──────────────────────────────────────────────────────────── │
▾ Produktio│ [+] New connection n │
▾ Web │ [$] Local shell in a new tab Alt+L │
▌ ○ web│ [*] Broadcast: command on several hosts m │
▌ ○ web│ [/] Network scan: find SSH devices f │
▌ ○ db-01│ [#] Search session logs l │ menu ·
○ nas │ // connections │
○ nas │ ── CONNECTIONS ───────────────────────────────────────────────────────── │
○ spark │ [·] nas admin@nas.local │
│ [·] spark dominik@spark.lan │
│ [#] switch-core Netzwerk manager@192.168.1.2 │
│ [·] db-01 Produktion postgres@10.0.1.5 │
│ [·] web-01 Produktion / Web deploy@10.0.0.11 │
│ [=] All 6 connections in the manager type a name, folder or #tag │
│ // all actions │
│ ── ALL ACTIONS ───────────────────────────────────────────────────────── │
│ [/] Search & logs › scrollback, all tabs, log glance, session logs 3 │
│ [T] Tabs & view › new, split, zoom, workspaces 2 │
│ [*] Several hosts & network › broadcast, scan, schedules, switches 5 │