From e890f74478615025546f6e9b1dfd06cf7651fadc Mon Sep 17 00:00:00 2001 From: jjbrunton Date: Tue, 11 Aug 2026 22:17:18 +0100 Subject: [PATCH] Configure browsing session pacing and size --- .../src/features/growth/growth-page.tsx | 55 +++++++++ docs/configuration.md | 2 +- docs/data-flow.md | 4 +- docs/database.md | 2 +- docs/frontend.md | 2 +- packages/api-contracts/src/growth.ts | 2 + .../browsing-simulation-repository.ts | 16 ++- src/database/client.ts | 3 + src/services/account-browsing-simulation.ts | 104 +++++++++++------- src/web/growth-contracts.ts | 3 +- src/web/routes/growth.ts | 1 + tests/account-browsing-simulation.test.ts | 38 ++++++- tests/dashboard/growth.test.tsx | 21 ++++ tests/web/growth-route.test.ts | 4 +- 14 files changed, 201 insertions(+), 56 deletions(-) diff --git a/apps/dashboard/src/features/growth/growth-page.tsx b/apps/dashboard/src/features/growth/growth-page.tsx index 7d0281b..8ac59e7 100644 --- a/apps/dashboard/src/features/growth/growth-page.tsx +++ b/apps/dashboard/src/features/growth/growth-page.tsx @@ -178,6 +178,11 @@ function BrowsingSimulationSection({ account }: { account: GrowthAccountDetail } const runNow = useRunBrowsingSimulationMutation(account.accountId); const { settings, stats, todayTarget, recentDecisions } = account.browsing; const selected = recentDecisions.filter((decision) => decision.decision === 'simulated-upvote'); + const [gapMinutes, setGapMinutes] = useState(String(settings.minimumGapMs / 60_000)); + const [selectionsPerSession, setSelectionsPerSession] = useState(String(settings.selectionsPerSession)); + + useEffect(() => setGapMinutes(String(settings.minimumGapMs / 60_000)), [settings.minimumGapMs]); + useEffect(() => setSelectionsPerSession(String(settings.selectionsPerSession)), [settings.selectionsPerSession]); return (
@@ -207,6 +212,56 @@ function BrowsingSimulationSection({ account }: { account: GrowthAccountDetail } label="Submit selected upvotes" onChange={(autoVoteEnabled) => update.mutate({ autoVoteEnabled })} /> +
+ + +
+
+ + +