From aebb1b4f017b784054fac658b28d113ce5e201a1 Mon Sep 17 00:00:00 2001
From: C Deutsch
Date: Sat, 14 Nov 2026 10:51:12 -0600
Subject: [PATCH 01/12] Replace the Plan nav item and the menu's Delete account
with an Account page
The main nav had a Plan item that sat oddly beside Push and Links, and the menu had a bare "Delete account" item. Both now live on one `Account` page, which the menu opens: the signed-in email, the plan in a line with a link to its page, the "Encrypted" line with this device's id (moved from Plan), and a link to delete the account.
It is one page with links out, not a settings layout with tabs, because neither destination can move. `/delete-account` is public, as the deletion page Google Play was given, and `/plan` is where Stripe's checkout and portal send people back to.
The nav's slider now shrinks away on a page with no nav item, rather than staying lit on the page left behind. The Support, Security and Delete account pages, and the docs, say where things are now.
Co-Authored-By: Claude Opus 5.5
---
apps/web/src/App.tsx | 2 +
apps/web/src/Layout.tsx | 7 +-
apps/web/src/components/Nav.tsx | 11 +--
apps/web/src/config/plan.ts | 2 +-
apps/web/src/pages/Account.module.css | 38 ++++++++
apps/web/src/pages/Account.tsx | 119 ++++++++++++++++++++++++++
apps/web/src/pages/DeleteAccount.tsx | 4 +-
apps/web/src/pages/Plan.module.css | 11 +--
apps/web/src/pages/Plan.tsx | 51 +++--------
apps/web/src/pages/Security.tsx | 10 +--
apps/web/src/pages/Support.tsx | 4 +-
docs/account-deletion.md | 2 +-
docs/e2ee.md | 2 +-
13 files changed, 195 insertions(+), 68 deletions(-)
create mode 100644 apps/web/src/pages/Account.module.css
create mode 100644 apps/web/src/pages/Account.tsx
diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx
index 2738dd9..a6d401e 100644
--- a/apps/web/src/App.tsx
+++ b/apps/web/src/App.tsx
@@ -7,6 +7,7 @@ import { useAuth } from './contexts/AuthContext';
import { AuthProvider } from './contexts/AuthProvider';
import { KeysProvider } from './contexts/KeysContext';
import { ThemeProvider } from './contexts/ThemeContext';
+import { Account } from './pages/Account';
import { IndexPage } from './pages/Index';
import Links from './pages/Links';
import Login from './pages/Login';
@@ -75,6 +76,7 @@ function App() {
}>
} />
} />
+ } />
} />
} />
diff --git a/apps/web/src/Layout.tsx b/apps/web/src/Layout.tsx
index 2e88360..bf5efe9 100644
--- a/apps/web/src/Layout.tsx
+++ b/apps/web/src/Layout.tsx
@@ -56,9 +56,10 @@ export default function Layout({ children }: LayoutProps) {
{isMenuOpen && (
- {/* Above Logout, where the Android, iOS and macOS menus have it. It leads to the
- public page, which asks for the password before anything goes. */}
-
+ {/* The plan, the device id and deleting the account are all on the Account page,
+ so the menu has one way in rather than an item for each. Deleting is a link
+ from there to the public page, which asks for the password before anything goes. */}
+
)}
diff --git a/apps/web/src/components/Nav.tsx b/apps/web/src/components/Nav.tsx
index c14e0e9..cb4a494 100644
--- a/apps/web/src/components/Nav.tsx
+++ b/apps/web/src/components/Nav.tsx
@@ -1,8 +1,6 @@
import { useEffect, useRef, useState } from 'react';
import { Link, useLocation } from 'react-router';
-import { PLAN_PAGE_LINKED } from '@/config/plan';
-
import styles from './Nav.module.css';
export default function Nav() {
@@ -19,6 +17,10 @@ export default function Nav() {
width: offsetWidth,
left: offsetLeft,
});
+ } else {
+ // A page with no item here (Account, Plan, the static pages while signed in): the
+ // slider shrinks away where it stood, rather than staying lit on the page left behind.
+ setSliderStyle((was) => ({ width: 0, left: was.left + was.width / 2 }));
}
}, [currentPath]);
@@ -37,11 +39,6 @@ export default function Nav() {
Links
- {PLAN_PAGE_LINKED && (
-
- Plan
-
- )}
);
}
diff --git a/apps/web/src/config/plan.ts b/apps/web/src/config/plan.ts
index bac856a..a1244d8 100644
--- a/apps/web/src/config/plan.ts
+++ b/apps/web/src/config/plan.ts
@@ -24,7 +24,7 @@ export const LIMITS: Record<'free' | 'pro', TierLimits> = {
};
/**
- * Whether the Plan page is reachable from the navigation. On since launch (2026-10-25),
+ * Whether the Account page shows the plan and links to the Plan page. On since launch (2026-10-25),
* when production moved to the live Stripe account. Turn it off only together with a
* move back to sandbox keys: on sandbox keys, anyone who reached the page could
* subscribe with a test card and get Pro. The route exists either way.
diff --git a/apps/web/src/pages/Account.module.css b/apps/web/src/pages/Account.module.css
new file mode 100644
index 0000000..4d75fa4
--- /dev/null
+++ b/apps/web/src/pages/Account.module.css
@@ -0,0 +1,38 @@
+.page {
+ max-width: 560px;
+}
+
+.section {
+ margin: 2rem 0;
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+}
+
+/* The gap spaces a section's contents; the global margins on p and h2 would add to it */
+.section > * {
+ margin: 0;
+}
+
+.section h2 {
+ font-size: 1.25rem;
+}
+
+.muted {
+ opacity: 0.7;
+ font-size: 0.9rem;
+}
+
+.error {
+ color: var(--color-error);
+}
+
+.danger {
+ color: var(--color-error);
+}
+
+/* An email address has no spaces to break at, and a long one would push a narrow screen sideways */
+.email,
+.deviceId {
+ overflow-wrap: anywhere;
+}
diff --git a/apps/web/src/pages/Account.tsx b/apps/web/src/pages/Account.tsx
new file mode 100644
index 0000000..120d532
--- /dev/null
+++ b/apps/web/src/pages/Account.tsx
@@ -0,0 +1,119 @@
+import { useEffect, useState } from 'react';
+import { Helmet } from 'react-helmet';
+import { Link } from 'react-router';
+
+import { PLAN_PAGE_LINKED } from '@/config/plan';
+import { useAuth } from '@/contexts/AuthContext';
+import { usePlan } from '@/hooks/usePlan';
+import { deviceId } from '@/services/keyStore';
+
+import { describePlan } from './Plan';
+
+import styles from './Account.module.css';
+
+/**
+ * Account, `/account`: the menu's way into everything about the account. Who is signed
+ * in, the plan in a line with the way to its own page, the "Encrypted" line, and the way
+ * to delete the account.
+ *
+ * One page with links out, rather than a settings layout with the plan and deletion as
+ * tabs inside it, because neither of those can move: `/delete-account` is public (it is the
+ * address given to Google Play, read by people with no account) and `/plan` is where
+ * Stripe's checkout and portal send people back to. A settings layout would have had to
+ * leave itself for both.
+ */
+export function Account() {
+ const { user } = useAuth();
+
+ return (
+
+
+ Account
+
+
Account
+
+
+
Email
+
{user?.email}
+
+
+ {PLAN_PAGE_LINKED && }
+
+
+
+
+
Delete account
+
+ Deletes the account and everything pushed from it, at once and for good. The next page says exactly what goes
+ and asks for your password first.
+
+
+
+ Delete account
+
+
+
+
+ );
+}
+
+/** The plan as the Plan page heads it, in one line. The usage and the billing stay on that page. */
+function PlanSummary() {
+ const { plan, error } = usePlan();
+ const summary = plan && describePlan(plan);
+
+ return (
+
+
Plan
+ {summary ? (
+
+ {summary.title}. {summary.sentence}
+
+ ) : error ? (
+
+ {error}
+
+ ) : (
+
Reading your plan…
+ )}
+
+ Usage and billing
+
+
+ );
+}
+
+/**
+ * The "Encrypted" line (docs/e2ee.md, Saying so): that the pushes are encrypted, this
+ * device's id, and where to read what that means. The id is what this install puts on its
+ * pushes in place of the device's model name, so showing it lets someone see all the
+ * server is told about the device. IndexedDB can refuse (a private window in some
+ * browsers), and the line then goes without the id rather than not at all.
+ */
+function Encrypted() {
+ const [id, setId] = useState(null);
+ useEffect(() => {
+ let current = true;
+ deviceId()
+ .then((made) => current && setId(made))
+ .catch((error) => console.error('Could not read the device id:', error));
+ return () => {
+ current = false;
+ };
+ }, []);
+
+ return (
+
+
Encrypted
+
+ Your pushes are encrypted on your devices with a key made from your password, and only they can read them.{' '}
+ How it works.
+
- Choose Delete account. On the website and in the extension this opens this page: use the{' '}
- form below.
+ Choose Delete account. On the website and in the extension it is on the{' '}
+ Account page, and it opens this page: use the form below.
In the Android, iPhone and Mac apps, enter your password to confirm, and press Delete account
diff --git a/apps/web/src/pages/Plan.module.css b/apps/web/src/pages/Plan.module.css
index ecbd029..e27367b 100644
--- a/apps/web/src/pages/Plan.module.css
+++ b/apps/web/src/pages/Plan.module.css
@@ -2,6 +2,12 @@
max-width: 560px;
}
+.back {
+ display: inline-block;
+ margin-top: 1rem;
+ font-size: 0.9rem;
+}
+
.section {
margin: 2rem 0;
display: flex;
@@ -75,8 +81,3 @@
.meterFillFull {
background: var(--color-error);
}
-
-/* A device id is 22 characters with no spaces, which would otherwise push a narrow screen sideways */
-.deviceId {
- overflow-wrap: anywhere;
-}
diff --git a/apps/web/src/pages/Plan.tsx b/apps/web/src/pages/Plan.tsx
index 4a818d4..4b9b8eb 100644
--- a/apps/web/src/pages/Plan.tsx
+++ b/apps/web/src/pages/Plan.tsx
@@ -6,7 +6,6 @@ import Button from '@/components/Button';
import { LIMITS, formatMb } from '@/config/plan';
import { usePlan } from '@/hooks/usePlan';
import { errorText } from '@/services/callable';
-import { deviceId } from '@/services/keyStore';
import { PlanReport, planApi } from '@/services/plan';
import styles from './Plan.module.css';
@@ -69,8 +68,10 @@ export function describePlan(plan: PlanReport): { title: string; sentence: strin
* and the plan is then read back from Stripe at once rather than waiting on the
* webhook, so the page says "Pro" on arrival.
*
- * Not linked from the navigation until launch (`PLAN_PAGE_LINKED`): production runs on
- * the Stripe sandbox's keys until then, and a test card here would give anyone Pro.
+ * Reached from the Account page, and only while `PLAN_PAGE_LINKED` is on: production ran
+ * on the Stripe sandbox's keys until launch, and a test card here would give anyone Pro.
+ * It keeps its own address, rather than becoming a section of Account, because Stripe's
+ * checkout and portal send people back to `/plan` (docs/billing.md).
*/
export default function Plan() {
const { plan, error: readError, refresh, setPlan } = usePlan();
@@ -183,6 +184,7 @@ export default function Plan() {
Plan
+
)}
- {/* Nothing in it depends on the plan, so it shows while the plan is read or cannot be.
- Keyed, so that React keeps the one section when the plan arrives rather than
- mounting another, which would read the device id again and blink its line. */}
-
);
}
@@ -218,6 +216,7 @@ export default function Plan() {
Plan
+
Plan
@@ -298,45 +297,15 @@ export default function Plan() {
)}
-
-
);
}
-/**
- * The "Encrypted" line (docs/e2ee.md, Saying so): that the pushes are encrypted, this
- * device's id, and where to read what that means. On the Plan page because the web app has
- * no settings page and this is the page about the account. The id is what this install
- * puts on its pushes in place of the device's model name, so showing it lets someone see
- * all the server is told about the device. IndexedDB can refuse (a private window in
- * some browsers), and the line then goes without the id rather than not at all.
- */
-function Encrypted() {
- const [id, setId] = useState(null);
- useEffect(() => {
- let current = true;
- deviceId()
- .then((made) => current && setId(made))
- .catch((error) => console.error('Could not read the device id:', error));
- return () => {
- current = false;
- };
- }, []);
-
+function BackToAccount() {
return (
-
-
Encrypted
-
- Your pushes are encrypted on your devices with a key made from your password, and only they can read them.{' '}
- How it works.
-
- {id && (
-
- This device: {id}
-
- )}
-
+
+ ← Account
+
);
}
diff --git a/apps/web/src/pages/Security.tsx b/apps/web/src/pages/Security.tsx
index 96e55a6..5a81a69 100644
--- a/apps/web/src/pages/Security.tsx
+++ b/apps/web/src/pages/Security.tsx
@@ -9,7 +9,7 @@ import { LIMITS, SUPPORT_EMAIL } from '@/config/plan';
* Security, `/security`: the gist of docs/e2ee.md for the people it protects. What is
* encrypted, what is not, what a lost password costs, and the recovery key. Public, like
* Support, since the front page and Support link here and the reader may not have an
- * account yet; the Plan page links here too.
+ * account yet; the Account page links here too.
*
* It says what is not protected as plainly as what is: the reason for a key made from the
* password is that the user can see what it does, and a page that only listed the
@@ -134,10 +134,10 @@ export function Security() {
YOUR DEVICE ID
- Each install of PushThat makes a random device ID, which the web app shows on the Plan{' '}
- page. It goes with every push so that the device that sent one does not notify itself, and it says nothing about
- the device: it replaced the device’s name (the one you gave it, its model name, or the browser’s
- user agent), which pushes used to carry.
+ Each install of PushThat makes a random device ID, which the web app shows on the{' '}
+ Account page. It goes with every push so that the device that sent one does not
+ notify itself, and it says nothing about the device: it replaced the device’s name (the one you gave it,
+ its model name, or the browser’s user agent), which pushes used to carry.
QUESTIONS
diff --git a/apps/web/src/pages/Support.tsx b/apps/web/src/pages/Support.tsx
index 42d291e..a1d8a04 100644
--- a/apps/web/src/pages/Support.tsx
+++ b/apps/web/src/pages/Support.tsx
@@ -34,8 +34,8 @@ export default function Support() {
To change your card, download an invoice or cancel, open{' '}
- {PLAN_PAGE_LINKED ? Plan : 'Plan'} in the web app and choose Manage billing. Cancelling
- stops the next renewal and keeps Pro until the year already paid for ends.
+ {PLAN_PAGE_LINKED ? Plan : 'Plan'} in the web app (under Account in its menu) and choose
+ Manage billing. Cancelling stops the next renewal and keeps Pro until the year already paid for ends.
diff --git a/docs/account-deletion.md b/docs/account-deletion.md
index a0f7f4c..d11d0e6 100644
--- a/docs/account-deletion.md
+++ b/docs/account-deletion.md
@@ -173,5 +173,5 @@ the call (`services/account.ts` says why), so it works the same signed in or out
who has forgotten their password resets it first; someone who cannot sign in at all writes
to support.
-The website's and the extension's menu item leads to this page. The Android, iOS and macOS
+The website's and the extension's Account page (from the menu) links to this page. The Android, iOS and macOS
apps ask for the password in a dialog of their own and call the function directly.
diff --git a/docs/e2ee.md b/docs/e2ee.md
index 7a8583b..a30de6a 100644
--- a/docs/e2ee.md
+++ b/docs/e2ee.md
@@ -249,7 +249,7 @@ Existing accounts have the raw password as their Firebase password and plaintext
The reason for a password-derived key is that the user can see it. The surfaces:
- **Sign-up:** "Your password is the key to your pushes, and we cannot reset it for you. Save your recovery key." The recovery key is shown there and then.
-- **Settings and the Plan page:** an "Encrypted" line with the device's `deviceId` and a link to the security page.
+- **Settings, and the web app's Account page:** an "Encrypted" line with the device's `deviceId` and a link to the security page.
- **Password reset:** the recovery key prompt and, without it, the sentence that the old pushes are gone, before anything is deleted.
- **The site:** a `/security` page with the gist of this document: what is encrypted, what is not, what a lost password costs.
From d3d0f88979cae41f89bcac699446302c72930523 Mon Sep 17 00:00:00 2001
From: C Deutsch
Date: Sat, 14 Nov 2026 11:04:23 -0600
Subject: [PATCH 02/12] Move the plan onto the Account page and redirect /plan
there
The Account page was four short sections, one of them a line linking to the Plan page where the substance was: a click that bought nothing. The plan is now the first section of Account, since it is what most people open that page for, with its status, billing buttons, this month's usage and, on Free, what Pro adds.
Stripe's checkout and portal still return to `/plan`, so that address redirects to `/account` with its query, and `?checkout=complete` is still read to confirm a subscription on arrival. The return URLs can move to `/account` later without anything breaking in between.
Co-Authored-By: Claude Opus 5.5
---
apps/web/src/App.tsx | 17 +-
.../PlanSection.module.css} | 17 +-
.../Plan.tsx => components/PlanSection.tsx} | 165 ++++++++----------
apps/web/src/config/plan.ts | 8 +-
apps/web/src/pages/Account.tsx | 51 ++----
apps/web/src/pages/Support.tsx | 4 +-
docs/billing.md | 6 +-
7 files changed, 115 insertions(+), 153 deletions(-)
rename apps/web/src/{pages/Plan.module.css => components/PlanSection.module.css} (81%)
rename apps/web/src/{pages/Plan.tsx => components/PlanSection.tsx} (71%)
diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx
index a6d401e..94432a8 100644
--- a/apps/web/src/App.tsx
+++ b/apps/web/src/App.tsx
@@ -1,4 +1,4 @@
-import { Navigate, Outlet, Route, Routes, useSearchParams } from 'react-router';
+import { Navigate, Outlet, Route, Routes, useLocation, useSearchParams } from 'react-router';
import Layout from './Layout';
import ProtectedRoute from './components/ProtectedRoute';
@@ -12,7 +12,6 @@ import { IndexPage } from './pages/Index';
import Links from './pages/Links';
import Login from './pages/Login';
import NotFound from './pages/NotFound';
-import Plan from './pages/Plan';
import Push from './pages/Push';
import { ResetPassword } from './pages/ResetPassword';
import { ViewPush } from './pages/ViewPush';
@@ -51,6 +50,18 @@ function ImagePageOrHome() {
);
}
+/**
+ * `/plan`, the Plan page's address before it became the first section of Account. Stripe's
+ * checkout returns here with `?checkout=complete` and its portal returns here
+ * (functions/src/stripe-functions.ts, `planPageUrl`, and the portal's configuration), so the
+ * query goes along: the plan section reads it to confirm a subscription on arrival. Kept
+ * for old bookmarks once those point at `/account` too.
+ */
+function PlanRedirect() {
+ const { search } = useLocation();
+ return ;
+}
+
function App() {
return (
@@ -77,7 +88,7 @@ function App() {
} />
} />
} />
- } />
+ } />
} />
diff --git a/apps/web/src/pages/Plan.module.css b/apps/web/src/components/PlanSection.module.css
similarity index 81%
rename from apps/web/src/pages/Plan.module.css
rename to apps/web/src/components/PlanSection.module.css
index e27367b..9c9a2d3 100644
--- a/apps/web/src/pages/Plan.module.css
+++ b/apps/web/src/components/PlanSection.module.css
@@ -1,13 +1,3 @@
-.page {
- max-width: 560px;
-}
-
-.back {
- display: inline-block;
- margin-top: 1rem;
- font-size: 0.9rem;
-}
-
.section {
margin: 2rem 0;
display: flex;
@@ -24,6 +14,13 @@
font-size: 1.25rem;
}
+/* This month and Pro are parts of the plan, under its heading, so they sit a step down and
+ a little apart from what comes before them rather than starting sections of their own. */
+.section h3 {
+ font-size: 1rem;
+ margin-top: 0.75rem;
+}
+
.row {
display: flex;
flex-wrap: wrap;
diff --git a/apps/web/src/pages/Plan.tsx b/apps/web/src/components/PlanSection.tsx
similarity index 71%
rename from apps/web/src/pages/Plan.tsx
rename to apps/web/src/components/PlanSection.tsx
index 4b9b8eb..c82b73d 100644
--- a/apps/web/src/pages/Plan.tsx
+++ b/apps/web/src/components/PlanSection.tsx
@@ -1,5 +1,4 @@
import { useEffect, useRef, useState } from 'react';
-import { Helmet } from 'react-helmet';
import { Link, useNavigate, useSearchParams } from 'react-router';
import Button from '@/components/Button';
@@ -8,7 +7,7 @@ import { usePlan } from '@/hooks/usePlan';
import { errorText } from '@/services/callable';
import { PlanReport, planApi } from '@/services/plan';
-import styles from './Plan.module.css';
+import styles from './PlanSection.module.css';
/** How often, and how many times, the plan is read back from Stripe after a checkout; see `settleCheckout`. */
const CHECKOUT_SETTLE_WAIT_MS = 1500;
@@ -61,19 +60,21 @@ export function describePlan(plan: PlanReport): { title: string; sentence: strin
}
/**
- * The account's plan: where it stands, this month's usage against its limits, and the
- * two things that change it: subscribing, and managing the subscription in Stripe's
- * portal. The checkout is Stripe's own page, reached by redirect from a session the
- * server made; Stripe sends the person back here with `?checkout=complete` once paid,
- * and the plan is then read back from Stripe at once rather than waiting on the
- * webhook, so the page says "Pro" on arrival.
+ * The account's plan, as the first section of the Account page: where it stands, this
+ * month's usage against its limits, and the two things that change it: subscribing, and
+ * managing the subscription in Stripe's portal. The checkout is Stripe's own page, reached
+ * by redirect from a session the server made; Stripe sends the person back with
+ * `?checkout=complete` once paid, and the plan is then read back from Stripe at once
+ * rather than waiting on the webhook, so the page says "Pro" on arrival.
*
- * Reached from the Account page, and only while `PLAN_PAGE_LINKED` is on: production ran
- * on the Stripe sandbox's keys until launch, and a test card here would give anyone Pro.
- * It keeps its own address, rather than becoming a section of Account, because Stripe's
- * checkout and portal send people back to `/plan` (docs/billing.md).
+ * Stripe still sends people back to `/plan`, which was this section's own page before it
+ * moved here; that address now redirects to `/account` with its query (App.tsx), so the
+ * checkout's return lands here either way.
+ *
+ * Shown only while `PLAN_PAGE_LINKED` is on: production ran on the Stripe sandbox's keys
+ * until launch, and a test card here would give anyone Pro.
*/
-export default function Plan() {
+export function PlanSection() {
const { plan, error: readError, refresh, setPlan } = usePlan();
const [busy, setBusy] = useState<'checkout' | 'settling' | 'portal' | 'payment' | null>(null);
const [error, setError] = useState(null);
@@ -96,7 +97,7 @@ export default function Plan() {
useEffect(() => {
if (settled.current || params.get('checkout') !== 'complete') return;
settled.current = true;
- void navigate('/plan', { replace: true });
+ void navigate('/account', { replace: true });
setBusy('settling');
void settleCheckout()
.then((found) =>
@@ -180,12 +181,8 @@ export default function Plan() {
if (!plan) {
return (
-
-
- Before tax, charged by Stripe. Cancel any time.
-
- )}
- {hasCustomer && (
-
-
+ )}
+ {error && (
+
+ {error}
-
+ )}
+ {notice && (
+
+ {notice}
+
+ )}
+
+
This month
+
+
+
+ Files up to {formatMb(limits.fileBytes)}, kept for {limits.keepDays} days from the moment they are pushed; a
+ file already pushed keeps the retention it was pushed with. The month starts on the day you{' '}
+ {plan.tier === 'pro' ? 'subscribed' : 'signed up'}.
+
{plan.tier === 'free' && (
-
-
Pro
+ <>
+
Pro
{LIMITS.pro.url.toLocaleString()} URL pushes a month, up from {LIMITS.free.url}
@@ -295,17 +284,9 @@ export default function Plan() {
${plan.priceUsd} a year. Refunds, cancelling and receipts are explained on the{' '}
support page.
-
+ >
)}
-
- );
-}
-
-function BackToAccount() {
- return (
-
- ← Account
-
+
);
}
diff --git a/apps/web/src/config/plan.ts b/apps/web/src/config/plan.ts
index a1244d8..132c389 100644
--- a/apps/web/src/config/plan.ts
+++ b/apps/web/src/config/plan.ts
@@ -2,7 +2,7 @@
* The plan, as the pages describe it (docs/billing.md at the repository root). The
* numbers the functions enforce and report are in `functions/src/plan.ts` and
* the rules carry them too; these are what the front page quotes before anyone has
- * signed in, and the Plan page reads its own from `getPlan`. The copies are changed
+ * signed in, and the Account page's plan reads its own from `getPlan`. The copies are changed
* together.
*/
@@ -24,10 +24,10 @@ export const LIMITS: Record<'free' | 'pro', TierLimits> = {
};
/**
- * Whether the Account page shows the plan and links to the Plan page. On since launch (2026-10-25),
+ * Whether the Account page shows the plan. On since launch (2026-10-25),
* when production moved to the live Stripe account. Turn it off only together with a
- * move back to sandbox keys: on sandbox keys, anyone who reached the page could
- * subscribe with a test card and get Pro. The route exists either way.
+ * move back to sandbox keys: on sandbox keys, anyone who saw the plan there could
+ * subscribe with a test card and get Pro. The rest of the Account page shows either way.
*/
export const PLAN_PAGE_LINKED = true;
diff --git a/apps/web/src/pages/Account.tsx b/apps/web/src/pages/Account.tsx
index 120d532..57b67ec 100644
--- a/apps/web/src/pages/Account.tsx
+++ b/apps/web/src/pages/Account.tsx
@@ -2,25 +2,24 @@ import { useEffect, useState } from 'react';
import { Helmet } from 'react-helmet';
import { Link } from 'react-router';
+import { PlanSection } from '@/components/PlanSection';
import { PLAN_PAGE_LINKED } from '@/config/plan';
import { useAuth } from '@/contexts/AuthContext';
-import { usePlan } from '@/hooks/usePlan';
import { deviceId } from '@/services/keyStore';
-import { describePlan } from './Plan';
-
import styles from './Account.module.css';
/**
- * Account, `/account`: the menu's way into everything about the account. Who is signed
- * in, the plan in a line with the way to its own page, the "Encrypted" line, and the way
- * to delete the account.
+ * Account, `/account`: the menu's way into everything about the account. The plan, who is
+ * signed in, the "Encrypted" line, and the way to delete the account.
+ *
+ * The plan comes first because it is what most people open this page for, and it is all
+ * here rather than a line linking to a page of its own: Account was four short sections, one
+ * of them a link to the page with the substance, which was a click that bought nothing.
*
- * One page with links out, rather than a settings layout with the plan and deletion as
- * tabs inside it, because neither of those can move: `/delete-account` is public (it is the
- * address given to Google Play, read by people with no account) and `/plan` is where
- * Stripe's checkout and portal send people back to. A settings layout would have had to
- * leave itself for both.
+ * One page, rather than a settings layout with the plan and deletion as tabs, because
+ * deletion cannot move into one: `/delete-account` is public (it is the address given to
+ * Google Play, read by people with no account), so this page links out to it.
*/
export function Account() {
const { user } = useAuth();
@@ -32,13 +31,13 @@ export function Account() {
Account
+ {PLAN_PAGE_LINKED && }
+
Email
{user?.email}
- {PLAN_PAGE_LINKED && }
-
@@ -57,32 +56,6 @@ export function Account() {
);
}
-/** The plan as the Plan page heads it, in one line. The usage and the billing stay on that page. */
-function PlanSummary() {
- const { plan, error } = usePlan();
- const summary = plan && describePlan(plan);
-
- return (
-
-
Plan
- {summary ? (
-
- {summary.title}. {summary.sentence}
-
- ) : error ? (
-
- {error}
-
- ) : (
-
Reading your plan…
- )}
-
- Usage and billing
-
-
- );
-}
-
/**
* The "Encrypted" line (docs/e2ee.md, Saying so): that the pushes are encrypted, this
* device's id, and where to read what that means. The id is what this install puts on its
diff --git a/apps/web/src/pages/Support.tsx b/apps/web/src/pages/Support.tsx
index a1d8a04..d4de96d 100644
--- a/apps/web/src/pages/Support.tsx
+++ b/apps/web/src/pages/Support.tsx
@@ -34,8 +34,8 @@ export default function Support() {
To change your card, download an invoice or cancel, open{' '}
- {PLAN_PAGE_LINKED ? Plan : 'Plan'} in the web app (under Account in its menu) and choose
- Manage billing. Cancelling stops the next renewal and keeps Pro until the year already paid for ends.
+ {PLAN_PAGE_LINKED ? Account : 'Account'} from the web app’s menu and choose Manage
+ billing. Cancelling stops the next renewal and keeps Pro until the year already paid for ends.
diff --git a/docs/billing.md b/docs/billing.md
index b8ad453..2ad8537 100644
--- a/docs/billing.md
+++ b/docs/billing.md
@@ -13,7 +13,7 @@ Checkout happens on the web app only. The Android, iOS and macOS apps show the p
| File size | 25 MB | 100 MB |
| Files kept | 7 days | 30 days |
-A file's retention is decided when it is pushed, from the tier at that moment, and nothing moves it afterwards: subscribing does not extend files already pushed, and a lapse does not shorten them. The Plan page says so. Re-stamping on a tier change would need a composite index on `userId` and `expiresAt`, and was not worth it for a push that is a hand-off, not storage.
+A file's retention is decided when it is pushed, from the tier at that moment, and nothing moves it afterwards: subscribing does not extend files already pushed, and a lapse does not shorten them. The plan section of the Account page says so. Re-stamping on a tier change would need a composite index on `userId` and `expiresAt`, and was not worth it for a push that is a hand-off, not storage.
Decided 2026-10-25. A URL push costs about $0.00002 to serve, so the URL limits are abuse caps. Files cost through download egress ($0.12 per GB past the project's free 100 GB a month) and storage; a Pro account at every limit at once is 10 GB a month, $1.50 to $2.70, against $22.16 kept after Stripe's fees (about 6.4% + 30 cents). That worst case was accepted knowingly; real use is far below it. Billing is yearly only because the fixed 30 cents takes a fifth of a $2 monthly charge.
@@ -30,12 +30,12 @@ Set up on 2026-10-25.
- **Product:** PushThat Pro, `prod_VVWkWeG0cIT51z`, tax code `txcd_10103000` (software as a service for personal use)
- **Price:** $24 a year, `tax_behavior: exclusive`, `price_1UUVggEJNixT7uDaaVEcm1i6`
-- **Customer portal:** `bpc_1UUVh2EJNixT7uDa2ChCsS3U`, the default configuration. Invoice history, the card, name, email and address editable, cancelling at the period's end with a reason asked for. Plan changes are off. Returns to `https://pushthat.link/plan`; terms and privacy links are `/terms` and `/privacy`.
+- **Customer portal:** `bpc_1UUVh2EJNixT7uDa2ChCsS3U`, the default configuration. Invoice history, the card, name, email and address editable, cancelling at the period's end with a reason asked for. Plan changes are off. Returns to `https://pushthat.link/plan`, which the web app redirects to `/account`, where the plan now is; terms and privacy links are `/terms` and `/privacy`.
- **Webhook:** `we_1UUVhAEJNixT7uDa9cl3QtUg` at `https://us-central1-push-that.cloudfunctions.net/stripeWebhook`, API version `2025-03-31.basil`, for `customer.subscription.created`, `updated`, `deleted`, `paused` and `resumed`, `invoice.paid`, `charge.refunded` and `charge.dispute.created`. Its signing secret is shown in the endpoint's page in Workbench.
There is one Firebase project, `push-that`, so the sandbox's webhook points at production's function. That is deliberate until launch (decided 2026-10-25): production runs on the sandbox's three settings while billing is tested end to end against the deployed functions, then all three are replaced with the live account's at once. The three always come from the same environment, since the key picks the account checkouts are made in, the webhook secret verifies only that account's endpoint, and the price id must be a price in it.
-While production is on the sandbox, anyone who reaches the Plan page can subscribe with a test card and get Pro, so the web app does not link to it or show it until launch.
+While production is on the sandbox, anyone who sees the plan on the Account page can subscribe with a test card and get Pro, so the web app does not show it until launch.
| Secret | Before launch | At launch |
| ----------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------- |
From 34fcf330c542eeca0928a8be04310876f72023bd Mon Sep 17 00:00:00 2001
From: C Deutsch
Date: Sat, 14 Nov 2026 11:05:17 -0600
Subject: [PATCH 03/12] Link to the plan when a push is refused for the month's
limit
The limit's message named what Pro allows but gave no way to it, and the plan is otherwise only reachable from the menu. Hitting the limit is when someone on Free is most ready to upgrade, so the Push page now follows that message, and only that one, with "Upgrade to Pro" (or "See your plan" on Pro), linking to the Account page.
`refusalReason` says whether a refusal was the limit alongside the sentence. `refusalMessage` stays as its sentence alone for the extension's notice, which cannot hold a link.
Co-Authored-By: Claude Opus 5.5
---
apps/web/src/pages/Push.module.css | 7 ++++
apps/web/src/pages/Push.tsx | 53 +++++++++++++++++++++-------
apps/web/src/services/pushRefusal.ts | 24 ++++++++-----
apps/web/tests/pushRefusal.mjs | 11 ++++++
4 files changed, 74 insertions(+), 21 deletions(-)
diff --git a/apps/web/src/pages/Push.module.css b/apps/web/src/pages/Push.module.css
index cf170f1..2398c5b 100644
--- a/apps/web/src/pages/Push.module.css
+++ b/apps/web/src/pages/Push.module.css
@@ -32,6 +32,13 @@
border: 1px solid #fecaca;
}
+/* The site's link color is its pink, which is hard to read on this pale red box */
+.error a {
+ color: inherit;
+ font-weight: 600;
+ text-decoration: underline;
+}
+
.divider {
display: flex;
align-items: center;
diff --git a/apps/web/src/pages/Push.tsx b/apps/web/src/pages/Push.tsx
index c124cdd..15b8814 100644
--- a/apps/web/src/pages/Push.tsx
+++ b/apps/web/src/pages/Push.tsx
@@ -1,9 +1,10 @@
import { getFirestore } from 'firebase/firestore';
import { getStorage } from 'firebase/storage';
import { useState } from 'react';
+import { Link } from 'react-router';
import Button from '@/components/Button';
-import { LIMITS, formatMb } from '@/config/plan';
+import { LIMITS, PLAN_PAGE_LINKED, formatMb } from '@/config/plan';
import { usePlan } from '@/hooks/usePlan';
import { KEYS_UNAVAILABLE, usePushKeys } from '@/hooks/usePushKeys';
import {
@@ -12,7 +13,7 @@ import {
atLimit,
isRulesRefusal,
limitMessage,
- refusalMessage,
+ refusalReason,
} from '@/services/pushRefusal';
import {
PushTooLongError,
@@ -31,12 +32,17 @@ export default function Push() {
const [isSubmitting, setIsSubmitting] = useState(false);
const [isUploadSubmitting, setIsUploadSubmitting] = useState(false);
const [error, setError] = useState(null);
+ // Whether `error` is the month's limit, which is followed by a link to the plan: hitting
+ // the limit is when someone on Free is most ready to upgrade, and the only way to the plan
+ // otherwise is the menu.
+ const [limitReached, setLimitReached] = useState(false);
const { plan, refresh: refreshPlan } = usePlan();
const { keys } = usePushKeys();
const handleLinkSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError(null);
+ setLimitReached(false);
if (!url) return;
if (!keys) {
@@ -51,6 +57,7 @@ export default function Push() {
// until it is read again; a refusal here asks for the read, so the next try is right.
void refreshPlan();
setError(limitMessage(plan, 'url'));
+ setLimitReached(true);
return;
}
@@ -79,15 +86,19 @@ export default function Push() {
console.error('Error saving link:', error);
// The limit reached on another device, a key a reset replaced, or a push this copy of
// PushThat cannot make (pushRefusal.ts); the plan read again stops the next try here.
- setError(
- isRulesRefusal(error)
- ? await refusalMessage(plan, 'url', refreshPlan, () => keyIsStale(getFirestore(), keys))
- : error instanceof PushUnconfirmedError
+ if (isRulesRefusal(error)) {
+ const refusal = await refusalReason(plan, 'url', refreshPlan, () => keyIsStale(getFirestore(), keys));
+ setError(refusal.message);
+ setLimitReached(refusal.atLimit);
+ } else {
+ setError(
+ error instanceof PushUnconfirmedError
? UNCONFIRMED_MESSAGE
: error instanceof PushTooLongError
? TOO_LONG_LINK_MESSAGE
: 'Failed to save link. Please try again.'
- );
+ );
+ }
} finally {
setIsSubmitting(false);
}
@@ -96,6 +107,7 @@ export default function Push() {
const handleFileSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError(null);
+ setLimitReached(false);
if (!file) return;
if (!keys) {
@@ -121,6 +133,7 @@ export default function Push() {
if (plan && atLimit(plan, 'file')) {
void refreshPlan();
setError(limitMessage(plan, 'file'));
+ setLimitReached(true);
return;
}
@@ -139,15 +152,19 @@ export default function Push() {
if (fileInput) fileInput.value = '';
} catch (error) {
console.error('Error saving file:', error);
- setError(
- isRulesRefusal(error)
- ? await refusalMessage(plan, 'file', refreshPlan, () => keyIsStale(getFirestore(), keys))
- : error instanceof PushUnconfirmedError
+ if (isRulesRefusal(error)) {
+ const refusal = await refusalReason(plan, 'file', refreshPlan, () => keyIsStale(getFirestore(), keys));
+ setError(refusal.message);
+ setLimitReached(refusal.atLimit);
+ } else {
+ setError(
+ error instanceof PushUnconfirmedError
? UNCONFIRMED_MESSAGE
: error instanceof PushTooLongError
? 'That file name is too long to push.'
: 'Failed to upload file. Please try again.'
- );
+ );
+ }
} finally {
setIsUploadSubmitting(false);
}
@@ -161,7 +178,17 @@ export default function Push() {
return (