Skip to content
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

fix: disable ledger for firefox, closes #5287 #5583

Closed
wants to merge 1 commit into from

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented Jun 28, 2024

This PR adds a check for firefox and if so disabled the Use Ledger button at sign in

Summary by CodeRabbit

  • New Features
    • The 'Use Ledger' button is now conditionally disabled if the user is on a Firefox browser, enhancing compatibility and preventing potential issues.

@pete-watters pete-watters self-assigned this Jun 28, 2024
Copy link

coderabbitai bot commented Jun 28, 2024

Walkthrough

The changes introduce a new constant isFirefox in the WelcomeLayout component to detect if the user is using Firefox. If Firefox is detected, the 'Use Ledger' button is disabled to cater to browser-specific requirements.

Changes

Files Change Summary
src/.../welcome.layout.tsx Reordered imports, added a Firefox detection check, and conditionally disabled the 'Use Ledger' button

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@pete-watters pete-watters marked this pull request as ready for review June 28, 2024 09:19
@pete-watters pete-watters force-pushed the fix/5287/ledger-firefox branch from afa2e6b to 4f77959 Compare June 28, 2024 09:20
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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 65131b0 and afa2e6b.

Files selected for processing (1)
  • src/app/ui/pages/welcome.layout.tsx (3 hunks)
Additional comments not posted (2)
src/app/ui/pages/welcome.layout.tsx (2)

1-1: Imports are correctly added and structured.


116-116: Conditional disabling of the button is correctly implemented.

Ensure to verify the UI's behavior across different browsers to ensure that the disabling functionality is consistent and does not affect user experience negatively.

Verification successful

Conditional disabling of the button is correctly implemented.

Ensure that the isFirefox flag is correctly identifying the Firefox browser to guarantee the button's behavior is as expected.

  • Verify the implementation of isFirefox within the codebase.

Conditional disabling of the button is correctly implemented.

The isFirefox flag correctly identifies the Firefox browser using the user agent string.

  • Implementation found in src/app/ui/pages/welcome.layout.tsx: const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the UI's behavior across different browsers for consistency.

# Test: Manual testing is required here. Use BrowserStack or a similar service to check the UI on different browsers.
echo "Manual testing required: Check UI on different browsers using BrowserStack."

Length of output: 160



Script:

#!/bin/bash
# Search for the implementation of the isFirefox flag in the codebase
rg 'isFirefox' --type js --type ts

Length of output: 216

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

Outside diff range and nitpick comments (2)
src/app/ui/pages/welcome.layout.tsx (2)

22-22: Review browser detection logic.

The logic to detect Firefox using navigator.userAgent.toLowerCase().includes('firefox') is straightforward and commonly used. However, consider the implications of user-agent sniffing and potential issues with user-agent strings in different environments.


117-117: Ensure graceful degradation for the disabled 'Use Ledger' button.

The button is disabled based on the browser type. Ensure that this is clearly communicated to the user, possibly through a tooltip or an alternative message, to improve user experience and accessibility.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 65131b0 and 4f77959.

Files selected for processing (1)
  • src/app/ui/pages/welcome.layout.tsx (2 hunks)
Additional comments not posted (1)
src/app/ui/pages/welcome.layout.tsx (1)

Line range hint 4-4: Confirm usage of imported components.

Ensure that Button, LettermarkIcon, Link, and LogomarkIcon are utilized appropriately in the component and that there are no unused imports.

Verification successful

Confirm usage of imported components.

The imported components Button, LettermarkIcon, Link, and LogomarkIcon are all utilized in the src/app/ui/pages/welcome.layout.tsx file.

  • Button is used multiple times.
  • LettermarkIcon is used.
  • Link is used.
  • LogomarkIcon is used.

No unused imports were found.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the newly imported components are utilized in the file.

# Test: Search for the usage of the new components. Expect: At least one occurrence of each component.
rg --type tsx $'Button|LettermarkIcon|Link|LogomarkIcon' src/app/ui/pages/welcome.layout.tsx

Length of output: 121



Script:

#!/bin/bash
# Description: Verify that the newly imported components are utilized in the file.

# Test: Search for the usage of the new components. Expect: At least one occurrence of each component.
rg 'Button|LettermarkIcon|Link|LogomarkIcon' src/app/ui/pages/welcome.layout.tsx

Length of output: 744

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

We have a screen for this, that shows a "browser not supported" message

IMO this is a degraded experience, because now the user doesn't know why they can't use Ledger.

...but also, we don't support FF so 🤷🏼 @314159265359879 is this still an issue? Doesn't the screen work?

@pete-watters
Copy link
Contributor Author

We have a screen for this, that shows a "browser not supported" message

IMO this is a degraded experience, because now the user doesn't know why they can't use Ledger.

...but also, we don't support FF so 🤷🏼 @314159265359879 is this still an issue? Doesn't the screen work?

Thanks, I didn't know about that screen

@pete-watters pete-watters linked an issue Jun 28, 2024 that may be closed by this pull request
@pete-watters pete-watters deleted the fix/5287/ledger-firefox branch July 8, 2024 17:30
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.

Firefox disable "use ledger" button
2 participants