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

Cais gateway UI changes #1614

Merged
merged 7 commits into from
Oct 20, 2023
Merged

Cais gateway UI changes #1614

merged 7 commits into from
Oct 20, 2023

Conversation

CaisManai
Copy link
Contributor

Revamped the UI and fixed several UI bugs. Only tested on desktop.

@CaisManai CaisManai requested review from zkokelj and 0xjba October 20, 2023 12:37
@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2023

Walkthrough

The pull request introduces significant changes to the wallet extension's user interface, improving the visual presentation and user experience. It includes modifications to the HTML structure, CSS styles, and JavaScript functionality. New elements and styles are added, and existing functions are updated for better error handling and status messaging.

Changes

File Summary
.../staticOG/index.html The HTML structure and content have been significantly updated. Changes include adding a logo, restructuring the layout, updating instructions, modifying table headers and buttons, and introducing a new form and table for displaying connected accounts.
.../staticOG/javascript.js The JavaScript file has been updated with new constants and modifications to existing functions. Changes include better error handling, status messaging, and visibility adjustments for certain elements.
.../staticOG/style.css The CSS file has been significantly updated to improve the visual appearance and user experience. Changes include modifications to the background, font, padding, positioning, and animation properties of various elements, and new styles for a login form and a spinner animation.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

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.

Review Status

Actionable comments generated: 5

Commits Files that changed from the base of the PR and between d494bc8 and ec52d10.
Files ignored due to filter (1)
  • tools/walletextension/api/staticOG/obscuro.svg
Files selected for processing (3)
  • tools/walletextension/api/staticOG/index.html (2 hunks)
  • tools/walletextension/api/staticOG/javascript.js (5 hunks)
  • tools/walletextension/api/staticOG/style.css (3 hunks)
Additional comments (Suppressed): 12
tools/walletextension/api/staticOG/style.css (7)
  • 1-182: The new CSS rules significantly change the look and feel of the page. The body's background color has been changed to a gradient, and the font color, size, and weight have been adjusted. New classes have been added for a logo, a login form (.begin-box), and a button with a hover effect. The anchor tag's color has been kept the same. Ensure that these changes align with the overall design language of the application and that they provide a good user experience across different screen sizes and devices.

  • 206-213: The display property of the table has been set to none, which means the table will not be visible by default. If this is intentional and the visibility of the table is controlled dynamically using JavaScript, then this is fine. Otherwise, this could be an issue. The background-color of the table has been changed from #333 to #000000, and a margin-top of 20px has been added.

  • 219-221: The background-color of the th element remains unchanged.

  • 223-236: New styles have been added for h2, #join, and #versionDisplay. Ensure that these changes are reflected correctly in the HTML structure.

  • 238-240: The color of the #status element has been set to red. This is typically used to indicate errors or warnings, so ensure that this is the intended use case.

  • 242-245: The #revokeUserID element has been given a margin-top of 10px and a padding of 10px.

  • 247-315: A new class .spinner has been added for a spinner animation. This is typically used to indicate that a process is running in the background. Ensure that this animation is used appropriately in the JavaScript code.

tools/walletextension/api/staticOG/javascript.js (5)
  • 5-14: The new constants idInformation, idInformation2, idBegin, and idSpinner have been added. Ensure that these IDs are correctly defined in the HTML structure and are used appropriately throughout the JavaScript code.

  • 275-298: The new elements informationArea, informationArea2, beginBox, and spinner are fetched from the DOM and used in the displayOnlyJoin function. Ensure that these elements are correctly manipulated to reflect the desired UI state.

  • 324-334: The error message in line 333 has been updated. Make sure this new message is more informative and user-friendly than the previous one.

  • 368-379: The visibility of beginBox and spinner is manipulated before and after the loop in lines 373-377. This seems to be a way to show a loading state while the accounts are being authenticated. Ensure that this provides a better user experience and doesn't introduce any UI glitches.

  • 397-402: The visibility of beginBox and spinner is manipulated before and after the revokeUserID function call. This seems to be a way to show a loading state while the user ID is being revoked. Ensure that this provides a better user experience and doesn't introduce any UI glitches.

tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
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.

Review Status

Actionable comments generated: 4

Commits Files that changed from the base of the PR and between ec52d10 and 4f0407d.
Files selected for processing (1)
  • tools/walletextension/api/staticOG/index.html (2 hunks)
Additional comments (Suppressed): 3
tools/walletextension/api/staticOG/index.html (3)
  • 18-18: The spinner div is empty. If it's meant to display a loading spinner, ensure that it's being populated dynamically via JavaScript or CSS animations.

  • 21-35: The instructions provided are clear and detailed, which should help users understand the process. However, consider breaking this large block of text into smaller sections or using collapsible elements for better readability.

  • 47-57: The table structure is well defined and clear. The IDs and classes are appropriately named, which should make it easier to manipulate this table in JavaScript.

tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
Copy link
Contributor

@0xjba 0xjba left a comment

Choose a reason for hiding this comment

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

Please revert back the Hard coded gateway address & any usage of it.
Line 1, 14-18, Line 34

Copy link
Contributor

@zkokelj zkokelj left a comment

Choose a reason for hiding this comment

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

Nice improvements!

Mentioned a few things in the comments, but nothing major (not working after refresh is the biggest issue in my opinion).

tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
tools/walletextension/api/staticOG/style.css Show resolved Hide resolved
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.

Review Status

Actionable comments generated: 1

Commits Files that changed from the base of the PR and between 4f0407d and 1a227b2.
Files selected for processing (3)
  • tools/walletextension/api/staticOG/index.html (1 hunks)
  • tools/walletextension/api/staticOG/javascript.js (8 hunks)
  • tools/walletextension/api/staticOG/style.css (2 hunks)
Additional comments (Suppressed): 16
tools/walletextension/api/staticOG/style.css (2)
  • 1-184: The new CSS rules for the HTML and body elements, as well as the new classes and IDs, significantly change the visual appearance of the page. The changes include a new gradient background, font properties, and a new layout for the login form. The .begin-box class, which is likely used for the login form, has been set to visibility: hidden; by default. This suggests that the form will be displayed programmatically, possibly in response to a user action. The .begin-box .user-box input:focus ~ label and .begin-box .user-box input:valid ~ label rules change the position and color of the label when the input field is focused or contains valid input, providing visual feedback to the user. The .begin-box a:hover rule adds a hover effect to the links in the form. The .begin-box a span rules and keyframes add an animation to the links. Ensure that these changes provide a good user experience and are compatible with all targeted browsers.

  • 205-319: The new CSS rules for the table element and its children change the appearance and behavior of the table. The table is now hidden by default (display: none;), suggesting that it will be displayed programmatically, possibly in response to a user action. The width of the table has been set to 100%, which will make it span the entire width of its parent element. The background color of the table and the table headers has been changed. The #join ID, #versionDisplay ID, #status ID, and #revokeUserID ID have new styles that change their position, size, color, and visibility. The .spinner class and its pseudo-elements add a spinner animation, which is likely used to indicate loading or processing. Ensure that these changes provide a good user experience and are compatible with all targeted browsers.

tools/walletextension/api/staticOG/javascript.js (6)
  • 8-14: The new constants idInformation, idInformation2, idBegin, and idSpinner have been added. Ensure that these IDs correspond to the correct HTML elements in the UI. Also, ensure that these elements are used appropriately in the code.

  • 66-71: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [58-71]

No significant changes have been made in these lines. The functions getNetworkName and getRPCFromUrl remain the same.

  • 273-306: The new variables informationArea, informationArea2, beginBox, and spinner have been introduced and are used in the displayOnlyJoin and displayConnectedAndJoinedSuccessfully functions. These changes seem to be related to the UI overhaul mentioned in the PR summary. Ensure that these changes align with the intended UI design and user experience.

  • 324-334: The error message in line 331 has been updated. Ensure that this new message is more clear and helpful to the user.

  • 366-378: The visibility of beginBox and spinner is being toggled before and after the loop in lines 369-370 and 376-377. This seems to be a loading indicator for the user. Ensure that this provides a better user experience and doesn't cause any unexpected behavior or layout shifts in the UI.

  • 393-400: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [395-410]

Similar to the previous comment, the visibility of beginBox and spinner is being toggled in the revokeUserIDButton event listener. Again, ensure that this provides a better user experience and doesn't cause any unexpected behavior or layout shifts in the UI.

tools/walletextension/api/staticOG/index.html (8)
  • 4-6: The title and favicon have been updated. Ensure that the new favicon file favicon-32x32.png exists at the specified path and that the new title is appropriate for the page.

  • 15-16: A new logo has been added to the page. Ensure that the logo file obscuro.svg exists at the specified path and is displayed correctly.

  • 18-18: A new spinner element has been added. Ensure that the spinner is displayed and hidden correctly in the JavaScript code.

  • 20-61: A new div with the id begin-box has been added, containing a form with instructions, a join button, an accounts table, a revoke button, and a status paragraph. Ensure that the form behaves as expected and that the instructions are clear and accurate.

  • 40-46: The join button has been redesigned with additional span elements. Ensure that the button's appearance and functionality are as expected.

  • 47-57: The accounts table has been redesigned with new column headers. Ensure that the table displays the correct data and that the column headers are appropriate.

  • 58-58: The revoke button has been moved inside the form. Ensure that the button's functionality is not affected by this change.

  • 63-63: The version display div has been moved outside the form. Ensure that the version display is still visible and positioned correctly.

tools/walletextension/api/staticOG/index.html Outdated Show resolved Hide resolved
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.

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 1a227b2 and 7f4aafd.
Files selected for processing (1)
  • tools/walletextension/api/staticOG/index.html (1 hunks)
Additional comments (Suppressed): 7
tools/walletextension/api/staticOG/index.html (7)
  • 4-6: The title tag and favicon link have been updated. Ensure that the new favicon file favicon-32x32.png exists in the same directory as the HTML file.

  • 9-9: The type="module" attribute has been added to the script tag for javascript.js. This means that the script is treated as an ECMAScript module. As a result, the script is loaded in strict mode and variables are scoped to the module rather than the global scope. Ensure that javascript.js is compatible with this change.

  • 14-16: A new div with class container-fluid has been added, containing an image with the Obscuro logo. Ensure that the image file obscuro.svg exists in the same directory as the HTML file.

  • 18-18: A new div with class spinner and id spinner has been added. This is likely for a loading spinner animation. Ensure that the corresponding CSS and JavaScript for this spinner are implemented correctly.

  • 20-61: A new div with class begin-box and id begin-box has been added. This div contains a form with instructions, a join button, an accounts table, a revoke accounts button, and a status paragraph. The structure and content of this form are significantly different from the previous version. Ensure that the corresponding CSS and JavaScript are updated to handle this new structure and content.

  • 58-58: The style attribute has been removed from the revokeUserID button. Ensure that the corresponding CSS is updated to style this button.

  • 63-63: The style attribute has been removed from the versionDisplay div. Ensure that the corresponding CSS is updated to style this div.

@CaisManai CaisManai requested a review from 0xjba October 20, 2023 13:50
Copy link
Contributor

@0xjba 0xjba left a comment

Choose a reason for hiding this comment

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

LGTM

@CaisManai CaisManai merged commit 4c5c8b2 into main Oct 20, 2023
1 of 2 checks passed
@CaisManai CaisManai deleted the cais-gateway-ui-changes branch October 20, 2023 15:37
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.

4 participants