[PR #4949] [MERGED] [Mobile] 🐛 Fix widget order #5676

Closed
opened 2026-02-28 21:16:34 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4949
Author: @Johnn27
Created: 5/6/2025
Status: Merged
Merged: 5/12/2025
Merged by: @matt-fidd

Base: masterHead: mobile-fix-widget-order-3972


📝 Commits (5)

📊 Changes

2 files changed (+54 additions, -15 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/Overview.tsx (+48 -15)
upcoming-release-notes/4949.md (+6 -0)

📄 Description

Fixes #3972

Problem:
Dashboard widgets were appearing in a jumbled or inconsistent order on mobile devices, making the dashboard difficult to use and understand on smaller screens.

Solution:
This PR implements a stable and predictable ordering for widgets on the mobile dashboard view. The mobile layout now arranges widgets in a single column, with their vertical order determined by their layout on the desktop:

  1. Widgets are first sorted based on their desktop y coordinate (top-to-bottom).
  2. For widgets on the same desktop row, they are then sorted by their desktop x coordinate (left-to-right).

For the mobileLayout supplied to ResponsiveGridLayout:

  • Each widget is set to x: 0 (first column) and w: 1 (full width of the column).
  • The y coordinate for each widget is calculated cumulatively. This means the y position of a widget is the sum of the heights (h) of all preceding widgets in the sorted list, ensuring they stack correctly without overlap.
  • The original height (h) of each widget is preserved.

Additionally:

  • The calculations for desktopLayout (the RGL-compatible version of widgets for desktop) and the new mobileLayout have been wrapped in useMemo hooks. This optimizes performance by ensuring these layouts are only recomputed when the underlying widgets data changes.

Impact:
This change significantly improves the mobile user experience by providing a consistent, logical, and predictable display of dashboard widgets, matching the intuitive reading order derived from the desktop layout.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4949 **Author:** [@Johnn27](https://github.com/Johnn27) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/12/2025 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `mobile-fix-widget-order-3972` --- ### 📝 Commits (5) - [`ab339e6`](https://github.com/actualbudget/actual/commit/ab339e64e390cc6e234d9b3942fb677364c3c2e8) Fix Dashboard Widgets Not Ordered on Mobile - [`99eb885`](https://github.com/actualbudget/actual/commit/99eb885ad8bb136518acd8b7510cdcdfdc8abaea) Update Release Notes - [`f55e99f`](https://github.com/actualbudget/actual/commit/f55e99fc0e4c03f26baabef16096764775e7b237) Merge branch 'master' of https://github.com/actualbudget/actual into mobile-fix-widget-order-3972 - [`bda67aa`](https://github.com/actualbudget/actual/commit/bda67aa0be371e180c869c94182f6906ce2180b5) Update formatting and comment - [`292a573`](https://github.com/actualbudget/actual/commit/292a57352b47aba6892e436a5388c6dda0e8cf33) Merge branch 'master' into mobile-fix-widget-order-3972 ### 📊 Changes **2 files changed** (+54 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/Overview.tsx` (+48 -15) ➕ `upcoming-release-notes/4949.md` (+6 -0) </details> ### 📄 Description Fixes #3972 **Problem:** Dashboard widgets were appearing in a jumbled or inconsistent order on mobile devices, making the dashboard difficult to use and understand on smaller screens. **Solution:** This PR implements a stable and predictable ordering for widgets on the mobile dashboard view. The mobile layout now arranges widgets in a single column, with their vertical order determined by their layout on the desktop: 1. Widgets are first sorted based on their desktop `y` coordinate (top-to-bottom). 2. For widgets on the same desktop row, they are then sorted by their desktop `x` coordinate (left-to-right). For the `mobileLayout` supplied to `ResponsiveGridLayout`: * Each widget is set to `x: 0` (first column) and `w: 1` (full width of the column). * The `y` coordinate for each widget is calculated cumulatively. This means the `y` position of a widget is the sum of the heights (`h`) of all preceding widgets in the sorted list, ensuring they stack correctly without overlap. * The original height (`h`) of each widget is preserved. **Additionally:** * The calculations for `desktopLayout` (the RGL-compatible version of widgets for desktop) and the new `mobileLayout` have been wrapped in `useMemo` hooks. This optimizes performance by ensuring these layouts are only recomputed when the underlying `widgets` data changes. **Impact:** This change significantly improves the mobile user experience by providing a consistent, logical, and predictable display of dashboard widgets, matching the intuitive reading order derived from the desktop layout. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:16:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5676