You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default folders.tab_order includes Drafts, but activeFolder() did not map the visible Drafts label to Folders.Drafts. It therefore fell through to Inbox while the UI still highlighted Drafts. The separate gd path opened Drafts as an off-tab folder, producing two Drafts views with different contents.
The same symptom was reported in #6. PR #19 also noticed the missing mapping, but its broader per-account folder changes were closed without merging.
Regardless of whether a custom configuration shows Drafts as a normal tab, every label accepted by TabLabels() needs to resolve to its configured mailbox. This keeps the existing off-tab behavior for configurations that hide Drafts.
What changed
map the visible Drafts tab to Folders.Drafts
make gd reuse the normal Drafts tab when present
retain the off-tab gd fallback when a custom tab order hides Drafts
clear stale server-search state when gd leaves Search
add focused regression tests and align the invariant and FAQ documentation
Test plan
go test ./internal/ui -run 'TestActiveFolderMapsDraftsTab|TestGoToDrafts(ReusesVisibleTab|UsesOffTabFallbackWhenHidden)'
go vet ./...
go test ./...
manually verified with a Gmail IMAP account that the visible Drafts tab loads the configured mailbox and gd does not create a duplicate tab
Hi, I’ve rebased this onto the latest main and resolved the conflicts. The relevant tests and go vet pass locally. This fixes the Drafts tab folder mapping and keeps Drafts navigation state consistent. When you have a moment, I’d appreciate a review.
That is why the PR shows as UNSTABLE with "no checks reported" rather than green. main has not moved since 2026-08-31, so the branch is still cleanly rebased and the run should be valid as-is.
Could a maintainer approve that run so the PR gets a real upstream result? Happy to rebase first if you would prefer a fresh branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The default
folders.tab_orderincludes Drafts, butactiveFolder()did not map the visibleDraftslabel toFolders.Drafts. It therefore fell through to Inbox while the UI still highlighted Drafts. The separategdpath opened Drafts as an off-tab folder, producing two Drafts views with different contents.The same symptom was reported in #6. PR #19 also noticed the missing mapping, but its broader per-account folder changes were closed without merging.
Regardless of whether a custom configuration shows Drafts as a normal tab, every label accepted by
TabLabels()needs to resolve to its configured mailbox. This keeps the existing off-tab behavior for configurations that hide Drafts.What changed
Folders.Draftsgdreuse the normal Drafts tab when presentgdfallback when a custom tab order hides Draftsgdleaves SearchTest plan
go test ./internal/ui -run 'TestActiveFolderMapsDraftsTab|TestGoToDrafts(ReusesVisibleTab|UsesOffTabFallbackWhenHidden)'go vet ./...go test ./...gddoes not create a duplicate tabRefs #6 and #19.