Skip to content

feat: folders (#218)#240

Merged
andrinoff merged 2 commits intofloatpane:masterfrom
andrinoff:feat/folders
Mar 6, 2026
Merged

feat: folders (#218)#240
andrinoff merged 2 commits intofloatpane:masterfrom
andrinoff:feat/folders

Conversation

@andrinoff
Copy link
Copy Markdown
Member

@andrinoff andrinoff commented Mar 5, 2026

Replaces the hardcoded mailbox system (Inbox/Sent/Trash/Archive) with a dynamic folder sidebar that displays all IMAP folders across all accounts.

Closes #218

Changes

Folder sidebar

  • New FolderInbox component with a folder list on the left and email list on the right
  • Tab/Shift+Tab to switch between folders
  • Folders fetched from all accounts and merged (deduplicated)
  • INBOX always sorted to the top, rest alphabetical
  • Active folder highlighted with background color
  • [Gmail]/ and [Google Mail]/ prefixes stripped from display names

Move to folder (m)

  • Press m on a selected email to open a folder picker overlay
  • Navigate with j/k, confirm with Enter, cancel with Esc
  • Moves the email via IMAP and removes it from the current view

Caching

  • Folder lists cached per account to ~/.config/matcha/folder_cache.json
  • Folder emails cached per folder to ~/.config/matcha/folder_emails/<folder>.json
  • On startup: cached folders and INBOX emails display instantly, background refresh fetches latest
  • On folder switch: in-memory cache used first, then disk cache, then IMAP fetch
  • Pagination results persisted to disk cache so switching back to a folder preserves loaded emails

Pagination

  • Per-account exhaustion tracking prevents infinite "loading more..." on folders with few emails
  • Increased initial fetch and pagination limits from 20 to 50 per account
  • Stale fetch responses ignored when user has already switched to a different folder

Cleanup

  • Removed "Sent" and "Trash & Archive" from the Choice menu (all folders now accessible via sidebar)
  • Simplified email helpers in main model to work with folder-based system

Signed-off-by: drew <me@andrinoff.com>
@andrinoff andrinoff marked this pull request as ready for review March 6, 2026 07:44
Signed-off-by: drew <me@andrinoff.com>
@andrinoff andrinoff added the enhancement New feature or request label Mar 6, 2026
@andrinoff andrinoff merged commit d525efb into floatpane:master Mar 6, 2026
2 of 3 checks passed
@github-actions github-actions Bot added the chore Maintenance, refactor, cleanup label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, refactor, cleanup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Support provider folders

1 participant