Skip to content

Feature: Thread Management

Overview

Thread Management is the core feature that enables users to view, navigate, and interact with email conversations (threads) from shared inboxes. It provides a familiar email-like interface optimized for team collaboration and efficient processing of customer communications.

Feature Purpose

The Thread Management feature serves as the foundation for team-based email handling. It transforms individual email access into a collaborative workspace where teams can see all conversations in one place, navigate efficiently, and take coordinated action.

User Value Proposition

For Support Teams:

  • See all customer conversations in one centralized view
  • Navigate quickly between threads without context switching
  • Process high volumes of emails efficiently
  • Never miss a customer inquiry

For Team Leads:

  • Monitor team workload and response patterns
  • Ensure even distribution of work
  • Track conversation history comprehensively

For Organizations:

  • Reduce response times through better organization
  • Improve customer satisfaction with coordinated responses
  • Scale support operations without losing quality

Key Capabilities

1. Thread List View

Description: A scrollable list displaying all email threads for the selected inbox, optimized for performance with thousands of threads.

User Experience:

  • Threads sorted by most recent activity (newest first)
  • Each thread shows:
    • Sender name and avatar/initials
    • Email subject
    • Preview of message content (truncated)
    • Timestamp (relative time: "2 hours ago", "yesterday")
    • Unread indicator (visual badge or highlight)
    • Tags (if any)
    • The assignee's initials at the trailing edge, next to the status icon. An unassigned thread shows nothing there, so the gaps stand out in a scan.
    • For a thread with more than one mail, the preview starts with the number of mails and the sender of the last one ("4 mails, last from Alice Example"). The compact list keeps its single line and shows only the initials.
  • Virtual scrolling for smooth performance with 100k+ threads
  • Empty state when no threads exist

Acceptance Criteria:

  • List loads within 2 seconds for typical inbox
  • Virtual scrolling maintains 60fps
  • Unread threads are visually distinct
  • Thread metadata accurately reflects latest state

2. Thread Detail View

Description: Full conversation view showing all emails and actions in chronological order.

User Experience:

  • Split-pane layout (list on left, detail on right)
  • Thread header shows subject and tags
  • Timeline displays:
    • Incoming emails (from customers)
    • Outgoing emails (from team)
    • Internal comments
    • Assignment actions
    • Status changes
    • Tag changes
    • Draft creations/sends
  • Each email expandable to show full content
  • Auto-scroll to latest message
  • Keyboard shortcut to open (Enter key)

Email bodies: Each body renders through the App Suite mail sanitizer and content pipeline inside a sandboxed frame (ADR-0026), so a mail cannot run scripts or break the page layout. In light mode every mail sits on the same white canvas as in App Suite Mail. In dark mode Teams goes one step further: mails without a design of their own, the plain replies and notifications that make up most traffic, render on the dark card with their hard-coded text colours adapted, while mails that bring their own background keep the white canvas because inverting a designed mail breaks it. A mail whose colours Teams cannot adapt safely also falls back to the white canvas rather than rendering half-adapted.

For the mails that still look wrong on the dark card, the mail header offers "Show on light background", which switches that mail to the white canvas and remembers the choice on this device; the same button switches it back. Mails already on the white canvas show no button, so the switch only ever goes from dark to light. Readers who prefer the App Suite look everywhere set "Always show emails on a light background" in the topbar settings menu, a group that appears in dark mode only; it is stored with the other Teams preferences and hides the per-mail button.

Acceptance Criteria:

  • Thread loads within 1 second
  • All actions appear in correct chronological order
  • Email content renders properly (HTML safe)
  • In dark mode, a mail without its own background renders on the dark card; a designed mail keeps the white canvas
  • "Show on light background" appears only in dark mode and only for mails on the dark card, and is remembered per mail on the device
  • "Always show emails on a light background" appears in the settings menu in dark mode only and overrides the per-mail choice
  • Timeline auto-scrolls to bottom on new actions

3. Keyboard Navigation

Description: Efficient keyboard controls for power users to navigate without mouse.

User Experience:

  • Arrow Up/Down: Navigate to previous/next thread
  • Enter: Open selected thread
  • Home/End: Jump to first/last thread
  • Cmd/Ctrl + A: Select all threads
  • Cmd/Ctrl + Click: Toggle thread selection
  • Shift + Click: Select range of threads
  • Delete/Backspace: Delete selected threads (future)

Acceptance Criteria:

  • Keyboard focus is visible
  • Navigation doesn't cause unnecessary scrolling
  • Shortcuts work consistently across browsers
  • Selected thread remains in view after navigation

4. Multi-Selection

Description: Select multiple threads to perform bulk operations.

User Experience:

  • Cmd/Ctrl + Click toggles individual selection
  • Shift + Click selects range from anchor point
  • Cmd/Ctrl + A selects all visible threads
  • Selected threads show visual highlight
  • The top bar applies status, assignee, category, spam and delete actions to every selected thread
  • On a phone, a long press starts a selection (see Selecting Threads on a Phone below)

Acceptance Criteria:

  • Selection state persists during navigation
  • Visual feedback is clear and consistent
  • Selection works with keyboard and mouse
  • At least one thread remains selected (can't deselect last item)

5. Inbox Filtering

Description: Switch between different shared inboxes and personal views.

User Experience:

  • Sidebar shows all available inboxes
  • Personal views: "Assigned to me", "Shared with me"
  • Clicking inbox loads its threads
  • Active inbox highlighted in sidebar
  • Inbox selection persists in URL
  • Last viewed thread remembered per inbox

Acceptance Criteria:

  • Inbox list loads from backend
  • Switching inboxes updates threads within 2 seconds
  • URL updates to reflect current inbox
  • Returning to inbox restores previous thread selection

6. Thread Synchronization

Description: Automatic sync of threads from mail server.

User Experience:

  • Background sync when opening inbox
  • New threads appear automatically
  • Modified threads update in real-time
  • Sync indicator shows progress (future)
  • Sync respects mail server rate limits

Acceptance Criteria:

  • Sync detects new emails within 30 seconds
  • Sync uses token-based incremental updates
  • Database stores sync token per inbox
  • Failed syncs retry with exponential backoff

7. Create Thread via Comment

Description: Start new threads directly from internal comments without waiting for an incoming email, enabling proactive conversations.

User Experience:

  • User can create a new thread from the inbox view
  • Provides subject and initial message/comment
  • Thread appears immediately in thread list
  • No external email required to initiate thread
  • Thread starts with status "New" (null)
  • First action is a comment-type action

Acceptance Criteria:

  • Thread created with valid subject and message
  • Thread immediately visible in thread list
  • Thread persisted to database with unique ID
  • Initial comment action recorded in timeline
  • API returns 201 status with created thread
  • User attribution tracked for thread creator
  • Thread can receive subsequent comments and emails

Use Cases:

  • Support team wants to track internal investigation before customer contact
  • Team lead creates thread for team discussion about potential issue
  • Proactive outreach planning requiring team coordination
  • Documentation of internal decision-making process

8. Swipe Actions on a Phone

Description: On a phone-width screen each row of the thread list answers the triage decisions with a swipe, so a thread can be taken, closed or discarded without opening it.

Left swipe (discard):

  • Reveals three buttons: More, Mark as spam and Delete. Mark as spam only appears when the mail backend supports spam handling.
  • A swipe past the buttons deletes directly.
  • More opens the action sheet described below.

Right swipe (ownership and status):

  • A short swipe marks the thread Done. A thread that is Done shows "Reopen" and goes back to To do.
  • A long swipe is the ownership move: it assigns a thread that is nobody's to the current user ("Take") and gives a thread without status In Progress; on a thread that is already theirs it removes the assignee ("Unassign"). The label under the thumb switches at each threshold, so the outcome is visible before the finger lifts.
  • On a public folder without a member list the long swipe stops at Done.

Action sheet:

  • Slides up from the bottom and lists, in this order: the thread's subject and sender as a heading, the workflow statuses with the current one marked, Assign to me, No assignee and the other members of the inbox, the categories as toggles, and finally Mark as spam and Delete, visually separated from the rest.
  • Tapping an action applies it and closes the sheet. Category toggles keep the sheet open.
  • The sheet stays clear of the App Suite bottom bar on smartphones.

Feedback and undo:

  • Crossing a swipe threshold gives a short haptic tick on devices that support vibration and only for touch input.
  • Done, Reopen, Take, Unassign, Mark as spam and Delete each show a toast with Undo. Undo restores the previous status and assignee, returns a spam-marked thread to the inbox, or brings deleted mails back from Trash. Status and assignee changes made from a thread's own top bar do not offer undo.

Acceptance Criteria:

  • Swiping only acts on the row under the thumb; the drawer and the release area never overlap
  • Every swipe action and every sheet action can be undone from the toast
  • The sheet and the toast never cover the App Suite bottom navigation

9. Selecting Threads on a Phone

Description: Bulk actions exist for status, assignee, categories, spam and delete, and the desktop reaches them with modifier keys. On a phone a long press opens the same selection and the same actions, so a run of noise or a batch of similar threads is handled in one go.

Entering and leaving a selection:

  • A long press on a row (touch input only) starts a selection with that row in it. The list switches to selection mode: a checkbox takes the place of the unread dot, or of the avatar in the compact list, and tapping a row toggles it instead of opening it.
  • Keeping the finger down after the long press and moving it over further rows selects every row between the pressed one and the finger; moving back shrinks the range again. Each new row gives a light haptic tick. This is the gesture for "everything above this line is noise".
  • Swiping is off while a selection exists, so a thumb cannot delete a row that is about to be part of a bulk action.
  • The list header shows the count ("3 selected") and gains Select all and Cancel next to the filter button, which stays where it is. Select all covers the threads of the current view and filter.
  • Cancel, Escape, pull to refresh, switching the folder, removing the last selected thread, or applying an action leave selection mode.

The bar below the list:

  • While a selection exists, a bar sits below the list with the actions of the action sheet in the same order: Status, Assign, Categories, Spam and Delete. Spam only appears when the mail backend supports spam handling. The list shrinks to make room, so its last row stays reachable.
  • Status, Assign and Categories open the corresponding part of the action sheet for the whole selection. The sheet marks a status or an assignee only when every selected thread has it, and a category only when every selected thread carries it.
  • Spam and Delete apply directly.
  • The top bar of the list does not change while a selection exists; selection mode only adds the checkboxes and the bar.

Feedback and undo:

  • Starting a selection gives a short haptic tick, as the swipes do.
  • Status, Assign to me, other assignees and Mark as spam offer one undo for the whole batch, phrased with the count ("3 threads marked as done"). Delete offers the undo of the deletion, phrased the same way. A category toggle adds or removes that one category on every selected thread, and each thread keeps its other categories.

Acceptance Criteria:

  • A long press never opens the thread or the browser's context menu, and the tap that ends it does not undo the selection it just made
  • The list scrolls as usual while a selection exists; only a drag that extends the selection holds it still
  • The bar sits flush above the App Suite bottom navigation with no list showing between them
  • Every bulk action can be undone from the toast

10. A Stable List on a Phone

Description: Swiping through a list only works as a rhythm when the rows stay where the thumb expects them. In a busy inbox threads arrive while the reader is mid-list, and rows leave after an action. The list keeps the rows under the thumb in both cases.

New threads wait behind a pill:

  • While the list is scrolled to the top and no swipe or selection is in progress, a thread that arrives is inserted at its place as before.
  • Otherwise the thread is held back and a pill appears at the top edge of the list: "3 new threads". Tapping the pill scrolls to the top and lets the held threads in. Scrolling to the top by hand, or ending the swipe or selection while at the top, lets them in as well.
  • While a swipe drawer is open, the pill stays hidden so it never covers the drawer. Closing the drawer at the top lets the held threads in; closing it further down shows the pill. Screen readers announce the number of waiting threads either way.
  • Changes to threads that are already visible (a new reply, a status or assignee change made by a colleague) apply in place without waiting; only new rows are held. A thread that leaves the view leaves at once. A held thread that changes keeps waiting with its fresh state, and one that stops matching the view is dropped from the pill.
  • Undo is never held: a thread brought back by Undo appears right away.
  • Switching the folder or the filter discards held threads and loads the new view as usual. Pull to refresh works only at the top of the list, where new threads are inserted directly.

Removing a thread keeps the next one under the thumb:

  • When an action or a colleague's change removes a row from the view (Done in the Active view, spam, delete, a reassignment), the rows below move up to close the gap, and the row that was below the removed one now sits exactly where it was. A reader who swipes the same spot repeatedly acts on consecutive threads.
  • A row removed above the visible part of the list shortens the list without moving the rows in view. The undo toast appears at the bottom of the screen, outside the list, so it never covers the next row.

Acceptance Criteria:

  • A thread arriving while the reader is scrolled, swiping or selecting never moves the rows in view
  • The pill count matches the threads that drop in when it is tapped
  • Nothing covers an open swipe drawer while threads are held
  • Removing a row anywhere in the list leaves the rows in view where they were, apart from the ones closing the gap

11. Filtering on a Phone

Description: Triage narrows the list before acting on it: what nobody owns, what is mine, what is unread, what belongs to a category. The list header's filter menu holds every view; on a phone the ones used for triage also sit on the screen as chips.

The filter menu:

  • The menu in the list header lists the status views Active, Unassigned, Assigned, Mine, Unread, Archive, Spam (only when the mail backend supports spam handling) and Trash, and below them every category. It marks the active view and the selected categories.
  • Mine shows the open threads assigned to the current user; Assigned shows everyone's.
  • Unread shows the open threads with at least one mail that is unread in the mailbox. Read state follows the mailbox: reading a mail anywhere, in Teams, in App Suite or on a phone, clears it here with the next synchronisation. There is no action to mark a thread read or unread.
  • Categories combine with a status view and with each other: a thread matches when it carries any of the selected categories.
  • The filter is part of the URL, so a link to a filtered view opens that view.

The chip row on a phone:

  • Below the list header a row of chips shows Unassigned, Mine, Unread and Category. The chips are quiet outlines; the active one is drawn in the accent colour.
  • Tapping a status chip applies it and marks it as active; tapping it again clears it. The three status chips are exclusive with each other. Each tap gives a light haptic tick.
  • The Category chip opens the list of categories with check marks, in the order of the category picker. Categories combine with a status chip and with each other, as in the menu. The chip names the selected categories; with none selected it reads "Category". Keeping the categories behind one chip keeps the row short however many categories exist.
  • Archive, Spam and Trash stay in the menu. They are not triage views, and keeping them out of the row keeps it short. With one of them active no status chip is marked.
  • The row appears only on phone-width screens; the desktop keeps the menu.

Acceptance Criteria:

  • A chip and the menu entry of the same view always agree on what is active
  • A thread that stops matching the active view (handed to a colleague in Mine, read in Unread) leaves the list without a reload, keeping the rows in view in place
  • The chip row fits a phone-width screen without scrolling and never pushes the list's last row out of reach

12. Flow on a Phone

Description: The swipes, the selection and the chips make each decision cheaper. Flow reduces the number of times a triager has to return to the list and find their place again: the view moves on after a decision, the list is ordered by who needs to act, and a focused mode works through the unassigned threads one at a time.

Moving on after a decision:

  • When a thread is open on a phone and the reader marks it Done, deletes it, marks it as spam or assigns it to a colleague, the view opens the thread below it in the list instead of staying on a thread that just left the view. When the handled thread was the last one, the view returns to the list.
  • The topbar settings menu has a group "After acting on a thread (phone)" with three choices: Open the next thread (the default), Open the previous thread, and Back to the list. The setting is per user and applies to phone-width screens; the desktop keeps its panes.
  • Every one of these actions offers its undo, and undoing reopens the handled thread once it is back in the list. Other status changes, category changes and taking a thread do not move on.

Order by attention:

  • On a phone the Active, Unread and Assigned views show the threads in three sections, in this order: Needs an owner (unassigned), Mine (assigned to the reader), Everyone else (assigned to colleagues). Within a section the threads keep their newest-first order.
  • Each section starts with a heading and its count. While the list is scrolled, the heading of the section in view stays pinned to the top of the list.
  • A thread moves between sections as soon as its assignee changes, including through a colleague's action.
  • A view with one section shows no heading: the Unassigned and Mine views stay flat, as do Archive, Spam and Trash. The desktop keeps its flat, newest-first order everywhere.
  • Moving on after a decision follows this order, so "next" is the thread below in the sections as displayed.

Focused triage mode:

  • The list header of the Unassigned view on a phone has a Triage button. It replaces the list with one unassigned thread at a time: sender, time, subject, the preview, the number of mails and the inbox, on a card. Below the card four buttons sit in thumb reach: Take, Delete, Skip and More, where More opens the action sheet for the thread with Done and the other statuses.
  • Swiping the card right takes the thread and swiping left skips it, so a quick pass needs only the two main decisions. Each direction has a single swipe; no swipe deletes in triage. Behind the card, the Take or the Skip icon from the toolbar marks the zone. Each swipe zone gives a haptic tick. Tapping the card opens the full thread and leaves the mode.
  • Skip moves on and keeps the thread for the end of the deck. Only the reader's deck changes: the thread stays unassigned and in everyone's Unassigned view.
  • Skips are kept on the phone for the current session. They survive opening a thread, leaving triage or switching to another app, and are gone after a reload or sign-out. They apply to the thread in every view.
  • A skipped thread is dealt again, at the end of the deck, when a new mail from outside the team or a colleague's comment arrives on it. Replies from the team, drafts and status or assignment changes don't count.
  • When only skipped threads are left, the deck shows how many there are with Go through them, which deals them again and restarts the counter, and Close. Opening triage when every unassigned thread is skipped shows the same screen.
  • Each decision advances to the next unassigned thread at once and the counter ("7 of 23") moves with it. A thread a colleague takes meanwhile leaves the queue and the total shrinks; threads that arrive while the mode is open join the end of the queue and the total grows. New threads are never held behind the "new threads" pill while the mode is open.
  • The mode ends when the queue is empty and nothing is skipped, when the reader taps Close or goes back, or when the screen leaves the phone width. Each of these returns to the Unassigned list. The mode only opens from its button: opening an inbox or reloading the page shows the list. The list, its chips and its swipe actions are unchanged by the mode.

Acceptance Criteria:

  • After Done, Delete, Spam or an assignment to a colleague on an open thread, the phone shows the neighbour without passing through the list, and Undo brings the handled thread back on screen
  • The section headings and counts match the rows below them at all times, including after a colleague reassigns a thread
  • In triage mode no decision can hit the same thread twice, and the counter never counts a thread twice
  • Triage mode only ever deals unassigned threads, and going back from it shows the Unassigned list
  • Skipping a thread changes nothing a colleague can see

UI/UX Design

Layout

┌────────────────────────────────────────────────┐
│ Sidebar │ Thread List │ Thread Detail          │
│         │             │                        │
│ For You │  ┌─────┐   │ ┌──────────────────┐  │
│ - Me    │  │Thrd1│   │ │ Subject & Tags   │  │
│ - Shared│  │     │   │ └──────────────────┘  │
│         │  ├─────┤   │                        │
│ Shared  │  │Thrd2│   │ ┌──────────────────┐  │
│ Inboxes │  │     │   │ │ Email 1          │  │
│ - Sup...│  ├─────┤   │ │ (from customer)  │  │
│ - Bil...│  │Thrd3│   │ └──────────────────┘  │
│         │  └─────┘   │                        │
│         │             │ ┌──────────────────┐  │
│         │             │ │ Comment          │  │
│         │             │ └──────────────────┘  │
│         │             │                        │
│         │             │ [Comment input...]    │
└────────────────────────────────────────────────┘

Visual Design

  • Thread list uses card/row-based layout
  • Selected thread has accent color background
  • Unread threads show bold text and indicator dot
  • Avatars show user initials if no photo
  • Tags display as colored chips
  • Timeline uses alternating left/right alignment for visual flow
  • Empty states show friendly illustrations and guidance

Responsive Behavior

  • Mobile: Sidebar collapses, thread list full-width
  • Mobile: Thread detail replaces list when thread selected
  • Mobile: Rows swipe left to discard and right to take or close (see Swipe Actions on a Phone)
  • Mobile: A long press selects several rows for one bulk action (see Selecting Threads on a Phone)
  • Mobile: One-tap filter chips sit below the list header (see Filtering on a Phone)
  • Mobile: The view moves on after a decision, the list is ordered by attention, and a focused triage mode works through the unassigned threads (see Flow on a Phone)
  • Tablet: Adjustable split panes
  • Desktop: Three-column layout with fixed sidebar

Technical Implementation

Architecture

  • Frontend: Vue 3 components with Pinia state management
  • Backend: Fastify REST API
  • Database: PostgreSQL with Drizzle ORM
  • Real-time: WebSocket for live updates

API Endpoints

EndpointMethodPurpose
/threads/:inboxIdGETFetch all threads for inbox
/threads/:inboxIdPUTCreate new thread via comment
/threads/:inboxId/countGETGet thread count with optional filter
/threads/:inboxId/:threadIdGETFetch single thread with actions
/threads/:inboxId/:threadId/actionsGETFetch thread actions/timeline

Data Model

Thread Schema:

{
  id: string,              // Thread GUID from mail system
  displayName: string,     // Sender name
  email: string,          // Sender email
  subject: string,        // Email subject
  message: string,        // Preview text
  created_at: Date,       // Thread creation time
  assignee: UserRef,      // Assigned user (null if unassigned)
  tags: string[],         // Array of tag strings
  status: string,         // "to-do" | "in-progress" | "done" | null
  unread: boolean,        // Has unread emails
  inbox: InboxRef,        // Source inbox
  actions: Action[]       // Timeline of actions
}

Action Types:

  • email: Incoming/outgoing email
  • assign: Assignment change
  • comment: Internal comment
  • status: Status change
  • tag: Tag update
  • draft: Draft created
  • sentDraft: Draft sent
  • removed: Deleted action

State Management

Threads Store (stores/threads.js):

  • threads: Array of thread objects
  • selectedThread: Currently viewed thread
  • selectedThreadIds: Set of selected thread IDs
  • rangeSelectionAnchorId: Anchor for shift+click selection

Store Actions:

  • fetchThreadsForFolder(folderId): Load threads from API
  • selectThread(thread): Select single thread
  • toggleThreadSelection(threadId): Toggle selection
  • selectThreadRange(endThreadId): Range select
  • selectAllThreads(): Select all visible
  • deleteThreadsByIds(ids): Bulk delete

Performance Optimizations

  • Virtual scrolling via vue-virtual-scroller for large lists
  • Lazy loading of thread details on selection
  • Debounced search/filter operations (future)
  • Optimistic UI updates with rollback on error
  • Background thread sync every 30 seconds

Integration Points

  • App Suite Mail: Syncs threads from IMAP folders via App Suite API
  • Database: Stores thread metadata and action history
  • WebSocket: Receives real-time updates from other users
  • Router: URL reflects current inbox and thread selection

Dependencies

  • Vue 3 and Vue Router (ADR-0002, ADR-0003)
  • Pinia for state management
  • vue-virtual-scroller for performance
  • UnoCSS for styling (ADR-0004)
  • App Suite core APIs for mail integration
  • PostgreSQL + Drizzle ORM (ADR-0006)

Known Limitations

  • No pagination - all thread metadata fetched at once (virtual scrolling handles 100k+ efficiently)
  • The phone triage surfaces (swipes, selection, chips, flow) target phone-width screens; tablets get the desktop layout. Triage ends at an owner, a status or a category: replying on a phone goes through the same compose as on the desktop, and there is no action to mark a thread read or unread
  • No search functionality (planned)
  • Filters cover the status views, ownership (Unassigned, Assigned, Mine), read state and categories; there is no filter by sender, date range or free text

Future Enhancements

  1. Search: Full-text search across thread content
  2. Advanced Filters: Filter by sender and date range
  3. Thread Merging: Combine related threads
  4. Pinned Threads: Keep important threads at top
  5. Read/Unread Tracking: Mark threads as read automatically
  6. Keyboard Shortcuts Panel: Help overlay showing all shortcuts
  7. Custom Views: Save filter combinations as views
  • ADR-0002: Use Vue.js as frontend framework
  • ADR-0003: Use Vue Router for navigation
  • ADR-0004: CSS framework decisions (UnoCSS)
  • ADR-0005: Use tree structure in sidepanel
  • ADR-0006: Introduce database layer
  • ADR-0009: Ignore sent items when fetching threads

Success Metrics

  • Thread list load time < 2 seconds (p95)
  • UI responsiveness maintained at 60fps
  • Zero data loss during sync conflicts
  • User can navigate 100 threads/minute with keyboard
  • 90% of users prefer Teams over individual mailbox access