feat(workspaces): sticky account rail with billing/redeem links - #930
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AccountRailinto 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./portal/billing(always) and/portal/redeem(gated behindisPlatformContext, since the portal's redeem route 404s on reseller/non-platform hosts).page.tsxviaresolveTenantByDomain(domain)compared againstROOT_TENANT_ID, since the session user never carriestenantId.Changes
apps/builder/src/app/page.tsx— resolveisPlatformContextfrom the request domain and pass it toAccountRail.apps/builder/src/features/workspaces/components/account-rail.tsx— sticky/scrollable layout rework; new billing/redeem menu links; sharedrailMenuItemClassName.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— addactions.billing/actions.redeemtranslation keys (en authored; other locales carry the same keys for follow-up translation).Test plan
/on a platform host (redeem link visible) vs a reseller host (redeem link hidden), confirm sticky rail scrolls independently and sign-out stays pinned