AI Request Logs: column “move left / move right” has no effect#669
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @alexWinterjuice. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #669 +/- ##
=============================================
+ Coverage 74.57% 74.68% +0.10%
Complexity 1754 1754
=============================================
Files 85 85
Lines 7548 7549 +1
=============================================
+ Hits 5629 5638 +9
+ Misses 1919 1911 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dkotter
left a comment
There was a problem hiding this comment.
In testing, this does now allow you to change the order of these columns but unless I'm missing something, the order does not persist beyond the first page load. If I change the order and refresh, the order reverts back. Should we be trying to save the order for future page loads?
Hi @dkotter, I guess yes that's the ask in issue ticket. If we notice the DataViews in the IMO, if we are providing this order, then we should same this somewhere else, we can remove the order field and make it fixed. The UX would be better either ways. |
|
thanks! @dkotter You're right the previous version only kept the order for the current page view. I've updated the PR to persist column order across page loads. The order is now saved to localStorage as part of Changes:
Tested by reordering columns, refreshing, and confirming the order persists. |
|
Hi @Trushiv04, Thanks for the PR. Can we also update the column visibility in the same PR? For example, please refer the screencast. When I update the column to hide, and refresh it again, the column is visible again. If we can land a fix within the scope of this PR would be good IMO. Because both are same issue and would use similar logic, so we can include this in PR. Before Fix (with this PR change)Screen.Recording.2026-06-05.at.11.32.02.AM.movAfter Fix (Just visibility change)Screen.Recording.2026-06-05.at.11.20.15.AM.movCan you please update the PR with a fix. This is because, if the user update any column to hide, then loads the page, the column order changes are lost they are not persisted. I would add the same thing in issue description, so issue author can update the description. Thanks, |
|
Thanks @hbhalodia! You're right they're the same underlying issue, so it made sense to handle both here. The root cause was in I've updated it so a shorter field list is treated as valid (the user may have intentionally hidden columns). It now only falls back to the default order when the stored value is missing or contains nothing valid. So both column order and column visibility now persist across reloads. Tested:
|
What?
Closes #667
Fixes the AI Request Logs table so that "move left / move right" column reordering persists instead of snapping back to the default order.
Why?
In
LogsTable.tsx,onChangeViewransortFieldsByCanonicalOrder()on every view update, which re-sorted the fields back toDEFAULT_VIEW_FIELDSimmediately after the user reordered a column. As a result, column order changes had no effect.How?
Removed the canonical resort from
onChangeViewso the user's chosen field order (nextView.fields) is preserved. The initial field order is already set toDEFAULT_VIEW_FIELDSwhen state is initialized, so canonical ordering on the first render is unaffected. The now-unusedFIELD_ORDERmap andsortFieldsByCanonicalOrderhelper were removed.Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Used for: Locating the cause in onChangeView and drafting the fix. Final implementation and manual testing were done by me.
Testing Instructions
Screenshots or screencast
After the fix column reordering now persists:
Screen.Recording.2026-06-04.at.6.59.45.PM.mov
Changelog Entry