Skip to content

Commit 101e7e6

Browse files
committed
add search in sent and move to sent
1 parent 725a6be commit 101e7e6

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

docs/content/docs/keybindings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ To update both the help overlay and this document at once, edit that file and ru
7474
| `Mf` | move to Feed |
7575
| `Mp` | move to PaperTrail |
7676
| `Mt` | move to Trash |
77+
| `Ms` | move to Sent |
7778
| `Mo` | move to ScreenedOut |
7879
| `Mw` | move to Waiting |
7980
| `Mc` | move to Scheduled |

internal/ui/keys.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var HelpSections = []HelpSection{
5757
{"Mf", "move to Feed"},
5858
{"Mp", "move to PaperTrail"},
5959
{"Mt", "move to Trash"},
60+
{"Ms", "move to Sent"},
6061
{"Mo", "move to ScreenedOut"},
6162
{"Mw", "move to Waiting"},
6263
{"Mc", "move to Scheduled"},

internal/ui/model.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3311,7 +3311,13 @@ func (m *Model) applyFilter() tea.Cmd {
33113311
// Skip if text filter is active and doesn't match
33123312
if m.filterText != "" {
33133313
query := strings.ToLower(m.filterText)
3314-
hay := strings.ToLower(e.From + " " + e.Subject)
3314+
// In Sent folder, search To/CC/BCC instead of From — From is always us.
3315+
var hay string
3316+
if len(m.folders) > 0 && m.activeFolder() == m.cfg.Folders.Sent {
3317+
hay = strings.ToLower(e.To + " " + e.CC + " " + e.BCC + " " + e.Subject)
3318+
} else {
3319+
hay = strings.ToLower(e.From + " " + e.Subject)
3320+
}
33153321
if !strings.Contains(hay, query) {
33163322
continue
33173323
}
@@ -3428,6 +3434,7 @@ func (m Model) handleChord(prefix, key string) (tea.Model, tea.Cmd) {
34283434
"f": m.cfg.Folders.Feed,
34293435
"p": m.cfg.Folders.PaperTrail,
34303436
"t": m.cfg.Folders.Trash,
3437+
"s": m.cfg.Folders.Sent,
34313438
"o": m.cfg.Folders.ScreenedOut,
34323439
"w": m.cfg.Folders.Waiting,
34333440
"c": m.cfg.Folders.Scheduled,

0 commit comments

Comments
 (0)