Move To Folder: create new #422

Closed
opened 2026-06-04 17:24:52 +00:00 by guettli · 1 comment
guettli commented 2026-06-04 17:24:52 +00:00 (Migrated from codeberg.org)

When I choose "move to folder" from single Mail View, I want to be able to create a new folder.

When I choose "move to folder" from single Mail View, I want to be able to create a new folder.
guettlibot commented 2026-06-04 17:35:03 +00:00 (Migrated from codeberg.org)

PR opened at https://codeberg.org/guettli/sharedinbox/pulls/423.

Here's what I did:

Implementation summary:

  1. lib/core/repositories/mailbox_repository.dart — added createMailbox(accountId, name) method to the interface (no special role, for user-created folders).

  2. lib/data/repositories/mailbox_repository_impl.dart — implemented createMailbox by routing to the existing IMAP/JMAP private helpers, making the role parameter nullable (String?). The JMAP request now conditionally includes the role field only when non-null (avoids sending an empty/null role to the server).

  3. lib/ui/screens/email_detail_screen.dart — added:

    • _promptNewFolderName() — shows an AlertDialog with a text field + Cancel/Create buttons, properly disposes the controller
    • A "Create new folder…" ListTile at the bottom of the "Move to…" bottom sheet using a sentinel value to distinguish it from folder paths; on selection, prompts for a name, calls createMailbox, then moves the email to the new folder
PR opened at https://codeberg.org/guettli/sharedinbox/pulls/423. Here's what I did: **Implementation summary:** 1. **`lib/core/repositories/mailbox_repository.dart`** — added `createMailbox(accountId, name)` method to the interface (no special role, for user-created folders). 2. **`lib/data/repositories/mailbox_repository_impl.dart`** — implemented `createMailbox` by routing to the existing IMAP/JMAP private helpers, making the `role` parameter nullable (`String?`). The JMAP request now conditionally includes the `role` field only when non-null (avoids sending an empty/null role to the server). 3. **`lib/ui/screens/email_detail_screen.dart`** — added: - `_promptNewFolderName()` — shows an `AlertDialog` with a text field + Cancel/Create buttons, properly disposes the controller - A "Create new folder…" `ListTile` at the bottom of the "Move to…" bottom sheet using a sentinel value to distinguish it from folder paths; on selection, prompts for a name, calls `createMailbox`, then moves the email to the new folder
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#422