Skip to content

feat(recents): show progress bar while shared-drive files load#3947

Merged
rezk2ll merged 1 commit into
masterfrom
feat/recents-shared-drive-loading-bar
Jun 22, 2026
Merged

feat(recents): show progress bar while shared-drive files load#3947
rezk2ll merged 1 commit into
masterfrom
feat/recents-shared-drive-loading-bar

Conversation

@rezk2ll

@rezk2ll rezk2ll commented Jun 22, 2026

Copy link
Copy Markdown
Member

Context

In the recents view, shared-drive and federated-share files are fetched from the stack through the dataproxy and arrive a few seconds after the local files (longer for accounts with many drives). Until then the list looks settled, then silently grows with no indication anything was pending.

Solution

Show a thin progress bar under the header while that background fetch is in flight, once a list is already on screen. The empty initial load keeps its existing skeleton.

Summary by CodeRabbit

  • New Features

    • Added visual loading indicator in the Recent view that displays when additional shared or federated items are being fetched in the background.
  • Tests

    • Added test coverage for the loading indicator behavior across different loading states.

Shared-drive and federated files are fetched from the stack via the dataproxy and arrive after the local files, so the recents list silently grows once it already looks settled. Surface that background fetch with a progress bar under the header once a list is on screen.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

RecentView is extended with a LinearProgress indicator for background fetching scenarios. A new isFetchingMore boolean is derived from recentsResult: it is true when fetchStatus is 'loading' and the current data array already has items (indicating an incremental fetch rather than an initial load). When true, LinearProgress renders inside the Content area. A new spec file adds three test cases covering the progress bar appearing during a loading fetch with existing items, disappearing once loaded, and being absent when loading begins with no items present.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: adding a progress bar in the recents view during shared-drive file loading, which matches the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/recents-shared-drive-loading-bar

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.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Our agent can fix these. Install it.

Gates Passed
3 Quality Gates Passed

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/modules/views/Recent/index.loading.spec.jsx (2)

76-79: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Restore spies after each test to prevent mock leakage.

console spies are created in each test but never restored. Add cleanup for isolation and to avoid cross-test side effects.

Suggested patch
 describe('Recent View loading indicator', () => {
   beforeEach(() => {
     jest.spyOn(console, 'error').mockImplementation()
     jest.spyOn(console, 'warn').mockImplementation()
   })
+
+  afterEach(() => {
+    jest.restoreAllMocks()
+  })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/views/Recent/index.loading.spec.jsx` around lines 76 - 79, The
console spies created in the beforeEach hook using jest.spyOn for console.error
and console.warn are never restored, causing mock leakage between tests. Add an
afterEach hook that calls mockRestore() on both spies to restore the original
console implementations after each test completes, ensuring proper test
isolation.

48-48: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Provide the full useSharingContext shape in the mock.

RecentView reads allLoaded, refresh, and isOwner in addition to byDocId. Stubbing only byDocId makes this test fragile to harmless component changes.

Suggested patch
-useSharingContext.mockReturnValue({ byDocId: [] })
+useSharingContext.mockReturnValue({
+  byDocId: [],
+  allLoaded: true,
+  isOwner: jest.fn(() => true),
+  refresh: jest.fn()
+})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/views/Recent/index.loading.spec.jsx` at line 48, The
useSharingContext mock at the useSharingContext.mockReturnValue() call currently
only provides the byDocId property, but the RecentView component also reads
allLoaded, refresh, and isOwner from this context. Update the mock return object
to include all four properties (byDocId, allLoaded, refresh, and isOwner) with
appropriate stub values to ensure the test properly reflects what the component
actually uses and prevents the test from becoming fragile to harmless component
changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/modules/views/Recent/index.loading.spec.jsx`:
- Around line 76-79: The console spies created in the beforeEach hook using
jest.spyOn for console.error and console.warn are never restored, causing mock
leakage between tests. Add an afterEach hook that calls mockRestore() on both
spies to restore the original console implementations after each test completes,
ensuring proper test isolation.
- Line 48: The useSharingContext mock at the useSharingContext.mockReturnValue()
call currently only provides the byDocId property, but the RecentView component
also reads allLoaded, refresh, and isOwner from this context. Update the mock
return object to include all four properties (byDocId, allLoaded, refresh, and
isOwner) with appropriate stub values to ensure the test properly reflects what
the component actually uses and prevents the test from becoming fragile to
harmless component changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e56e6be2-e995-4b0a-904f-2eb2de33b87d

📥 Commits

Reviewing files that changed from the base of the PR and between 5dbf8ae and 880a3c6.

📒 Files selected for processing (2)
  • src/modules/views/Recent/index.jsx
  • src/modules/views/Recent/index.loading.spec.jsx

@bundlemon

bundlemon Bot commented Jun 22, 2026

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
static/js/main.(hash).js
48.83KB (+42B +0.08%) -
Unchanged files (19)
Status Path Size Limits
static/js/cozy.(hash).js
928.36KB -
static/resource/(hash).js
336.09KB -
services/qualificationMigration.js
283.39KB -
services/dacc.js
263.13KB -
static/js/lib-react.(hash).js
43.88KB -
static/css/cozy.(hash).css
30.13KB -
static/js/lib-polyfill.(hash).js
22.77KB -
static/js/lib-router.(hash).js
21.86KB -
static/js/public.(hash).js
19.77KB -
static/css/main.(hash).css
13.57KB -
static/js/intents.(hash).js
8.99KB -
static/js/(chunkId).(hash).js
8.6KB -
static/js/async/(chunkId).(hash).js
7.5KB -
manifest.webapp
3.09KB -
static/css/public.(hash).css
2.34KB -
index.html
772B -
public/index.html
704B -
intents/index.html
642B -
assets/manifest.json
185B -

Total files change +40B 0%

Groups updated (1)
Status Path Size Limits
**/*.js
5.98MB (+42B 0%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.16MB -
**/*.css
77.43KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@Crash--

Crash-- commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

let's try it

@rezk2ll rezk2ll merged commit c77457e into master Jun 22, 2026
6 checks passed
@rezk2ll rezk2ll deleted the feat/recents-shared-drive-loading-bar branch June 22, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants