Skip to content

feat: requested UI and UX improvements#524

Merged
coodos merged 1 commit intomainfrom
fix/e-currency-ui-ux-fixes
Dec 8, 2025
Merged

feat: requested UI and UX improvements#524
coodos merged 1 commit intomainfrom
fix/e-currency-ui-ux-fixes

Conversation

@coodos
Copy link
Contributor

@coodos coodos commented Dec 8, 2025

Description of change

UI/UX improvements

Issue Number

closes #520

Type of change

  • Update (a change which updates existing functionality)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added total currency supply information displayed on currency detail pages.
    • Introduced "Negative Balance Allowed" / "No Negative" indicators on dashboard and currency detail cards.
  • Bug Fixes

    • Fixed user menu dropdown to properly display the current account name.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Added a backend endpoint and service method to calculate total currency supply by aggregating account balances. Enhanced frontend UI to display total supply, indicate whether negative balances are allowed, and show the current account context (user or group) in the top menu.

Changes

Cohort / File(s) Summary
Backend Ledger API
platforms/eCurrency-api/src/controllers/LedgerController.ts, platforms/eCurrency-api/src/index.ts, platforms/eCurrency-api/src/services/LedgerService.ts
Added getTotalSupply(currencyId) endpoint with authentication guard. Fetches all distinct account/accountType pairs for a currency, retrieves each balance, and returns the summed total. Added allowNegative field mapping to balance listings.
User Context Display
platforms/eCurrency/client/src/components/user-menu-dropdown.tsx
Fixed prop name from onAccountContextChang to onAccountContextChange. Updated display label to show "Currently managing: {currentAccountName}" with logic to derive account name from user/group context.
Currency Detail & Dashboard UI
platforms/eCurrency/client/src/pages/currency-detail.tsx, platforms/eCurrency/client/src/pages/dashboard.tsx
Added data fetch for total currency supply via /api/ledger/total-supply/{currencyId}. Renders "Negative Balance Allowed" indicator (Yes/No with color coding) and total supply value. Dashboard shows inline badge ("Negative Allowed" or "No Negative") on each currency card.

Sequence Diagram

sequenceDiagram
    participant User
    participant Client as Client (Browser)
    participant Server as API Server
    participant DB as Database
    
    User->>Client: Navigate to currency detail
    Client->>Server: GET /api/ledger/total-supply/:currencyId
    Note over Server: Authenticate request
    Server->>DB: Query distinct accounts for currency
    DB-->>Server: [accountId, accountType] pairs
    
    loop For each account
        Server->>DB: Get balance for account
        DB-->>Server: balance
        Note over Server: Accumulate total
    end
    
    Server-->>Client: { currencyId, totalSupply }
    Client->>Client: Render total supply & allowNegative badge
    Client-->>User: Display currency details with supply & balance rules
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Backend service logic: getTotalSupply aggregation loop requires verification of query correctness and balance accumulation
  • Prop name fix: Potential breaking changes—verify all callers of UserMenuDropdown use updated prop name
  • Data fetching integration: Ensure query key and endpoint alignment; check loading state handling
  • UI rendering logic: Verify conditional rendering of badges and supply display across multiple components

Suggested reviewers

  • ananyayaya129
  • sosweetham

Poem

🐰 Hop hop, the supply's now clear,
Total counts ring loud and dear,
Badges bloom where balances show,
Context switches—watch us grow!
Ledgers dance, accounts align,
A feature complete, carrots divine! 🥕✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/e-currency-ui-ux-fixes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 849c36f and b372c5d.

📒 Files selected for processing (6)
  • platforms/eCurrency-api/src/controllers/LedgerController.ts (2 hunks)
  • platforms/eCurrency-api/src/index.ts (1 hunks)
  • platforms/eCurrency-api/src/services/LedgerService.ts (1 hunks)
  • platforms/eCurrency/client/src/components/user-menu-dropdown.tsx (2 hunks)
  • platforms/eCurrency/client/src/pages/currency-detail.tsx (2 hunks)
  • platforms/eCurrency/client/src/pages/dashboard.tsx (1 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coodos coodos marked this pull request as ready for review December 8, 2025 16:27
@coodos coodos merged commit 71d2336 into main Dec 8, 2025
3 of 4 checks passed
@coodos coodos deleted the fix/e-currency-ui-ux-fixes branch December 8, 2025 16:28
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.

[feature] eCurrency UI Improvements

2 participants