Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Oct 9, 2025

Part of #2032
I'd love to have bullet-proof lazy-loading/infinite-scrolling, but not today.

This feels like a safe improvement.
The biggest problem with loading less entries, is that we can only scroll to entries that were loaded.
I think for now that's less important than performance. Especially on mobile.

@github-actions github-actions bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Oct 9, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2025

📝 Walkthrough

Walkthrough

Adjusted the entries list to import an in-house IsMobile hook and changed queryOptions.count from a fixed 10,000 to a conditional value: 1,000 when IsMobile.value is true, otherwise 5,000. No other logic paths were modified.

Changes

Cohort / File(s) Summary of changes
Viewer entries list pagination tuning
frontend/viewer/src/project/browse/EntriesList.svelte
Imported IsMobile hook and replaced fixed queryOptions.count = 10000 with conditional: IsMobile.value ? 1000 : 5000. No other behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • hahn-kev

Poem

I twitch my whiskers, tap-tap-tap—
Smaller bites for phones in my lap.
A thousand nibbles on mobile breeze,
Five thousand more on desktop, please.
Hops through lists, efficient and spry—
Carrots counted, quick as I! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly conveys the core change of reducing the number of loaded entries with an emphasis on mobile performance, directly reflecting the conditional count adjustments implemented in the code. It is clear, specific, and free of extraneous details.
Description Check ✅ Passed The description clearly explains the context and rationale for this incremental performance improvement on mobile, references the related issue #2032, and acknowledges known limitations, all of which directly relate to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch load-less-entries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

UI unit Tests

  1 files  ±0   45 suites  ±0   28s ⏱️ ±0s
111 tests ±0  111 ✅ ±0  0 💤 ±0  0 ❌ ±0 
160 runs  ±0  160 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3615aad. ± Comparison against base commit 010ba63.

♻️ This comment has been updated with latest results.

@argos-ci
Copy link

argos-ci bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 9, 2025, 10:22 AM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
frontend/viewer/src/project/browse/EntriesList.svelte (1)

78-78: Good performance optimization for mobile devices.

The conditional entry count (1,000 for mobile, 5,000 for desktop, down from 10,000) should improve initial load performance while accepting the trade-off of constrained scrolling.

Consider extracting the magic numbers as named constants for easier maintenance:

+const MAX_ENTRIES_MOBILE = 1_000;
+const MAX_ENTRIES_DESKTOP = 5_000;
+
 const fetchCurrentEntries = useDebounce(async (silent = false) => {
   if (!miniLcmApi) return [];
   if (!silent) loadingUndebounced = true;
   try {
     const queryOptions: IQueryOptions = {
-      count: IsMobile.value ? 1_000 : 5_000,
+      count: IsMobile.value ? MAX_ENTRIES_MOBILE : MAX_ENTRIES_DESKTOP,
       offset: 0,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 010ba63 and 3615aad.

📒 Files selected for processing (1)
  • frontend/viewer/src/project/browse/EntriesList.svelte (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build API / publish-api
  • GitHub Check: frontend
  • GitHub Check: Build FW Lite and run tests
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: check-and-lint
🔇 Additional comments (1)
frontend/viewer/src/project/browse/EntriesList.svelte (1)

22-22: Verify that IsMobile is reactive and consider its scope.

Ensure the IsMobile hook properly reacts to viewport changes (e.g., device rotation, browser resizing). Note that IsMobile is not included in the entriesResource dependencies (line 100-102), so changes to IsMobile.value alone won't trigger a refetch. This means if a user resizes from desktop to mobile, they'll still have 5,000 entries loaded rather than 1,000.

Consider whether this behavior is acceptable or if IsMobile should be added to the resource dependencies:

 const entriesResource = resource(
-  () => ({ search, sort, gridifyFilter, miniLcmApi }),
+  () => ({ search, sort, gridifyFilter, miniLcmApi, isMobile: IsMobile.value }),
   async () => await fetchCurrentEntries());

Note: Adding IsMobile to dependencies would cause refetches on viewport changes, which could be disruptive if users are actively browsing.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

C# Unit Tests

130 tests  ±0   130 ✅ ±0   20s ⏱️ -1s
 20 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3615aad. ± Comparison against base commit 010ba63.

@myieye myieye requested a review from rmunn October 9, 2025 10:28
@myieye myieye linked an issue Oct 9, 2025 that may be closed by this pull request
@myieye myieye merged commit 0a82286 into develop Oct 13, 2025
23 checks passed
@myieye myieye deleted the load-less-entries branch October 13, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Big projects are slow

1 participant