Repository navigation
Angular SDK: the subscription page redesign and app-style theming from Svelte (TBP-944), v0.9.0 - #43
Merged
Conversation
…d app-style theming, ported from bridge-svelte (TBP-944)
Ports bridge-svelte 0.9.2 (TBP-813) and 0.9.3 (TBP-814) to Angular.
A completed checkout, or a Free pick, used to stop on /subscription/success
("You're all set") and wait for "Continue". It now lands on
billing.successRoute, the subscription page by default, which shows
<bridge-checkout-notice>: a one-time, dismissible banner naming the plan.
The OAuth-callback page records the checkout after confirming it; the plan
picker records a Free pick before navigating (not when the page listens to
(select)). The signal (checkoutResult, takeCheckoutResult,
clearCheckoutResult) is in memory only, so a reload never shows it again.
/subscription/success is still served, and clears the signal.
bridgeBillingRoutes({ checkoutNotice: false }) hides the banner.
The subscription page: plan cards and the current-plan panel are surfaces
from the --bridge-* tokens (new --bridge-card-bg, --bridge-card-shadow), a
large formatted price, "Choose / Upgrade to / Switch to" buttons, the
current plan flagged in the primary colour, check marks on features, a
"Change plan" heading beside the interval switch (new heading input), and
the renewal date and card under the current plan.
Theming: every text size scales from --bridge-text-base (a registered
@Property from var(--bridge-font-size, 1em) on the body), weights come from
--bridge-font-weight-heading / -button / -label, buttons take
--bridge-button-shadow, and --bridge-card-shadow also covers the plan-change
dialog. The whole stylesheet, and <bridge-login>'s own styles, sit in
@layer bridge, ordered after Tailwind v4's layers, so any unlayered app CSS
wins without !important. Every default is the previous value.
Additive: new inputs, exports and config keys only. The plan button labels
change, as in svelte.
Refs: TBP-944
…ew plan card labels and the bridge cascade layer (TBP-944) Mirrors bridge-svelte's TBP-813 / TBP-814 tests. Unit (vitest): billing.successRoute defaults and overrides; the callback records a confirmed checkout after re-reading billing, and nothing on a failure, a cancel or a sign-in; the checkoutResult signal; the plan-format helpers; the default card's Choose / Upgrade to / Switch to labels, current flag, price block and heading; a Free pick recording the result and landing on successRedirect (not with (select)); <bridge-checkout-notice> shown once, dismissible, with a template; the subscription page from bridgeBillingRoutes() showing it once, after a Free pick, hidden with checkoutNotice: false, the old success page clearing it, the summary panel's meta line; the Stripe return on the callback page landing on /subscription with the banner. styles-layer.spec.ts pins the layer order, the @Property, one @layer bridge block, text-base sizes, weight and shadow tokens with the old values as fallbacks, and component styles in the layer (the dev badge excluded). Mutation-checked: removing the record in the picker, the callback or the callback page, the banner on the page, or the banner's clear fails the suite. Playwright: the Free-pick flow and the welcome paywall expect the landing on /subscription with the banner and the new labels; app-style-wins.spec.ts ports svelte's computed-style checks. Refs: TBP-944
…r; match the app's type and shadows; the app's CSS wins (TBP-944) The Angular equivalents of bridge-svelte's TBP-813 / TBP-814 doc changes: theming (matching your app's look, type and shadow tokens, the bridge layer, Tailwind), mechanisms, config, the billing setup and onboarding pages, and the billing, branding and sdk-auth agent guides. Also fixes the add-billing page's stale paymentErrorRoute default (/payment-error). Refs: TBP-944
…0.9.3: a checkout lands back in the app with a banner, and the app's CSS always wins (TBP-944) Refs: TBP-944
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.
Angular apps now get the same subscription page and the same theming as Svelte apps (bridge-svelte 0.9.2 and 0.9.3). Ticket: TBP-944. This PR also bumps the package to 0.9.0. It is not merged, published or tagged.
What an Angular app looks like now
The subscription page (
/subscription, frombridgeBillingRoutes()):After paying, or after picking a Free plan, the user comes straight back to the subscription page. A green banner there says "You're on Pro now". It shows once, can be closed, and is gone after a reload. The separate "You're all set" page is no longer part of the normal flow, but it still works for any app that links to it.
An app can send people somewhere else after checkout (for example its dashboard) with one setting, and show the same banner there.
Theming:
!importantneeded. Tailwind's reset can no longer strip Bridge's buttons.Checked
Screenshots
Side by side, same data:
/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/angular-subscription.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/svelte-subscription.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/angular-subscription-monthly.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/svelte-subscription-monthly.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/angular-plan-selector.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/svelte-plan-selector.png/private/tmp/claude-501/-Users-iman-code-thebridge-platform-bridge-server/a9d88945-4010-4780-a810-c20f75dcea1c/scratchpad/port-angular/angular-subscription-themed.png(These files are on the Air that made them. They are not attached to the PR.)
Worth knowing