Skip to content

feat(message-list): bridge legacy loading and item actions into Compose state machine#10863

Open
rafaeltonholo wants to merge 19 commits intothunderbird:mainfrom
rafaeltonholo:feat/10775/add-legacy-message-list-loading-bridge
Open

feat(message-list): bridge legacy loading and item actions into Compose state machine#10863
rafaeltonholo wants to merge 19 commits intothunderbird:mainfrom
rafaeltonholo:feat/10775/add-legacy-message-list-loading-bridge

Conversation

@rafaeltonholo
Copy link
Copy Markdown
Member

Resolves #10775.
feature-flag: enable_message_list_new_state

Summary

  • Add LegacyMessageListBridge and LoadMessagesLegacySideEffect so the Compose message list state machine can load data from the legacy MessageListFragment / MessageListViewModel pipeline
  • Route message item behaviour through state and UI effects, including active/focused message tracking, open-message handling, selection toggling, select all/deselect all, toolbar action mode updates, and scroll-to-message behaviour
  • Update the legacy fragment integration to map legacy items into MessageItemUi, apply account-specific sort criteria, and keep the new state machine backed by legacy data while the migration continues
  • Add unit coverage for the new state transitions and side-effect handlers
  • MessageListFragment clean up

Important

Testing notes

  • Must enable enable_message_list_new_state to verify this work
  • Navigate to a folder
  • Must work:
    • Loading folder's messages
    • Opening a message
    • Select one message
    • Deselect one message
    • Select all messages
    • Deselect all messages
    • Select a message by tapping on the avatar

@github-actions
Copy link
Copy Markdown
Contributor

Missing report label. Set exactly one of: report: include, report: exclude OR report: highlight.

@github-actions github-actions bot added the tb-team Tasks and features handled by project maintainers label Apr 13, 2026
@rafaeltonholo rafaeltonholo added report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). feature-flag Changes guarded by a feature flag. Please add a comment stating the name: "feature-flag: abc" labels Apr 13, 2026
Update `SortCriteriaMenuList` to use the current account ID when dispatching sort criteria changes, ensuring settings are applied per-account rather than globally. This also adds a check to exclude `UnifiedAccountId` when determining the account ID.
Implemented message focus tracking and updated `MessageListFragment` to use the focused message for keyboard/contextual actions.

- Added `focusedMessage` to `MessageListMetadata` and corresponding focus events to `MessageItemEvent`.
- Updated `MessageListScreenRenderer` to dispatch focus enter/exit events.
- Refactored `MessageListFragment` to use `focusedMessage` for delete, archive, move, copy, and flag toggle operations.
- Implemented `toggleMessageSelect` logic using the view model state.
- Added `OpenMessage` effect to `MessageListEffect`.
- Created `OpenMessageSideEffect` to handle message click events and dispatch the open message effect.
- Updated `SetupLoadedMessagesState` to set active message on message click.
- Integrated `OpenMessageSideEffect` in `MessageListSideEffectsModule`.
- Updated `MessageListFragment` to handle `OpenMessage` effect and open the message.
… mode

- Added `ToggleMessageSideEffect` to handle message click events in selecting mode and dispatch toggle select event.
- Updated `SetupSelectingMessagesState` to toggle message selection state on click.
- Integrated `ToggleMessageSideEffect` in `MessageListSideEffectsModule`.
…age updates

- Created `SetMessageActiveSideEffect` to handle `SetMessageActive` events and scroll to the newly active message
- Updated `SetupLoadedMessagesState` to mark messages as active/inactive in the message list on click and active state changes
- Added `mapMessages()` utility to `MessageListState` for transforming message lists while preserving state type
- Fixed message scrolling comparison to use message IDs instead of object equality
- Replaced `LifecycleStartEffect` with `collectAsStateWithLifecycle` for scroll event collection
- Integrated `SetMessageActiveSideEffect` in `MessageListSideEffectsModule`
- Changed visibility of `MessageListScreenAccessibilityState` and `rememberMessageListScreenAccessibilityState` to internal
- Changed visibility of side effect classes to internal: `SetMessageActiveSideEffect`, `LoadPreferencesSideEffect`, `ToggleMessageSideEffect`, `ChangeSortCriteriaSideEffect`, `AllConfigurationsReadySideEffect`, `OpenMessageSideEffect`, `LoadSwipeActionsStateSideEffectHandler`, `LoadSortCriteriaStateSideEffectHandler`, `LoadFolderInformationSideEffect`
- Changed visibility of `DefaultLocalDeleteOperationDecider` and `MessageListViewModel` to internal
@rafaeltonholo rafaeltonholo force-pushed the feat/10775/add-legacy-message-list-loading-bridge branch from f5833f5 to affec6c Compare April 16, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-flag Changes guarded by a feature flag. Please add a comment stating the name: "feature-flag: abc" report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML 0.1/UI.04.2] - Implement legacy message list loading bridge

2 participants