Skip to content

feat(workflows): show code-managed email templates read-only - #549

Closed
Silthus wants to merge 10 commits into
srv/templates-apifrom
spec/code-managed-templates
Closed

Silthus wants to merge 10 commits into
srv/templates-apifrom
spec/code-managed-templates

Conversation

@Silthus

@Silthus Silthus commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Moved here from part 3 of 3 of #118924, closed on 2026-10-25 so this fork stack is the only copy. It opens upstream again after review.

Problem

Engineers, and the coding agents working for them, keep transactional emails (welcome, password reset) as HTML files in their repository and want PostHog to send them (spec).

  • Master sends only templates made in the PostHog UI, addressed by a UUID that differs per project.
  • A project secret API key (phs_) can send but cannot create or update a template, so code cannot upload one.
  • Nothing marks a template as owned by code, so an edit in PostHog and the next change from code overwrite each other.

This is part 3 of 3: the template library UI. Part 1 adds the columns, part 2 the API that sets them.

Merge Danger

Warning

🟡 Merge risk: medium · two-way door (merge-risk rubric)

  • The template editor now sends a form without the server-owned fields (key, managed_by, source_*), for every template, flag or not.
  • A code-managed template opens read-only: no Save, Delete disabled, "Stop managing in code" offered. Only part 2's upload makes a template code-managed, behind workflows-transactional-email-api.
  • The API tab of every transactional template, GUI-made ones included, now shows POST /messaging/send/email/ in place of the per-template send route. It names template.key when the template has a key, template.id otherwise. The tab shows only with the flag on.

Changes

Kind Files Lines
Production 19 +896 −185
Tests 5 +561 −0
Total (this layer) 24 +1457 −185
  • A code-managed template shows a "Managed by code" tag in the library, its source file line, its key with a copy button, and a send-by-key API example.
  • It opens as a read-only preview: subject, preheader, the HTML in a sandboxed frame, and the plain text. Save is gone, Delete is disabled with its reason, and Duplicate makes an editable copy without the key.
  • The API tab of every transactional template, GUI-made ones included, shows POST /messaging/send/email/ with template.id, or template.key for a template with a key. It replaces the example of POST /messaging_templates/{id}/send/.
  • "Stop managing in code" releases the template, after a confirmation.
  • When an upload claims back a released template mid-edit, the refused save, draft autosave or draft discard locks the page, reloads it read-only with the published content and offers "Duplicate with my changes".
  • While the refused edits wait, the banner, menu and Quill Duplicate actions are disabled or hidden, so only "Duplicate with my changes" copies. Leaving the page asks first.
  • A second refusal keeps the edits the first one rescued. A refused draft discard does not store the discarded draft as refused edits.
  • A release while refused edits wait puts those edits back in the editable form.
  • The Quill actions behind today-rail-nav offer the same choices, and disable Duplicate while its copy is made.
  • Source links work for GitHub, GitLab subgroups and Bitbucket.

Screenshots

UI walk at 4b0ca4756ed, in the order a member meets it: a production frontend build on a preview stack, the demo project, LemonUI, and the today-rail-nav variant for the last two. All eight stages ran in both variants (38 screenshots, 13 shown), and each matched apart from the two items in Decisions. No recording was made: gap.

1. The library tags Weekly digest "Managed by code". The GUI template and the legacy template carry no tag. 2. Opening it shows a read-only preview with the key, source links and an info banner.
The library tags Weekly digest "Managed by code". The GUI template and the legacy template carry no tag Opening it shows a read-only preview with the key, source links and an info banner
3. The API tab of a keyed template sends with template.key. 4. The API tab of a GUI template sends with template.id.
The API tab of a keyed template sends with template.key The API tab of a GUI template sends with template.id
5. "Stop managing in code" asks first and names templates/weekly-digest.html. 6. After the release the editor is editable, the tag and banner are gone, and the key stays.
"Stop managing in code" asks first and names templates/weekly-digest.html After the release the editor is editable, the tag and banner are gone, and the key stays
7. An upload claims it back mid-edit. The next keystroke shows the refused-edits banner. The info banner stays below it without Duplicate. 8. While the refused edits wait, menu Duplicate is disabled and points to "Duplicate with my changes".
An upload claims it back mid-edit. The next keystroke shows the refused-edits banner. The info banner stays below it without Duplicate While the refused edits wait, menu Duplicate is disabled and points to "Duplicate with my changes"
9. "Duplicate with my changes" opens an editable copy that holds the refused subject. 10. Released, edited again and claimed again: the copy holds the second edits, not the first.
"Duplicate with my changes" opens an editable copy that holds the refused subject Released, edited again and claimed again: the copy holds the second edits, not the first
11. A legacy template with no managed_by stays a normal editable template. 12. With today-rail-nav, the library tags only the code templates.
A legacy template with no managed_by stays a normal editable template With today-rail-nav, the library tags only the code templates
13. With today-rail-nav, an upload mid-edit shows the same refused-edits banner.
With today-rail-nav, an upload mid-edit shows the same refused-edits banner
Earlier Storybook evidence (mocked data, at the commits named)

Storybook renders of the real scene against mocked data (example.com repository, invented copy).

Library card Code-managed template
Library card with the Managed by code tag Read-only preview with key, source line and notice
Stop managing in code Duplicate (editable copy)
Release confirmation Editable copy without key or tag
Claimed back while editing (#508)
Read-only template with a warning: your changes weren't saved, Duplicate with my changes

The read-only preview's field labels (Subject, Preheader, HTML, Plain text) now use LemonField.Pure, the label of other Lemon forms. Rendered on 89f57b2cd3e and its parent at 560px (Storybook, mocked data); 1440px before, 1440px after:

Before: small muted labels After: Lemon form labels
Read-only preview with small muted labels Read-only preview with Lemon form labels

More states, before and after, at 560px and 1440px: #489 screenshots, #492 screenshots, #508 at 775px. The #508 render shows Storybook's own mock toasts in the corner.

Review fixes, rendered on 07d7e0ee544 at 560px (Storybook, mocked data):

A 90-character key truncates and keeps its copy button Duplicate while its request runs
Long key with an ellipsis and the copy button Duplicate with a spinner

Quill actions behind today-rail-nav on a code-managed template, rendered on 756474ff699 at 1280px (Storybook, mocked data). In "Before", only the actions menu is master's:

Before (master) After
Before: Save as new template, Duplicate and an enabled Delete After: Duplicate, Stop managing in code, and Delete disabled with its reason

A target="_self" link in the preview opened a new tab, and the preview stayed: after the click.

How did you test this code?

Test rationale: messageTemplateLogic.test.ts drives the lock, release, duplicate and refused-save flows at the kea logic; EmailHtmlFrame.test.ts and gitMetadataParser.spec.ts cover preview links and source links.

Test file Regression it catches
messageTemplateLogic.test.ts a code-managed template that saves, a duplicate that keeps the key, a release that stays read-only, a save that sends server-owned fields, a refused save, draft autosave or draft discard that leaves the page editable or still unsaved (also when its reload fails), a navigation that drops refused edits without asking, a duplicate of refused edits that drops them or carries ownership fields
MessageTemplateMenu.test.tsx a "Stop managing in code" menu whose Cancel still releases, or whose confirm does not
EmailHtmlFrame.test.ts, gitMetadataParser.spec.ts preview links that replace the preview, wrong Bitbucket or GitLab subgroup links
Proof Result
UI walk At 4b0ca4756ed, both variants: library, read-only preview, API tab, release, edit, upload claims it back, refused-edits actions, release again, and a legacy template. Uploads used PUT messaging_templates/by_key/<key>/ with a personal API key. Every stage matched, apart from the two items in Decisions below.
Local gate At the stack top 987b927630e, which holds this head unchanged: frontend jest 84, frontend typecheck, and the rest of the gate all green.
Not covered An upload is noticed only on the next autosave, so a page with a saved draft stays editable until the next keystroke (follow-up). With today-rail-nav, a code-managed template shows a disabled Save, while LemonUI hides it.

Release status

  • This change is behind a feature flag and is not available to users

Docs update

The beta docs page /docs/workflows/transactional-email-api ships separately on posthog.com (Silthus/posthog#475). Every new error's docs_url points at its anchor.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5) wrote the code, the split and the fixes. Reviews by GPT-6.1 Sol and Claude Opus 5.5.

Decisions

The decisions for this change are on part 2 and on #118924. The ones for this part:

Question Answer Who Where
While refused edits wait, does the code-managed info banner stay? Yes, without its Duplicate action, under the refused-edits banner. Its text stays true. The alternative is to hide it while edits wait (UI walk UW-1) 🤖 Agent pending approval
Should the API tab of a keyed template show template.id? No, rejected: it shows template.key, which is the same in every project, and a GUI template shows its id (UI walk UW-2) 🤖 Agent pending approval

Open: should the read-only preview show the sender? The editor shows From and Reply-to, the preview does not (➡️ yes, in this part: a read-only sender row from EmailSenderSummary, because the sender is set only in PostHog).

Involvement: QA swarm design pass (GPT-6.1 Sol high); round 1 (review and team lanes GPT-6.1 Sol high, fresh eyes and UI Claude Opus 5.5 high, 6 fixes); round 2 on the fixes (review and team lanes GPT-6.1 Sol high, fresh eyes and UI Claude Opus 5.5 high, 4 fixes); final read 1 (GPT-6.1 Sol high, 1 fix); final read 2 clean; fixers Claude Opus 5.5 high; UI walk (Claude Opus 5.5).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 CI report

⚠️ Complexity (TypeScript) — 3 functions above the limit (max 76)

Cyclomatic complexity above the limit in changed typescript files (10 for production files, 15 for test files). Warn only: worth simplifying when you next touch these functions.

Function Location Complexity Limit
MessageTemplate products/workflows/frontend/TemplateLibrary/MessageTemplate.tsx:64 76 10
MessageTemplateCard products/workflows/frontend/TemplateLibrary/MessageTemplateCard.tsx:12 13 10
templateSource products/workflows/frontend/TemplateLibrary/codeManagedTemplate.ts:18 11 10
⚠️ Bundle size — 🔺 +8.4 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 76.03 MiB · 🔺 +8.4 KiB (+0.0%)

File Size Δ vs base
posthog-app/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate.js 46.5 KiB 🔺 +7.2 KiB (+18.5%)

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

⚠️ Eager graph — 2 over budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.01 MiB · 24 files 🔺 +49 B (+0.0%) █████████░ 88.6% of 1.14 MiB
logged-out boot: index + App + bootApp (preloaded by every page, including /login)
src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
2.94 MiB · 620 files 🔺 +49 B (+0.0%) ██████████ 96.9% of 3.03 MiB
🟡 authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
7.65 MiB · 2,633 files 🔺 +49 B (+0.0%) ██████████ 102.1% of 7.50 MiB
dashboard scene
src/scenes/dashboard/Dashboard.tsx
9.68 MiB · 3,703 files 🔺 +49 B (+0.0%) ██████████ 96.7% of 10.01 MiB
🟡 today home path
src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
8.06 MiB · 2,977 files 🔺 +49 B (+0.0%) ██████████ 104.1% of 7.74 MiB
AI-first home path
src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
7.90 MiB · 2,706 files 🔺 +49 B (+0.0%) █████████░ 88.1% of 8.96 MiB
events scene
src/scenes/activity/explore/EventsScene.tsx
9.15 MiB · 3,495 files 🔺 +49 B (+0.0%) ██████████ 95.4% of 9.59 MiB
web analytics scene
src/scenes/web-analytics/WebAnalyticsScene.tsx
10.01 MiB · 3,713 files 🔺 +49 B (+0.0%) █████████░ 92.4% of 10.83 MiB
replay detail scene
src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
8.22 MiB · 3,075 files 🔺 +1014 B (+0.0%) █████████░ 86.8% of 9.47 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/layout/navigation-3000/navigationLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/dashboard/dashboardLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/lemon-ui/LemonMarkdown/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/RichContentEditor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/CodeSnippet/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/taxonomy/core-filter-definitions-by-group.json stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/zod/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/billing/billingLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/ProductEmptyState/productSetupPreloadLogic.ts stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 products/dashboards/frontend/widgets/previews/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 products/wizard/frontend/runs/WizardRunDetailsDrawer.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 zod/v4/locales/de.js stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/queries/validators.js stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/scenes/project-homepage/today/TodayReportPage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/queries/Query/Query.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 products/posthog_ai/frontend/components/tool/widgets/VisualizationWidget.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 products/posthog_ai/frontend/components/tool/widgets/RecordingsWidget.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/queries/Query/Query.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 products/posthog_ai/frontend/api/primitives.ts stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/scenes/notebooks/Notebook/notebookLogic.ts stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/queries/validators.js stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/scenes/web-analytics/LiveMetricsDashboard/LiveWebAnalyticsMetrics.tsx stays out of src/scenes/web-analytics/WebAnalyticsScene.tsx
🟢 products/product_analytics/frontend/insights/trends/WorldMap/countryVectors.tsx stays out of src/scenes/web-analytics/WebAnalyticsScene.tsx
🟢 src/scenes/settings/SettingsMap.tsx stays out of src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
🟢 @jspm/core/nodelibs/browser/fs stays out of src/scenes/session-recordings/detail/SessionRecordingDetail.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.4 KiB src/index.tsx
1.3 KiB src/RootErrorBoundary.tsx
1.3 KiB src/lib/utils/bootTiming.ts
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
69.4 KiB src/lib/lemon-ui/icons/icons.tsx
38.7 KiB ../node_modules/.pnpm/@dnd-kit+core@6.0.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js
33.9 KiB ../node_modules/.pnpm/kea@4.0.0-pre.6_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js
29.4 KiB src/scenes/scenes.ts
26.9 KiB src/lib/constants.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/web-analytics/WebAnalyticsScene.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
183.2 KiB src/queries/validators.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
143.2 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
Size File
321.9 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
316.1 KiB ../node_modules/.pnpm/posthog-js@1.438.18_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js
286.8 KiB src/taxonomy/core-filter-definitions-by-group.json
238.5 KiB ../packages/quill/packages/quill/dist/index.js
220.9 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.7 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
106.3 KiB src/products.tsx
98.9 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of PostHog#32479

✅ Toolbar bundle — eager 2.29 MiB within budget

What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.

Metric Size Δ vs base Budget
Eager (shipped)
entry + static imports
2.29 MiB · 18 files 🔺 +49 B (+0.0%) ████░░░░░░ 39.9% of 5.72 MiB
Deferred (lazy) 2.11 MiB · 40 files no change n/a — loads on demand
Loader dist/toolbar.js 1.2 KiB no change █░░░░░░░░░ 6.0% of 19.5 KiB
Largest eagerly-shipped chunks
Size File
899.4 KiB dist/toolbar/toolbar-app-REMKF2SV.css
691.4 KiB dist/toolbar/chunk-chunk-DDSP4M6B.js
260.7 KiB dist/toolbar/chunk-chunk-HRRIOF34.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
130.4 KiB dist/toolbar/chunk-chunk-IT6XUU73.js
74.8 KiB dist/toolbar/toolbar-app-YPZZ2PIS.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-CGDYYVIR.js
21.7 KiB dist/toolbar/chunk-chunk-PM4VBMO5.js
6.8 KiB dist/toolbar/chunk-chunk-DV7IWQNF.js

Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile

✅ Dist folder size — 🔺 +116.8 KiB (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1020.76 MiB · 🔺 +116.8 KiB (+0.0%)

@Silthus
Silthus force-pushed the spec/code-managed-templates branch from 89f57b2 to f04e5eb Compare October 23, 2026 21:24
Silthus and others added 10 commits October 23, 2026 21:37
The template library marks a code-managed template with its source and
key, shows it read-only, and offers a release back to PostHog.

Part 3 of 3 of PostHog#118924.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ield

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus force-pushed the spec/code-managed-templates branch from f04e5eb to 4b0ca47 Compare October 24, 2026 17:28
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
Silthus added a commit that referenced this pull request Oct 24, 2026
@Silthus Silthus closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant