Bug 506154 - System Monitor shows incorrect order for a page with 11 or more rows
Summary: System Monitor shows incorrect order for a page with 11 or more rows
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.4.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 506271 510497 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-06-25 10:48 UTC by Gicpd5423
Modified: 2025-10-17 20:11 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.5.0
Sentry Crash Report:


Attachments
State of the page after saving the changes (37.63 KB, image/png)
2025-06-25 10:48 UTC, Gicpd5423
Details
State of the page after reopening the program (37.59 KB, image/png)
2025-06-25 10:49 UTC, Gicpd5423
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gicpd5423 2025-06-25 10:48:05 UTC
SUMMARY
When I tried to re-add diagrams to the new History page, I noticed that their order after saving the changes got messed up. Later I tried to check the *.page file to try and change the order of diagrams manually and noticed the issue with ordering.

STEPS TO REPRODUCE
1. Create a new page (or edit an existing one)
2. Fill the page with at least 11 rows (either headers or diagrams) and save the changes
3. Close and reopen the program
4. Click on the edited page to observe the changes

OBSERVED RESULT
The rows are shown in this order:
row-0
row-1
row-10
row-11
...
row-2
...

EXPECTED RESULT
Rows should be shown in the following order: 
row-0
row-1
row-2
...
row-10
row-11
...

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version:  6.9.1
Comment 1 Gicpd5423 2025-06-25 10:48:46 UTC
Created attachment 182643 [details]
State of the page after saving the changes
Comment 2 Gicpd5423 2025-06-25 10:49:17 UTC
Created attachment 182644 [details]
State of the page after reopening the program
Comment 3 Josi 2025-08-07 19:46:15 UTC
I observed the same issue and experimented with the page file by editing it manually. It seems that System Monitor orders the [row-X] entries lexicographically (as strings) rather than numerically.

For example, "row-10" appears before "row-2", and replacing the numbers with letters (e.g., "row-A", "row-B", etc.) results in the expected order. This suggests the sorting is based on string comparison, not numeric value.

Knowing that, the page file can be fixed manually until it is edited again via the System Monitor.
Comment 4 Arjen Hiemstra 2025-10-07 13:01:10 UTC
*** Bug 506271 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2025-10-13 12:36:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/391
Comment 6 Arjen Hiemstra 2025-10-13 12:37:04 UTC
*** Bug 510497 has been marked as a duplicate of this bug. ***
Comment 7 Arjen Hiemstra 2025-10-14 12:15:05 UTC
Git commit 4bd457af4319c13d6276e2fef89f9064d81d2280 by Arjen Hiemstra.
Committed on 14/10/2025 at 12:08.
Pushed by ahiemstra into branch 'master'.

page: Sort groups in numeric mode when loading page data

Otherwise we end up with things like `row-10` becoming the second row
because of lexical ordering.

M  +5    -1    src/page/PageDataObject.cpp

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/4bd457af4319c13d6276e2fef89f9064d81d2280
Comment 8 Arjen Hiemstra 2025-10-14 12:31:26 UTC
Git commit e0afe3a92f8eadf429a0ccd6dbe43a74f3a5dd3f by Arjen Hiemstra.
Committed on 14/10/2025 at 12:28.
Pushed by ahiemstra into branch 'Plasma/6.5'.

page: Sort groups in numeric mode when loading page data

Otherwise we end up with things like `row-10` becoming the second row
because of lexical ordering.


(cherry picked from commit 4bd457af4319c13d6276e2fef89f9064d81d2280)

Co-authored-by: Arjen Hiemstra <ahiemstra@heimr.nl>

M  +5    -1    src/page/PageDataObject.cpp

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/e0afe3a92f8eadf429a0ccd6dbe43a74f3a5dd3f