Page MenuHomePhabricator

Refactor PageActivity/PageFragment to use ViewModel.
Open, LowPublic8 Estimated Story Points

Description

The PageFragment currently has multiple loadPage function signatures, which can be confusing. Additionally, PageFragmentLoadState is responsible for both core logic and UI updates, leading to a mixing of concerns. Introducing a ViewModel can help resolve both of these issues by using state management to drive UI updates once data is loaded.

This refactor can be approached in multiple stages:

  1. Define the data structure needed to manage the page loading process.
  2. Consolidate the logic from both PageFragmentLoadState and the loadPage functions into a single loader class.
  3. Refactor this loader class into a ViewModel to better separate concerns and handle UI updates through state changes.

Event Timeline

WRai-WMF set the point value for this task to 8.Jul 10 2025, 5:18 PM

The initial refactor to add ViewModel to load page is complete. This ticket is on hold as the changes in tabs ticket would conflict with this refactor. Once the tabs ticket is merged, the code will be updated to align with its changes.