Conversation
Implements infinite scroll pagination for menu list, menu item list, and linkable items dropdown with page size of 20. Shows loading spinner when fetching more items. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix pagination not triggering after second page by properly tracking state changes in LaunchedEffect keys - Remove inaccurate menu item count from menu list - Remove unused fetchAllMenuItems function - Move Edit Items button to end of menu card, centered vertically - Fix detekt warnings: swallowed exceptions, unused imports, complexity - Extract MenuItemListContent and sibling helper functions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ExposedDropdownMenu doesn't support LazyColumn (SubcomposeLayout intrinsic measurement issue), causing crashes when opening the dropdown. This replaces it with a ModalBottomSheet which properly supports pagination with LazyColumn. Also restores PAGE_SIZE to 20 (was 5 for testing). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This resource was left over after removing the menu item count feature. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Generated by 🚫 Danger |
- Extract duplicate type selection label logic to helper function - Simplify parseErrorMessage by consolidating redundant cases - Consolidate findPreviousSiblingIndex/findNextSiblingIndex into single function Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22560 +/- ##
==========================================
- Coverage 38.23% 38.18% -0.06%
==========================================
Files 2237 2237
Lines 111111 111318 +207
Branches 15544 15579 +35
==========================================
+ Hits 42486 42505 +19
- Misses 65087 65272 +185
- Partials 3538 3541 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment was marked as resolved.
This comment was marked as resolved.
Prevents race conditions when multiple pagination requests occur in rapid succession. Each pagination function now uses a mutex to ensure atomic read-check-update operations, preventing duplicate items or incorrect pagination state. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Ensure canLoadMore remains true when pagination fails, allowing users to retry after transient errors (network issues, timeouts, etc.). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prevents stale data from overwriting state when user rapidly switches between menu item types. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
Support all 22 protocols from wp_allowed_protocols(): http, https, ftp, ftps, mailto, news, irc, irc6, ircs, gopher, nntp, feed, telnet, mms, rtsp, sms, svn, tel, fax, xmpp, webcal, urn. Also adds support for anchor links (#section) and protocol-relative URLs (//). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Derive offset from UI state instead of cache variables to avoid race conditions between initial load and pagination - Set canLoadMore=true on initial load errors to allow retry Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pre-compute parent-to-children mapping to reduce child lookup from O(n) to O(1) per item, improving overall complexity from O(n²) to O(n log n). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use when expression to reduce return statements from 4 to 2. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| } | ||
| val offset = currentState.menus.size | ||
|
|
||
| @Suppress("TooGenericExceptionCaught") |
There was a problem hiding this comment.
⛏️ I think it's a bit more clear to extract the Suppress to the function signature level
There was a problem hiding this comment.
Thanks for the review! I'll mull this over and make the change in a future PR if needed.
adalpari
left a comment
There was a problem hiding this comment.
LGTM! Just left a minor comment





Description
Partially addresses CMM-1166.
Adds pagination support to the navigation menus feature, allowing users to browse large lists of menus, menu items, and linkable items (posts, pages, categories, tags) without loading everything at once.
Key changes:
Limitations
Testing instructions
Menu list pagination:
Menu item list pagination:
Linkable items pagination:
Error handling:
Screen_recording_20260205_072459.mp4