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

feat: switch everything to tabs #560

Merged
merged 7 commits into from
Oct 17, 2024
Merged

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Oct 15, 2024

switches the whole UI to just using tabs, keeps everything on one page so no more scrolling:

image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced new components: BalanceSheet, BalanceTable, FederationInfo, and FederationStatus.
    • Enhanced FederationTabsCard with additional functionality and improved layout.
    • Added a tabbed interface to the Gateway component for better content organization.
  • Improvements
    • Simplified layout of the FederationAdmin component.
    • Updated language keys and added new labels for better clarity.
    • Modified the FederationsTable layout for improved flexibility.
    • Renamed components for clarity: GatewaysCard to GatewaysStatus and GuardiansCard to GuardiansStatus.
  • Removals
    • Removed outdated components: BalanceCard, BalanceTable, and FederationInfoCard.

@Kodylow Kodylow requested review from a team as code owners October 15, 2024 00:55
Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 6:09pm

Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

This pull request introduces significant structural changes to the FederationAdmin component, primarily focusing on the InviteCode and FederationTabsCard components. Several components related to the dashboard have been removed, including BalanceCard, BalanceTable, and FederationInfoCard. New components such as BalanceSheet, BalanceTable, FederationInfo, and FederationStatus have been added to enhance functionality. Additionally, multiple language files have undergone key renaming and updates to improve localization.

Changes

File Path Change Summary
apps/router/src/guardian-ui/admin/FederationAdmin.tsx Structural modifications to FederationAdmin, focusing on InviteCode and FederationTabsCard.
apps/router/src/guardian-ui/components/dashboard/admin/BalanceCard.tsx Component removed.
apps/router/src/guardian-ui/components/dashboard/admin/BalanceTable.tsx Component and interface removed.
apps/router/src/guardian-ui/components/dashboard/admin/FederationInfoCard.tsx Component removed.
apps/router/src/guardian-ui/components/dashboard/admin/InviteCode.tsx Layout adjustments made.
apps/router/src/guardian-ui/components/dashboard/tabs/FederationTabsCard.tsx Updated props and structure with new tabs and components.
apps/router/src/guardian-ui/components/dashboard/tabs/balanceSheet/BalanceSheet.tsx New component added for balance data fetching.
apps/router/src/guardian-ui/components/dashboard/tabs/balanceSheet/BalanceTable.tsx New component added for financial summary display. Interface added.
apps/router/src/guardian-ui/components/dashboard/tabs/info/FederationInfo.tsx New component added for displaying federation information.
apps/router/src/guardian-ui/components/dashboard/tabs/status/FederationStatus.tsx New component added for guardian and gateway status.
apps/router/src/guardian-ui/components/dashboard/tabs/status/GatewaysStatus.tsx Component renamed from GatewaysCard.
apps/router/src/guardian-ui/components/dashboard/tabs/status/GuardiansStatus.tsx Component renamed from GuardiansCard.
apps/router/src/gateway-ui/Gateway.tsx Structural changes to introduce a tabbed interface for content organization.
apps/router/src/gateway-ui/components/federations/FederationsTable.tsx Layout structure changed to use a Flex component instead of Card.
apps/router/src/gateway-ui/components/lightning/LightningCard.tsx Removed GatewayCard wrapper for simplification.
apps/router/src/gateway-ui/components/walletCard/WalletCard.tsx Refactored to remove GatewayCard wrapper, simplifying structure.
apps/router/src/gateway-ui/languages/en.json Updates to text strings for localization improvements.
flake.nix Updated fedimint input reference from a specific tag to a commit hash.

Possibly related PRs

  • refactor:Single "Fedimint UI" App #522: The refactor of the Fedimint UI includes changes to the application context and state management, which may relate to the structural modifications in the FederationAdmin component that involve state management and data fetching logic.
  • defaults gateway to msats on load #537: The changes in the Header.tsx and related components regarding active service handling may connect with the modifications in the FederationAdmin component, as both involve managing and displaying service-related information.

Suggested reviewers

  • dpc
  • tvolk131

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e21290e and 7952711.

📒 Files selected for processing (1)
  • apps/router/src/guardian-ui/components/dashboard/tabs/FederationTabsCard.tsx (5 hunks)
🧰 Additional context used
🔇 Additional comments (1)
apps/router/src/guardian-ui/components/dashboard/tabs/FederationTabsCard.tsx (1)

Line range hint 1-295: LGTM!

The changes align with the PR objectives of switching to a tabbed layout. The new structure and components enhance the federation dashboard's functionality and organization.


🪧 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.
    • 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 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 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 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 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
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: 7

🧹 Outside diff range and nitpick comments (3)
apps/router/src/languages/zh.json (1)

Line range hint 1-1: Consider revising the translation for "claimed-note".

The current translation "声称的笔记" (shēngchēng de bǐjì) might be misleading. In the context of cryptocurrency, "note" typically refers to a unit of digital currency rather than a written note. Consider using a term that better conveys the concept of a redeemed or claimed unit of digital currency.

apps/router/src/languages/ko.json (1)

Line range hint 1-1000: Overall translation quality is good, but some improvements could be made.

The Korean translations in this file are generally well-structured and consistent. However, there are a few areas where additional context or clarification could enhance user understanding:

  1. Technical terms: Consider adding explanations for technical terms that are left in English, such as "DKG" or "API announcements".
  2. Contextual translations: Some translations might benefit from more context-specific wording, especially in the setup and wallet sections.

These improvements could enhance the overall user experience for Korean-speaking users.

apps/router/src/languages/it.json (1)

Line range hint 270-270: Redundant translation detected.

On line 270, "actions" is translated as "Aktionen", which is inconsistent with the correct translation "Azione" used on line 11. This should be corrected to maintain consistency throughout the file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c609b2e and d22423b.

📒 Files selected for processing (24)
  • apps/router/src/guardian-ui/admin/FederationAdmin.tsx (2 hunks)
  • apps/router/src/guardian-ui/components/dashboard/admin/BalanceCard.tsx (0 hunks)
  • apps/router/src/guardian-ui/components/dashboard/admin/BalanceTable.tsx (0 hunks)
  • apps/router/src/guardian-ui/components/dashboard/admin/FederationInfoCard.tsx (0 hunks)
  • apps/router/src/guardian-ui/components/dashboard/admin/InviteCode.tsx (1 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/FederationTabsCard.tsx (6 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/balanceSheet/BalanceSheet.tsx (1 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/balanceSheet/BalanceTable.tsx (1 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/info/FederationInfo.tsx (1 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/status/FederationStatus.tsx (1 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/status/GatewaysStatus.tsx (2 hunks)
  • apps/router/src/guardian-ui/components/dashboard/tabs/status/GuardiansStatus.tsx (3 hunks)
  • apps/router/src/languages/ca.json (1 hunks)
  • apps/router/src/languages/de.json (1 hunks)
  • apps/router/src/languages/en.json (2 hunks)
  • apps/router/src/languages/es.json (1 hunks)
  • apps/router/src/languages/fr.json (1 hunks)
  • apps/router/src/languages/hu.json (1 hunks)
  • apps/router/src/languages/it.json (1 hunks)
  • apps/router/src/languages/ja.json (1 hunks)
  • apps/router/src/languages/ko.json (1 hunks)
  • apps/router/src/languages/pt.json (1 hunks)
  • apps/router/src/languages/ru.json (1 hunks)
  • apps/router/src/languages/zh.json (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/router/src/guardian-ui/components/dashboard/admin/BalanceCard.tsx
  • apps/router/src/guardian-ui/components/dashboard/admin/BalanceTable.tsx
  • apps/router/src/guardian-ui/components/dashboard/admin/FederationInfoCard.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/router/src/languages/hu.json
🧰 Additional context used
🔇 Additional comments (23)
apps/router/src/guardian-ui/components/dashboard/tabs/status/FederationStatus.tsx (3)

1-9: Imports look good.


11-15: Props interface is well-defined.


17-32: FederationStatus component implementation is correct.

apps/router/src/guardian-ui/admin/FederationAdmin.tsx (2)

2-11: Import changes align with new tabbed layout.

The removal of several component imports and the addition of FederationTabsCard are consistent with the PR's objective of implementing a tabbed interface.


Line range hint 79-93: Component structure changes implement tabbed layout.

The simplified structure with InviteCode, FederationTabsCard, and DangerZone as main components implements the desired tabbed layout. New props enhance information sharing between components.

apps/router/src/guardian-ui/components/dashboard/tabs/status/GatewaysStatus.tsx (5)

16-18: Import paths updated correctly.


22-26: Component and props interface names updated consistently.


107-110: Component structure simplified using Flex.


111-126: Alert rendering adapted to new component structure.


127-130: Table rendering simplified within new component structure.

apps/router/src/languages/ja.json (1)

Line range hint 1-1037: LGTM!

The changes in this file are minimal and don't introduce any issues. The renaming of "fed-info" to "info" in the "federation-dashboard" section is a simple change that doesn't affect functionality.

apps/router/src/languages/en.json (4)

53-53: Verify if guardian authentication is still needed.

The removal of "authenticate as a guardian" might indicate a change in functionality. Ensure this aligns with any updates to the authentication process.


Line range hint 55-68: LGTM. Verify UI updates for new labels.

The restructuring and new labels improve the information display. Ensure the UI has been updated to accommodate these changes, especially for the new version and consensus block height information.


69-71: Clarify implementation status of the new 'status' object.

The new status object seems to be a placeholder. Confirm if this is intentional or if additional properties are planned for the status display.


Line range hint 53-71: LGTM. Verify consistency with new tabbed layout.

The changes align well with the PR objectives of switching to a tabbed layout and consolidating UI elements. Ensure all new and modified labels are correctly integrated into the new UI design.

apps/router/src/languages/pt.json (1)

55-55: Key rename looks good.

The change from "fed-info" to "info" is consistent and doesn't affect the underlying structure.

apps/router/src/languages/ru.json (1)

Line range hint 55-67: Key renamed from "fed-info" to "info".

The change is consistent with the summary and doesn't affect the translations.

apps/router/src/languages/es.json (1)

Line range hint 55-67: Update code references to the renamed key.

The key "fed-info" has been renamed to "info". Ensure all code referencing this key is updated accordingly.

✅ Verification successful

No issues found with key renaming. All references updated accordingly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for occurrences of the old key name "fed-info" in JavaScript and TypeScript files
rg '"fed-info"' -t js -t ts

Length of output: 29

apps/router/src/languages/fr.json (1)

55-55: Change approved.

The renaming from "fed-info" to "info" is consistent with the AI summary and doesn't introduce any structural changes to the translations.

apps/router/src/languages/ca.json (1)

Line range hint 55-67: Verify key renaming across the application.

The key "fed-info" has been renamed to "info" in the "federation-dashboard" section. Ensure this change is reflected in the application code and other language files to maintain consistency.

✅ Verification successful

Adjust the search commands to correctly target TypeScript and JavaScript files.


Key renaming is consistent across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for occurrences of "fed-info" in other language files and application code
rg '"fed-info"' --type json
rg 'fed-info' --type typescript --type javascript

Length of output: 114


Script:

#!/bin/bash
# Check for occurrences of "fed-info" in other language files and application code
rg '"fed-info"' --type json
rg 'fed-info' -g "*.ts" -g "*.js"

Length of output: 63

apps/router/src/languages/de.json (1)

Line range hint 55-67: LGTM: Key renamed and label updated.

The renaming of "fed-info" to "info" and the update of the label look good. The changes are consistent and maintain the overall structure of the translations.

apps/router/src/guardian-ui/components/dashboard/tabs/status/GuardiansStatus.tsx (1)

Line range hint 1-110: LGTM!

The changes align with the PR objectives, improving the component's structure and naming conventions while maintaining its core functionality.

apps/router/src/guardian-ui/components/dashboard/tabs/balanceSheet/BalanceTable.tsx (1)

1-143: Code meets the requirements and functions correctly.

No issues were found in the implementation.

Comment on lines +14 to +21
useEffect(() => {
const fetchBalance = () => {
api.audit().then(setAuditSummary).catch(console.error);
};
fetchBalance();
const interval = setInterval(fetchBalance, 5000);
return () => clearInterval(interval);
}, [api]);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Reconsider polling interval

The 5-second interval for fetching balance data might be too frequent. Consider increasing the interval to reduce server load and improve performance.

apps/router/src/languages/it.json Show resolved Hide resolved
signedApiAnnouncements={signedApiAnnouncements}
/>
<GatewaysCard config={config} />
<InviteCode inviteCode={inviteCode} />
Copy link
Contributor

Choose a reason for hiding this comment

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

I was expecting all files to be reformatted to use tabs instead of spaces. :D

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that separately, that's a linter update

dpc
dpc previously approved these changes Oct 17, 2024
@Kodylow Kodylow merged commit 6dad54a into fedimint:master Oct 17, 2024
3 checks passed
@Kodylow Kodylow deleted the root-tabs-selector branch October 17, 2024 21:07
This was referenced Oct 18, 2024
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