Skip to content

Conversation

@myieye
Copy link
Collaborator

@myieye myieye commented Nov 7, 2025

No description provided.

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

coderabbitai bot commented Nov 7, 2025

📝 Walkthrough

Walkthrough

This PR introduces pagination support for project activity history. Backend services now accept optional skip and take parameters (defaulting to skip=0, take=100) for retrieving activity data. Frontend implements incremental loading with infinite scroll that progressively fetches activity batches as users scroll through the list.

Changes

Cohort / File(s) Summary
Backend Core Service
backend/FwLite/LcmCrdt/HistoryService.cs
Adds optional skip (default 0) and take (default 100) parameters to ProjectActivity() method; replaces hard-coded 100-item limit with dynamic Skip(skip).Take(take).
Backend API Layer
backend/FwLite/FwLiteShared/Services/HistoryServiceJsInvokable.cs, backend/FwLite/FwLiteWeb/Routes/ActivityRoutes.cs
HistoryServiceJsInvokable now accepts and forwards skip and take parameters to underlying service. ActivityRoutes updated to pass these parameters through route handler; unused using directives removed.
Frontend Type Definition
frontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IHistoryServiceJsInvokable.ts
Interface method signature updated from projectActivity() to projectActivity(skip: number, take: number).
Frontend Service Layer
frontend/viewer/src/lib/services/history-service.ts
HistoryService.activity() now requires skip and take parameters; passes them to JS interop call or appends as query parameters to HTTP fallback.
Frontend UI Implementation
frontend/viewer/src/lib/activity/ActivityView.svelte
Implements incremental data loading with infinite scroll: introduces loadCount, BATCH_SIZE, and scroll threshold; fetches activity in chunks as users scroll; adds local state for selectedRow and VList reference; renders content when activity data exists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • ActivityView.svelte: Pay special attention to infinite scroll logic, loadCount state management, and how skip/take values are computed and accumulated across multiple fetches.
  • Parameter threading: Verify pagination parameters correctly propagate through the entire stack (routes → JSInvokable → service → frontend).
  • Default values: Confirm that default skip=0 and take=100 provide sensible initial behavior and don't inadvertently change existing functionality.
  • HTTP fallback: Ensure query parameter format in history-service.ts HTTP fallback is correct.

Poem

🐰 Pagination hops through history's scroll,
With skip and take to reach our goal,
Each batch of data, infinite and free,
As users scroll, more stories we see!
Infinite loading, smooth as can be. 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate whether the description relates to the changeset. Add a pull request description explaining the changes, such as the purpose of implementing infinite scrolling and any relevant implementation details or context.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing infinite scrolling pagination for the activity view component, which aligns with the multi-file changeset adding skip/take parameters throughout the stack.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch load-more-project-activity

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 Nov 7, 2025

UI unit Tests

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

Results for commit 6516ee2. ± Comparison against base commit 36aec34.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

C# Unit Tests

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

Results for commit 6516ee2. ± Comparison against base commit 36aec34.

@argos-ci
Copy link

argos-ci bot commented Nov 7, 2025

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Nov 7, 2025, 1:02 PM

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: 2

🧹 Nitpick comments (1)
frontend/viewer/src/lib/activity/ActivityView.svelte (1)

46-52: Consider adding a loading indicator for progressive loads.

Users may not realize more data is being fetched when they scroll near the end. A subtle loading indicator would improve the UX.

You could add a loading state check in the scroll handler:

{#if activity.loading}
  <div class="text-center py-2">
    <span class="text-muted-foreground">Loading more...</span>
  </div>
{/if}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36aec34 and 6516ee2.

📒 Files selected for processing (6)
  • backend/FwLite/FwLiteShared/Services/HistoryServiceJsInvokable.cs (1 hunks)
  • backend/FwLite/FwLiteWeb/Routes/ActivityRoutes.cs (1 hunks)
  • backend/FwLite/LcmCrdt/HistoryService.cs (2 hunks)
  • frontend/viewer/src/lib/activity/ActivityView.svelte (2 hunks)
  • frontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IHistoryServiceJsInvokable.ts (1 hunks)
  • frontend/viewer/src/lib/services/history-service.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: imnasnainaec
Repo: sillsdev/languageforge-lexbox PR: 1867
File: platform.bible-extension/src/main.ts:239-246
Timestamp: 2025-07-31T19:10:41.178Z
Learning: In the sillsdev/languageforge-lexbox repository, user imnasnainaec prefers to defer code improvements when there are related TODO comments indicating planned refactoring work, choosing to bundle related changes together rather than making incremental improvements that would need to be modified again during the larger refactoring.
📚 Learning: 2025-07-30T04:53:41.702Z
Learnt from: rmunn
Repo: sillsdev/languageforge-lexbox PR: 1844
File: frontend/viewer/src/lib/entry-editor/ItemListItem.svelte:26-37
Timestamp: 2025-07-30T04:53:41.702Z
Learning: In frontend/viewer/src/lib/entry-editor/ItemListItem.svelte, the TODO comments for unused props `index` and `actions` are intentional reminders for future work to be completed in a separate PR, not issues to be resolved immediately. These represent planned functionality that will be implemented later.

Applied to files:

  • frontend/viewer/src/lib/activity/ActivityView.svelte
🧬 Code graph analysis (4)
frontend/viewer/src/lib/services/history-service.ts (1)
frontend/viewer/src/lib/dotnet-types/generated-types/LcmCrdt/IProjectActivity.ts (1)
  • IProjectActivity (9-16)
frontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IHistoryServiceJsInvokable.ts (1)
frontend/viewer/src/lib/dotnet-types/generated-types/LcmCrdt/IProjectActivity.ts (1)
  • IProjectActivity (9-16)
backend/FwLite/FwLiteWeb/Routes/ActivityRoutes.cs (3)
backend/FwLite/LcmCrdt/HistoryService.cs (1)
  • HistoryService (67-224)
frontend/viewer/src/lib/services/history-service.ts (1)
  • HistoryService (20-80)
frontend/viewer/src/lib/project-context.svelte.ts (1)
  • historyService (93-95)
backend/FwLite/LcmCrdt/HistoryService.cs (2)
backend/FwLite/LcmCrdt/Data/MiniLcmRepository.cs (1)
  • IAsyncEnumerable (127-155)
backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs (8)
  • IAsyncEnumerable (121-128)
  • IAsyncEnumerable (162-169)
  • IAsyncEnumerable (215-222)
  • IAsyncEnumerable (259-266)
  • IAsyncEnumerable (352-355)
  • IAsyncEnumerable (388-391)
  • IAsyncEnumerable (393-400)
  • IAsyncEnumerable (613-628)
⏰ 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). (8)
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build API / publish-api
  • GitHub Check: Build FwHeadless / publish-fw-headless
  • GitHub Check: check-and-lint
  • GitHub Check: Analyze (csharp)
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: frontend
  • GitHub Check: Build FW Lite and run tests
🔇 Additional comments (7)
backend/FwLite/LcmCrdt/HistoryService.cs (2)

69-69: LGTM: Pagination parameters with sensible defaults.

The addition of optional skip and take parameters with defaults maintains backward compatibility while enabling pagination.


83-83: LGTM: Pagination applied correctly.

The query now properly applies skip and take operations for pagination.

frontend/viewer/src/lib/services/history-service.ts (1)

65-67: LGTM: Pagination parameters properly forwarded.

The method signature and implementation correctly handle pagination for both the JS-invokable API and HTTP fallback paths.

frontend/viewer/src/lib/dotnet-types/generated-types/FwLiteShared/Services/IHistoryServiceJsInvokable.ts (1)

15-15: LGTM: Generated type definition updated correctly.

The signature now includes pagination parameters, aligning with the backend JSInvokable method.

backend/FwLite/FwLiteShared/Services/HistoryServiceJsInvokable.cs (1)

17-19: LGTM: Parameters properly forwarded to the underlying service.

The method correctly accepts pagination parameters and forwards them to the history service.

frontend/viewer/src/lib/activity/ActivityView.svelte (2)

16-18: LGTM: Sensible pagination constants.

The threshold and batch size values provide a good balance between network efficiency and user experience.


55-91: LGTM: Infinite scroll implementation is well-structured.

The VList integration with scroll detection and conditional rendering works correctly. The selectedRow initialization ensures the first item is selected when data arrives.

@myieye myieye merged commit 4b252e6 into develop Nov 7, 2025
30 checks passed
@myieye myieye deleted the load-more-project-activity branch November 7, 2025 13:25
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.

2 participants