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(customer-analytics): keep inline edit actions visible (#100523)

Arthur Moreira de Deus7f8b8b790000
diff --git a/docs/internal/customer-analytics-accounts-table.md b/docs/internal/customer-analytics-accounts-table.md
index 605a1e6a4350..054f9aeeba5f 100644
--- a/docs/internal/customer-analytics-accounts-table.md
+++ b/docs/internal/customer-analytics-accounts-table.md
@@ -55,3 +55,5 @@ Automatic sizing uses the existing resized-table layout and does not change scro
The `ManyColumns` story in `AccountsTab.stories.tsx` covers six added custom properties alongside native and relationship columns.
Its browser assertions check content-dependent widths, the 200px cap, horizontal scrolling, and the row expansion control.
+At narrow widths, it also covers custom-property inline editing: the input fits the available column width, and Save and Cancel stay together below it when needed, aligned to the right.
+The row grows without widening the column.
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index bc7d055e7e89..66b743bb08db 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6961,9 +6961,9 @@ snapshots:
scenes-app-customer-analytics-accounts--feature-gate-off--light:
hash: v1.k794b7964.e8b91bf6a0dd1b5d31064f4cbb94e9791e999c210831c455a498d0c7cc7e6bbb.IkZPJrJz33sKS8zzKwoy8V3s0GvmKpe5EGYTCIljhLs
scenes-app-customer-analytics-accounts--many-columns--dark:
- hash: v1.k794b7964.bbcafae15f682dd892236c17af7ae5920df61f4a14f1c2b298977ba77b6bacb2.xumXP9yIhqUxrM69J_MjvUCNMHuL2PwIgLs3u3PbCP0
+ hash: v1.k794b7964.c4c14cff203abdcb043554c234992f8f9c5fd402593321ac273ed11f56008c87.jOW1vwhYZ7YROPN6kZEfuCAK_dMmpXqNPwQ5LoqE-z4
scenes-app-customer-analytics-accounts--many-columns--light:
- hash: v1.k794b7964.41369848fe476522e301d6e10665de13e88a1a8a64c4a17a2adc81306f24b64e.kaZ8ldUFXD5oEmnfoaB6ag8wg77wYPwSi0dCsHVX6Lk
+ hash: v1.k794b7964.1768294dde4750497834dd820aeafddb70f696feae609c2a3ea623dbfb34083b.pScO4R-ZrH5Rp71laUMaPLo9U97DBOyRnJVJesjRB4Q
scenes-app-customer-analytics-accounts--row-expanded-conversations--dark:
hash: v1.k794b7964.bd5d33f06635b1fa2ac401e370dfad9e7c125e349f41bd172cafb5e38aeab721.7jRlvWfxiKE6Dp9YRZQ9MWzbZlKypIJd7WQbE-Zscjw
scenes-app-customer-analytics-accounts--row-expanded-conversations--light:
diff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
index 12f45c8cf17a..75094100f99c 100644
--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md
+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
@@ -122,7 +122,7 @@ Operator sets honor each field's type because `accountsColumnConfigLogic` seeds
`accountsTableQuery.ts` translates all three filter kinds into typed query filters. The backend filters relationships through active assignments, native model or JSON fields directly, and custom properties through storage chosen from the definition type. Negative operators include accounts where the value is unset. Invalid native combinations and deleted or incompatible custom properties are omitted rather than changing query engines.
Custom property value suggestions load from `GET /api/projects/:team_id/custom_property_definitions/values/?key=<definition-id>&value=<search>`. Native account fields do not fetch suggestions.
-A custom-property column is editable unless its definition is canonical or has a data warehouse source. Workflow-referenced properties stay editable and show a warning that a future workflow run overwrites a manual value. `AccountsTable` passes this condition as `isEditable` to `CustomPropertyCell`. Editable cells show a pencil that replaces the rendered value with a compact, type-aware editor. Date and datetime properties use the Lemon Calendar picker and save from its Apply action. Link properties reject values outside HTTP and HTTPS before saving. `accountsLogic.updateAccountCustomProperty` writes through the generated custom-property-values endpoint, blocks duplicate writes, masks stale query data with a per-account override, refreshes the list and metrics, and clears the override after the next list response or a failed write. The event records only the display type, never the property name or value.
+A custom-property column is editable unless its definition is canonical or has a data warehouse source. Workflow-referenced properties stay editable and show a warning that a future workflow run overwrites a manual value. `AccountsTable` passes this condition as `isEditable` to `CustomPropertyCell`. Editable cells show a pencil that replaces the rendered value with a compact, type-aware editor. In inline edit mode, the input fits the available column width. Save and Cancel stay together and wrap below the input when needed, aligned to the right. The row grows without widening the column. Date and datetime properties use the Lemon Calendar picker and save from its Apply action. Link properties reject values outside HTTP and HTTPS before saving. `accountsLogic.updateAccountCustomProperty` writes through the generated custom-property-values endpoint, blocks duplicate writes, masks stale query data with a per-account override, refreshes the list and metrics, and clears the override after the next list response or a failed write. The event records only the display type, never the property name or value.
**Overview tile math** (`accountsOverviewTilesLogic` / `AccountsOverviewTilesEditor`). A tile's metric is a discriminated union: `count`, the column aggregations `sum`/`avg`/`min`/`max`/`median`, and `count_threshold`. `tileQueryMetric` translates these into the typed `AccountsTableMetric` union. Column aggregations carry an optional `scale` multiplier, and threshold tiles translate into typed custom-property filters when clicked.
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
index baca22b947b0..740935594888 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx
@@ -463,6 +463,54 @@ export const ManyColumns: Story = {
}
scrollContainer.scrollLeft = 0
})
+
+ for (const definitionIndex of [2, 4]) {
+ const header = canvasElement
+ .querySelector(
+ `[data-attr="accounts-table-sort-${customPropertyAlias(ADDITIONAL_COLUMN_DEFINITIONS[definitionIndex].id)}"]`
+ )
+ ?.closest('th')
+ const cell = header?.closest('table')?.querySelector('tbody tr')?.children[header.cellIndex]
+ const editButton = cell?.querySelector<HTMLElement>('[data-attr="accounts-custom-property-value-edit"]')
+ if (!cell || !editButton) {
+ throw new Error('Editable custom property cell is missing')
+ }
+ const originalWidth = cell.getBoundingClientRect().width
+ await userEvent.click(editButton)
+ await waitFor(() => {
+ const input = cell.querySelector('[data-attr="accounts-custom-property-value-input"]')
+ const save = cell.querySelector('[data-attr="accounts-custom-property-value-save"]')
+ const cancel = cell.querySelector('[data-attr="accounts-custom-property-value-cancel"]')
+ if (!input || !save || !cancel) {
+ throw new Error('Inline editor controls are missing')
+ }
+ const cellBounds = cell.getBoundingClientRect()
+ for (const control of [input, save, cancel]) {
+ const bounds = control.getBoundingClientRect()
+ if (
+ bounds.left < cellBounds.left ||
+ bounds.right > cellBounds.right ||
+ bounds.top < cellBounds.top ||
+ bounds.bottom > cellBounds.bottom
+ ) {
+ throw new Error('Inline editor controls must stay inside the cell')
+ }
+ }
+ const inputBounds = input.getBoundingClientRect()
+ const saveBounds = save.getBoundingClientRect()
+ const cancelBounds = cancel.getBoundingClientRect()
+ if (saveBounds.top < inputBounds.bottom || saveBounds.top !== cancelBounds.top) {
+ throw new Error('Save and Cancel must wrap together below the input in narrow columns')
+ }
+ if (cancelBounds.right <= inputBounds.right) {
+ throw new Error('Save and Cancel must align to the right of the available cell space')
+ }
+ if (cellBounds.width !== originalWidth) {
+ throw new Error('Inline editing must not widen the column')
+ }
+ })
+ }
+ canvasElement.querySelector('[data-attr="accounts-custom-property-value-save"]')?.scrollIntoView()
},
}
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
index b1716ccdef59..65a77afc9592 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
@@ -513,7 +513,7 @@ function renderCustomPropertyEditor(
onClose={cancelEdit}
buttonProps={{
size: 'small',
- className: 'w-40',
+ className: 'w-full',
'data-attr': 'accounts-custom-property-value-input',
}}
/>
@@ -550,7 +550,7 @@ function renderCustomPropertyEditor(
? 'danger'
: 'default'
}
- className="w-40"
+ className="w-full"
data-attr="accounts-custom-property-value-input"
/>
)
@@ -599,13 +599,15 @@ function CustomPropertyCell({
if (isEditing && accountId) {
return (
<div
- className={`inline-flex w-fit items-center ${definition.display_type === 'boolean' ? 'gap-2' : 'gap-1'}`}
+ className={`inline-flex w-fit min-w-0 max-w-full flex-wrap items-center ${definition.display_type === 'boolean' ? 'gap-2' : 'gap-1'}`}
>
- <div className={definition.display_type === 'boolean' ? undefined : 'w-40'}>
+ <div className={definition.display_type === 'boolean' ? undefined : 'w-40 min-w-0 max-w-full'}>
{renderCustomPropertyEditor(draft, definition, setDraft, saveValue, () => setIsEditing(false))}
</div>
{!isDatePicker && (
- <>
+ <div
+ className={`ml-auto flex shrink-0 items-center ${definition.display_type === 'boolean' ? 'gap-2' : 'gap-1'}`}
+ >
<LemonButton
type="primary"
size="xsmall"
@@ -629,7 +631,7 @@ function CustomPropertyCell({
onClick={() => setIsEditing(false)}
data-attr="accounts-custom-property-value-cancel"
/>
- </>
+ </div>
)}
</div>
)