Repository navigation
PostHog revamp, Stripe fixes, unified site header - #16
Merged
Merged
Conversation
…captures write through marketing/ (capture, compositor, renders) stays local and is ignored. __previewWrite only exists in the preview build (npm run dev:preview).
…e, Stripe calls off the event loop - checkout refuses people who already subscribe (409, manage it in the portal) - an active subscription on a price we don't know grants Pro instead of Free - Stripe SDK calls run in the threadpool - billing page asks for the plan again after checkout until the webhook lands
…, flush on shutdown - consent from an earlier visit counts, so identify runs after a reload - capture_pageview: history_change for the SPA - backend PostHog client flushes its queue when the app stops
…ents by object and action Privacy (the policy promised it, the layout editor did not do it): - layout pages render in same-origin iframes: maskForRecording() puts data-ph-mask on their <body>, so rrweb masks the text and blocks the images inside - slide thumbnails (SVG data URIs holding the slide's text) are blocked - side panels, titles, presence, comments and in-place editing are masked; names that sit in attributes are ph-no-capture; autocapture skips content areas - public-link tokens are scrubbed from every URL property; public pages never record Foundation: src/analytics (init, track with document context, consent, identity), environment/app_version/locale on every event, nothing sent from localhost unless VITE_POSTHOG_DEV=1, heatmaps, web vitals and exception capture after consent. The cookie choice is also sent to the account so server events can follow it. Events: the server now records what used to be duplicated here (document created, reviews, versions, comments, themes); "Reviewed" goes to the backend. New: style, looks, header/footer, shortcuts, undo/redo, collaboration, marketing CTAs, snippets and the demo.
…, error tracking - users.analytics_consent (migration 004) set by PATCH /users/me from the banner - accepted: the Clerk id and $set (plan); declined or never answered: a stable anon_<HMAC> pseudonym with no person profile (POSTHOG_ANON_SALT) - events renamed to object_action with `source` (agent | person) and `document_mode`: document_created (one event for Markdown, layout, app and MCP), agent_changes_reviewed (north star, new POST /layout/reviewed), version_*, comment_*, document_shared/moved/published/exported, folder_created, checkout_started, subscription_started/canceled - mcp_api_request only on failure (agent_request_failed); render_page counted once - unhandled errors go to PostHog error tracking, never tied to a person - MCP tool calls report their toolset - funnel script on the new server-only events, production only
…alogue - Caddy: /ingest -> PostHog, so blockers don't drop a developer audience (validated with caddy:2-alpine) - VITE_APP_VERSION / APP_VERSION from the git SHA; VITE_POSTHOG_UI_HOST - docs/architecture/analytics.md: sources, consent and identity, what is never sent, the event catalogue and configuration
…ripe refuses - the "already subscribed" check relied on the local plan, which only changes when the webhook lands; a late or lost webhook let a second payment open a second subscription. Checkout now lists the customer's subscriptions in Stripe first, refuses with 409 and heals the plan if one is still paid for - Stripe errors on checkout and portal (e.g. a restricted key without Customer Portal: Write) are logged with Stripe's message and answered with a clear 502
…sent to manage, not to pay again - on a plan change the remaining document creations move by the difference between the allowances (free → Pro: 15 left becomes 100 left; what was used still counts; back to free never goes negative). Before, a new subscriber kept the free 15 out of 100 until Sunday's reset - the pricing page knows the signed-in plan: a subscriber sees "Your plan · Manage" (to /billing) instead of "Get Pro"; a 409 from checkout goes to /billing instead of a generic error
The banner only calls setConsent when there is no choice yet, so someone who accepted on an earlier visit stayed opted out of PostHog for good.
…ditor, legal pages in Portuguese SiteHeader replaces MarketingNav and TopBar: the links depend only on being signed in or not. Privacy, terms and contact share one shell, with pt-BR texts next to the English ones.
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
PostHog revamp
src/analytics): opt-out until cookie consent, the choice re-applied on every visit, pageviews on route changes, heatmaps, web vitals, exception capture.data-ph-maskon the srcDoc body), titles, names and comments masked or blocked; public links never recorded and their token scrubbed from URLs.object_action,document_id/document_modeon everything), catalogue indocs/architecture/analytics.md.users.analytics_consent, migration 004): accepted → Clerk id; declined or never answered → anonymousanon_<HMAC>with no person profile./ingestproxy blocks for Caddy,APP_VERSION/VITE_APP_VERSIONin builds, error tracking in the API middleware,toolseton MCP tool-call telemetry.Stripe
Site
SiteHeadereverywhere, footer on every screen but the editor, privacy/terms/contact in one shell with pt-BR texts.Other
/marketing/kit out of git; preview write hook kept.Deploy notes
.env:POSTHOG_ENABLED,POSTHOG_API_KEY,POSTHOG_ANON_SALT(never changes), Stripe vars./ingestblock before this frontend ships (VITE_POSTHOG_HOST=https://doc-forge.dev/ingest).Test plan