Skip to content

feat: added pull-to-refresh on home screen.#1035

Merged
coodos merged 1 commit into
mainfrom
feat/eid-wallet-pull-to-refresh
Jun 15, 2026
Merged

feat: added pull-to-refresh on home screen.#1035
coodos merged 1 commit into
mainfrom
feat/eid-wallet-pull-to-refresh

Conversation

@Sahil2004

@Sahil2004 Sahil2004 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description of change

Added pull-to-refresh on home screen of eid-wallet.

Issue Number

Closes #1028

Type of change

  • New (a change which implements a new feature)

How the change has been tested

Manually.

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • New Features

    • Pull-to-refresh support added for mobile. Drag down from the top of the page to refresh your account information and linked services.
  • Performance Improvements

    • Optimized mobile touch interactions for smoother, more responsive experience.

@Sahil2004 Sahil2004 self-assigned this Jun 12, 2026
@Sahil2004 Sahil2004 requested a review from coodos as a code owner June 12, 2026 04:09
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The main home page now supports pull-to-refresh on mobile devices through a touch-driven state machine. Downward drag triggers data refresh when a distance threshold is met. User info loading is centralized in a helper function and called during both initial mount and subsequent refresh. A visual indicator provides feedback during the gesture. Touch listeners are registered on mount and cleaned up on destroy.

Changes

Pull-to-refresh functionality

Layer / File(s) Summary
Pull-to-refresh state machine and gesture detection
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
Module-scope state (pullState, pullDistance) and touch handlers (start/move/end/cancel) track downward drag from scroll top and trigger refreshBindings() when drag passes threshold.
Lifecycle touch listener management
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
Document-level touch event listeners registered on mount (with passive options; touchmove uses passive: false) and removed on destroy.
User info hydration helper
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
New loadUserInfo() centralizes fetching and caching of user data, isFake flag, and vault ename for reuse across initialization and refresh.
Data refresh flow integration
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
Mount and refreshBindings() both call loadUserInfo() alongside binding-document and personal-store reloads.
Pull-to-refresh UI indicator
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
Fixed, safe-area-inset-positioned indicator renders conditionally and animates based on pullState to provide visual feedback.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • coodos

Poem

🐰 A gentle swipe from the top brings cheer,
Data refreshes when you pull down here!
Touch by touch, the state machine turns,
Fresh records glow as the spinner burns. 🔄✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature added in this PR: pull-to-refresh functionality on the home screen.
Description check ✅ Passed The description follows the template with all required sections completed: issue number, type of change, testing method, and change checklist items marked as done.
Linked Issues check ✅ Passed The PR implements pull-to-refresh gesture support on the home screen via state machine and touch handlers, directly addressing the primary objective in issue #1028. The implementation includes proper data refresh mechanisms through the new loadUserInfo() helper.
Out of Scope Changes check ✅ Passed All changes are focused on implementing pull-to-refresh functionality and related data refresh mechanisms. Touch event handling, state management, and the loadUserInfo() helper are all directly scoped to the stated objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/eid-wallet-pull-to-refresh

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte (1)

186-201: 💤 Low value

Consider adding error logging for consistency with other loaders.

The other data loaders (loadBindingDocuments, loadPersonalIntoStore) wrap their logic in try/catch and log warnings on failure. While the upstream controller getters have internal .catch() handlers that return undefined, adding a similar pattern here would provide consistent diagnostics.

♻️ Optional: Add try/catch for consistency
 async function loadUserInfo(): Promise<void> {
     if (!globalState) return;
+    try {
         const [userInfo, fake, vaultData] = await Promise.all([
             globalState.userController.user,
             globalState.userController.isFake,
             globalState.vaultController.vault,
         ]);
         isFake = fake;
         cachedIsFake = fake;
         userData = { ...userInfo, isFake: fake };
         cachedUserData = userData;
         if (vaultData?.ename) {
             ename = vaultData.ename;
             cachedEname = ename;
         }
+    } catch (err) {
+        console.warn("[main] Failed to load user info:", err);
+    }
 }
🤖 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 `@infrastructure/eid-wallet/src/routes/`(app)/main/+page.svelte around lines
186 - 201, Wrap the body of loadUserInfo in a try/catch similar to
loadBindingDocuments/loadPersonalIntoStore: call the same Promise.all on
globalState.userController.user, globalState.userController.isFake, and
globalState.vaultController.vault inside a try block, and in the catch log a
warning with context (e.g., "loadUserInfo failed" plus the caught error) so
failures are diagnosable but don’t throw; preserve the existing assignments to
isFake, cachedIsFake, userData, cachedUserData, ename and cachedEname when the
Promise.all succeeds.
🤖 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 `@infrastructure/eid-wallet/src/routes/`(app)/main/+page.svelte:
- Around line 186-201: Wrap the body of loadUserInfo in a try/catch similar to
loadBindingDocuments/loadPersonalIntoStore: call the same Promise.all on
globalState.userController.user, globalState.userController.isFake, and
globalState.vaultController.vault inside a try block, and in the catch log a
warning with context (e.g., "loadUserInfo failed" plus the caught error) so
failures are diagnosable but don’t throw; preserve the existing assignments to
isFake, cachedIsFake, userData, cachedUserData, ename and cachedEname when the
Promise.all succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccc96f67-54ba-4faf-b58b-724cb3022ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 5f08b54 and d6b6906.

📒 Files selected for processing (1)
  • infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte

Comment thread infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte
@Sahil2004 Sahil2004 requested a review from coodos June 15, 2026 05:00
@coodos coodos merged commit f7601e4 into main Jun 15, 2026
4 checks passed
@coodos coodos deleted the feat/eid-wallet-pull-to-refresh branch June 15, 2026 10:32
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.

eID Wallet: Home screen missing pull-to-refresh — records don't update unless navigating away and back

2 participants