: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(heatmaps): preserve toolbar data url patterns (#105252)
Javier Bahamondesec7ca2b8baa6
diff --git a/docs/internal/toolbar-entitlements.md b/docs/internal/toolbar-entitlements.mdindex 19423eae836b..6fcf7b29591b 100644--- a/docs/internal/toolbar-entitlements.md+++ b/docs/internal/toolbar-entitlements.md@@ -15,3 +15,16 @@ Opening the heatmap menu while access is loading does not enable heatmaps. A conThis is a toolbar UI gate. The rollout flag does not add entitlement enforcement to the heatmap data endpoints.The `HeatmapEntitlementsLoading` Storybook story keeps the entitlement request pending to cover the loading state. Its screenshot test waits for “Checking plan access…” to appear and sets `waitForLoadersToDisappear: false` so the visible spinner does not time out the test.++## Saved heatmap data URLs++Capture requests reject malformed data URLs, using the same URL validation as other saved heatmap writes.+Wildcards in the URL path are supported.++Saving a heatmap from the toolbar keeps the captured page URL separate from the heatmap data URL.+The saved data URL preserves the toolbar's selected URL pattern, including wildcards, for both responsive captures and the single-width fallback.+Capture requests without a data URL keep using the exact page URL.++A heatmap editor with resource-level access can change the data URL of a toolbar capture in the page settings without replacing its screenshot.+Changing the captured page or its rendering settings still requires a new capture from the toolbar.+Object-level editor access alone does not allow changing either URL.diff --git a/frontend/src/toolbar/stats/heatmapCaptureLogic.test.ts b/frontend/src/toolbar/stats/heatmapCaptureLogic.test.tsindex a3e292ebba2f..a15a0e77bb1e 100644--- a/frontend/src/toolbar/stats/heatmapCaptureLogic.test.ts+++ b/frontend/src/toolbar/stats/heatmapCaptureLogic.test.ts@@ -54,44 +54,48 @@ describe('heatmapCaptureLogic', () => {currentPageLogic.actions.setHref('https://app.example.com/dashboard')})- it.each([- {- name: 'uploads one image per captured width as parallel images/widths arrays',- captures: [- { width: 320, blob: jpeg() },- { width: 768, blob: jpeg() },- { width: 1440, blob: jpeg() },- ],- expectedWidths: ['320', '768', '1440'],- expectedImageCount: 3,- expectedSingleWidth: null as string | null,- },- {- name: 'falls back to a single capture at the current width when no widths could be reflowed',- captures: [] as { width: number; blob: Blob }[],- expectedWidths: [] as string[],- expectedImageCount: 0,- expectedSingleWidth: '1440' as string | null,- },- ])('$name', async ({ captures, expectedWidths, expectedImageCount, expectedSingleWidth }) => {- ;(captureResponsiveScreenshots as jest.Mock).mockResolvedValue(captures)- mockCaptureResponse()+ describe.each(['https://app.example.com/dashboard', 'https://app.example.com/*'])('data URL %s', (dataUrl) => {+ it.each([+ {+ name: 'uploads one image per captured width as parallel images/widths arrays',+ captures: [+ { width: 320, blob: jpeg() },+ { width: 768, blob: jpeg() },+ { width: 1440, blob: jpeg() },+ ],+ expectedWidths: ['320', '768', '1440'],+ expectedImageCount: 3,+ expectedSingleWidth: null as string | null,+ },+ {+ name: 'falls back to a single capture at the current width when no widths could be reflowed',+ captures: [] as { width: number; blob: Blob }[],+ expectedWidths: [] as string[],+ expectedImageCount: 0,+ expectedSingleWidth: '1440' as string | null,+ },+ ])('$name', async ({ captures, expectedWidths, expectedImageCount, expectedSingleWidth }) => {+ ;(captureResponsiveScreenshots as jest.Mock).mockResolvedValue(captures)+ mockCaptureResponse()+ currentPageLogic.actions.setWildcardHref(dataUrl)- await expectLogic(logic, () => {- logic.actions.saveToPostHog()- })- .delay(0)- .toDispatchActions(['saveToPostHog', 'saveToPostHogSuccess'])+ await expectLogic(logic, () => {+ logic.actions.saveToPostHog()+ })+ .delay(0)+ .toDispatchActions(['saveToPostHog', 'saveToPostHogSuccess'])- const [url, options] = (global.fetch as jest.Mock).mock.calls[0]- expect(url).toContain('/api/projects/@current/saved/capture/')- const body = options.body as FormData- expect(body.get('url')).toBe('https://app.example.com/dashboard')- expect(body.getAll('widths')).toEqual(expectedWidths)- const images = body.getAll('images')- expect(images).toHaveLength(expectedImageCount)- expect(images.every((image) => image instanceof File)).toBe(true)- expect(body.get('width')).toBe(expectedSingleWidth)- expect(body.get('image') instanceof File).toBe(expectedSingleWidth !== null)+ const [url, options] = (global.fetch as jest.Mock).mock.calls[0]+ expect(url).toContain('/api/projects/@current/saved/capture/')+ const body = options.body as FormData+ expect(body.get('url')).toBe('https://app.example.com/dashboard')+ expect(body.get('data_url')).toBe(dataUrl)+ expect(body.getAll('widths')).toEqual(expectedWidths)+ const images = body.getAll('images')+ expect(images).toHaveLength(expectedImageCount)+ expect(images.every((image) => image instanceof File)).toBe(true)+ expect(body.get('width')).toBe(expectedSingleWidth)+ expect(body.get('image') instanceof File).toBe(expectedSingleWidth !== null)+ })})})diff --git a/frontend/src/toolbar/stats/heatmapCaptureLogic.ts b/frontend/src/toolbar/stats/heatmapCaptureLogic.tsindex 299fb4ea68a5..239c97e4bff0 100644--- a/frontend/src/toolbar/stats/heatmapCaptureLogic.ts+++ b/frontend/src/toolbar/stats/heatmapCaptureLogic.ts@@ -30,6 +30,7 @@ interface CaptureProgress {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface heatmapCaptureLogicValues {href: string // currentPageLogic+ wildcardHref: string // currentPageLogicwindowWidth: number // heatmapToolbarMenuLogicisAuthenticated: boolean // toolbarConfigLogicuiHost: string // toolbarConfigLogic@@ -68,15 +69,16 @@ export interface heatmapCaptureLogicActions {export type heatmapCaptureLogicType = MakeLogicType<heatmapCaptureLogicValues, heatmapCaptureLogicActions>-function buildBaseFormData(href: string): FormData {+function buildBaseFormData(href: string, dataUrl: string): FormData {const formData = new FormData()formData.append('url', href)+ formData.append('data_url', dataUrl)formData.append('name', document.title || href)return formData}-function buildMultiWidthFormData(href: string, captures: WidthCapture[]): FormData {- const formData = buildBaseFormData(href)+function buildMultiWidthFormData(href: string, dataUrl: string, captures: WidthCapture[]): FormData {+ const formData = buildBaseFormData(href, dataUrl)for (const { width, blob } of captures) {formData.append('images', new File([blob], `heatmap-${width}.jpg`, { type: 'image/jpeg' }))formData.append('widths', String(width))@@ -84,9 +86,9 @@ function buildMultiWidthFormData(href: string, captures: WidthCapture[]): FormDareturn formData}-async function buildSingleWidthFormData(href: string, width: number): Promise<FormData> {+async function buildSingleWidthFormData(href: string, dataUrl: string, width: number): Promise<FormData> {const blob = await captureElementScreenshot(document.documentElement)- const formData = buildBaseFormData(href)+ const formData = buildBaseFormData(href, dataUrl)formData.append('image', new File([blob], `heatmap-${Date.now()}.jpg`, { type: 'image/jpeg' }))formData.append('width', String(width))return formData@@ -97,7 +99,7 @@ export const heatmapCaptureLogic = kea<heatmapCaptureLogicType>([connect(() => ({values: [currentPageLogic,- ['href'],+ ['href', 'wildcardHref'],heatmapToolbarMenuLogic,['windowWidth'],toolbarConfigLogic,@@ -127,8 +129,8 @@ export const heatmapCaptureLogic = kea<heatmapCaptureLogicType>([)const formData =captures.length > 0- ? buildMultiWidthFormData(values.href, captures)- : await buildSingleWidthFormData(values.href, values.windowWidth)+ ? buildMultiWidthFormData(values.href, values.wildcardHref, captures)+ : await buildSingleWidthFormData(values.href, values.wildcardHref, values.windowWidth)const result = await toolbarApi.savedHeatmaps.capture(formData, {context: 'capture_heatmap',diff --git a/products/web_analytics/backend/api/heatmaps_api.py b/products/web_analytics/backend/api/heatmaps_api.pyindex 2b64aa6d7242..b69f4a745ce1 100644--- a/products/web_analytics/backend/api/heatmaps_api.py+++ b/products/web_analytics/backend/api/heatmaps_api.py@@ -1465,8 +1465,14 @@ class SavedHeatmapCaptureRequestSerializer(serializers.Serializer):)url = serializers.CharField(max_length=2000,- help_text="Exact page URL the screenshot was captured on. Wildcards are not allowed; this is stored as both "- "the heatmap URL and its data URL, so the overlay reads aggregate data for this exact URL.",+ help_text="Exact page URL the screenshot was captured on. Wildcards are not allowed.",+ )+ data_url = serializers.URLField(+ required=False,+ allow_blank=True,+ max_length=2000,+ help_text="URL or wildcard pattern used to select the heatmap data overlaid on the screenshot. "+ "Defaults to the captured page URL when omitted or empty.",)name = serializers.CharField(required=False,@@ -1773,7 +1779,8 @@ class SavedHeatmapViewSet("the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+""'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page ""at each width and captures it, matching the widths the server renders). The image bytes are stored and "- "served only through the authenticated content endpoint. The heatmap's data URL is set to the captured URL.",+ "served only through the authenticated content endpoint. The optional data URL selects which pages supply "+ "the overlay data and defaults to the captured URL.",)@action(methods=["POST"],@@ -1810,6 +1817,7 @@ class SavedHeatmapViewSet(snapshot_bytes.append((width, image_bytes))url = validated["url"]+ data_url = validated.get("data_url") or urlname = validated.get("name") or urltarget_widths = list(dict.fromkeys(width for width, _ in snapshot_bytes))@@ -1818,7 +1826,7 @@ class SavedHeatmapViewSet(team=self.team,name=name,url=url,- data_url=url,+ data_url=data_url,target_widths=target_widths,type=SavedHeatmap.Type.SCREENSHOT,source=SavedHeatmap.Source.TOOLBAR,@@ -1981,13 +1989,8 @@ class SavedHeatmapViewSet(if obj.source == SavedHeatmap.Source.TOOLBAR:validated = serializer.validated_data- render_input_changing = (- ("url" in validated and validated["url"] != obj.url)- or ("data_url" in validated and validated["data_url"] != obj.data_url)- or (- "block_consent_modals" in validated- and validated["block_consent_modals"] != obj.block_consent_modals- )+ render_input_changing = ("url" in validated and validated["url"] != obj.url) or (+ "block_consent_modals" in validated and validated["block_consent_modals"] != obj.block_consent_modals)if render_input_changing:raise ValidationError(diff --git a/products/web_analytics/backend/test/test_heatmap_access_control.py b/products/web_analytics/backend/test/test_heatmap_access_control.pyindex 658eb6697439..b3c50608b0c9 100644--- a/products/web_analytics/backend/test/test_heatmap_access_control.py+++ b/products/web_analytics/backend/test/test_heatmap_access_control.py@@ -282,7 +282,14 @@ class TestHeatmapAccessControl(ClickhouseTestMixin, APIBaseTest):self.client.get(self._detail_url(other_heatmap.short_id)).status_code, status.HTTP_403_FORBIDDEN)- def test_object_level_editor_cannot_retarget_heatmap_url(self):+ @parameterized.expand(+ [+ (SavedHeatmap.Source.SERVER, "url"),+ (SavedHeatmap.Source.SERVER, "data_url"),+ (SavedHeatmap.Source.TOOLBAR, "data_url"),+ ]+ )+ def test_object_level_editor_cannot_retarget_heatmap_url(self, source: SavedHeatmap.Source, field: str) -> None:# Regression: HeatmapAggregateQueryScopingPermission's object-grant fallback authorizes# aggregate queries by matching the request's url_exact against a SavedHeatmap the caller# has object-level access to. If an object-only editor could repoint that heatmap's@@ -292,12 +299,15 @@ class TestHeatmapAccessControl(ClickhouseTestMixin, APIBaseTest):self._create_access_control(self.viewer_user, resource_id=str(self.heatmap.id), access_level="editor")self.client.force_login(self.viewer_user)- retarget_response = self.client.patch(- self._detail_url(), data={"url": "https://attacker-controlled.example.com"}, format="json"- )+ self.heatmap.source = source+ self.heatmap.save(update_fields=["source"])+ original_data_url = self.heatmap.data_url++ retarget_response = self.client.patch(self._detail_url(), data={field: "https://example.com/*"}, format="json")self.assertEqual(retarget_response.status_code, status.HTTP_403_FORBIDDEN, retarget_response.json())self.heatmap.refresh_from_db()self.assertEqual(self.heatmap.url, "https://example.com")+ self.assertEqual(self.heatmap.data_url, original_data_url)# Non-URL fields on the same object-level grant are unaffected.rename_response = self.client.patch(self._detail_url(), data={"name": "still allowed"}, format="json")diff --git a/products/web_analytics/backend/test/test_heatmap_screenshots.py b/products/web_analytics/backend/test/test_heatmap_screenshots.pyindex c2c4c6ba0c4f..499efc64e414 100644--- a/products/web_analytics/backend/test/test_heatmap_screenshots.py+++ b/products/web_analytics/backend/test/test_heatmap_screenshots.py@@ -546,7 +546,10 @@ class TestHeatmapToolbarCapture(APIBaseTest):data.update(overrides)return self.client.post(f"/api/environments/{self.team.id}/saved/capture/", data, format="multipart")- def test_capture_creates_completed_toolbar_heatmap_and_serves_bytes(self, mock_task: MagicMock) -> None:+ @parameterized.expand([(None,), ("",), ("https://app.example.com/dashboard",), ("https://app.example.com/*",)])+ def test_capture_creates_completed_toolbar_heatmap_and_serves_bytes(+ self, mock_task: MagicMock, data_url: str | None+ ) -> None:image_bytes = _jpeg_bytes()resp = self.client.post(f"/api/environments/{self.team.id}/saved/capture/",@@ -555,6 +558,7 @@ class TestHeatmapToolbarCapture(APIBaseTest):"url": "https://app.example.com/dashboard","width": 1440,"name": "Dashboard",+ **({"data_url": data_url} if data_url is not None else {}),},format="multipart",)@@ -564,7 +568,9 @@ class TestHeatmapToolbarCapture(APIBaseTest):self.assertEqual(resp.data["type"], "screenshot")saved = SavedHeatmap.objects.get(id=resp.data["id"])- self.assertEqual(saved.data_url, "https://app.example.com/dashboard")+ self.assertEqual(saved.url, "https://app.example.com/dashboard")+ self.assertEqual(saved.data_url, data_url or saved.url)+ self.assertEqual(resp.data["data_url"], saved.data_url)self.assertEqual(saved.target_widths, [1440])self.assertEqual(saved.created_by, self.user)@@ -643,6 +649,7 @@ class TestHeatmapToolbarCapture(APIBaseTest):"images": [SimpleUploadedFile(f"heatmap-{w}.jpg", img, "image/jpeg") for w, img in zip(widths, images)],"widths": widths,"url": "https://app.example.com/dashboard",+ "data_url": "https://app.example.com/*","name": "Dashboard",},format="multipart",@@ -651,6 +658,8 @@ class TestHeatmapToolbarCapture(APIBaseTest):saved = SavedHeatmap.objects.get(id=resp.data["id"])self.assertEqual(saved.source, SavedHeatmap.Source.TOOLBAR)+ self.assertEqual(saved.url, "https://app.example.com/dashboard")+ self.assertEqual(saved.data_url, "https://app.example.com/*")self.assertEqual(saved.target_widths, widths)self.assertEqual(sorted(s.width for s in saved.snapshots.all()), widths)@@ -676,7 +685,7 @@ class TestHeatmapToolbarCapture(APIBaseTest):self.assertEqual(resp.status_code, 400)mock_task.assert_not_called()- def test_partial_update_blocks_render_input_change_for_toolbar_but_allows_rename(+ def test_partial_update_blocks_render_input_change_for_toolbar_but_allows_metadata(self, mock_task: MagicMock) -> None:saved = SavedHeatmap.objects.create(@@ -705,26 +714,32 @@ class TestHeatmapToolbarCapture(APIBaseTest):renamed = self.client.patch(f"/api/environments/{self.team.id}/saved/{saved.short_id}/",- {"name": "Renamed"},+ {"name": "Renamed", "data_url": "https://example.com/*"},)self.assertEqual(renamed.status_code, 200, renamed.data)saved.refresh_from_db()self.assertEqual(saved.name, "Renamed")+ self.assertEqual(saved.data_url, "https://example.com/*")+ self.assertEqual(saved.url, "https://example.com")+ self.assertEqual(saved.status, SavedHeatmap.Status.COMPLETED)+ self.assertEqual(saved.snapshots.count(), 1)+ mock_task.assert_not_called()class TestSavedHeatmapCaptureRequestSerializer(SimpleTestCase):@parameterized.expand([- ("wildcard", "https://app.example.com/*"),- ("javascript_scheme", "javascript:alert"),- ("ftp_scheme", "ftp://app.example.com/x"),- ("no_scheme", "app.example.com/x"),+ ("wildcard", "url", "https://app.example.com/*"),+ ("javascript_scheme", "url", "javascript:alert"),+ ("ftp_scheme", "url", "ftp://app.example.com/x"),+ ("no_scheme", "url", "app.example.com/x"),+ ("invalid_data_url", "data_url", "not-a-url"),])- def test_rejects_invalid_url(self, _name: str, url: str) -> None:- serializer = SavedHeatmapCaptureRequestSerializer(data={"url": url})+ def test_rejects_invalid_url(self, _name: str, field: str, url: str) -> None:+ serializer = SavedHeatmapCaptureRequestSerializer(data={field: url})self.assertFalse(serializer.is_valid())- self.assertIn("url", serializer.errors)+ self.assertIn(field, serializer.errors)def test_accepts_a_query_string_url(self) -> None:serializer = SavedHeatmapCaptureRequestSerializer(diff --git a/products/web_analytics/frontend/generated/api.schemas.ts b/products/web_analytics/frontend/generated/api.schemas.tsindex 58ebdc44bfdc..526beae46c5a 100644--- a/products/web_analytics/frontend/generated/api.schemas.ts+++ b/products/web_analytics/frontend/generated/api.schemas.ts@@ -395,10 +395,12 @@ export interface SavedHeatmapCaptureRequestApi {*/widths?: number[]/**- * Exact page URL the screenshot was captured on. Wildcards are not allowed; this is stored as both the heatmap URL and its data URL, so the overlay reads aggregate data for this exact URL.+ * Exact page URL the screenshot was captured on. Wildcards are not allowed.* @maxLength 2000*/url: string+ /** URL or wildcard pattern used to select the heatmap data overlaid on the screenshot. Defaults to the captured page URL when omitted or empty. */+ data_url?: string/*** Human-readable label for the saved heatmap. Defaults to the URL when omitted.* @maxLength 400diff --git a/products/web_analytics/frontend/generated/api.ts b/products/web_analytics/frontend/generated/api.tsindex 8bbebe992df2..2498b5e05f9b 100644--- a/products/web_analytics/frontend/generated/api.ts+++ b/products/web_analytics/frontend/generated/api.ts@@ -383,7 +383,7 @@ export const getSavedCaptureCreateUrl = (projectId: string) => {}/**- * Persist screenshots captured client-side by the on-page toolbar as a completed screenshot heatmap. No headless render is enqueued: the toolbar runs in the user's authenticated browser, so this is the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page at each width and captures it, matching the widths the server renders). The image bytes are stored and served only through the authenticated content endpoint. The heatmap's data URL is set to the captured URL.+ * Persist screenshots captured client-side by the on-page toolbar as a completed screenshot heatmap. No headless render is enqueued: the toolbar runs in the user's authenticated browser, so this is the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page at each width and captures it, matching the widths the server renders). The image bytes are stored and served only through the authenticated content endpoint. The optional data URL selects which pages supply the overlay data and defaults to the captured URL.*/export const savedCaptureCreate = async (projectId: string,@@ -404,6 +404,9 @@ export const savedCaptureCreate = async (savedHeatmapCaptureRequestApi.widths.forEach((value) => formData.append(`widths`, value.toString()))}formData.append(`url`, savedHeatmapCaptureRequestApi.url)+ if (savedHeatmapCaptureRequestApi.data_url !== undefined) {+ formData.append(`data_url`, savedHeatmapCaptureRequestApi.data_url)+ }if (savedHeatmapCaptureRequestApi.name !== undefined) {formData.append(`name`, savedHeatmapCaptureRequestApi.name)}diff --git a/products/web_analytics/frontend/generated/api.zod.ts b/products/web_analytics/frontend/generated/api.zod.tsindex 90d806368861..fe5ae606ccdd 100644--- a/products/web_analytics/frontend/generated/api.zod.ts+++ b/products/web_analytics/frontend/generated/api.zod.ts@@ -153,7 +153,7 @@ export const SavedPartialUpdateBody = /* @__PURE__ */ zod.object({})/**- * Persist screenshots captured client-side by the on-page toolbar as a completed screenshot heatmap. No headless render is enqueued: the toolbar runs in the user's authenticated browser, so this is the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page at each width and captures it, matching the widths the server renders). The image bytes are stored and served only through the authenticated content endpoint. The heatmap's data URL is set to the captured URL.+ * Persist screenshots captured client-side by the on-page toolbar as a completed screenshot heatmap. No headless render is enqueued: the toolbar runs in the user's authenticated browser, so this is the path for pages behind a login that Browserless cannot reach. Send one 'image'+'width', or 'images'+'widths' parallel arrays to store several viewport widths on one heatmap (the toolbar re-lays out the page at each width and captures it, matching the widths the server renders). The image bytes are stored and served only through the authenticated content endpoint. The optional data URL selects which pages supply the overlay data and defaults to the captured URL.*/export const savedCaptureCreateBodyWidthMin = 100export const savedCaptureCreateBodyWidthMax = 3000@@ -167,6 +167,10 @@ export const savedCaptureCreateBodyWidthsMax = 16export const savedCaptureCreateBodyUrlMax = 2000+export const savedCaptureCreateBodyDataUrlOneMax = 2000++export const savedCaptureCreateBodyDataUrlTwoMax = 0+export const savedCaptureCreateBodyNameMax = 400export const SavedCaptureCreateBody = /* @__PURE__ */ zod.object({@@ -197,8 +201,15 @@ export const SavedCaptureCreateBody = /* @__PURE__ */ zod.object({url: zod.string().max(savedCaptureCreateBodyUrlMax)+ .describe('Exact page URL the screenshot was captured on. Wildcards are not allowed.'),+ data_url: zod+ .union([+ zod.url().max(savedCaptureCreateBodyDataUrlOneMax),+ zod.string().max(savedCaptureCreateBodyDataUrlTwoMax),+ ])+ .optional().describe(- 'Exact page URL the screenshot was captured on. Wildcards are not allowed; this is stored as both the heatmap URL and its data URL, so the overlay reads aggregate data for this exact URL.'+ 'URL or wildcard pattern used to select the heatmap data overlaid on the screenshot. Defaults to the captured page URL when omitted or empty.'),name: zod.string()diff --git a/products/web_analytics/frontend/heatmaps/components/HeatmapPageFields.tsx b/products/web_analytics/frontend/heatmaps/components/HeatmapPageFields.tsxindex f01d7d481a1c..bf7dc8be8cd1 100644--- a/products/web_analytics/frontend/heatmaps/components/HeatmapPageFields.tsx+++ b/products/web_analytics/frontend/heatmaps/components/HeatmapPageFields.tsx@@ -24,7 +24,7 @@ export function HeatmapPageFields({displayUrl,type,blockConsentModals,- urlEditDisabledReason,+ dataUrlEditDisabledReason,renderSettingsEditDisabledReason,isBrowserUrlValid,} = useValues(heatmapLogic)@@ -44,7 +44,7 @@ export function HeatmapPageFields({setDataUrl(value || null)}}fullWidth={true}- disabledReason={urlEditDisabledReason}+ disabledReason={dataUrlEditDisabledReason}status={!isBrowserUrlValid ? 'danger' : undefined}/><div className="text-xs text-muted mt-1">{dataUrlHelp}</div>diff --git a/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.test.ts b/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.test.tsindex 0bcc1b37e756..c06957456858 100644--- a/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.test.ts+++ b/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.test.ts@@ -306,9 +306,11 @@ describe('heatmapLogic', () => {if (restriction === 'viewer') {logic.actions.setUserAccessLevel(AccessControlLevel.Viewer)expect(logic.values.editDisabledReason).toBeTruthy()+ expect(logic.values.dataUrlEditDisabledReason).toBeTruthy()} else {logic.actions.setSource('toolbar')expect(logic.values.editDisabledReason).toBeNull()+ expect(logic.values.dataUrlEditDisabledReason).toBeNull()}expect(logic.values.urlEditDisabledReason).toBeTruthy()expect(logic.values.regenerateDisabledReason).toBeTruthy()diff --git a/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.ts b/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.tsindex 8ff1d92b7bea..0aa525c21d92 100644--- a/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.ts+++ b/products/web_analytics/frontend/heatmaps/scenes/heatmap/heatmapLogic.ts@@ -148,6 +148,7 @@ export interface heatmapLogicValues {currentTeamIdStrict: number | string // teamLogicblockConsentModals: booleancontainerWidth: number | null+ dataUrlEditDisabledReason: string | nulldesiredNumericWidth: numberdisplayUrlIsPattern: booleandraftSettings: HeatmapSettings@@ -336,6 +337,7 @@ export interface heatmapLogicMeta {previewType: (savedSettings: HeatmapSettings | null, type: HeatmapType) => HeatmapTypeeditDisabledReason: (userAccessLevel: AccessControlLevel | null) => string | nullrenderSettingsEditDisabledReason: (editDisabledReason: string | null, source: HeatmapSource) => string | null+ dataUrlEditDisabledReason: (editDisabledReason: string | null) => string | nullurlEditDisabledReason: (editDisabledReason: string | null, source: HeatmapSource) => string | nullsaveDisabledReason: (editDisabledReason: string | null,@@ -830,6 +832,11 @@ export const heatmapLogic = kea<heatmapLogicType>([(reason: string | null, source: HeatmapSource): string | null =>reason || (source === 'toolbar' ? 'Open in toolbar to capture a new screenshot.' : null),],+ dataUrlEditDisabledReason: [+ (s) => [s.editDisabledReason],+ (reason: string | null): string | null =>+ reason || getAccessControlDisabledReason(AccessControlResourceType.Heatmap, AccessControlLevel.Editor),+ ],urlEditDisabledReason: [(s) => [s.editDisabledReason, s.source],(reason: string | null, source: HeatmapSource): string | null =>diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex c8f089669d80..9eedd6f28133 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -86627,10 +86627,12 @@ export namespace Schemas {*/widths?: number[];/**- * Exact page URL the screenshot was captured on. Wildcards are not allowed; this is stored as both the heatmap URL and its data URL, so the overlay reads aggregate data for this exact URL.+ * Exact page URL the screenshot was captured on. Wildcards are not allowed.* @maxLength 2000*/url: string;+ /** URL or wildcard pattern used to select the heatmap data overlaid on the screenshot. Defaults to the captured page URL when omitted or empty. */+ data_url?: string;/*** Human-readable label for the saved heatmap. Defaults to the URL when omitted.* @maxLength 400