Skip to content

Commit 5bd8f2e

Browse files
committed
fix: Added Drafts case to activeFolder() tab-label, it was missing
1 parent e1200fc commit 5bd8f2e

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

internal/ui/model.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,8 @@ func (m Model) activeFolder() string {
886886
return f.PaperTrail
887887
case "Sent":
888888
return f.Sent
889+
case "Drafts":
890+
return f.Drafts
889891
case "Trash":
890892
return f.Trash
891893
case "Archive":

internal/ui/model_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,24 @@ func TestActiveFolderUsesOffTabFolder(t *testing.T) {
396396
}
397397
}
398398

399+
// Drafts can appear in tab_order (default order includes it), so the
400+
// regular tab switch must resolve it — not just the off-tab path used by gd.
401+
func TestActiveFolderResolvesDraftsTab(t *testing.T) {
402+
m := Model{
403+
cfg: &config.Config{
404+
Folders: config.FoldersConfig{
405+
Inbox: "INBOX",
406+
Drafts: "Drafts",
407+
},
408+
},
409+
folders: []string{"Inbox", "Drafts"},
410+
activeFolderI: 1, // Drafts tab
411+
}
412+
if got := m.activeFolder(); got != "Drafts" {
413+
t.Fatalf("activeFolder() on Drafts tab = %q, want %q", got, "Drafts")
414+
}
415+
}
416+
399417
func TestActiveFolderHonorsPerAccountOverride(t *testing.T) {
400418
cfg := &config.Config{
401419
Folders: config.FoldersConfig{

0 commit comments

Comments
 (0)