Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(posthog-ai): show the whole diff in edit cards (#111371)

Shy Alter96b258fd8c1e
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index b9cd7a94e5e9..7afd4e35196e 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7111,9 +7111,9 @@ snapshots:
products-posthog-ai-optionselector--with-skip--light:
hash: v1.k794b7964.3e3088b0a9011240d1ea0408e7a00e93c45f6df467b0de5237b668ccc58b49d1.C0sUxwpoEuyYD9BM0daSWe9Y_Cfavx5NcMCT-znQWcw
products-posthog-ai-permissioninput--matching-configuration--dark:
- hash: v1.k794b7964.32f3cd289ba4d85f920f30164b8ff264b752c418d9ccc42a6f708458ba668467.jvnRfjTZoG9Z6ymsDBqaXC7R3KCkYSeKQUp2JE0yiVo
+ hash: v1.k794b7964.1a9487e6281219c4550e2f7d12fc5acc87dc9dc106234b7da119e6ebb486cd7e.BckiKpPgZGMSeckbLYcUwk2Ve-5VT-PURniyuW4xLlY
products-posthog-ai-permissioninput--matching-configuration--light:
- hash: v1.k794b7964.d478b95b0240c651b90a4634978a3f934ce34d7e7a92197d8a4e7aa4db6c0775.BIuSpIBo6bRQIfOtoOmZunCm5FarVrrEyUaCMb7oxlY
+ hash: v1.k794b7964.ce6699534ba1ac0389af510a2d45397cc9190948725c725f111edc632b4fdf21._cEmbMKcmcTZrRWee5oZQUasdCyyqMgPP5HShYP8gbQ
products-posthog-ai-permissioninput--mismatched-configuration--dark:
hash: v1.k794b7964.e331794504d3dcb057098e1a1789f53c59eb6d8aa31f27740ccbb35d8cdca32a.umeyxQPE6YC4nkiAkrcfcmnRKWjj4X5tsyZ88jrulcc
products-posthog-ai-permissioninput--mismatched-configuration--light:
diff --git a/products/posthog_ai/frontend/components/tool/EditDiffRenderer.tsx b/products/posthog_ai/frontend/components/tool/EditDiffRenderer.tsx
index dee6d8643d0b..214208fc0bd6 100644
--- a/products/posthog_ai/frontend/components/tool/EditDiffRenderer.tsx
+++ b/products/posthog_ai/frontend/components/tool/EditDiffRenderer.tsx
@@ -30,6 +30,8 @@ const DIFF_EDITOR_OPTIONS: editor.IDiffEditorConstructionOptions = {
diffWordWrap: 'inherit',
fontSize: 12,
lineNumbers: 'on',
+ // Monaco reserves five digits per line-number column by default. Columns still widen for longer files.
+ lineNumbersMinChars: 2,
minimap: { enabled: false },
renderOverviewRuler: false,
overviewRulerLanes: 0,
@@ -42,6 +44,8 @@ const DIFF_EDITOR_OPTIONS: editor.IDiffEditorConstructionOptions = {
renderGutterMenu: false,
guides: { indentation: false },
padding: { top: 4, bottom: 4 },
+ // Re-measures when the box grows to fit wrapped lines. Without it Monaco keeps its first, shorter size and clips them.
+ automaticLayout: true,
// Don't trap the thread's scroll when the cursor is over the diff.
scrollbar: { alwaysConsumeMouseWheel: false, vertical: 'auto', horizontal: 'auto' },
}