Commit 8940b13
authored
Add fairies feature flag, improve invites, update sales page. (tldraw#7234)
Add fairy feature flags and invite system:
- Feature flag system (fairies_enabled, fairies_purchase_enabled) with
admin UI
- Update pricing page with Paddle payment integration
- Fairy invite flow should work for signed out users, redirects them
after sign in
- Redirect to home when fairy flags disabled
- Admin page for toggling feature flags
- Extract payment logic from sidebar to reusable usePaddle hook
- Add descriptions and reddemedby to fairy invites.
### Change type
- [x] `other`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds KV-backed feature flags (fairies, fairies_purchase) with admin
controls, gates UI/DO/routes, enhances fairy invites
(description/redeemedBy, signed-out flow), and centralizes Paddle
checkout used on pricing and sidebar.
>
> - **Feature Flags (global)**:
> - Add KV-backed flags `fairies` and `fairies_purchase` with
`/app/feature-flags` API and polling `FeatureFlagsFetcher` +
`useFeatureFlags`.
> - Gate client hooks (`useFairyAccess`), UI (sidebar/purchase/pricing),
and DO `/fairy/has-access` + invite redemption by flags.
> - **Checkout / Pricing**:
> - Extract Paddle integration to `usePaddle` and use in pricing page
and sidebar link.
> - Pricing page: sign-in redirect (`redirect-to`), conditional button
labels, deep-link checkout via `?checkout=true`.
> - **Fairy Invites**:
> - Add `description` and `redeemedBy` tracking (DB migration) and show
in Admin table; include description on create.
> - Signed-out invite flow stores token and triggers sign-in, then
processes via root handler.
> - **Admin**:
> - New Feature Flags section (toggle flags) and updated Fairy Invites
management (grant/remove access unified, description input, copy link).
> - **Backend/Worker**:
> - New feature flag utils (get/set, defaults by env), admin routes for
flags, worker route exposure, KV bindings in wrangler.
> - **i18n/UI**:
> - Add strings for “Home”, “Start your fairy adventure”, “Your fairies
are waiting for you! →”.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bc78b6f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3c6e62d commit 8940b13
24 files changed
Lines changed: 840 additions & 249 deletions
File tree
- apps/dotcom
- client
- public/tla
- locales-compiled
- locales
- src
- pages
- tla
- components/TlaSidebar/components
- hooks
- pages
- providers
- utils
- sync-worker
- src
- routes/tla
- utils
- zero-cache/migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
945 | 951 | | |
946 | 952 | | |
947 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
948 | 960 | | |
949 | 961 | | |
950 | 962 | | |
| |||
1559 | 1571 | | |
1560 | 1572 | | |
1561 | 1573 | | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
1562 | 1580 | | |
1563 | 1581 | | |
1564 | 1582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
422 | 425 | | |
423 | 426 | | |
424 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
| |||
672 | 678 | | |
673 | 679 | | |
674 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
675 | 684 | | |
676 | 685 | | |
677 | 686 | | |
| |||
0 commit comments