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

UI bugfixes from testing 0.4 today #480

Merged
merged 13 commits into from
Aug 9, 2024
Merged

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Aug 9, 2024

Found a couple bugs from doing a round of testing today with a bunch of people with Clovyr, adresses these issues I logged during it:

#479 : turns this into an animated ellipsis to show progress, for larger federations this can take a couple seconds and a couple people thought the setup had halted

#478 : bugfix, updated to have them reenter their guardian name to acknowledge they've backed up their password

#477: bugfix, already had this but it broke during the big refactor I did

#476 : remove obvious copy button to encourage user to actually copy it down separately instead of just clicking through

#475 : added on connect guardians and on verify guardians screens

#473: this is going to be fixed backend side not UI side

#472: use null for one time generation instead of ''

Summary by CodeRabbit

  • New Features

    • Introduced a WarningModal to confirm critical actions within the role selection process.
    • Enhanced loading indicators with dynamic ellipses in the RunDKG component.
    • Added a new SignApiAnnouncement component for improved API announcement handling.
    • Consolidated modal functionality into a new RestartModals component for better user experience during peer setup.
  • Improvements

    • Refined user interface elements across multiple components for better clarity and responsiveness.
    • Integrated internationalization support for various labels and messages.
    • Improved password handling logic in several components for a more intuitive user experience.
    • Enhanced the clarity of the verification process by linking peer identity to the verification code prompt.
  • Bug Fixes

    • Resolved issues around dynamic rendering and state management for modals and user prompts.
  • Documentation

    • Updated English language JSON file with new strings for improved user guidance and messaging.

@Kodylow Kodylow requested review from a team as code owners August 9, 2024 00:02
Copy link
Contributor

coderabbitai bot commented Aug 9, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

Walkthrough

The recent changes across the application enhance user interaction by streamlining component logic and improving state management. Key updates include the removal of unnecessary modal handling, enhancements to password management, and better responsiveness in UI elements. This restructuring simplifies code, improves user experience, and facilitates internationalization.

Changes

File Path Change Summary
apps/guardian-ui/src/admin/FederationAdmin.tsx Removed announcement check logic, simplifying state management and control flow.
apps/guardian-ui/src/components/dashboard/danger/*.tsx Replaced onApiAnnouncementOpen prop with signedApiAnnouncements and introduced SignApiAnnouncement for better modularity.
apps/guardian-ui/src/components/setup/*.tsx Updated state management for loading indicators, password handling, and role selection with confirmation modals.
apps/guardian-ui/src/languages/en.json Added new strings for internationalization, improving clarity and user guidance.
apps/guardian-ui/src/setup/FederationSetup.tsx Consolidated modal logic into RestartModals for improved maintainability.
apps/guardian-ui/src/setup/SetupContext.tsx Changed password initial state from an empty string to null for clearer state management.
apps/guardian-ui/src/types.tsx Updated password type in SetupState to allow null values, enhancing flexibility.
packages/ui/src/Header.tsx Improved Header component responsiveness by modifying margin properties for better layout adaptability.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant FederationSetup
    participant RestartModals

    User->>FederationSetup: Initiates restart
    FederationSetup->>RestartModals: Opens restart confirmation modal
    RestartModals->>User: Prompts confirmation
    User->>RestartModals: Confirms restart
    RestartModals->>FederationSetup: Executes restart logic
Loading

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

Outside diff range, codebase verification and nitpick comments (1)
apps/guardian-ui/src/components/setup/screens/verifyGuardians/VerifyGuardians.tsx (1)

67-67: Ensure ourCurrentId is not null before accessing peers[ourCurrentId].

The code checks if ourCurrentId is null and sets an error if so. However, the access to peers[ourCurrentId] does not have a null check immediately before it. To prevent potential runtime errors, ensure that ourCurrentId is validated right before accessing peers[ourCurrentId].

  • Add a null check for ourCurrentId before using it to access peers[ourCurrentId].
Analysis chain

Ensure ourPeerName is correctly set.

The ourPeerName variable is introduced to display the peer's name. Verify that peers[ourCurrentId] is always defined to avoid potential runtime errors.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `peers[ourCurrentId]` is always defined.

# Test: Check for potential undefined access to `peers[ourCurrentId]`.
rg --type js --context 3 'peers\[ourCurrentId\]'

Length of output: 50


Script:

#!/bin/bash
# Search for the definition and usage of `ourCurrentId` and `peers` to understand their context.
rg --type js 'ourCurrentId' -A 3
rg --type js 'peers' -A 3

Length of output: 58


Script:

#!/bin/bash
# Search for peer-related logic or state management in the VerifyGuardians.tsx file.
fd 'VerifyGuardians.tsx' | xargs rg -A 5 'peer'

Length of output: 4154

Copy link
Member

@tvolk131 tvolk131 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kodylow Kodylow merged commit 9b7e5df into fedimint:master Aug 9, 2024
1 check passed
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