mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-08 09:49:34 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
401d4dcc67 | ||
|
|
99daf8fa66 |
No files matched your search
+11
-2
@@ -3036,9 +3036,18 @@ func (m model) composerIdleHint() string {
|
||||
case tierNarrow:
|
||||
hint = "? shortcuts"
|
||||
case tierMedium:
|
||||
hint = fmt.Sprintf("? shortcuts · Ctrl+X cmds · %s sidebar", sidebarKey)
|
||||
parts := []string{"? shortcuts", "Ctrl+X cmds"}
|
||||
if m.sidebarAvailable() {
|
||||
parts = append(parts, sidebarKey+" sidebar")
|
||||
}
|
||||
hint = strings.Join(parts, " · ")
|
||||
default:
|
||||
hint = fmt.Sprintf("? shortcuts · Ctrl+X cmds · %s sidebar · %s detail · %s copy · Shift+Tab mode", sidebarKey, detailKey, mouseKey)
|
||||
parts := []string{"? shortcuts", "Ctrl+X cmds"}
|
||||
if m.sidebarAvailable() {
|
||||
parts = append(parts, sidebarKey+" sidebar")
|
||||
}
|
||||
parts = append(parts, detailKey+" detail", mouseKey+" copy", "Shift+Tab mode")
|
||||
hint = strings.Join(parts, " · ")
|
||||
}
|
||||
return zeroTheme.faint.Render(hint)
|
||||
}
|
||||
|
||||
@@ -2501,9 +2501,36 @@ func TestComposerIdleHintAndJumpCue(t *testing.T) {
|
||||
m.width, m.height = 100, 30
|
||||
m.transcript = append(m.transcript, transcriptRow{kind: rowAssistant, text: "hi", final: true})
|
||||
|
||||
// Idle, empty composer, managed mode -> the discoverability hint shows.
|
||||
if h := plainRender(t, m.composerIdleHint()); !strings.Contains(h, "shortcuts") {
|
||||
t.Fatalf("expected idle hint, got %q", h)
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
width int
|
||||
}{
|
||||
{name: "medium", width: 80},
|
||||
{name: "full", width: 100},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
idle := m
|
||||
idle.width = test.width
|
||||
|
||||
// Idle, empty composer, managed mode -> the discoverability hint shows.
|
||||
hint := plainRender(t, idle.composerIdleHint())
|
||||
if !strings.Contains(hint, "shortcuts") {
|
||||
t.Fatalf("expected idle hint, got %q", hint)
|
||||
}
|
||||
if strings.Contains(hint, "sidebar") {
|
||||
t.Fatalf("empty sidebar should not be advertised, got %q", hint)
|
||||
}
|
||||
|
||||
withSidebar := idle
|
||||
withSidebar.plan.steps = []planStep{{content: "inspect footer", status: "in_progress"}}
|
||||
if hint := plainRender(t, withSidebar.composerIdleHint()); !strings.Contains(hint, "Ctrl+B sidebar") {
|
||||
t.Fatalf("available sidebar should be advertised, got %q", hint)
|
||||
}
|
||||
withSidebar.sidebarHidden = true
|
||||
if hint := plainRender(t, withSidebar.composerIdleHint()); !strings.Contains(hint, "Ctrl+B sidebar") {
|
||||
t.Fatalf("collapsed sidebar should keep its restore shortcut, got %q", hint)
|
||||
}
|
||||
})
|
||||
}
|
||||
// Hidden during a run.
|
||||
busy := m
|
||||
|
||||
Reference in new issue
Block a user