Skip to content

feat(workspaces): sticky account rail with billing/redeem links - #930

Merged
realcodesiman merged 3 commits into
mainfrom
feat/account-rail-billing-redeem-links
Aug 10, 2026
Merged

feat(workspaces): sticky account rail with billing/redeem links#930
realcodesiman merged 3 commits into
mainfrom
feat/account-rail-billing-redeem-links

Conversation

@realcodesiman

Copy link
Copy Markdown
Contributor

Summary

  • Restructures AccountRail into a sticky panel with a fixed avatar/plan header, a scrollable menu body, and a pinned sign-out footer, fixing the dead-gap layout on self-hosted/community installs where the plan/usage block doesn't render.
  • Adds cross-zone links to /portal/billing (always) and /portal/redeem (gated behind isPlatformContext, since the portal's redeem route 404s on reseller/non-platform hosts).
  • Resolves platform-vs-reseller context in page.tsx via resolveTenantByDomain(domain) compared against ROOT_TENANT_ID, since the session user never carries tenantId.

Changes

  • apps/builder/src/app/page.tsx — resolve isPlatformContext from the request domain and pass it to AccountRail.
  • apps/builder/src/features/workspaces/components/account-rail.tsx — sticky/scrollable layout rework; new billing/redeem menu links; shared railMenuItemClassName.
  • apps/builder/src/features/workspaces/components/__tests__/account-rail.test.tsx — new coverage for the rail's conditional links and layout.
  • apps/builder/messages/*.json — add actions.billing / actions.redeem translation keys (en authored; other locales carry the same keys for follow-up translation).

Test plan

  • pnpm lint
  • pnpm --filter builder check-types
  • pnpm --filter builder test -- account-rail
  • manual verification: load / on a platform host (redeem link visible) vs a reseller host (redeem link hidden), confirm sticky rail scrolls independently and sign-out stays pinned

Restructures AccountRail into a sticky, scrollable panel (fixed header
+ scrollable menu body + pinned sign-out footer) and adds cross-zone
links to /portal/billing and /portal/redeem. The redeem link is gated
by isPlatformContext, resolved in page.tsx via resolveTenantByDomain,
since /portal/redeem 404s on reseller (non-platform) hosts.
Home page's outer chrome (min-h-dvh, py-12/py-16) had drifted from the
portal's (account) layout shell (AccountShell: max-w-6xl px-6, py-8
row), giving the two account rails mismatched sticky insets (top-16 /
calc(100vh-8rem) vs top-8 / calc(100vh-4rem)) despite both documenting
the same top-N/2N coupling rule.

Adopt the portal's py-8 chrome on the home page and update the
builder rail's sticky top/max-h to match. Keeps the builder rail's
md:max-h- (vs the portal's md:h-) since its plan/usage block is
cloud-gated and a fixed height would render an empty-looking card on
self-hosted/community editions.
- Give the account rail a fixed sticky height instead of max-h, and give
  the workspaces column its own independent max-h scrollport so the two
  panes scroll correctly relative to the shared page padding.
- Remove the unused workspacesLimit prop/usage badge from WorkspacesList
  and the page.tsx call site; only the used count is shown now.
- Register /portal/redeem as a public proxy route so the redeem link
  works unauthenticated.
- Split account-rail tests into one assertion per case instead of manual
  root remount/unmount between assertions.
@realcodesiman
realcodesiman merged commit a853dbb into main Aug 10, 2026
7 checks passed
@realcodesiman
realcodesiman deleted the feat/account-rail-billing-redeem-links branch August 10, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant