Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Dec 25, 2025

💡 What: Added a visual loading state to the Button component and implemented it on the Auth page.
🎯 Why: To provide immediate visual feedback to users when an asynchronous action (like logging in) is in progress, preventing confusion and double-submissions.
📸 Changes:

  • Created web/components/ui/Spinner.tsx
  • Modified web/components/ui/Button.tsx to support isLoading
  • Updated web/pages/Auth.tsx
    Accessibility: The button is disabled (disabled attribute) when loading, preventing keyboard interaction and announcing the state to screen readers via the disabled attribute (and implicit visual change).

PR created automatically by Jules for task 14124150984758611977 started by @Devasy23

Summary by CodeRabbit

  • New Features

    • Buttons now support an is-loading state and display an animated spinner beside the label.
    • A reusable spinner component is used across the app.
  • Bug Fixes / UX

    • Buttons are disabled while loading to prevent duplicate actions.
    • Pages that previously showed static loading text now show the spinner and hide action icons during processing.

✏️ Tip: You can customize this high-level summary in your review settings.

- Added `Spinner` component using Lucide `Loader2`.
- Updated `Button` component to accept `isLoading` prop.
- Integrated loading state into Auth page login button for better UX.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

Walkthrough

Adds a new Spinner component, extends Button with an isLoading prop that renders the spinner and disables the button, and updates the Auth page to use isLoading and show the spinner instead of inline loading text.

Changes

Cohort / File(s) Summary
New Spinner Component
web/components/ui/Spinner.tsx
Adds Spinner export and SpinnerProps { className?: string; size?: number; ariaLabel?: string }; renders Loader2 with animate-spin, forwards size and aria-label, and sets role="status".
Button Loading State
web/components/ui/Button.tsx
Adds isLoading?: boolean to ButtonProps; Button now accepts isLoading (default false), sets `disabled={isLoading
Auth Page Updates
web/pages/Auth.tsx
Imports Spinner, replaces disabled={loading} with isLoading={loading} on submit button, removes inline "Processing..." text, and conditionally hides the ArrowRight icon while loading.

Suggested reviewers

  • vrajpatelll

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add loading state to Button component' accurately summarizes the main change: introducing a loading state feature to the Button component via the new isLoading prop and Spinner integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2f655 and 9e2cf47.

📒 Files selected for processing (2)
  • web/components/ui/Spinner.tsx
  • web/pages/Auth.tsx
🧰 Additional context used
📓 Path-based instructions (1)
web/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Web pages should be created as components in web/pages/ and added to routing configuration

Files:

  • web/pages/Auth.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-27T18:33:22.596Z
Learnt from: CR
Repo: Devasy23/splitwiser PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T18:33:22.596Z
Learning: Applies to {mobile/context/**/*.js,web/contexts/**/*.{ts,tsx}} : React Context should be used for state management of authentication and app-wide state in both mobile and web

Applied to files:

  • web/pages/Auth.tsx
🧬 Code graph analysis (1)
web/pages/Auth.tsx (2)
web/components/ui/Spinner.tsx (1)
  • Spinner (10-19)
web/components/ui/Button.tsx (1)
  • Button (12-60)
🔇 Additional comments (4)
web/components/ui/Spinner.tsx (1)

1-19: LGTM! Well-implemented accessible Spinner component.

The component properly handles accessibility with role="status" and a customizable aria-label, allowing context-specific labels (e.g., "Signing in with Google") while maintaining "Loading" as a sensible default. The implementation is clean and follows React best practices.

web/pages/Auth.tsx (3)

6-6: LGTM! Correct import of the new Spinner component.


173-174: LGTM! Excellent accessibility with context-specific label.

The Google sign-in button now uses the reusable Spinner component with an appropriate context-specific ariaLabel, addressing the duplication concern raised in the PR comments while maintaining good accessibility practices.


251-252: LGTM! Well-integrated loading state with good UX.

The Button component correctly uses the isLoading prop to display the Spinner and disable interaction during submission. The conditional rendering of the ArrowRight icon ({!loading && <ArrowRight size={20} />}) provides clear visual feedback: a spinner during async actions and a directional arrow when the button is actionable.


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.

@netlify
Copy link

netlify bot commented Dec 25, 2025

Deploy Preview for split-but-wiser ready!

Name Link
🔨 Latest commit 9e2cf47
🔍 Latest deploy log https://app.netlify.com/projects/split-but-wiser/deploys/694ec806c23e00000713440e
😎 Deploy Preview https://deploy-preview-217--split-but-wiser.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.42%. Comparing base (22f39f1) to head (9e2cf47).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #217   +/-   ##
=======================================
  Coverage   74.42%   74.42%           
=======================================
  Files          17       17           
  Lines        1693     1693           
  Branches      158      158           
=======================================
  Hits         1260     1260           
  Misses        381      381           
  Partials       52       52           
Components Coverage Δ
Authentication System 75.45% <ø> (ø)
Expense Management 70.64% <ø> (ø)
Group Management 76.20% <ø> (ø)
User Management 97.16% <ø> (ø)
Backend Core 69.41% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Devasy Devasy marked this pull request as ready for review December 25, 2025 12:34
@Devasy
Copy link
Owner

Devasy commented Dec 25, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/pages/Auth.tsx (1)

163-200: Consider refactoring the Google sign-in button for consistency.

The Google sign-in button (lines 163-200) implements its own custom loading spinner, which creates code duplication with the new Spinner component. While the current implementation works, consider whether the reusable Button component could be adapted to support this use case, which would improve maintainability and consistency.

If the custom styling is intentional to match Google's branding, this is fine as-is.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22f39f1 and 0c3f602.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • web/components/ui/Button.tsx
  • web/components/ui/Spinner.tsx
  • web/pages/Auth.tsx
🧰 Additional context used
📓 Path-based instructions (1)
web/pages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Web pages should be created as components in web/pages/ and added to routing configuration

Files:

  • web/pages/Auth.tsx
🧬 Code graph analysis (2)
web/pages/Auth.tsx (1)
web/components/ui/Button.tsx (1)
  • Button (12-60)
web/components/ui/Button.tsx (1)
web/components/ui/Spinner.tsx (1)
  • Spinner (9-17)
🔇 Additional comments (4)
web/components/ui/Button.tsx (3)

4-4: LGTM! Clean integration of the Spinner component.

The import and prop definition are well-structured and follow the existing patterns in the component.

Also applies to: 9-9


53-53: LGTM! Proper handling of disabled state.

The button correctly disables itself during loading state while respecting any explicitly passed disabled prop. This prevents double submissions and provides good accessibility.


56-56: Spinner placement looks good.

The Spinner is correctly positioned before the button content with appropriate spacing. The mr-1 margin works well with the gap-2 flexbox spacing defined in baseStyles (line 22).

web/pages/Auth.tsx (1)

254-255: LGTM! Clean migration to the new loading state pattern.

The changes correctly use the new isLoading prop and conditionally render the ArrowRight icon only when not loading. This provides clear visual feedback while maintaining consistent button text, which is better UX than the previous text-changing approach.

- Updated `Spinner` component to accept an optional `ariaLabel` prop.
- Sets default `aria-label` to "Loading".
- Ensures accessibility for screen readers by allowing context-specific labels.
@Devasy
Copy link
Owner

Devasy commented Dec 26, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Devasy
Copy link
Owner

Devasy commented Dec 26, 2025

@jules 163-200: Consider refactoring the Google sign-in button for consistency.

The Google sign-in button (lines 163-200) implements its own custom loading spinner, which creates code duplication with the new Spinner component. While the current implementation works, consider whether the reusable Button component could be adapted to support this use case, which would improve maintainability and consistency.

If the custom styling is intentional to match Google's branding, this is fine as-is.

@google-labs-jules
Copy link
Contributor Author

@jules 163-200: Consider refactoring the Google sign-in button for consistency.

The Google sign-in button (lines 163-200) implements its own custom loading spinner, which creates code duplication with the new Spinner component. While the current implementation works, consider whether the reusable Button component could be adapted to support this use case, which would improve maintainability and consistency.

If the custom styling is intentional to match Google's branding, this is fine as-is.

Good catch on the code duplication! I've refactored the Google sign-in button to use the new Spinner component for consistency, while preserving the custom styling and layout of the button itself.

- Replaced custom inline spinner with `Spinner` component in Google sign-in button.
- Added `role="status"` to `Spinner` component for better accessibility.
- Removed unnecessary `pnpm-lock.yaml` file.
@Devasy
Copy link
Owner

Devasy commented Dec 26, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

2 participants