Skip to content

Fix sign-in modal service issues in Boilerplate (#10845) #10846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 26, 2025
Merged

Fix sign-in modal service issues in Boilerplate (#10845) #10846

merged 12 commits into from
May 26, 2025

Conversation

ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented May 25, 2025

closes #10845

Summary by CodeRabbit

  • New Features

    • Improved synchronization between sign-in panel and modal, allowing seamless switching and updating of sign-in methods.
  • Enhancements

    • The default sign-in method is now set to OTP-only.
    • Button styles and panel switching behavior dynamically adjust based on the selected sign-in method for a more intuitive user experience.

Copy link

coderabbitai bot commented May 25, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes update the sign-in modal and panel components to use two-way binding for the SignInPanelType property, introduce an event callback for panel type changes, and adjust default values and button styling. The modal service no longer explicitly sets the panel type, and state changes are now encapsulated in a method.

Changes

File(s) Change Summary
.../SignIn/SignInModal.razor Switched from explicit parameter to two-way binding for SignInPanelType.
.../SignIn/SignInModal.razor.cs Changed default SignInPanelType to OtpOnly; removed unused private field.
.../SignIn/SignInPanel.razor Button style now depends on panel type; state changes use a method instead of direct assignment.
.../SignIn/SignInPanel.razor.cs Added SignInPanelTypeChanged event callback and ChangeSignInPanelType method for state management.
.../Services/SignInModalService.cs Removed explicit setting of SignInPanelType parameter during modal creation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignInModal
    participant SignInPanel

    User->>SignInModal: Open modal
    SignInModal->>SignInPanel: Bind SignInPanelType (two-way)
    SignInPanel->>SignInPanel: User toggles panel type (OTP/Password)
    SignInPanel->>SignInPanel: ChangeSignInPanelType(type)
    SignInPanel->>SignInModal: SignInPanelTypeChanged event
    SignInModal->>SignInPanel: Update SignInPanelType
Loading

Assessment against linked issues

Objective Addressed Explanation
Resolve issues with sign-in modal service and panel state synchronization (#10845)

Poem

A modal pops up with a gentle hop,
Two-way binding now—no need to stop!
OTP or password, the panel can switch,
With callbacks and methods, it’s never a glitch.
The service is cleaner, the flow is just right—
A sign-in success on this coding night!
🐇✨


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs (1)

404-408: Remove unnecessary async modifier.

The method doesn't contain any asynchronous operations, so the async modifier and Task return type are unnecessary overhead.

Apply this diff to simplify the method:

-    private async Task ChangeSignInPanelType(SignInPanelType type)
+    private void ChangeSignInPanelType(SignInPanelType type)
     {
         SignInPanelType = type;
-        await SignInPanelTypeChanged.InvokeAsync(type);
+        SignInPanelTypeChanged.InvokeAsync(type);
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9e18e2e and c0af343.

📒 Files selected for processing (5)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInModal.razor (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInModal.razor.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/SignInModalService.cs (0 hunks)
💤 Files with no reviewable changes (1)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/SignInModalService.cs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build and test
  • GitHub Check: build api + blazor web
  • GitHub Check: build blazor hybrid (windows)
🔇 Additional comments (6)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs (1)

43-43: LGTM: Two-way binding parameter added correctly.

The EventCallback<SignInPanelType> parameter enables proper two-way binding with the parent component, following Blazor conventions.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInModal.razor (1)

10-10: LGTM: Two-way binding implemented correctly.

The change from explicit parameter passing to two-way binding syntax (@bind-SignInPanelType) properly synchronizes the panel type state between the modal and panel components.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInModal.razor.cs (1)

7-7: LGTM: Default value change aligns with PR objectives.

Changing the default from SignInPanelType.Full to SignInPanelType.OtpOnly is consistent with the sign-in modal service fixes described in the PR objectives.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor (3)

110-110: LGTM: Improved button styling based on panel type.

The conditional styling makes the "Send OTP" button more prominent when in OTP-only mode, providing better visual hierarchy and user experience.


118-118: LGTM: Proper two-way binding implementation.

Replacing direct property assignment with the ChangeSignInPanelType method call ensures the parent component is notified of state changes through the EventCallback.


123-123: LGTM: Consistent two-way binding pattern.

Using the ChangeSignInPanelType method maintains consistency with the other toggle link and properly implements the two-way binding pattern.

@msynk msynk merged commit 378e4dd into develop May 26, 2025
3 checks passed
@msynk msynk deleted the 10845 branch May 26, 2025 17:00
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.

Boilerplate project template sign-in modal service has issues
2 participants