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): simplify account tag controls (#104692)

Arthur Moreira de Deus638b915ec53b
diff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
index 87d3c0f75504..09b77bffa491 100644
--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md
+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md
@@ -101,9 +101,9 @@ The server selects the first valid hostname from:
`AccountsTableRow.logoDomain` carries the resolved hostname. The browser loads image bytes from `GET /api/projects/@current/accounts/icon/?domain=…&theme=…`. The action proxies logo.dev through `CDPIconsService`, which enforces per-team and instance budgets and caches misses for 24 hours. Keep logo.dev behind this proxy so the browser does not send customer domains to a third party or require another CSP origin.
-The `tag_names` cell is editable in place: `TagsCell` renders the editable `ObjectTags` variant (available tags from `tagsModel`), saving through the account PATCH via `accountsLogic.updateAccountTags` — optimistic per-account override (`tagOverrides`, masking the stale fetched cell like `relationshipOverrides`), debounced full-list PATCH (`TAGS_SAVE_DEBOUNCE_MS`, since `ObjectTags` fires per added/removed tag), `savingTags` guard, revert + toast + captured exception on failure. Clicking a tag in the cell adds it to the tags filter, compounding with tags already filtered (`addTagToFilter` — dedupes, and reports through `reportFilterChange('tag')` like the filter control).
+The `tag_names` cell is editable in place: `TagsCell` renders the editable `ObjectTags` variant and loads available tags from `tagsModel` when editing starts. The All tags filter and account detail sidebar use the same lazy-load behavior. Tag edits save through the account PATCH via `accountsLogic.updateAccountTags` — optimistic per-account override (`tagOverrides`, masking the stale fetched cell like `relationshipOverrides`), debounced full-list PATCH (`TAGS_SAVE_DEBOUNCE_MS`, since `ObjectTags` fires per added/removed tag), `savingTags` guard, revert + toast + captured exception on failure. Clicking a tag in the cell adds it to the tags filter, compounding with tags already filtered (`addTagToFilter` — dedupes, and reports through `reportFilterChange('tag')` like the filter control).
-Default columns: `name`, `tag_names`, `notebook_count`, plus one relationship column per team definition. `ACCOUNTS_DEFAULT_COLUMNS` is the stored-state seed name, but execution is fully typed. Once `loadRelationshipDefinitionsSuccess` fires, still-default columns upgrade to `defaultSelectColumns`. The name column is force-kept because removing it breaks identity, scroll, and role edits. `buildAccountColumnGroups` only offers typed account fields, tags, notes, relationships, and custom properties. Warehouse-backed columns, arbitrary lazy joins, and SQL expressions are unsupported. Older saved expressions are omitted from the query plan.
+Default columns: `name`, `tag_names`, `notebook_count`, plus one relationship column per team definition. `ACCOUNTS_DEFAULT_COLUMNS` is the stored-state seed name, but execution is fully typed. Once `loadRelationshipDefinitionsSuccess` fires, still-default columns upgrade to `defaultSelectColumns`. The name column is force-kept because removing it breaks identity, scroll, and role edits. `buildAccountColumnGroups` offers tags as one `tags` option with the `tags` type under Account properties instead of exposing the raw tags join fields. Restoring a saved view maps the old raw `names` expression to this column and removes the unsupported raw `account_id` expression. It also offers typed account fields, notes, relationships, and custom properties. Warehouse-backed columns, arbitrary lazy joins, and SQL expressions are unsupported. Older saved expressions are omitted from the query plan.
**Custom property columns** surface the team's `CustomPropertyDefinition`s (loaded in `accountsColumnConfigLogic` via the generated `customPropertyDefinitionsList`) as a "Custom properties" picker group. Each is selected as ``accounts.custom_properties.values.`<definition-id>` AS cp_<id>`` — a JSON dot-access through the `custom_properties` lazy join on `system.accounts` (backed by the `customer_analytics_custompropertyvalue` EAV table; one JOIN regardless of column count). Because the alias is an opaque `cp_<id>`, every label-bearing surface must resolve it back via the `aliasToDefinition` selector: the table header (`useContextColumns` in `AccountsTable`) and the configurator's "Visible columns" list (`SelectedAccountColumn`). Cells render by display type (`CustomPropertyCell`: date→`TZLabel`, boolean→icon, link→new-tab URL, select→`LemonColorGlyph` + label, numeric→`formatCustomPropertyValue`). Server-side sorting uses the typed custom property reference, and the backend chooses the value column from the definition's display type. The stored sort state (URL hash, saved views) keeps the clean column name. Numeric custom properties are also selectable in the **overview tiles** sum/avg/min/max/median/threshold pickers — `numericColumnOptions` recognizes the display type and wraps the value in `toFloatOrNull(...)` the same way so aggregation is numeric.
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
index cf5ead14b3cd..6d82c6acd66f 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsColumnConfigurator.tsx
@@ -36,6 +36,10 @@ import {
} from './accountsColumnConfigLogic'
import { accountsViewsLogic } from './accountsViewsLogic'
+const ACCOUNT_COLUMN_LABELS: Record<string, string> = {
+ tag_names: 'tags',
+}
+
export function AccountsColumnConfigurator(): JSX.Element {
const { columnConfiguratorVisible } = useValues(accountsColumnConfigLogic)
const { showColumnConfigurator, hideColumnConfigurator } = useActions(accountsColumnConfigLogic)
@@ -278,7 +282,11 @@ function SelectedAccountColumn({
const alias = extractDisplayLabel(column)
// Custom-property and relationship columns are aliased to opaque `cp_<id>` / `rel_<id>`
// (or legacy role keys); show the definition name instead.
- const label = aliasToDefinition[alias]?.name ?? aliasToRelationshipDefinition[alias]?.name ?? alias
+ const label =
+ aliasToDefinition[alias]?.name ??
+ aliasToRelationshipDefinition[alias]?.name ??
+ ACCOUNT_COLUMN_LABELS[alias] ??
+ alias
// `name` carries the row identity (account id) and external_id for the
// Account cell — removing it would break row expansion and role updates.
const isMandatory = column === ACCOUNTS_NAME_COLUMN
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.test.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.test.tsx
index a4a5b07f7505..92ec798c5fe8 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.test.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.test.tsx
@@ -1,6 +1,6 @@
import '@testing-library/jest-dom'
-import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { BindLogic, Provider } from 'kea'
import { userLogic } from 'scenes/userLogic'
@@ -19,13 +19,15 @@ import { AccountsTabFilters } from './AccountsTabFilters'
describe('AccountsTabFilters', () => {
let logic: ReturnType<typeof accountsLogic.build>
let savedViews: ColumnConfigurationApi[]
+ let tagsRequest: jest.Mock
beforeEach(() => {
savedViews = []
+ tagsRequest = jest.fn(() => [200, ['enterprise']])
useMocks({
get: {
'/api/organizations/:organization_id/members/': () => [200, { results: [] }],
- '/api/projects/:team_id/tags': () => [200, []],
+ '/api/projects/:team_id/tags': tagsRequest,
'/api/projects/:team_id/column_configurations': () => [
200,
{ count: savedViews.length, results: savedViews },
@@ -99,6 +101,16 @@ describe('AccountsTabFilters', () => {
expect(screen.getByDisplayValue('Shared accounts')).toBeInTheDocument()
})
+ it('loads existing tags when the tag filter opens', async () => {
+ renderFilters()
+
+ fireEvent.click(screen.getByText('All tags'))
+ await waitFor(() => expect(tagsRequest).toHaveBeenCalled())
+ fireEvent.focus(screen.getByPlaceholderText('Select or type tags...'))
+
+ expect(await screen.findByText('enterprise')).toBeInTheDocument()
+ })
+
it('renders the "My accounts" checkbox', () => {
renderFilters()
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx
index 8c4a3796ea73..67a8f60b23c7 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx
@@ -39,7 +39,8 @@ export function AccountsTabFilters(): JSX.Element {
refresh,
reportFilterChange,
} = useActions(accountsLogic)
- const { tags: tagsAvailable } = useValues(tagsModel)
+ const { tags: tagsAvailable, tagsLoading } = useValues(tagsModel)
+ const { loadTagsIfNeeded } = useActions(tagsModel)
const { customPropertyTaxonomicOptions, relationshipTaxonomicOptions } = useValues(accountsColumnConfigLogic)
const tagsButtonLabel =
@@ -76,6 +77,7 @@ export function AccountsTabFilters(): JSX.Element {
<div className="flex flex-wrap gap-2 items-center">
<LemonDropdown
closeOnClickInside={false}
+ onVisibilityChange={(open) => open && loadTagsIfNeeded()}
overlay={
<div className="p-2 min-w-64">
<LemonInputSelect
@@ -83,6 +85,7 @@ export function AccountsTabFilters(): JSX.Element {
allowCustomValues
value={tagsFilter}
options={(tagsAvailable || []).map((t: string) => ({ key: t, label: t }))}
+ loading={tagsLoading}
onChange={(tags) => {
setTagsFilter(tags)
reportFilterChange('tag')
diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
index 65a77afc9592..296b0a5d46ae 100644
--- a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx
@@ -107,7 +107,8 @@ function NameCell({ record }: { record: unknown }): JSX.Element {
function TagsCell({ record }: { record: unknown }): JSX.Element {
const { isTagsSaving, tagOverrides } = useValues(accountsLogic)
const { updateAccountTags, addTagToFilter } = useActions(accountsLogic)
- const { tags: tagsAvailable } = useValues(tagsModel)
+ const { tags: tagsAvailable, tagsLoading } = useValues(tagsModel)
+ const { loadTagsIfNeeded } = useActions(tagsModel)
const getCell = useGetCell()
const raw = getCell(record, 'tag_names')
const cellTags = Array.isArray(raw) ? (raw.filter((t) => typeof t === 'string') as string[]) : []
@@ -120,8 +121,9 @@ function TagsCell({ record }: { record: unknown }): JSX.Element {
<ObjectTags
tags={tags}
onChange={(newTags) => updateAccountTags(accountId, newTags)}
+ onEdit={loadTagsIfNeeded}
onTagClick={addTagToFilter}
- saving={isTagsSaving(accountId)}
+ saving={isTagsSaving(accountId) || tagsLoading}
tagsAvailable={(tagsAvailable || []).filter((tag) => !tags.includes(tag))}
data-attr="accounts-tags-cell"
/>
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
index 3ea65539ff72..3cee3143af1f 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.test.ts
@@ -7,11 +7,13 @@ import type {
} from 'products/customer_analytics/frontend/generated/api.schemas'
import {
+ ACCOUNTS_TAGS_COLUMN,
AccountColumnGroup,
applyColumnDisplayToSelect,
buildAccountColumnGroups,
customPropertyAlias,
filterColumnOptions,
+ normalizeAccountColumns,
relationshipAlias,
roleKeyToDefinitionMap,
translateSelectColumns,
@@ -113,13 +115,18 @@ describe('accountsColumnConfigLogic column groups and translation', () => {
expect(buildAccountColumnGroups({}).map((group) => group.key)).not.toContain('relationships')
})
- it('only offers Postgres-backed groups', () => {
+ it('only offers Postgres-backed groups and nests tags under account properties', () => {
const table = (name: string, fields: Record<string, Record<string, unknown>>): DatabaseSchemaTable =>
({ name, fields }) as unknown as DatabaseSchemaTable
const allTablesMap = {
'system.accounts': table('accounts', {
name: { name: 'name', type: 'string', hogql_value: 'name' },
- tags: { name: 'tags', type: 'lazy_table', table: 'account_tags', fields: ['names'] },
+ tags: {
+ name: 'tags',
+ type: 'lazy_table',
+ table: 'account_tags',
+ fields: ['account_id', 'names'],
+ },
notebooks: {
name: 'notebooks',
type: 'lazy_table',
@@ -133,7 +140,10 @@ describe('accountsColumnConfigLogic column groups and translation', () => {
fields: ['score'],
},
}),
- account_tags: table('account_tags', { names: { name: 'names', type: 'array' } }),
+ account_tags: table('account_tags', {
+ account_id: { name: 'account_id', type: 'uuid' },
+ names: { name: 'names', type: 'array' },
+ }),
account_notebooks: table('account_notebooks', { count: { name: 'count', type: 'integer' } }),
account_enrichment: table('account_enrichment', { score: { name: 'score', type: 'float' } }),
'warehouse.accounts': table('warehouse.accounts', { tier: { name: 'tier', type: 'string' } }),
@@ -141,17 +151,29 @@ describe('accountsColumnConfigLogic column groups and translation', () => {
const customDefinition = definition('11111111-2222-3333-4444-555555555555', 'Plan')
const relationship = relationshipDefinition('66666666-7777-8888-9999-000000000000', 'CSM')
- const keys = buildAccountColumnGroups(allTablesMap, [customDefinition], [relationship]).map(
- (group) => group.key
- )
+ const groups = buildAccountColumnGroups(allTablesMap, [customDefinition], [relationship])
- expect(keys).toEqual([
+ expect(groups.map((group) => group.key)).toEqual([
'account_properties',
'relationships',
'custom_properties',
- 'accounts.tags',
'accounts.notebooks',
])
+ expect(groups.find((group) => group.key === 'account_properties')?.options).toContainEqual({
+ name: 'tags',
+ expression: ACCOUNTS_TAGS_COLUMN,
+ type: 'tags',
+ })
+ })
+
+ it('normalizes saved raw tag columns to the supported tags column', () => {
+ expect(
+ normalizeAccountColumns([
+ 'accounts.tags.account_id AS account_id',
+ 'accounts.tags.names AS names',
+ ACCOUNTS_TAGS_COLUMN,
+ ])
+ ).toEqual(['name', ACCOUNTS_TAGS_COLUMN])
})
it('translateSelectColumns resolves legacy roles through the lazy join and drops unmatched ones', () => {
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
index e8b8e294db66..e5ff5f842bed 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts
@@ -24,6 +24,9 @@ import type {
import { ACCOUNT_FIELD_TAXONOMIC_OPTIONS, propertyTypeForDisplayType } from './accountsPropertyFilters'
export const ACCOUNTS_NAME_COLUMN = 'name'
+export const ACCOUNTS_TAGS_COLUMN = 'accounts.tags.names AS tag_names'
+const LEGACY_ACCOUNTS_TAGS_NAME_COLUMN = 'accounts.tags.names AS names'
+const LEGACY_ACCOUNTS_TAGS_ACCOUNT_ID_COLUMN = 'accounts.tags.account_id AS account_id'
// Legacy role names remain serialized for saved views and shared URLs.
// Query planning maps them to seeded relationship definitions.
@@ -41,12 +44,24 @@ export function isLegacyRoleColumn(column: string): column is AccountRoleKey {
export const ACCOUNTS_DEFAULT_COLUMNS: string[] = [
ACCOUNTS_NAME_COLUMN,
- 'accounts.tags.names AS tag_names',
+ ACCOUNTS_TAGS_COLUMN,
'accounts.notebooks.count AS notebook_count',
]
-function ensureNameColumn(columns: string[]): string[] {
- return columns.includes(ACCOUNTS_NAME_COLUMN) ? columns : [ACCOUNTS_NAME_COLUMN, ...columns]
+export function normalizeAccountColumns(columns: string[]): string[] {
+ const normalizedColumns = columns.flatMap((column) => {
+ if (column === LEGACY_ACCOUNTS_TAGS_NAME_COLUMN) {
+ return [ACCOUNTS_TAGS_COLUMN]
+ }
+ if (column === LEGACY_ACCOUNTS_TAGS_ACCOUNT_ID_COLUMN) {
+ return []
+ }
+ return [column]
+ })
+ const deduplicatedColumns = [...new Set(normalizedColumns)]
+ return deduplicatedColumns.includes(ACCOUNTS_NAME_COLUMN)
+ ? deduplicatedColumns
+ : [ACCOUNTS_NAME_COLUMN, ...deduplicatedColumns]
}
export function diffColumnConfiguration(
@@ -181,7 +196,7 @@ const JOIN_FIELD_TYPES = new Set(['lazy_table', 'virtual_table', 'view', 'materi
// Definition-driven groups replace these raw joins.
const HIDDEN_JOIN_GROUPS = new Set(['custom_properties', 'relationships'])
-const POSTGRES_BACKED_JOIN_GROUPS = new Set(['tags', 'notebooks'])
+const POSTGRES_BACKED_JOIN_GROUPS = new Set(['notebooks'])
const POSTGRES_BACKED_ACCOUNT_FIELDS = new Set<string>(Object.values(AccountsTableAccountField))
const SKIPPED_DIRECT_FIELD_TYPES = new Set([
@@ -253,10 +268,18 @@ export function buildAccountColumnGroups(
if (accountsTable) {
for (const field of Object.values(accountsTable.fields)) {
if (JOIN_FIELD_TYPES.has(field.type)) {
+ const joinedTable = field.table ? allTablesMap?.[field.table] : undefined
+ if (field.name === 'tags') {
+ directOptions.push({
+ name: 'tags',
+ expression: ACCOUNTS_TAGS_COLUMN,
+ type: 'tags',
+ })
+ continue
+ }
if (HIDDEN_JOIN_GROUPS.has(field.name) || !POSTGRES_BACKED_JOIN_GROUPS.has(field.name)) {
continue
}
- const joinedTable = field.table ? allTablesMap?.[field.table] : undefined
addJoinGroup(field.name, joinOptionsFromSchema(field, joinedTable))
continue
}
@@ -547,9 +570,9 @@ export const accountsColumnConfigLogic = kea<accountsColumnConfigLogicType>([
selectColumns: [
[...ACCOUNTS_DEFAULT_COLUMNS],
{
- setSelectColumns: (_, { columns }) => ensureNameColumn(columns),
- setDefaultSelectColumns: (_, { columns }) => ensureNameColumn(columns),
- restoreSelectColumns: (_, { columns }) => ensureNameColumn(columns),
+ setSelectColumns: (_, { columns }) => normalizeAccountColumns(columns),
+ setDefaultSelectColumns: (_, { columns }) => normalizeAccountColumns(columns),
+ restoreSelectColumns: (_, { columns }) => normalizeAccountColumns(columns),
selectColumn: (state, { column }) => (state.includes(column) ? state : [...state, column]),
unselectColumn: (state, { column }) =>
column === ACCOUNTS_NAME_COLUMN ? state : state.filter((c) => c !== column),
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsViewState.ts b/products/customer_analytics/frontend/components/Accounts/accountsViewState.ts
index c367840530c3..b18635eb0135 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsViewState.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsViewState.ts
@@ -7,7 +7,11 @@ import {
import { ColumnConfigurationApi } from 'products/product_analytics/frontend/generated/api.schemas'
-import { ACCOUNTS_DEFAULT_COLUMNS, AccountColumnDisplayState } from './accountsColumnConfigLogic'
+import {
+ ACCOUNTS_DEFAULT_COLUMNS,
+ AccountColumnDisplayState,
+ normalizeAccountColumns,
+} from './accountsColumnConfigLogic'
import type { AccountSortOrder, RoleFilterValue } from './accountsLogic'
import type { AccountsOverviewTile, TileFilter } from './accountsOverviewTilesLogic'
import type { AccountFilter } from './accountsPropertyFilters'
@@ -199,7 +203,9 @@ export function deserializeAccountsView(view: Partial<ColumnConfigurationApi>):
) as AccountsViewProperties
return {
- columns: view.columns && view.columns.length > 0 ? view.columns : [...ACCOUNTS_DEFAULT_COLUMNS],
+ columns: normalizeAccountColumns(
+ view.columns && view.columns.length > 0 ? view.columns : [...ACCOUNTS_DEFAULT_COLUMNS]
+ ),
sortOrder: orderByToSortOrder(view.order_by),
filters: {
search: rawFilters.search ?? '',
diff --git a/products/customer_analytics/frontend/components/Accounts/accountsViewsLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsViewsLogic.test.ts
index aa527a1d32d8..c08a88408fe4 100644
--- a/products/customer_analytics/frontend/components/Accounts/accountsViewsLogic.test.ts
+++ b/products/customer_analytics/frontend/components/Accounts/accountsViewsLogic.test.ts
@@ -14,7 +14,7 @@ import { initKeaTests } from '~/test/init'
import { ColumnConfigurationApi } from 'products/product_analytics/frontend/generated/api.schemas'
import { customerAnalyticsSceneLogic } from '../../customerAnalyticsSceneLogic'
-import { ACCOUNTS_DEFAULT_COLUMNS, accountsColumnConfigLogic } from './accountsColumnConfigLogic'
+import { ACCOUNTS_DEFAULT_COLUMNS, ACCOUNTS_TAGS_COLUMN, accountsColumnConfigLogic } from './accountsColumnConfigLogic'
import { accountsLogic, SEARCH_DEBOUNCE_MS } from './accountsLogic'
import { accountsOverviewTilesLogic } from './accountsOverviewTilesLogic'
import { accountsViewsLogic } from './accountsViewsLogic'
@@ -282,6 +282,20 @@ describe('accountsViewsLogic', () => {
expect(source.filters).toContainEqual({ kind: 'assigned' })
})
+ it('does not mark a saved view dirty when normalizing legacy tag columns', async () => {
+ const view = buildView({
+ columns: ['accounts.tags.account_id AS account_id', 'accounts.tags.names AS names'],
+ })
+ useMocks({ get: { '/api/projects/:team_id/column_configurations/': { count: 1, results: [view] } } })
+ mountAll()
+ await expectLogic(logic).toDispatchActions(['loadViewsSuccess'])
+
+ await expectLogic(logic, () => logic.actions.applyView(view)).toFinishAllListeners()
+
+ expect(accountsColumnConfigLogic.values.selectColumns).toEqual(['name', ACCOUNTS_TAGS_COLUMN])
+ expect(logic.values.isDirty).toBe(false)
+ })
+
it('keeps column widths when the selected view changes', async () => {
useMocks({ get: { '/api/projects/:team_id/column_configurations/': { count: 0, results: [] } } })
mountAll()
diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx
index 76e18de6c367..f3eb7f671426 100644
--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx
+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx
@@ -13,7 +13,8 @@ import { customerAnalyticsAccountSceneLogic } from './customerAnalyticsAccountSc
export function AccountSidebar({ account }: { account: AccountApi }): JSX.Element {
const { tagsSaving } = useValues(customerAnalyticsAccountSceneLogic)
const { updateTags } = useActions(customerAnalyticsAccountSceneLogic)
- const { tags: tagsAvailable } = useValues(tagsModel)
+ const { tags: tagsAvailable, tagsLoading } = useValues(tagsModel)
+ const { loadTagsIfNeeded } = useActions(tagsModel)
return (
<aside
@@ -25,7 +26,8 @@ export function AccountSidebar({ account }: { account: AccountApi }): JSX.Elemen
<ObjectTags
tags={account.tags ?? []}
onChange={updateTags}
- saving={tagsSaving}
+ onEdit={loadTagsIfNeeded}
+ saving={tagsSaving || tagsLoading}
tagsAvailable={tagsAvailable}
wrap
/>