Skip to content

feat(dashboard): wallet layout split tabs#5025

Draft
rpavlini wants to merge 2 commits into
mainfrom
feat/wallet-layout-update
Draft

feat(dashboard): wallet layout split tabs#5025
rpavlini wants to merge 2 commits into
mainfrom
feat/wallet-layout-update

Conversation

@rpavlini

@rpavlini rpavlini commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Split the Wallet page into General and History tabs with URL-based navigation to improve clarity. Added overview, automatic top-up, and one-time top-up cards for faster billing actions.

  • New Features

    • General tab: Wallet overview with balances and coupon redemption; payment methods and billing info; automatic top-up (pre-paid only) with a $10 min gap and 0/0 to disable, requires a payment method; one-time top-up with presets and Stripe redirect.
    • History tab: Moved Invoices and Charges here for cleaner browsing.
    • Alerts: Email verification, credit card bonus, outstanding invoices, and auto top-up disabled states.
    • Tab-aware routing: Wallet route accepts a page param for deep links (general, history) with redirect to General when missing.
  • Refactors

    • Extracted wallet UI into WalletOverviewCard, AutomaticTopUpCard, and OneTimeTopUpCard.
    • Moved billing tables under components/billing/* and fixed relative imports.
    • Simplified Wallet.tsx with smaller components, improved loading skeletons, and a clearer error state.

Written for commit 269a18e. Summary will update on new commits.

Review in cubic

Signed-off-by: rpavlini <rpavlinic@daytona.io>
@nx-cloud

nx-cloud Bot commented Jun 11, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 269a18e

Command Status Duration Result
nx e2e:cleanup daytona-e2e ✅ Succeeded <1s View ↗
nx run-many --target=test:e2e --all --nxBail=true ✅ Succeeded 6m 26s View ↗
nx e2e daytona-e2e ✅ Succeeded 1m 22s View ↗
nx run-many --target=build --projects=api,runne... ✅ Succeeded 5s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-12 23:57:15 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found across 18 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/dashboard/src/components/billing/AutomaticTopUpCard.tsx Outdated
Comment thread apps/dashboard/src/components/billing/AutomaticTopUpCard.tsx
Comment thread apps/dashboard/src/components/billing/OneTimeTopUpCard.tsx Outdated
Comment thread apps/dashboard/src/components/billing/OneTimeTopUpCard.tsx Outdated
@rpavlini rpavlini marked this pull request as draft June 11, 2026 20:29
Signed-off-by: rpavlini <rpavlinic@daytona.io>
@rpavlini

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 12, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@rpavlini I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 18 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/dashboard/src/components/billing/AutomaticTopUpCard.tsx">

<violation number="1" location="apps/dashboard/src/components/billing/AutomaticTopUpCard.tsx:27">
P1: Automatic top-up state starts as `undefined`, causing a false dirty state on first render and allowing an unintended Save request before form state is synchronized from the wallet.</violation>
</file>

<file name="apps/dashboard/src/App.tsx">

<violation number="1" location="apps/dashboard/src/App.tsx:370">
P2: The wallet index route mounts `Wallet` and then redirects, causing avoidable billing query work before navigation to `/general`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

}

export function AutomaticTopUpCard({ organizationId, wallet }: AutomaticTopUpCardProps) {
const [automaticTopUp, setAutomaticTopUp] = useState<AutomaticTopUp | undefined>(undefined)

@cubic-dev-ai cubic-dev-ai Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Automatic top-up state starts as undefined, causing a false dirty state on first render and allowing an unintended Save request before form state is synchronized from the wallet.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/dashboard/src/components/billing/AutomaticTopUpCard.tsx, line 27:

<comment>Automatic top-up state starts as `undefined`, causing a false dirty state on first render and allowing an unintended Save request before form state is synchronized from the wallet.</comment>

<file context>
@@ -0,0 +1,195 @@
+}
+
+export function AutomaticTopUpCard({ organizationId, wallet }: AutomaticTopUpCardProps) {
+  const [automaticTopUp, setAutomaticTopUp] = useState<AutomaticTopUp | undefined>(undefined)
+  const paymentMethodsQuery = usePaymentMethodsQuery({ organizationId })
+  const setAutomaticTopUpMutation = useSetAutomaticTopUpMutation()
</file context>
Fix with cubic

element: <BillingOwnerAccessOutlet pageTitle="Wallet" />,
children: [{ index: true, lazy: lazyRoutes.Wallet }],
children: [
{ index: true, lazy: lazyRoutes.Wallet },

@cubic-dev-ai cubic-dev-ai Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The wallet index route mounts Wallet and then redirects, causing avoidable billing query work before navigation to /general.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/dashboard/src/App.tsx, line 370:

<comment>The wallet index route mounts `Wallet` and then redirects, causing avoidable billing query work before navigation to `/general`.</comment>

<file context>
@@ -366,7 +366,10 @@ const router = createBrowserRouter([
             element: <BillingOwnerAccessOutlet pageTitle="Wallet" />,
-            children: [{ index: true, lazy: lazyRoutes.Wallet }],
+            children: [
+              { index: true, lazy: lazyRoutes.Wallet },
+              { path: ':page', lazy: lazyRoutes.Wallet },
+            ],
</file context>
Suggested change
{ index: true, lazy: lazyRoutes.Wallet },
{ index: true, loader: () => redirect(`${RoutePath.BILLING_WALLET}/general`) },
Fix with cubic

@vedranjukic vedranjukic force-pushed the main branch 2 times, most recently from 2c15a7f to b40f732 Compare June 23, 2026 14:12
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.

1 participant