: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
feat(customer-analytics): expand pinned properties in account rows (#97976)
Arthur Moreira de Deus576a15d9a937
diff --git a/docs/internal/customer-analytics-account-sidebar.md b/docs/internal/customer-analytics-account-sidebar.mdindex 89472e0d60b4..477f27a3d2d6 100644--- a/docs/internal/customer-analytics-account-sidebar.md+++ b/docs/internal/customer-analytics-account-sidebar.md@@ -1,7 +1,20 @@# Account detail sidebar propertiesEach user can pin up to 50 account custom properties and relationships in their project.-The Pin properties button and the Properties gear open the same ordered selector.+When `customer-analytics-account-scene` is enabled, the Accounts list also shows these pins in expanded rows.+The left arrow expands or collapses the row. The account name opens account details.+Expanded pins use the same Properties section and editable fields as the account sidebar.+They follow the saved order and wrap horizontally within the table container.+Each property uses its content width, up to 16rem, with a 1rem gap between properties. An open editor uses the full 16rem width.+Field headers reserve equal height with or without an edit button, so read-only and editable values align.+Fixed-layout tables reserve 3rem for the expansion button so the icon does not get clipped.+If no properties are pinned, the Pin properties button opens the selector in place.+Only expanded accounts load property values. The list does not load the legacy detail tabs while this flag is enabled.+With the flag disabled, the existing row expansion and account-name behavior remain unchanged.++The Pin properties button and the Properties gear open the same ordered selector in both views.+In expanded rows, the gear sits beside the Properties label. In the sidebar, it stays right-aligned.+Only the panel that opened the selector renders it. Saving pins updates every mounted panel in the project.Dragging entries changes their saved display order. The sidebar scrolls independently ofthe main account content on wide account scenes.@@ -32,12 +45,13 @@ Clearing every holder requires confirmation. Failed saves keep the editor open;partial relationship failure, the sidebar reloads current assignments so a retry usesthe latest state.-Saved values report the same product events as the account list.-Their source is the account sidebar.+`AccountPinnedPropertiesPanel` connects both views to the same configuration, loading states, and editors.+`AccountPropertyField` renders each label, source icon, value, and editor.Pin preferences belong to `accountSidebarConfigLogic`, keyed by project. Live values andediting state belong to `accountSidebarPropertiesLogic`, keyed by project and account.The Relationships tab and account list refresh after assignment changes.-Successful sidebar writes emit the existing custom-property and role-assignment events-with `source: account_sidebar`. Custom-property events exclude property names and values;+Successful writes emit the existing custom-property and role-assignment events.+The source is `account_sidebar` for sidebar edits and `list_expansion` for expanded-list edits.+Custom-property events exclude property names and values;role-assignment events retain the existing role metadata and internal-user identifiers.diff --git a/docs/internal/customer-analytics-property-editors.md b/docs/internal/customer-analytics-property-editors.mdindex 082b93093caf..25da42b40ad6 100644--- a/docs/internal/customer-analytics-property-editors.md+++ b/docs/internal/customer-analytics-property-editors.md@@ -14,7 +14,7 @@ Omitting `pinned_properties` from a PATCH toselection. An explicit empty list clears it.API keys and OAuth tokens require `account:write` to change pins. Session-authenticated-viewers can personalize their own sidebar without permission to edit account values.+viewers can personalize their pins from the sidebar or expanded account rows without permission to edit account values.A failed save keeps the pin selector open with the attempted selection and order.The user can retry the save or remove a rejected property.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex a85c4723fd7a..4aa741d3db9d 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4656,6 +4656,10 @@ snapshots:hash: v1.k794b7964.acb1ef548c7f4a9372684ea9ec9657eeaaa3038fb575b48a45ce1af5a1de9024.KpfJthKxhu23FN2xjxl74ISvFTJWZEnUqNbFikwcYmwlemon-ui-lemon-table--with-expandable-rows--light:hash: v1.k794b7964.8cd6eea61d51b5b25421bede467e72052a4ceffbbc56a88771a970060e154022.wJr9J1IR5wSwCVJO0l3-jw0EmUSkqiwRKN-KpmpAmP8+ lemon-ui-lemon-table--with-fixed-layout-expandable-rows--dark:+ hash: v1.k794b7964.7e47184e00899246165116ef59ff21bceb953fdc7ca22ed4f192856ff0cac525.CFvDNgFtoFrJRfXqhcGJyIUjHYW_9pCFqfdyEHoXiuI+ lemon-ui-lemon-table--with-fixed-layout-expandable-rows--light:+ hash: v1.k794b7964.0544e7ec313bac1e95351cc509fd3f0e6f3b1d02366509a5f57a79889119a12c.yZJV-oUAz9uPbyecimRwUV5D46_OKfgY06y81YeeBKMlemon-ui-lemon-table--with-footer--dark:hash: v1.k794b7964.5ba8ce5dad67267240e741e49216107f6d2f7ce432b6d3c90268f2167a6a4c45.8r05jXH-YFCMPSj3FD6tHUc_Pfd6-85cXrHmTgU2kFolemon-ui-lemon-table--with-footer--light:@@ -6569,29 +6573,29 @@ snapshots:scenes-app-customer-analytics-account-detail--narrow--light:hash: v1.k794b7964.5a6763d49a273274f686f1517da9d2ba4af64b5be6897a9886addc04f429c209.JZ6O0iGKO-5AKZyg0XnVZ8JoOZ2-Jg4i9E746aSUm2Iscenes-app-customer-analytics-account-detail--pinned-properties--dark:- hash: v1.k794b7964.c07338213b06adf9bfd4b50f3ffa1a453bd341f09873f555462fe342347e3f00.8fzRLH13b5ApNO_5iC6HUegL5AWjTd_keBTI7hxjQaQ+ hash: v1.k794b7964.d9fbbd997fdf7c707918d0833d027023c6ffed3c9c18d1f313f36e6527b6ec38.Zf5I4t3cPK_y2k_-g3plUN06StdKyOFMPugt6m-pze4scenes-app-customer-analytics-account-detail--pinned-properties--light:- hash: v1.k794b7964.339c333ebc1367f2084c3e1f5210a887499307f0794c8ad1bd62fe85aaecdfc7.0rEF00np1G0v1HBOY0-dAEWIKhrvy8AduFWiy7DvLnc+ hash: v1.k794b7964.6880f033be7477a6cd253d31f1ccf452e079c4a3e116ef79f97cb400e319d5ed.NjlB4SZcP9qcG4uR8zI9Z2xnsnQ_UA6lIIFUeHWXI90scenes-app-customer-analytics-account-detail--pinned-properties-narrow--dark:hash: v1.k794b7964.ff9da4647c64580046ded4d93bfd5d1f5b9ddeb91afa106e89b290b1294caba3.v7FVsOduvBV8A7I35N0H0rNRbTs70559gvkezl-TZJsscenes-app-customer-analytics-account-detail--pinned-properties-narrow--light:hash: v1.k794b7964.2abb48fdc076ac41b8fc614e2917b8eb5075b0f88d3d0fc904eaab2c97a2eca0.UrfORDRAfYTngPUcDgRb8nS6pT4ExcEp0HmF9kD7zf0scenes-app-customer-analytics-account-detail-property-sidebar--custom-property-editors--dark:- hash: v1.k794b7964.66592dcf1b3fd0392d3fb40b6137fe122b85b735099f7b073568caa1b7556210.EcnIneYAPaWxcrA3krEwqQ3-1VM66r-alaQvyVFbRxc+ hash: v1.k794b7964.caefec23d66985f72f6eb40a23370ec4bf1701b9b6cfccd2a4b2b09cc9c1606f.lJ1UWZ6LkZI-k4XJw5UtuIJx1m5tWlMyvgoPlQH2L-gscenes-app-customer-analytics-account-detail-property-sidebar--custom-property-editors--light:- hash: v1.k794b7964.03e50dbd07b401ac7c838fc66a46e21d5e570f9250a60ef0a7eafa80b6c366be.yq0aD06ESQqYG8filudQGPguWppxOS74yM0broHj3zM+ hash: v1.k794b7964.13349e10d250d03add8a7d158b17eb227b77ddbd707e1838a9f5d16bdef134b9.TiZWT2QRZR-ewQ02sSeUk621TZPxw6rN_CfBE64JkU4scenes-app-customer-analytics-account-detail-property-sidebar--date-and-datetime-editors--dark:- hash: v1.k794b7964.15ba9785e2a6635181b7354b217d53d4ae05cc2db587671341defcba11f73def.4H1fw_nmfXD5eT4m5j-b05td3b9G5C6v9gUZbaMCRDU+ hash: v1.k794b7964.0b7233d427227d6ac680fcaaf14094654f67ae1a49bb440acf8d6959af7da28c._XhZ8Ayc2oLdVYGV-U_HxrSS0rBz-6MoBrSk9Ta2WbQscenes-app-customer-analytics-account-detail-property-sidebar--date-and-datetime-editors--light:- hash: v1.k794b7964.34b994fa9a3b92bb93f70bbcd7f95c6410187da93539e4ff5c9834ffaa6618e7.Fvdistl0g6mQAeJ9qgXVqZWJmMSUopy5YEBZTr7VAW4+ hash: v1.k794b7964.ae1b17a3f9d201114d3fef4afea9b48539aa0a9ff892955d8a6e3de17a78dea4.r6oqc0crE66PQXXwXk6ylf9lnc02y8jgSTBkSLUuFrMscenes-app-customer-analytics-account-detail-property-sidebar--empty--dark:hash: v1.k794b7964.3f250e8e47cb5e0d5fd6aba1b4c57dc3978db9f296a093e53c7b46fa6ca93528.ZsLhX7VF2gO8fS9hbGyCbahwLIVa-GP5EkJI1ij-ToQscenes-app-customer-analytics-account-detail-property-sidebar--empty--light:hash: v1.k794b7964.80932bda346697628be7627a1729c3fe6a5c860637dc9626bae39febdc22d3f5.tl_7hj4nr98S-dkzOcAIA7Cs4z6guQG7lR1IvbzsJgQscenes-app-customer-analytics-account-detail-property-sidebar--filled-and-scrollable--dark:- hash: v1.k794b7964.8aa0fb46f5b5fe78831081935412d41f180d6c1d7b1c82254507616a32e956c8.FkD1WwJOeWbl6OhgTd4eM3RsxATvgSfAqZ2Pa2XpugU+ hash: v1.k794b7964.b3012fb48d756b957157e313e13bde44fc1eb969b299474e1d5636e6bc7a99fa.fVSUkNrRbGB6j_ZFxchCIRcmqo4YLFzlG9AIfCrDgFoscenes-app-customer-analytics-account-detail-property-sidebar--filled-and-scrollable--light:- hash: v1.k794b7964.8cfa7db1f6d44e6d4b40f72cf335ffb24c3d9229ffbc9d2f45fbef65f4015d1a.VyzZd3tKHtaBr94myujgWZac0OaK0TX88AqoIvfdUXg+ hash: v1.k794b7964.facb96a5638e0e4ae76a5a784c423c78f58112ce0041cdd9ed2d2a356a113639.4LAw-Ryskom4ZPMds98pToXz2a0AWkzBDjRT3FhxZHkscenes-app-customer-analytics-account-detail-property-sidebar--pin-and-reorder--dark:hash: v1.k794b7964.ae32ab54e49606fc28e9a68b1274acc5193d58e55a144e66a36de73ed5352687.lFgL26WepIZ4NNnjQP38vqOEAleJXw1HwqLgjJqSvi4scenes-app-customer-analytics-account-detail-property-sidebar--pin-and-reorder--light:@@ -6601,45 +6605,61 @@ snapshots:scenes-app-customer-analytics-account-detail-property-sidebar--pin-limit-reached--light:hash: v1.k794b7964.81d64cf5202b63aad63a21e1f49fd7d1a16dbdc643678482ffb88b283b718d3d.59FqoIvlL2QE-juvVuI1KNGT_iFCHvAyttZYBDXWpb8scenes-app-customer-analytics-account-detail-property-sidebar--relationship-editors--dark:- hash: v1.k794b7964.1eb38510939dfa28bcf6cafc8a809d5038528955c71bfe4016173727a3a248d4.IfHF45YAUohDOAmlUVS7euQgkjeEwYHEU_fQ-SWivQ4+ hash: v1.k794b7964.d40fa817713dd10abed32ed3192c3a4b77f6b4965aa08f22b5e0df956aae8aea.uOS17zi2Qakr6PZ0Wyqp_5GEI5fI0uGlz_kTxtZe4kMscenes-app-customer-analytics-account-detail-property-sidebar--relationship-editors--light:- hash: v1.k794b7964.8ae8988856cff9280a8c90da459c409ef2dfd83cb87745192a8aa5f6b49e6256.pmCK41cTE3iu_ERpqFCXqGCyM7CxnAtoAoClocqBFBc+ hash: v1.k794b7964.6a05a5185d65c3453772d59fc900639806645f2bed4312fae645c378b92434db.3oa4FH1trEpqenwjacxbL7ghR3_4phrO37CcwbJq4zwscenes-app-customer-analytics-accounts--default--dark:- hash: v1.k794b7964.97f0ca87971b15063d49547b9dcd6ac408805eeeba4818861c79efe4a00546bb.Beg7zqqVXErdSTxwwKNImW-swYpMUtoQYSdy1HMF6vw+ hash: v1.k794b7964.87b94a84ccaa2040f2a63a4e1cd35dd0c315d1d2b109373e999ab033095d9991.Z0zI1_Ksb54CS0M_eO3B_EaIXjiDdPDUAxp2G556P5oscenes-app-customer-analytics-accounts--default--light:- hash: v1.k794b7964.49e00fd16d847577e31f63f3fe3b52106ea3413984de498d94dee9fb4191dfab.Pyp8xV0Zulz2LZPD8BYBY2pYF8MiL_RUeyB95taWBAg+ hash: v1.k794b7964.b986d24c5b87d97314d1b6fcd605ef453d56ffef2c2f3d6408722db977cf1fb2.1CjtHSZqb1ZDLB_hE3PLlIdf4IE4oCpn_BhAJh_DsQsscenes-app-customer-analytics-accounts--empty--dark:- hash: v1.k794b7964.8bbfbb085c8371d1acc371ebb7486f5a1830933fd43ccc69c4616c03b405c49b.S-o-UavAzV6HKT4M9ngxzog4L8V2gjmO7hFD-IurEiM+ hash: v1.k794b7964.8fcd9fb5b85daa321159db0495f6eff17e81c41db13a132c6600506a88476f89.I6cRb24I_X1dd6XnkTh03BfpNuowY_Tl3phT9K4i_lcscenes-app-customer-analytics-accounts--empty--light:- hash: v1.k794b7964.2eae93b6c127e4d0067f328ee14b00febf2251ce1ea115823bda5c91c5d25d20.pprP1-oCTqN-0lKKKkrtrefqO6-JTmpeXBUr6uVnqBU+ hash: v1.k794b7964.3833ace8ef40228fe67853ed97f183807bdb64a2c28b750822d311d986ec9f6c.QsSmBvyfg2-9I9jdYbxvHC4o0cSuZFhnQHtIsRJ7Eekscenes-app-customer-analytics-accounts--feature-gate-off--dark:hash: v1.k794b7964.4b8d5226ee154debdf333ff93d65a90ca766bcb25951e1baf36affb8b84b548d.dWZSHssPc83RkHVE-JPJA562bJR7MUim2yfqhjfNE50scenes-app-customer-analytics-accounts--feature-gate-off--light:hash: v1.k794b7964.e8b91bf6a0dd1b5d31064f4cbb94e9791e999c210831c455a498d0c7cc7e6bbb.IkZPJrJz33sKS8zzKwoy8V3s0GvmKpe5EGYTCIljhLsscenes-app-customer-analytics-accounts--row-expanded-conversations--dark:- hash: v1.k794b7964.85d2156f037fbbef7b7bfd3a53243f586a1422255364fc20bb2fdf62833edf9e.UF17aYyH5Y3WjTM7h8mCURAt98oED9XQfhG1rEUzKOA+ hash: v1.k794b7964.8ff40502a6dee9453d8bdff2350aa96b20c7c241a7ce2d69325e2d0e754f4428.LP6kVjCyhWYU85XTY8Fi5v6H_pdS8hu27wxDUCv_yCcscenes-app-customer-analytics-accounts--row-expanded-conversations--light:- hash: v1.k794b7964.01ce8914a73199cd0cfd692b1dd35434f9be454be0f4903bb475bb8c271c84a8.T8R4tZv9tCGQa516kPRRLI8G0r5jL73o4HmrH2D7yoU+ hash: v1.k794b7964.f2d44fd0549e2fa8bbc1ebc0fa533c80681d59afaf2f5ee1c3d7ec9cdfa32d02.cTPXhB1CmxHFVvDo01-_QlU7FU2Fd_I_AntpUTtWdCkscenes-app-customer-analytics-accounts--row-expanded-empty--dark:- hash: v1.k794b7964.01f884cde35ce4f59e9629d063c25f7f55fe3f45e4be94fd9b176e80044a3692.cQ1evUe7hRE6uWypbH4hz-DgGoOf3ZvuZfrAaSI7wws+ hash: v1.k794b7964.29607bee93ae98e4333700dd5bdc02468aaa7962bd5e8c9c11c68a2fcecd0500.9NYrLmodwfzvPX32lADBb9E2Pt1Sd-aIyjaICjJzo7Iscenes-app-customer-analytics-accounts--row-expanded-empty--light:- hash: v1.k794b7964.4d3eb646bfc9fa9e2bfeca3c11c76014b1db431d4a47c42051ca250a78f36ea9.aN76eWjyfARC_7vbAdOaNwxiym8WhKu8zoHv7YY0DrU+ hash: v1.k794b7964.6cad6b9a256482bae27919396c1e0e220f91fe187a6c00863b66d57a05dacd47.p23fCm9EIYytbqGvqYkzHQrTxJQW_ZZjMoNUg6T3M6Mscenes-app-customer-analytics-accounts--row-expanded-feature-requests--dark:- hash: v1.k794b7964.700dd4b2db8d70887eb28b5f9f3249ed76a43eb285eee7cc44ad943b97dd2d62.VJaag8tyrF8wroT7lWR5RCcD_9O4FMtuqGHlsdYln8g+ hash: v1.k794b7964.22059f7f48b0b9d8f2239c5b39db812ca1fc4b96a2e1dd3819e9e28a782d6310.savfzCdHPDJXGsMCCJbm-aWLBnyjHQJ1UinQEyfmo8kscenes-app-customer-analytics-accounts--row-expanded-feature-requests--light:- hash: v1.k794b7964.f8f5f387b10f139ebd7d7d973fe357f09f627a0fadbde73d8cbf4d9c039ceb46.VAJxkZjd8iprsEbDq27oGm6IIjjt1Gkh8e-0mCw-S3I+ hash: v1.k794b7964.2379806be50888eaf2e0194d51772ef9c980b51e5daede8d1734cf21c181f972.wnpx0rEnz9_cGzxPKECx6PktPM06h9ulnrC2DLRKfFoscenes-app-customer-analytics-accounts--row-expanded-links-disabled--dark:- hash: v1.k794b7964.454674320a381f066455658873231ecef115a1f8ebd4fb28336dab458f16d5b3.dCE35U2jbl9_Wz4om921P9iXVi9gjq_itULyXutuIwE+ hash: v1.k794b7964.3f0b9cf7a5f73764b4255caeb9fd1408f3bebaded5ecc56f0b2c72622e62a85c.UYyJSPEbo6T_S585H9z27Kx4EizBtQXbvMB7Xv0l5gAscenes-app-customer-analytics-accounts--row-expanded-links-disabled--light:- hash: v1.k794b7964.1ded4377e2c911433fe7c7cad58d9dc5ca25048b64d3fef64eb6758928bf6d9c.q52r6GX2EJc91KSFF7Tc_KoBT8ALu5hG2_4q0tfRbAA+ hash: v1.k794b7964.fecc6437de11626b0cf0cc5bfcf3aad070a1e5d27aae512ce69f570201b48755.G4A3DOHjjKcZw2_uHgJMiQQ_cd5Z8dKJfsUE5jakicU+ scenes-app-customer-analytics-accounts--row-expanded-no-pinned-properties--dark:+ hash: v1.k794b7964.56d8b186f08668f3047f49f605465062735328453b6bb73bf34ccdde70ec11a6.GSd68pAu60P7fbhVwsa-tHzn72Dwi09a5WHZ5wSuxFg+ scenes-app-customer-analytics-accounts--row-expanded-no-pinned-properties--light:+ hash: v1.k794b7964.ed01fa4e6aab01c7b257acabeea1c56c3ba31bfb8a8428ab699f4454b6c059bc.vQmrjSd93LVjfZMHWJ2SWoizJ1BIQtvXbIU1qx7iWYw+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties--dark:+ hash: v1.k794b7964.ac0790e90174fb5efd6483dc6baf16faa2ba2af73be21b90f314abb4a6bba9fd.KE6ECCpuBo2nZwLLU761SRPopER_xfg2zHXKJoW7sGo+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties--light:+ hash: v1.k794b7964.892c8c4da5f2f2c956b7def2828ba9ae8784d1a5750f9d0eb22883cea0be3fe4.qCeMIWaEHzrhhZQgt6gtpGwNWuH3KqbpKhkKbd1ln5A+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties-error--dark:+ hash: v1.k794b7964.3e1b407b49bd893a9fb9be047d649a9f81dc808f7d0ed8955085b2569a26f7a6.NOJ1KaCBUuXEgswiXi3Flh1IS3YF4A0RpsPGCPIeqIc+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties-error--light:+ hash: v1.k794b7964.04f0591b5e63beb094f749d3b878f3a7eda3a8574d9010c074412ba59066db20.RG6m392829qV5zThnr4-5RmO6U7SZR3sjilQP_z44TE+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties-narrow--dark:+ hash: v1.k794b7964.0744617a1ccc1001d37549505a05ddd841e38c271b3dd074613a35cf89e510a3.YLhXPX1yCfuxgSj0xqsu5IIObl76j1_K83LsT9RFmSY+ scenes-app-customer-analytics-accounts--row-expanded-pinned-properties-narrow--light:+ hash: v1.k794b7964.5912ee881d6495f775a5249c9bc22a83707e68596688d859ff88af7b9d2cf6db.PVsL-j2sGlo7PBa7CLDfvUzf8yMgy9g5UnCUvRBZ67wscenes-app-customer-analytics-accounts--row-expanded-usage-not-found--dark:- hash: v1.k794b7964.cd65fe4409d235612246e32bb0b30f22ec975993eb6961226f27dc30b146325f.3_5MdMYqgV49hODxv9hGK75sPv79z53eK4QqaekUqoo+ hash: v1.k794b7964.7d1acf4345f2ee184544bfee7048d1d0ad1d19c0c65bdb40bddfd662d582f395._y4rxyYg67P4b92wYq1k36vGSPXjjez0JDvb6enO0_gscenes-app-customer-analytics-accounts--row-expanded-usage-not-found--light:- hash: v1.k794b7964.0728c102b2d5e41ec26196cb25534e6556fae0bf3d98b28cf322862edc8ea13f.W61cjs7VG1TyyqFFK9t4C1jkBdvtdlk6nP6PH7sqRO8+ hash: v1.k794b7964.f4c5975d4feb66aa5af3db61390f3413211279828a36ab3bfa095bf00a3f2278.QzMeIdxkMlBeJA8ixWW3xwiQNXLjwMxm8lv-YDG8-AUscenes-app-customer-analytics-accounts--row-expanded-with-note--dark:- hash: v1.k794b7964.73f6224f2a2fe465845423f5851a4d6095de3bf76f475cd34a74d2a5af9fa69e.pBn0jp3FJZY-7b2j_ceh-dErIGGbxkRDJWrq4kVzDts+ hash: v1.k794b7964.844fff084c587550dbba83ba6304b80205309905cff4feddfa4ab17a71a9dc5d.4pZxCwpuFbz9by6Z_XUtRNYdqbE4-iwLPSt8aO15tKYscenes-app-customer-analytics-accounts--row-expanded-with-note--light:- hash: v1.k794b7964.84c3a7d780275f21ac26f7b7819acf934376ffede731f98591cb8276b822a784.g8o45FmYlFxr_OaZvURXrLvjZpD00diTHcp8x4A6Tfg+ hash: v1.k794b7964.f617faf6a1a4488b4d082a2e883b9d8f89d98b41b7b341e4e48132397c5a5144.3OSquo7HF7WG_3RxcLD04sI_knR6JYM-_jiPwX2yJskscenes-app-customer-analytics-dashboard--b-2-b-mode-with-groups-enabled--dark:hash: v1.k794b7964.676001075ee700388d9cdd0c7ec45430e7fc40c5b7aedbb7e26efe0e01ccee30.9lZ1hXCdIHbJEf7RqEWimEYspfWdC8UsIE8LKrK6c7cscenes-app-customer-analytics-dashboard--b-2-b-mode-with-groups-enabled--light:diff --git a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.stories.tsx b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.stories.tsxindex 559e582fe581..d7c81e9d72f3 100644--- a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.stories.tsx+++ b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.stories.tsx@@ -242,6 +242,17 @@ export const WithExpandableRows: Story = {},}+export const WithFixedLayoutExpandableRows: Story = {+ ...WithExpandableRows,+ args: {+ tableLayout: 'fixed',+ expandable: {+ expandedRowRender: (record) => <span>{record.occupation}</span>,+ },+ },+ parameters: { testOptions: { viewport: { width: 600, height: 400 } } },+}+export const Small: Story = { render: renderBasic as any, args: { size: 'small' } }export const Embedded: Story = { render: renderBasic as any, args: { embedded: true } }diff --git a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.test.tsx b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.test.tsxindex 0fadbcfd5333..e6ed65d34162 100644--- a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.test.tsx+++ b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.test.tsx@@ -148,6 +148,27 @@ describe('LemonTable', () => {expect(spanningCell).not.toHaveClass('whitespace-nowrap')})+ it.each([+ ['auto', '1%'],+ ['fixed', '3rem'],+ ] as const)('reserves toggle space and expands rows with %s layout', (tableLayout, toggleWidth) => {+ render(+ <LemonTable+ rowKey="id"+ dataSource={DATA.slice(0, 1)}+ columns={COLUMNS}+ tableLayout={tableLayout}+ expandable={{ expandedRowRender: (row) => <span>{row.name} details</span> }}+ />+ )++ expect(document.querySelector('colgroup > col:first-child')).toHaveStyle({ width: toggleWidth })+ fireEvent.click(screen.getByTitle('Show more'))+ expect(screen.getByText('alpha details')).toBeInTheDocument()+ fireEvent.click(screen.getByTitle('Show less'))+ expect(screen.queryByText('alpha details')).not.toBeInTheDocument()+ })+it('keeps headers, expanded rows, and empty states aligned when the row expansion toggle is hidden', () => {const { rerender } = render(<LemonTablediff --git a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.tsx b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.tsxindex 20251ec3b0fd..c9fd38706fc6 100644--- a/frontend/src/lib/lemon-ui/LemonTable/LemonTable.tsx+++ b/frontend/src/lib/lemon-ui/LemonTable/LemonTable.tsx@@ -467,7 +467,7 @@ export function LemonTable<T extends Record<string, any>, K extends BulkSelectio<colgroup>{isRowExpansionToggleShown && (- <col style={{ width: '1%' }} />+ <col style={{ width: tableLayout === 'fixed' ? '3rem' : '1%' }} />) /* Expand/collapse column */}{columnsdiff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.mdindex 5192d769780d..f6d42c11109c 100644--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md@@ -172,11 +172,20 @@ User tab changes preserve URL search and hash state and capture `TabViewed`; URLWhen `CUSTOMER_ANALYTICS_ACCOUNT_SCENE` is off, the scene renders `CustomerAnalyticsScene` and preserves the filtered, expanded-row fallback.`AccountsTableNameCell` records `AccountOpened` when a person opens an account in either experience.-`AccountsTable` disables row expansion while the flag is on.+`AccountsTable` keeps the left expansion button in both flag states.+With the flag on, `AccountPinnedPropertiesExpansion` shows only the user's pinned properties in saved order.+The expansion and sidebar share `AccountPinnedPropertiesPanel` and `AccountPropertyField`, including the Properties header, pin configurator, source icons, and edit controls.+The shared panel reuses the project-keyed pin configuration and account-keyed values, without mounting the legacy tabs.+`activeConfiguratorKey` limits the pin dialog to the panel that opened it. Saving pins updates every mounted panel.+Properties use content widths capped at 16rem and wrap horizontally with 1rem gaps.+LemonTable reserves 3rem for the expansion button under fixed layout.+Empty pins offer the Pin properties action in place. Open field editors use the full 16rem width.+Loading, failed requests, refresh failures, and missing definitions remain distinct states.## The expanded row-`AccountsTable.useExpandable()` makes expansion **controlled** by `accountsExpansionLogic`: `isRowExpanded` reads `expandedAccountIds`, `onRowExpand`/`onRowCollapse` dispatch `toggleAccountExpanded`. The body is `AccountNotebooksExpansion`: the Useful links and active-relationships sidebar plus the shared `AccountDetailTabs` over `notes` / `tasks` / `users` / `relationships` / `feature_requests` / `usage` / `spend` / `opportunities` / `conversations` / `meetings` / `event_stream` (`AccountExpansionTab`; the `tasks` tab is gated by the `CUSTOMER_ANALYTICS_CUSTOMER_TASKS` flag and the `event_stream` tab is gated by the `CUSTOMER_ANALYTICS_CSP` flag). `AccountNotesExpansion` owns the shared Notes body. Active tab comes from `activeTabFor(accountId)` (defaults to `notes`). Pagination inside these tabs keeps its page state out of the URL so changing pages does not rerun deep-link restoration and replace the active tab.+`AccountsTable.useExpandable()` makes expansion **controlled** by `accountsExpansionLogic`: `isRowExpanded` reads `expandedAccountIds`, `onRowExpand`/`onRowCollapse` dispatch `toggleAccountExpanded`. With `CUSTOMER_ANALYTICS_ACCOUNT_SCENE` enabled, the body is `AccountPinnedPropertiesExpansion`.+With the flag disabled, the body is `AccountNotebooksExpansion`: the Useful links and active-relationships sidebar plus the shared `AccountDetailTabs` over `notes` / `tasks` / `users` / `relationships` / `feature_requests` / `usage` / `spend` / `opportunities` / `conversations` / `meetings` / `event_stream` (`AccountExpansionTab`; the `tasks` tab is gated by the `CUSTOMER_ANALYTICS_CUSTOMER_TASKS` flag and the `event_stream` tab is gated by the `CUSTOMER_ANALYTICS_CSP` flag). `AccountNotesExpansion` owns the shared Notes body. Active tab comes from `activeTabFor(accountId)` (defaults to `notes`). Pagination inside these tabs keeps its page state out of the URL so changing pages does not rerun deep-link restoration and replace the active tab.**Tab data is cached for the row's expanded lifetime, not refetched per tab switch.** `AccountDetailTabs` only renders the active tab's content (keyed by `activeKey`), so a tab's logic would normally unmount the moment you switch away and refetch on return. To avoid that, `AccountNotebooksExpansion` holds a mount reference to each per-tab logic via `useMountedLogic` — `accountNotebooksLogic({ accountId })`, `accountRelatedUsersLogic({ externalId })`, `accountRelationshipsLogic({ accountId })`, `accountBillingLogic` for both `kind: 'usage'` and `kind: 'spend'`, `accountOpportunitiesLogic({ accountId })`, `accountSummariesLogic({ accountId })`, `accountConversationsLogic({ accountId })`, `accountEmailThreadsLogic({ accountId })`, and `accountMeetingsLogic({ accountId })`. Since `AccountNotebooksExpansion` stays mounted for as long as the row is expanded (it's the `expandedRowRender` body), those keyed instances survive tab switches and only tear down when the row collapses. The `useMountedLogic` props must stay identical to the `useValues` props in the tab components so both resolve to the same keyed instance. `accountLinksLogic` mounts through the always-rendered sidebar. `CustomerTasksMount` keeps the account task logic mounted only when `CUSTOMER_ANALYTICS_CUSTOMER_TASKS` is enabled. Data is loaded once on mount and not auto-refreshed while the row stays open — acceptable since this data needn't be live. Flag-gated tabs load only when their flag is enabled.@@ -356,10 +365,10 @@ We track user actions on the Accounts list with `posthog.capture()`. Conventions| `customer analytics accounts view updated` | `accountsViewsLogic` `updateViewSuccess` listener after content or metadata changes | _(none)_ || `customer analytics accounts view selected` | `accountsViewsLogic` `applyView` listener | `visibility` || `customer analytics accounts view deleted` | `accountsViewsLogic` `deleteViewSuccess` listener | _(none)_ |-| `customer analytics account role assigned` | `accountsLogic` `updateAccountRole` | `role` (`csm` \| `account_executive` \| `account_owner` for the seeded definitions, else the definition name), `is_assigned`, `assigned_user_id`, `source` (`list_row` from `accountsLogic.updateAccountRole` \| `relationships_tab` from `accountRelationshipsLogic` assign/end) |+| `customer analytics account role assigned` | `accountsLogic` `updateAccountRole` | `role` (`csm` \| `account_executive` \| `account_owner` for the seeded definitions, else the definition name), `is_assigned`, `assigned_user_id`, `source` (`list_row` from `accountsLogic.updateAccountRole` \| `relationships_tab` from `accountRelationshipsLogic` assign/end \| `account_sidebar` or `list_expansion` from shared-field edits) || `customer analytics accounts relationship deleted` | `accountRelationshipsLogic` `deleteRelationship` listener (after the DELETE succeeds) | _(none - count only; relationship and account identifiers stay out)_ || `customer analytics account tags updated` | `accountsLogic` `updateAccountTags` listener (after the debounced PATCH succeeds; dispatched by the tags cell editor) | `tag_count` (tag names kept out — they can name customers) |-| `customer analytics account custom property updated` | `accountsLogic` `updateAccountCustomProperty` listener and `accountSidebarPropertiesLogic` `persistCustomPropertySuccess` listener (after the custom-property-values write succeeds) | `display_type`, `workflow_reference` (property name and value stay out because they can contain customer data) |+| `customer analytics account custom property updated` | `accountsLogic` `updateAccountCustomProperty` listener and `accountSidebarPropertiesLogic` `persistCustomPropertySuccess` listener (after the custom-property-values write succeeds) | `display_type`, `workflow_reference`, `source` (`account_sidebar` or `list_expansion` for shared-field edits; property names and values stay out) || `customer analytics account pinned properties saved` | `accountSidebarConfigLogic` `persistPinnedPropertiesSuccess` listener (after the PATCH succeeds) | `pinned_count`, `custom_property_count`, `relationship_count` (counts only; definition names and ids stay out because property names can name customers) || `customer analytics account link clicked` | `AccountNotebooksExpansion.tsx` useful-link `onClick` (incl. the "Copy link to account" row, `link_key: 'copy-account-link'`) | `link_key`, `has_destination` || `customer analytics account note clicked` | `AccountNotebooksExpansion.tsx` note `<Link>` `onClick` | `notebook_short_id` |diff --git a/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.test.tsx b/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.test.tsxnew file mode 100644index 000000000000..7c55a7299753--- /dev/null+++ b/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.test.tsx@@ -0,0 +1,362 @@+import '@testing-library/jest-dom'++import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { BindLogic } from 'kea'+import { expectLogic } from 'kea-test-utils'++import { projectLogic } from 'scenes/projectLogic'++import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'+import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'+import { AccessControlLevel, AccessControlResourceType } from '~/types'++import type {+ AccountApi,+ AccountRelationshipApi,+ AccountRelationshipDefinitionApi,+ AccountRelationshipWriteApi,+ CustomPropertyDefinitionApi,+ CustomPropertyValueWriteApi,+ UserCustomerAnalyticsConfigApi,+} from '../../generated/api.schemas'+import { AccountSidebar } from '../../scenes/CustomerAnalyticsAccountScene/AccountSidebar'+import { accountSidebarConfigLogic } from '../../scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic'+import { accountSidebarPropertiesLogic } from '../../scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic'+import { customerAnalyticsAccountSceneLogic } from '../../scenes/CustomerAnalyticsAccountScene/customerAnalyticsAccountSceneLogic'+import { AccountPinnedPropertiesExpansion } from './AccountPinnedPropertiesExpansion'++const VALUES_URL = '/api/projects/:project_id/accounts/:account_id/custom_property_values/'+const RELATIONSHIPS_URL = '/api/projects/:project_id/accounts/:account_id/relationships/'+const DEFINITIONS_URL = '/api/projects/:project_id/custom_property_definitions/'+const CONFIG_URL = '/api/projects/:project_id/user_customer_analytics_config/@me/'+const FIELD_SELECTOR = '[data-attr="account-property-row"]'+const SAVE_ERROR = 'Could not save this property. Review the value and try again.'++const definition: CustomPropertyDefinitionApi = {+ id: 'property-1',+ name: 'Plan',+ display_type: 'text',+ target_type: 'account',+ is_canonical: false,+ has_workflow_reference: false,+ references: [],+ source: null,+ created_at: '2026-01-01T00:00:00Z',+ created_by: 1,+ updated_at: null,+}+const relationshipDefinition: AccountRelationshipDefinitionApi = {+ id: 'relationship-1',+ name: 'CSM',+ is_single_holder: true,+}+const members = [+ { id: 1, email: '[email protected]', first_name: '' },+ { id: 2, email: '[email protected]', first_name: '' },+]+const editCases = [+ { name: 'Plan', current: 'Starter', next: 'Growth', request: { definition: definition.id, value: 'Growth' } },+ {+ name: 'CSM',+ current: '[email protected]',+ next: '[email protected]',+ request: { definition: relationshipDefinition.id, user: 2 },+ },+] as const++function getField(name: string): HTMLElement {+ return screen.getByText(name).closest<HTMLElement>(FIELD_SELECTOR)!+}++async function changeDraft(name: string): Promise<void> {+ if (name === 'Plan') {+ fireEvent.change(screen.getByDisplayValue('Starter'), { target: { value: 'Growth' } })+ } else {+ await userEvent.click(getField(name).querySelector('[data-attr="account-relationship-members-input"]')!)+ await userEvent.click(await screen.findByText('[email protected]'))+ }+}++function createAssignment(userId: number): AccountRelationshipApi {+ return {+ id: `assignment-${userId}`,+ definition: relationshipDefinition,+ user: members.find(({ id }) => id === userId)!,+ started_at: '2026-01-01T00:00:00Z',+ ended_at: null,+ }+}++describe('AccountPinnedPropertiesExpansion', () => {+ let previousAppContext: typeof window.POSTHOG_APP_CONTEXT+ let storedValue: CustomPropertyValueWriteApi['value']+ let assignments: AccountRelationshipApi[]+ let writes: (CustomPropertyValueWriteApi | AccountRelationshipWriteApi)[]+ let logic: ReturnType<typeof accountSidebarPropertiesLogic.build>++ const renderExpansion = async (): Promise<void> => {+ render(<AccountPinnedPropertiesExpansion accountId="account-1" />)+ logic = accountSidebarPropertiesLogic({+ projectId: projectLogic.values.currentProjectId!,+ accountId: 'account-1',+ })+ await act(async () => {+ await expectLogic(logic).toFinishAllListeners()+ })+ expect(within(getField('Plan')).getByText('Starter')).toBeVisible()+ expect(within(getField('CSM')).getByText('[email protected]')).toBeVisible()+ }++ beforeEach(() => {+ previousAppContext = window.POSTHOG_APP_CONTEXT+ initKeaTests()+ window.POSTHOG_APP_CONTEXT = {+ ...window.POSTHOG_APP_CONTEXT!,+ resource_access_control: {+ ...window.POSTHOG_APP_CONTEXT!.resource_access_control,+ [AccessControlResourceType.CustomerAnalytics]: AccessControlLevel.Editor,+ },+ }+ storedValue = 'Starter'+ assignments = [createAssignment(1)]+ writes = []+ useMocks({+ get: {+ [CONFIG_URL]: {+ pinned_properties: [+ { kind: 'relationship', id: relationshipDefinition.id },+ { kind: 'custom_property', id: definition.id },+ ],+ },+ [DEFINITIONS_URL]: { count: 1, results: [definition] },+ '/api/projects/:project_id/account_relationship_definitions/': {+ count: 1,+ results: [relationshipDefinition],+ },+ '/api/organizations/:organization_id/members/': {+ count: members.length,+ next: null,+ results: members.map((user) => ({ user })),+ },+ [VALUES_URL]: ({ params }) => [+ {+ id: `value-${params.account_id}`,+ definition_id: definition.id,+ account_id: params.account_id,+ value: storedValue,+ created_at: '2026-01-01T00:00:00Z',+ created_by_id: 1,+ },+ ],+ [RELATIONSHIPS_URL]: () => assignments,+ },+ post: {+ [VALUES_URL]: async ({ request }) => {+ const body = (await request.json()) as CustomPropertyValueWriteApi+ writes.push(body)+ storedValue = body.value+ return [201, { id: 'new-value', definition_id: body.definition, value: storedValue }]+ },+ [RELATIONSHIPS_URL]: async ({ request }) => {+ const body = (await request.json()) as AccountRelationshipWriteApi+ writes.push(body)+ assignments = [createAssignment(body.user)]+ return [201, assignments[0]]+ },+ },+ })+ })++ afterEach(() => {+ cleanup()+ resumeKeaLoadersErrors()+ window.POSTHOG_APP_CONTEXT = previousAppContext+ })++ it('opens one configurator and shares saved pins, but not canceled drafts, across expansions and the sidebar', async () => {+ const account: AccountApi = {+ id: 'account-1',+ name: 'Example account',+ notebooks: [],+ ignored_at: null,+ created_at: '2026-01-01T00:00:00Z',+ created_by: null,+ updated_at: null,+ tags: [],+ }+ const configWrites: UserCustomerAnalyticsConfigApi[] = []+ useMocks({+ get: { '/api/projects/:project_id/accounts/:account_id/': account },+ post: { '/api/projects/:project_id/accounts/:account_id/presence/': [] },+ patch: {+ [CONFIG_URL]: async ({ request }) => {+ const body = (await request.json()) as UserCustomerAnalyticsConfigApi+ configWrites.push(body)+ return body+ },+ },+ })+ const { container } = render(+ <>+ <AccountPinnedPropertiesExpansion accountId={account.id} />+ <AccountPinnedPropertiesExpansion accountId="account-2" />+ <BindLogic logic={customerAnalyticsAccountSceneLogic} props={{ accountId: account.id }}>+ <AccountSidebar account={account} />+ </BindLogic>+ </>+ )+ const expansions = container.querySelectorAll<HTMLElement>('[data-attr="account-pinned-properties-expansion"]')+ expect(expansions).toHaveLength(2)+ const sidebar = container.querySelector<HTMLElement>('[data-attr="account-sidebar"]')!+ const panels = [...expansions, sidebar]+ for (const panel of panels) {+ expect(await within(panel).findByText('Starter')).toBeVisible()+ expect(within(panel).getByText('[email protected]')).toBeVisible()+ expect(within(panel).getByText('Properties')).toBeVisible()+ }++ await userEvent.click(within(expansions[0]).getByLabelText('Configure pinned properties'))+ let dialogs = await screen.findAllByRole('dialog', { hidden: true })+ expect(dialogs).toHaveLength(1)+ await userEvent.click(within(dialogs[0]).getByLabelText('Remove Plan'))+ for (const panel of panels) {+ expect(within(panel).getByText('Starter')).toBeVisible()+ }+ await userEvent.click(within(dialogs[0]).getByText('Cancel'))+ await waitFor(() => expect(screen.queryAllByRole('dialog', { hidden: true })).toHaveLength(0))+ expect(configWrites).toEqual([])+ for (const panel of panels) {+ expect(panel.querySelectorAll(FIELD_SELECTOR)).toHaveLength(2)+ expect(within(panel).getByText('Starter')).toBeVisible()+ expect(within(panel).getByText('[email protected]')).toBeVisible()+ }++ await userEvent.click(within(expansions[1]).getByLabelText('Configure pinned properties'))+ dialogs = await screen.findAllByRole('dialog', { hidden: true })+ expect(dialogs).toHaveLength(1)+ expect(within(dialogs[0]).getByLabelText('Remove Plan')).toBeVisible()+ await userEvent.click(within(dialogs[0]).getByLabelText('Remove CSM'))+ const configLogic = accountSidebarConfigLogic({ projectId: projectLogic.values.currentProjectId! })+ await act(async () => {+ await expectLogic(configLogic, () => {+ fireEvent.click(within(dialogs[0]).getByText('Save'))+ }).toFinishAllListeners()+ })++ expect(configWrites).toEqual([{ pinned_properties: [{ kind: 'custom_property', id: definition.id }] }])+ await waitFor(() => expect(screen.queryAllByRole('dialog', { hidden: true })).toHaveLength(0))+ for (const panel of panels) {+ expect(panel.querySelectorAll(FIELD_SELECTOR)).toHaveLength(1)+ expect(within(panel).getByText('Plan')).toBeVisible()+ expect(within(panel).getByText('Starter')).toBeVisible()+ expect(within(panel).queryByText('CSM')).not.toBeInTheDocument()+ expect(within(panel).queryByText('[email protected]')).not.toBeInTheDocument()+ }+ })++ it.each(editCases)(+ 'discards canceled $name drafts and displays saved edits',+ async ({ name, current, next, request }) => {+ await renderExpansion()+ await userEvent.click(screen.getByLabelText(`Edit ${name}`))+ await changeDraft(name)+ fireEvent.click(within(getField(name)).getByText('Cancel'))++ expect(within(getField(name)).getByText(current)).toBeVisible()+ expect(screen.getByLabelText(`Edit ${name}`)).toBeVisible()+ expect(writes).toEqual([])++ await userEvent.click(screen.getByLabelText(`Edit ${name}`))+ if (name === 'Plan') {+ expect(screen.getByDisplayValue(current)).toBeVisible()+ } else {+ expect(within(getField(name)).getByText(current)).toBeVisible()+ expect(within(getField(name)).queryByText(next)).not.toBeInTheDocument()+ }+ await changeDraft(name)+ await act(async () => {+ await expectLogic(logic, () => {+ fireEvent.click(within(getField(name)).getByText('Save'))+ }).toFinishAllListeners()+ })++ expect(writes).toEqual([request])+ expect(within(getField(name)).getByText(next)).toBeVisible()+ expect(getField(name).querySelector('input')).not.toBeInTheDocument()+ expect(screen.getByLabelText(`Edit ${name}`)).toBeVisible()+ }+ )++ it.each(editCases)(+ 'keeps the $name draft and error after a failed save',+ async ({ name, current, next, request }) => {+ silenceKeaLoadersErrors()+ let releaseSave: () => void = () => {}+ const pendingSave = new Promise<void>((resolve) => {+ releaseSave = resolve+ })+ useMocks({+ post: {+ [name === 'Plan' ? VALUES_URL : RELATIONSHIPS_URL]: async ({ request }) => {+ writes.push((await request.json()) as CustomPropertyValueWriteApi | AccountRelationshipWriteApi)+ await pendingSave+ return [400, { detail: 'Invalid value' }]+ },+ },+ })+ await renderExpansion()+ await userEvent.click(screen.getByLabelText(`Edit ${name}`))+ await changeDraft(name)+ const field = getField(name)+ fireEvent.click(within(field).getByText('Save'))+ await waitFor(() => expect(writes).toEqual([request]))+ expect(field.querySelector('input')).toBeDisabled()+ expect(within(field).getByText('Save').closest('button')).toHaveAttribute('aria-disabled', 'true')+ fireEvent.click(within(field).getByText('Save'))++ await act(async () => {+ await expectLogic(logic, releaseSave).toFinishAllListeners()+ })++ expect(writes).toEqual([request])+ expect(screen.getByText(SAVE_ERROR)).toBeVisible()+ expect(field.querySelector('input')).toBeEnabled()+ expect(within(field).getByText('Save').closest('button')).not.toHaveAttribute('aria-disabled', 'true')+ if (name === 'Plan') {+ expect(screen.getByDisplayValue(next)).toBeVisible()+ } else {+ expect(within(field).getByText(next)).toBeVisible()+ expect(within(field).queryByText(current)).not.toBeInTheDocument()+ }+ fireEvent.click(within(field).getByText('Cancel'))+ expect(screen.queryByText(SAVE_ERROR)).not.toBeInTheDocument()+ expect(within(field).getByText(current)).toBeVisible()+ }+ )++ it.each([+ ['canonical', { is_canonical: true }],+ ['warehouse', { source: { id: 'source-1' } }],+ ])('hides editing for a %s property without hiding editable relationships', async (_, overrides) => {+ useMocks({ get: { [DEFINITIONS_URL]: { count: 1, results: [{ ...definition, ...overrides }] } } })+ await renderExpansion()++ expect(within(getField('Plan')).queryByLabelText('Edit Plan')).not.toBeInTheDocument()+ expect(getField('Plan').querySelector('input')).not.toBeInTheDocument()+ expect(screen.getByLabelText('Edit CSM')).toBeVisible()+ })++ it('shows values without edit controls to a resource-level viewer', async () => {+ window.POSTHOG_APP_CONTEXT!.resource_access_control![AccessControlResourceType.CustomerAnalytics] =+ AccessControlLevel.Viewer+ await renderExpansion()++ for (const { name } of editCases) {+ expect(within(getField(name)).queryByLabelText(`Edit ${name}`)).not.toBeInTheDocument()+ expect(getField(name).querySelector('input')).not.toBeInTheDocument()+ }+ expect(writes).toEqual([])+ })+})diff --git a/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.tsx b/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.tsxnew file mode 100644index 000000000000..6f538d3b5589--- /dev/null+++ b/products/customer_analytics/frontend/components/Accounts/AccountPinnedPropertiesExpansion.tsx@@ -0,0 +1,12 @@+import { AccountPinnedPropertiesPanel } from '../../scenes/CustomerAnalyticsAccountScene/components/AccountPinnedPropertiesPanel'++export function AccountPinnedPropertiesExpansion({ accountId }: { accountId: string }): JSX.Element {+ return (+ <div+ className="sticky left-0 w-[100cqw] max-w-full bg-bg-light"+ data-attr="account-pinned-properties-expansion"+ >+ <AccountPinnedPropertiesPanel accountId={accountId} layout="horizontal" source="list_expansion" />+ </div>+ )+}diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsxindex 03458fc7afe2..6add5d6c73d8 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTab.stories.tsx@@ -7,9 +7,14 @@ import { App } from 'scenes/App'import { urls } from 'scenes/urls'import { mswDecorator } from '~/mocks/browser'-import type { MockResolverInfo } from '~/mocks/utils'+import type { MockResolverInfo, Mocks } from '~/mocks/utils'-import type { PaginatedAccountEmailThreadListApi } from 'products/customer_analytics/frontend/generated/api.schemas'+import type {+ CustomPropertyDefinitionApi,+ CustomPropertyValueApi,+ PaginatedAccountEmailThreadListApi,+ UserCustomerAnalyticsConfigApi,+} from 'products/customer_analytics/frontend/generated/api.schemas'const QUERY_ENDPOINT = '/api/projects/:team_id/accounts_table_query/'const ACCOUNT_RETRIEVE_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/'@@ -19,6 +24,9 @@ const ACCOUNT_EMAIL_THREAD_DETAIL_ENDPOINT = 'api/projects/:team_id/accounts/:acconst ACCOUNT_SUMMARIES_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/summaries/'const ACCOUNT_SUPPORT_TICKETS_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/support_tickets/'const ACCOUNT_RELATIONSHIPS_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/relationships/'+const ACCOUNT_PROPERTY_VALUES_ENDPOINT = 'api/projects/:team_id/accounts/:account_id/custom_property_values/'+const ACCOUNT_SIDEBAR_CONFIG_ENDPOINT = 'api/projects/:team_id/user_customer_analytics_config/@me/'+const CUSTOM_PROPERTY_DEFINITIONS_ENDPOINT = 'api/projects/:team_id/custom_property_definitions/'const FEATURE_REQUESTS_ENDPOINT = 'api/projects/:team_id/feature_requests/'const RELATIONSHIP_DEFINITIONS_ENDPOINT = 'api/projects/:team_id/account_relationship_definitions/'const ORGANIZATION_MEMBERS_ENDPOINT = 'api/projects/:team_id/organization_members/'@@ -379,6 +387,218 @@ export const FeatureGateOff: Story = {],}+const PINNED_PROPERTY_FIXTURES = [+ {+ id: 'summary',+ name: 'Account summary',+ display_type: 'text' as const,+ value: 'Evaluating the new dashboard with the customer success and implementation teams',+ },+ { id: 'active', name: 'Active', display_type: 'boolean' as const, value: false },+ { id: 'seats', name: 'Seats', display_type: 'number' as const, value: 42 },+ { id: 'unpinned', name: 'Unpinned property', display_type: 'text' as const, value: 'This value is not pinned' },+]+const PINNED_PROPERTY_DEFINITIONS: CustomPropertyDefinitionApi[] = PINNED_PROPERTY_FIXTURES.map(+ ({ id, name, display_type }) => ({+ id,+ name,+ display_type,+ target_type: 'account',+ is_canonical: false,+ source: null,+ references: [],+ has_workflow_reference: false,+ created_at: '2026-05-10T10:00:00Z',+ created_by: 1,+ updated_at: null,+ })+)+const PINNED_PROPERTY_VALUES: CustomPropertyValueApi[] = PINNED_PROPERTY_FIXTURES.map(({ id, value }) => ({+ id: `value-${id}`,+ definition_id: id,+ account_id: 'acc-1',+ value,+ created_at: '2026-05-10T10:00:00Z',+ created_by_id: 1,+}))+const PINNED_PROPERTIES_CONFIG: UserCustomerAnalyticsConfigApi = {+ pinned_properties: [+ { kind: 'custom_property', id: 'seats' },+ { kind: 'relationship', id: RELATIONSHIP_DEFINITIONS.results[0].id },+ { kind: 'custom_property', id: 'summary' },+ { kind: 'custom_property', id: 'active' },+ ],+}+const PINNED_EXPANSION_SELECTOR = '[data-attr="account-pinned-properties-expansion"]'+const PINNED_FIELD_SELECTOR = '[data-attr="account-property-row"]'+const PINNED_ROW_PARAMETERS = {+ featureFlags: [+ FEATURE_FLAGS.CUSTOMER_ANALYTICS,+ FEATURE_FLAGS.CUSTOMER_ANALYTICS_CSP,+ FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNT_SCENE,+ ],+ testOptions: {+ waitForSelector: `${PINNED_EXPANSION_SELECTOR} ${PINNED_FIELD_SELECTOR}`,+ viewport: { width: 1440, height: 900 },+ },+}++function pinnedRowDecorators(overrides: Mocks['get'] = {}): ReturnType<typeof mswDecorator>[] {+ return [+ mswDecorator({+ get: {+ 'api/projects/:team_id/column_configurations/': { count: 0, next: null, previous: null, results: [] },+ 'api/environments/:team_id/customer_journeys/': { count: 0, next: null, previous: null, results: [] },+ [ACCOUNT_SIDEBAR_CONFIG_ENDPOINT]: PINNED_PROPERTIES_CONFIG,+ [CUSTOM_PROPERTY_DEFINITIONS_ENDPOINT]: {+ count: PINNED_PROPERTY_DEFINITIONS.length,+ next: null,+ previous: null,+ results: PINNED_PROPERTY_DEFINITIONS,+ },+ [ACCOUNT_PROPERTY_VALUES_ENDPOINT]: PINNED_PROPERTY_VALUES,+ [ACCOUNT_RELATIONSHIPS_ENDPOINT]: [+ {+ id: 'assignment-csm',+ definition: RELATIONSHIP_DEFINITIONS.results[0],+ user: { id: 178, email: '[email protected]' },+ started_at: '2026-05-10T10:00:00Z',+ ended_at: null,+ },+ ],+ ...overrides,+ },+ post: {+ [QUERY_ENDPOINT]: mockAccountsTableQuery(SINGLE_ROW),+ },+ }),+ ]+}++async function expandPinnedRow(canvasElement: HTMLElement): Promise<HTMLElement> {+ const canvas = within(canvasElement)+ await canvas.findByText('Acme Inc', {}, { timeout: 15000 })+ await userEvent.click(await canvas.findByTitle('Show more'))+ return await waitFor(() => {+ const expansion = canvasElement.querySelector<HTMLElement>(PINNED_EXPANSION_SELECTOR)+ if (!expansion) {+ throw new Error('Pinned properties did not expand')+ }+ if (+ canvasElement.querySelector('[data-attr="account-expansion"]') ||+ within(expansion).queryByRole('tablist')+ ) {+ throw new Error('Pinned expansion must not render account detail tabs')+ }+ return expansion+ })+}++async function assertPinnedValues(expansion: HTMLElement): Promise<void> {+ const expected = [+ ['Seats', '42'],+ ['CSM', '[email protected]'],+ ['Account summary', 'Evaluating the new dashboard with the customer success and implementation teams'],+ ['Active', 'No'],+ ]+ await waitFor(() => {+ const fields = expansion.querySelectorAll<HTMLElement>(PINNED_FIELD_SELECTOR)+ if (fields.length !== expected.length) {+ throw new Error('Expansion must show only pinned properties')+ }+ for (const [index, [label, value]] of expected.entries()) {+ const field = within(fields[index])+ field.getByText(label)+ field.getByText(value)+ }+ })+ if (+ within(expansion).queryByText('Unpinned property') ||+ within(expansion).queryByText('This value is not pinned')+ ) {+ throw new Error('Pinned properties must exclude unpinned content')+ }+}++export const RowExpandedPinnedProperties: Story = {+ render: () => <App />,+ parameters: PINNED_ROW_PARAMETERS,+ decorators: pinnedRowDecorators(),+ play: async ({ canvasElement }) => {+ await assertPinnedValues(await expandPinnedRow(canvasElement))+ await userEvent.click(within(canvasElement).getByTitle('Show less'))+ await waitFor(() => {+ if (canvasElement.querySelector(PINNED_EXPANSION_SELECTOR)) {+ throw new Error('Pinned properties did not collapse')+ }+ })+ await assertPinnedValues(await expandPinnedRow(canvasElement))+ },+}++export const RowExpandedPinnedPropertiesNarrow: Story = {+ ...RowExpandedPinnedProperties,+ parameters: {+ ...PINNED_ROW_PARAMETERS,+ pageUrl: `${urls.customerAnalyticsAccounts()}#view=${encodeURIComponent(JSON.stringify({ columns: ['name'] }))}`,+ testOptions: {+ ...PINNED_ROW_PARAMETERS.testOptions,+ viewport: { width: 800, height: 900 },+ },+ },+ play: async ({ canvasElement }) => {+ await assertPinnedValues(await expandPinnedRow(canvasElement))+ },+}++export const RowExpandedNoPinnedProperties: Story = {+ render: () => <App />,+ parameters: {+ ...PINNED_ROW_PARAMETERS,+ testOptions: {+ waitForSelector: `${PINNED_EXPANSION_SELECTOR} [data-attr="account-pin-properties-empty"]`,+ },+ },+ decorators: pinnedRowDecorators({ [ACCOUNT_SIDEBAR_CONFIG_ENDPOINT]: { pinned_properties: [] } }),+ play: async ({ canvasElement }) => {+ const expansion = await expandPinnedRow(canvasElement)+ await within(expansion).findByRole('button', { name: 'Pin properties' })+ within(expansion).getByText('Pin the account details you use most.')+ within(expansion).getByText('Properties')+ if (+ within(expansion).queryByLabelText('Configure pinned properties') ||+ within(expansion).queryByRole('link')+ ) {+ throw new Error('Empty expansion must offer the Pin properties button without a gear or link')+ }+ if (expansion.querySelector(PINNED_FIELD_SELECTOR)) {+ throw new Error('Empty expansion must not show unpinned properties')+ }+ },+}++export const RowExpandedPinnedPropertiesError: Story = {+ render: () => <App />,+ parameters: {+ ...PINNED_ROW_PARAMETERS,+ testOptions: { waitForSelector: `${PINNED_EXPANSION_SELECTOR} button` },+ },+ decorators: pinnedRowDecorators({+ [ACCOUNT_PROPERTY_VALUES_ENDPOINT]: [500, { detail: 'Could not load pinned properties.' }],+ }),+ play: async ({ canvasElement }) => {+ const expansion = await expandPinnedRow(canvasElement)+ await within(expansion).findByText('Could not load pinned properties.')+ await within(expansion).findAllByRole('button', { name: 'Try again' })+ if (+ expansion.querySelector('[data-attr="account-pin-properties-empty"]') ||+ expansion.querySelector(PINNED_FIELD_SELECTOR)+ ) {+ throw new Error('A failed property request must not render empty or partial values')+ }+ },+}+export const RowExpandedEmpty: Story = {render: () => <App />,parameters: { testOptions: EXPANDED_ROW_TEST_OPTIONS },diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsxindex 71eb4e720f10..9a2c96e220f4 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTable.tsx@@ -44,6 +44,7 @@ import type {import { ACCOUNTS_TABLE_DATA_NODE_KEY } from '../../constants'import { formatCustomPropertyValue } from '../../scenes/CustomerAnalyticsConfigurationScene/account/customPropertyTypes'import { AccountNotebooksExpansion } from './AccountNotebooksExpansion'+import { AccountPinnedPropertiesExpansion } from './AccountPinnedPropertiesExpansion'import { AccountColumnDisplayConfig, LEGACY_ROLE_COLUMNS, accountsColumnConfigLogic } from './accountsColumnConfigLogic'import { AccountExpansionTab, accountsExpansionLogic } from './accountsExpansionLogic'import { accountsLogic, customPropertySavingKey, savingRoleKey } from './accountsLogic'@@ -796,9 +797,6 @@ function useExpandable(): QueryContext<DataTableNode>['expandable'] {const { toggleAccountExpanded } = useActions(accountsExpansionLogic)const accountSceneEnabled = !!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNT_SCENE]return useMemo(() => {- if (accountSceneEnabled) {- return undefined- }return {noIndent: true,expandedRowClassName: '[&>td]:overflow-visible!',@@ -820,9 +818,14 @@ function useExpandable(): QueryContext<DataTableNode>['expandable'] {},expandedRowRender: ({ result }) => {const cell = getNameCell(result)- return cell ? (+ if (!cell) {+ return null+ }+ return accountSceneEnabled ? (+ <AccountPinnedPropertiesExpansion accountId={cell.id} />+ ) : (<AccountNotebooksExpansion accountId={cell.id} externalId={cell.external_id ?? ''} />- ) : null+ )},}}, [accountSceneEnabled, expandedAccountIds, toggleAccountExpanded])@@ -868,22 +871,18 @@ const SKELETON_COLUMNS: LemonTableColumns<{ key: number }> = [})),]-function AccountsTableSkeleton({ expandable }: { expandable: boolean }): JSX.Element {+function AccountsTableSkeleton(): JSX.Element {return (<LemonTableclassName="DataTable"columns={SKELETON_COLUMNS}dataSource={Array.from({ length: SKELETON_ROW_COUNT }, (_, key) => ({ key }))}rowKey="key"- expandable={- expandable- ? {- noIndent: true,- expandedRowRender: () => null,- rowExpandable: () => true,- }- : undefined- }+ expandable={{+ noIndent: true,+ expandedRowRender: () => null,+ rowExpandable: () => true,+ }}/>)}@@ -897,10 +896,8 @@ export function AccountsTable(): JSX.Element {query: accountsQuerySource,} as DataNodeLogicProps))- const { featureFlags } = useValues(featureFlagLogic)const contextColumns = useContextColumns()const expandable = useExpandable()- const accountSceneEnabled = !!featureFlags[FEATURE_FLAGS.CUSTOMER_ANALYTICS_ACCOUNT_SCENE]const dataTableContext = useMemo<QueryContext<DataTableNode>>(() => ({columns: contextColumns,@@ -917,7 +914,7 @@ export function AccountsTable(): JSX.Element {// A null source means the query is still waiting on the relationship// definitions — same skeleton as the initial fetch, not an empty table.if ((responseLoading || !accountsQuerySource) && !response) {- return <AccountsTableSkeleton expandable={!accountSceneEnabled} />+ return <AccountsTableSkeleton />}return (<div className="@container">diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.test.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.test.tsxindex bb73e3a73fbd..9f0889b87ef3 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.test.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.test.tsx@@ -90,7 +90,7 @@ describe('AccountSidebar refresh recovery', () => {await act(async () => {await expectLogic(logic, () => logic.actions.loadPropertyData()).toFinishAllListeners()})- expect(screen.getByText("Couldn't refresh pinned properties. These values might be out of date.")).toBeVisible()+ expect(screen.getByText('Could not refresh pinned properties. These values may be out of date.')).toBeVisible()expect(screen.getByDisplayValue('Draft to retain')).toBeVisible()})})diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsxindex 11d5c3afb0fc..76e18de6c367 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/AccountSidebar.tsx@@ -1,77 +1,19 @@import { useActions, useValues } from 'kea'-import { LemonBanner, LemonDivider, LemonSkeleton } from '@posthog/lemon-ui'+import { LemonDivider } from '@posthog/lemon-ui'import { ObjectTags } from 'lib/components/ObjectTags/ObjectTags'-import { projectLogic } from 'scenes/projectLogic'import { tagsModel } from '~/models/tagsModel'import type { AccountApi } from '../../generated/api.schemas'-import {- accountSidebarConfigLogic,- configuratorKeysToPinnedProperties,- pinnedPropertyToConfiguratorKey,-} from './accountSidebarConfigLogic'-import { accountSidebarPropertiesLogic } from './accountSidebarPropertiesLogic'-import { AccountPinnedProperties } from './components/AccountPinnedProperties'-import { AccountPropertyConfigurator } from './components/AccountPropertyConfigurator'-import type { AccountPropertyOption } from './components/accountPropertyTypes'+import { AccountPinnedPropertiesPanel } from './components/AccountPinnedPropertiesPanel'import { customerAnalyticsAccountSceneLogic } from './customerAnalyticsAccountSceneLogic'export function AccountSidebar({ account }: { account: AccountApi }): JSX.Element {const { tagsSaving } = useValues(customerAnalyticsAccountSceneLogic)const { updateTags } = useActions(customerAnalyticsAccountSceneLogic)const { tags: tagsAvailable } = useValues(tagsModel)- const { currentProjectId } = useValues(projectLogic)- const configLogic = accountSidebarConfigLogic({ projectId: currentProjectId ?? 0 })- const {- availableDefinitions,- canSavePinnedProperties,- config,- configLoading,- draftPinnedProperties,- isConfiguring,- stalePinnedProperties,- } = useValues(configLogic)- const {- beginConfiguring,- cancelConfiguring,- loadAvailableDefinitions,- loadConfig,- savePinnedProperties,- setDraftPinnedProperties,- } = useActions(configLogic)- const propertyLogic = accountSidebarPropertiesLogic({ accountId: account.id, projectId: currentProjectId ?? 0 })- const {- sidebarProperties,- propertiesPanelState,- propertiesRefreshFailed,- propertySaveFailed,- editingPropertyKey,- savingPropertyKey,- availableMembers,- membersLoading,- } = useValues(propertyLogic)- const { loadPropertyData, editProperty, cancelEditing, saveCustomProperty, saveRelationship } =- useActions(propertyLogic)- const retryLoad = (): void => {- loadConfig()- loadAvailableDefinitions()- loadPropertyData()- }- const propertyOptions: AccountPropertyOption[] = [- ...(availableDefinitions?.customProperties ?? []).map((definition) => ({- key: pinnedPropertyToConfiguratorKey({ kind: 'custom_property', id: definition.id }),- label: definition.name,- kind: 'custom' as const,- })),- ...(availableDefinitions?.relationships ?? []).map((definition) => ({- key: pinnedPropertyToConfiguratorKey({ kind: 'relationship', id: definition.id }),- label: definition.name,- kind: 'relationship' as const,- })),- ]return (<aside@@ -89,77 +31,7 @@ export function AccountSidebar({ account }: { account: AccountApi }): JSX.Elemen/></div><LemonDivider className="my-0" />- <div className="flex flex-col flex-1 min-h-0" data-attr="account-rail-properties">- {propertiesPanelState !== 'ready' ? (- <div className="flex flex-col gap-3 p-4">- <span className="secondary text-secondary">Properties</span>- {propertiesPanelState === 'failed' ? (- <LemonBanner type="error" action={{ children: 'Try again', onClick: retryLoad }}>- Couldn't load pinned properties.- </LemonBanner>- ) : (- <div className="flex flex-col gap-2" data-attr="account-pinned-properties-loading">- <LemonSkeleton className="h-4 w-full" />- <LemonSkeleton className="h-4 w-3/4" />- </div>- )}- </div>- ) : (- <>- {stalePinnedProperties.length > 0 ? (- <div className="px-4 pt-4">- <LemonBanner type="warning">- Some pinned properties are no longer available. Update your pins to remove them.- </LemonBanner>- </div>- ) : null}- {propertySaveFailed ? (- <div className="px-4 pt-4">- <LemonBanner type="error">- Couldn't save this property. Review the value and try again.- </LemonBanner>- </div>- ) : null}- {propertiesRefreshFailed ? (- <div className="px-4 pt-4">- <LemonBanner type="warning" action={{ children: 'Try again', onClick: retryLoad }}>- Couldn't refresh pinned properties. These values might be out of date.- </LemonBanner>- </div>- ) : null}- <AccountPinnedProperties- properties={sidebarProperties}- editingPropertyKey={editingPropertyKey}- savingPropertyKey={savingPropertyKey}- availableMembers={availableMembers}- membersLoading={membersLoading}- onConfigure={beginConfiguring}- onEdit={(property) => {- if (!savingPropertyKey) {- editProperty(property)- }- }}- onCancelEdit={() => {- if (!savingPropertyKey) {- cancelEditing()- }- }}- onSaveCustomProperty={(property, value) => saveCustomProperty(property.key, value)}- onSaveRelationship={(property, memberIds) => saveRelationship(property.key, memberIds)}- />- </>- )}- </div>- <AccountPropertyConfigurator- isOpen={isConfiguring}- options={propertyOptions}- pinnedPropertyKeys={draftPinnedProperties.map(pinnedPropertyToConfiguratorKey)}- onChange={(keys) => setDraftPinnedProperties(configuratorKeysToPinnedProperties(keys))}- onSave={() => savePinnedProperties()}- onCancel={cancelConfiguring}- saving={configLoading && config !== null}- saveDisabledReason={!configLoading && !canSavePinnedProperties ? 'No changes to save' : undefined}- />+ <AccountPinnedPropertiesPanel accountId={account.id} /></aside>)}diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.test.ts b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.test.tsindex 30234f36b554..8d88740ddd79 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.test.ts+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.test.ts@@ -199,12 +199,29 @@ describe('accountSidebarConfigLogic', () => {useMocks(defaultMocks({ pinned_properties: [{ kind: 'custom_property', id: 'custom-1' }] }))await mountLogic()+ expect(logic.values.activeConfiguratorKey).toBeNull()+ expect(logic.values.isConfiguring).toBe(false)logic.actions.beginConfiguring()+ expect(logic.values.activeConfiguratorKey).toBe('default')+ expect(logic.values.isConfiguring).toBe(true)+ logic.actions.cancelConfiguring()+ expect(logic.values.activeConfiguratorKey).toBeNull()+ expect(logic.values.isConfiguring).toBe(false)++ logic.actions.beginConfiguring('account_sidebar:account-1')+ expect(logic.values.activeConfiguratorKey).toBe('account_sidebar:account-1')+ logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })+ logic.actions.beginConfiguring('list_expansion:account-2')+ expect(logic.values.activeConfiguratorKey).toBe('list_expansion:account-2')+ expect(logic.values.isConfiguring).toBe(true)+ expect(logic.values.draftPinnedProperties).toEqual([{ kind: 'custom_property', id: 'custom-1' }])+logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })logic.actions.movePinnedProperty(1, 0)expect(logic.values.draftPinnedProperties.map(({ id }) => id)).toEqual(['relationship-1', 'custom-1'])logic.actions.cancelConfiguring()+ expect(logic.values.activeConfiguratorKey).toBeNull()expect(logic.values.isConfiguring).toBe(false)expect(logic.values.draftPinnedProperties).toEqual([{ kind: 'custom_property', id: 'custom-1' }])@@ -218,81 +235,90 @@ describe('accountSidebarConfigLogic', () => {expect(logic.values.draftPinLimitReached).toBe(true)})- it('saves once while a request is active and adopts the server response', async () => {- const captureSpy = jest.spyOn(posthog, 'capture').mockImplementation(() => undefined as any)- let releasePatch: (() => void) | undefined- let patchCount = 0- let submittedBody: unknown- useMocks({- ...defaultMocks({ pinned_properties: [{ kind: 'custom_property', id: 'custom-1' }] }),- patch: {- [CONFIG_URL]: async ({ request }) => {- patchCount += 1- submittedBody = await request.json()- await new Promise<void>((resolve) => {- releasePatch = resolve- })- return submittedBody+ it.each([undefined, 'list_expansion:account-1'])(+ 'saves once while a request is active and adopts the server response (owner: %s)',+ async (configuratorKey) => {+ const captureSpy = jest.spyOn(posthog, 'capture').mockImplementation(() => undefined as any)+ let releasePatch: (() => void) | undefined+ let patchCount = 0+ let submittedBody: unknown+ useMocks({+ ...defaultMocks({ pinned_properties: [{ kind: 'custom_property', id: 'custom-1' }] }),+ patch: {+ [CONFIG_URL]: async ({ request }) => {+ patchCount += 1+ submittedBody = await request.json()+ await new Promise<void>((resolve) => {+ releasePatch = resolve+ })+ return submittedBody+ },},- },- })- await mountLogic()- logic.actions.beginConfiguring()- logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })-- await expectLogic(logic, () => logic.actions.savePinnedProperties()).toDispatchActions([- 'persistPinnedProperties',- ])- await waitFor(() => expect(patchCount).toBe(1))- await expectLogic(logic, () => logic.actions.savePinnedProperties()).toNotHaveDispatchedActions([- 'persistPinnedProperties',- ])- releasePatch?.()- await expectLogic(logic).toDispatchActions(['persistPinnedPropertiesSuccess']).toFinishAllListeners()+ })+ await mountLogic()+ logic.actions.beginConfiguring(configuratorKey)+ logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })- expect(patchCount).toBe(1)- expect(submittedBody).toEqual({- pinned_properties: [- { kind: 'custom_property', id: 'custom-1' },- { kind: 'relationship', id: 'relationship-1' },- ],- })- expect(logic.values.config?.pinned_properties).toEqual(- (submittedBody as UserCustomerAnalyticsConfigApi).pinned_properties- )- expect(logic.values.isConfiguring).toBe(false)- expect(captureSpy).toHaveBeenCalledWith(AccountsEvents.PinnedPropertiesSaved, {- pinned_count: 2,- custom_property_count: 1,- relationship_count: 1,- })- })+ await expectLogic(logic, () => logic.actions.savePinnedProperties()).toDispatchActions([+ 'persistPinnedProperties',+ ])+ await waitFor(() => expect(patchCount).toBe(1))+ expect(logic.values.activeConfiguratorKey).toBe(configuratorKey ?? 'default')+ await expectLogic(logic, () => logic.actions.savePinnedProperties()).toNotHaveDispatchedActions([+ 'persistPinnedProperties',+ ])+ releasePatch?.()+ await expectLogic(logic).toDispatchActions(['persistPinnedPropertiesSuccess']).toFinishAllListeners()- it('keeps the draft open for retry and shows one notification when saving fails', async () => {- silenceKeaLoadersErrors()- const toastSpy = jest.spyOn(lemonToast, 'error')- const captureSpy = jest.spyOn(posthog, 'capture')- useMocks({- ...defaultMocks({ pinned_properties: [{ kind: 'custom_property', id: 'custom-1' }] }),- patch: { [CONFIG_URL]: () => [500, { detail: 'Could not save pinned properties.' }] },- })- await mountLogic()- logic.actions.beginConfiguring()- logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })- logic.actions.movePinnedProperty(1, 0)+ expect(patchCount).toBe(1)+ expect(submittedBody).toEqual({+ pinned_properties: [+ { kind: 'custom_property', id: 'custom-1' },+ { kind: 'relationship', id: 'relationship-1' },+ ],+ })+ expect(logic.values.config?.pinned_properties).toEqual(+ (submittedBody as UserCustomerAnalyticsConfigApi).pinned_properties+ )+ expect(logic.values.activeConfiguratorKey).toBeNull()+ expect(logic.values.isConfiguring).toBe(false)+ expect(captureSpy).toHaveBeenCalledWith(AccountsEvents.PinnedPropertiesSaved, {+ pinned_count: 2,+ custom_property_count: 1,+ relationship_count: 1,+ })+ }+ )++ it.each([undefined, 'list_expansion:account-1'])(+ 'keeps the draft open for retry and shows one notification when saving fails (owner: %s)',+ async (configuratorKey) => {+ silenceKeaLoadersErrors()+ const toastSpy = jest.spyOn(lemonToast, 'error')+ const captureSpy = jest.spyOn(posthog, 'capture')+ useMocks({+ ...defaultMocks({ pinned_properties: [{ kind: 'custom_property', id: 'custom-1' }] }),+ patch: { [CONFIG_URL]: () => [500, { detail: 'Could not save pinned properties.' }] },+ })+ await mountLogic()+ logic.actions.beginConfiguring(configuratorKey)+ logic.actions.togglePinnedProperty({ kind: 'relationship', id: 'relationship-1' })+ logic.actions.movePinnedProperty(1, 0)- await expectLogic(logic, () => logic.actions.savePinnedProperties())- .toDispatchActions(['persistPinnedPropertiesFailure'])- .toFinishAllListeners()+ await expectLogic(logic, () => logic.actions.savePinnedProperties())+ .toDispatchActions(['persistPinnedPropertiesFailure'])+ .toFinishAllListeners()- expect(logic.values.config?.pinned_properties).toEqual([{ kind: 'custom_property', id: 'custom-1' }])- expect(logic.values.draftPinnedProperties).toEqual([- { kind: 'relationship', id: 'relationship-1' },- { kind: 'custom_property', id: 'custom-1' },- ])- expect(logic.values.isConfiguring).toBe(true)- expect(logic.values.canSavePinnedProperties).toBe(true)- expect(toastSpy).toHaveBeenCalledTimes(1)- expect(captureSpy).not.toHaveBeenCalledWith(AccountsEvents.PinnedPropertiesSaved, expect.anything())- })+ expect(logic.values.config?.pinned_properties).toEqual([{ kind: 'custom_property', id: 'custom-1' }])+ expect(logic.values.draftPinnedProperties).toEqual([+ { kind: 'relationship', id: 'relationship-1' },+ { kind: 'custom_property', id: 'custom-1' },+ ])+ expect(logic.values.activeConfiguratorKey).toBe(configuratorKey ?? 'default')+ expect(logic.values.isConfiguring).toBe(true)+ expect(logic.values.canSavePinnedProperties).toBe(true)+ expect(toastSpy).toHaveBeenCalledTimes(1)+ expect(captureSpy).not.toHaveBeenCalledWith(AccountsEvents.PinnedPropertiesSaved, expect.anything())+ }+ )})diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.ts b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.tsindex 7e4fbf97ef82..adc09e5cf07d 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.ts+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarConfigLogic.ts@@ -1,4 +1,16 @@-import { MakeLogicType, actions, afterMount, kea, key, listeners, path, props, reducers, selectors } from 'kea'+import {+ LogicWrapper,+ MakeLogicType,+ actions,+ afterMount,+ kea,+ key,+ listeners,+ path,+ props,+ reducers,+ selectors,+} from 'kea'import { loaders } from 'kea-loaders'import posthog from 'posthog-js'@@ -127,6 +139,7 @@ const resolvePinnedProperties = (// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface accountSidebarConfigLogicValues {+ activeConfiguratorKey: string | nullavailableDefinitions: AvailableDefinitions | nullavailableDefinitionsLoadFailed: booleanavailableDefinitionsLoading: boolean@@ -144,8 +157,8 @@ export interface accountSidebarConfigLogicValues {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface accountSidebarConfigLogicActions {- beginConfiguring: () => {- value: true+ beginConfiguring: (configuratorKey?: string) => {+ configuratorKey: string}cancelConfiguring: () => {value: true@@ -223,6 +236,7 @@ export interface accountSidebarConfigLogicActions {export interface accountSidebarConfigLogicMeta {key: number__keaTypeGenInternalSelectorTypes: {+ isConfiguring: (activeConfiguratorKey: string | null) => booleanpinnedPropertyResolution: (config: UserCustomerAnalyticsConfigApi | null,availableDefinitions: AvailableDefinitions | null@@ -248,174 +262,184 @@ export type accountSidebarConfigLogicType = MakeLogicType<accountSidebarConfigLogicMeta>-export const accountSidebarConfigLogic = kea<accountSidebarConfigLogicType>([- path([- 'products',- 'customer_analytics',- 'frontend',- 'scenes',- 'CustomerAnalyticsAccountScene',- 'accountSidebarConfigLogic',- ]),- props({} as AccountSidebarConfigLogicProps),- key((props) => props.projectId),- actions({- beginConfiguring: true,- cancelConfiguring: true,- setDraftPinnedProperties: (pinnedProperties: PinnedAccountProperty[]) => ({ pinnedProperties }),- togglePinnedProperty: (pinnedProperty: PinnedAccountProperty) => ({ pinnedProperty }),- movePinnedProperty: (fromIndex: number, toIndex: number) => ({ fromIndex, toIndex }),- savePinnedProperties: true,- }),- loaders(({ props }) => ({- config: [- null as UserCustomerAnalyticsConfigApi | null,- {- loadConfig: async (): Promise<UserCustomerAnalyticsConfigApi> =>- await api.userCustomerAnalyticsConfigRetrieve(String(props.projectId), CURRENT_USER_CONFIG_ID),- persistPinnedProperties: async ({- pinnedProperties,- }: {- pinnedProperties: PinnedAccountProperty[]- }): Promise<UserCustomerAnalyticsConfigApi> =>- await api.userCustomerAnalyticsConfigPartialUpdate(- String(props.projectId),- CURRENT_USER_CONFIG_ID,- {- pinned_properties: pinnedProperties.map(({ kind, id }) => ({ kind, id })),+export const accountSidebarConfigLogic: LogicWrapper<accountSidebarConfigLogicType> =+ kea<accountSidebarConfigLogicType>([+ path([+ 'products',+ 'customer_analytics',+ 'frontend',+ 'scenes',+ 'CustomerAnalyticsAccountScene',+ 'accountSidebarConfigLogic',+ ]),+ props({} as AccountSidebarConfigLogicProps),+ key((props) => props.projectId),+ actions({+ beginConfiguring: (configuratorKey: string = 'default') => ({ configuratorKey }),+ cancelConfiguring: true,+ setDraftPinnedProperties: (pinnedProperties: PinnedAccountProperty[]) => ({ pinnedProperties }),+ togglePinnedProperty: (pinnedProperty: PinnedAccountProperty) => ({ pinnedProperty }),+ movePinnedProperty: (fromIndex: number, toIndex: number) => ({ fromIndex, toIndex }),+ savePinnedProperties: true,+ }),+ loaders(({ props }) => ({+ config: [+ null as UserCustomerAnalyticsConfigApi | null,+ {+ loadConfig: async (): Promise<UserCustomerAnalyticsConfigApi> =>+ await api.userCustomerAnalyticsConfigRetrieve(String(props.projectId), CURRENT_USER_CONFIG_ID),+ persistPinnedProperties: async ({+ pinnedProperties,+ }: {+ pinnedProperties: PinnedAccountProperty[]+ }): Promise<UserCustomerAnalyticsConfigApi> =>+ await api.userCustomerAnalyticsConfigPartialUpdate(+ String(props.projectId),+ CURRENT_USER_CONFIG_ID,+ {+ pinned_properties: pinnedProperties.map(({ kind, id }) => ({ kind, id })),+ }+ ),+ },+ ],+ availableDefinitions: [+ null as AvailableDefinitions | null,+ {+ loadAvailableDefinitions: async (): Promise<AvailableDefinitions> => {+ const projectId = String(props.projectId)+ const [customProperties, relationships] = await Promise.all([+ loadEveryPage((params) => api.customPropertyDefinitionsList(projectId, params)),+ loadEveryPage((params) => api.accountRelationshipDefinitionsList(projectId, params)),+ ])+ return {+ customProperties: customProperties.filter(({ target_type }) => target_type === 'account'),+ relationships,}- ),- },- ],- availableDefinitions: [- null as AvailableDefinitions | null,- {- loadAvailableDefinitions: async (): Promise<AvailableDefinitions> => {- const projectId = String(props.projectId)- const [customProperties, relationships] = await Promise.all([- loadEveryPage((params) => api.customPropertyDefinitionsList(projectId, params)),- loadEveryPage((params) => api.accountRelationshipDefinitionsList(projectId, params)),- ])- return {- customProperties: customProperties.filter(({ target_type }) => target_type === 'account'),- relationships,- }+ },},+ ],+ })),+ reducers({+ configLoadFailed: [+ false,+ {+ loadConfig: () => false,+ loadConfigSuccess: () => false,+ loadConfigFailure: () => true,+ },+ ],+ availableDefinitionsLoadFailed: [+ false,+ {+ loadAvailableDefinitions: () => false,+ loadAvailableDefinitionsSuccess: () => false,+ loadAvailableDefinitionsFailure: () => true,+ },+ ],+ activeConfiguratorKey: [+ null as string | null,+ {+ beginConfiguring: (_, { configuratorKey }) => configuratorKey,+ cancelConfiguring: () => null,+ persistPinnedPropertiesSuccess: () => null,+ // A failed save keeps the selector open, so the user can retry or correct the+ // draft that the request did not store.+ },+ ],+ draftPinnedProperties: [+ [] as PinnedAccountProperty[],+ {+ setDraftPinnedProperties: (_, { pinnedProperties }) => [...pinnedProperties],+ togglePinnedProperty: (state, { pinnedProperty }) => {+ const existingIndex = state.findIndex(+ (reference) => referenceKey(reference) === referenceKey(pinnedProperty)+ )+ if (existingIndex >= 0) {+ return state.filter((_, index) => index !== existingIndex)+ }+ return state.length < MAX_PINNED_ACCOUNT_PROPERTIES ? [...state, pinnedProperty] : state+ },+ movePinnedProperty: (state, { fromIndex, toIndex }) => {+ if (fromIndex === toIndex || !state[fromIndex] || toIndex < 0 || toIndex >= state.length) {+ return state+ }+ const reordered = [...state]+ const [moved] = reordered.splice(fromIndex, 1)+ reordered.splice(toIndex, 0, moved)+ return reordered+ },+ },+ ],+ }),+ selectors({+ isConfiguring: [+ (s) => [s.activeConfiguratorKey],+ (activeConfiguratorKey: string | null): boolean => activeConfiguratorKey !== null,+ ],+ pinnedPropertyResolution: [+ (s) => [s.config, s.availableDefinitions],+ (+ config: UserCustomerAnalyticsConfigApi | null,+ definitions: AvailableDefinitions | null+ ): PinnedPropertyResolution =>+ config && definitions+ ? resolvePinnedProperties(config.pinned_properties, definitions)+ : { resolved: [], stale: [] },+ ],+ resolvedPinnedProperties: [+ (s) => [s.pinnedPropertyResolution],+ (resolution: PinnedPropertyResolution): ResolvedPinnedAccountProperty[] => resolution.resolved,+ ],+ stalePinnedProperties: [+ (s) => [s.pinnedPropertyResolution],+ (resolution: PinnedPropertyResolution): PinnedAccountProperty[] => resolution.stale,+ ],+ draftPinLimitReached: [+ (s) => [s.draftPinnedProperties],+ (draft: PinnedAccountProperty[]): boolean => draft.length >= MAX_PINNED_ACCOUNT_PROPERTIES,+ ],+ canSavePinnedProperties: [+ (s) => [s.isConfiguring, s.config, s.draftPinnedProperties, s.configLoading],+ (+ isConfiguring: boolean,+ config: UserCustomerAnalyticsConfigApi | null,+ draft: PinnedAccountProperty[],+ saving: boolean+ ): boolean =>+ isConfiguring &&+ config !== null &&+ !saving &&+ !pinnedPropertiesEqual(config.pinned_properties, draft),+ ],+ }),+ listeners(({ actions, values }) => ({+ beginConfiguring: () => {+ actions.setDraftPinnedProperties(values.resolvedPinnedProperties.map(({ reference }) => reference))},- ],- })),- reducers({- configLoadFailed: [- false,- {- loadConfig: () => false,- loadConfigSuccess: () => false,- loadConfigFailure: () => true,- },- ],- availableDefinitionsLoadFailed: [- false,- {- loadAvailableDefinitions: () => false,- loadAvailableDefinitionsSuccess: () => false,- loadAvailableDefinitionsFailure: () => true,+ cancelConfiguring: () => {+ actions.setDraftPinnedProperties(values.resolvedPinnedProperties.map(({ reference }) => reference))},- ],- isConfiguring: [- false,- {- beginConfiguring: () => true,- cancelConfiguring: () => false,- persistPinnedPropertiesSuccess: () => false,- // A failed save keeps the selector open, so the user can retry or correct the- // draft that the request did not store.+ savePinnedProperties: () => {+ if (values.canSavePinnedProperties) {+ actions.persistPinnedProperties({ pinnedProperties: values.draftPinnedProperties })+ }},- ],- draftPinnedProperties: [- [] as PinnedAccountProperty[],- {- setDraftPinnedProperties: (_, { pinnedProperties }) => [...pinnedProperties],- togglePinnedProperty: (state, { pinnedProperty }) => {- const existingIndex = state.findIndex(- (reference) => referenceKey(reference) === referenceKey(pinnedProperty)- )- if (existingIndex >= 0) {- return state.filter((_, index) => index !== existingIndex)- }- return state.length < MAX_PINNED_ACCOUNT_PROPERTIES ? [...state, pinnedProperty] : state- },- movePinnedProperty: (state, { fromIndex, toIndex }) => {- if (fromIndex === toIndex || !state[fromIndex] || toIndex < 0 || toIndex >= state.length) {- return state- }- const reordered = [...state]- const [moved] = reordered.splice(fromIndex, 1)- reordered.splice(toIndex, 0, moved)- return reordered- },+ persistPinnedPropertiesSuccess: ({ config }) => {+ actions.setDraftPinnedProperties([...config.pinned_properties])+ const customPropertyCount = config.pinned_properties.filter(+ ({ kind }) => kind === 'custom_property'+ ).length+ posthog.capture(AccountsEvents.PinnedPropertiesSaved, {+ pinned_count: config.pinned_properties.length,+ custom_property_count: customPropertyCount,+ relationship_count: config.pinned_properties.length - customPropertyCount,+ })},- ],- }),- selectors({- pinnedPropertyResolution: [- (s) => [s.config, s.availableDefinitions],- (- config: UserCustomerAnalyticsConfigApi | null,- definitions: AvailableDefinitions | null- ): PinnedPropertyResolution =>- config && definitions- ? resolvePinnedProperties(config.pinned_properties, definitions)- : { resolved: [], stale: [] },- ],- resolvedPinnedProperties: [- (s) => [s.pinnedPropertyResolution],- (resolution: PinnedPropertyResolution): ResolvedPinnedAccountProperty[] => resolution.resolved,- ],- stalePinnedProperties: [- (s) => [s.pinnedPropertyResolution],- (resolution: PinnedPropertyResolution): PinnedAccountProperty[] => resolution.stale,- ],- draftPinLimitReached: [- (s) => [s.draftPinnedProperties],- (draft: PinnedAccountProperty[]): boolean => draft.length >= MAX_PINNED_ACCOUNT_PROPERTIES,- ],- canSavePinnedProperties: [- (s) => [s.isConfiguring, s.config, s.draftPinnedProperties, s.configLoading],- (- isConfiguring: boolean,- config: UserCustomerAnalyticsConfigApi | null,- draft: PinnedAccountProperty[],- saving: boolean- ): boolean =>- isConfiguring && config !== null && !saving && !pinnedPropertiesEqual(config.pinned_properties, draft),- ],- }),- listeners(({ actions, values }) => ({- beginConfiguring: () => {- actions.setDraftPinnedProperties(values.resolvedPinnedProperties.map(({ reference }) => reference))- },- cancelConfiguring: () => {- actions.setDraftPinnedProperties(values.resolvedPinnedProperties.map(({ reference }) => reference))- },- savePinnedProperties: () => {- if (values.canSavePinnedProperties) {- actions.persistPinnedProperties({ pinnedProperties: values.draftPinnedProperties })+ })),+ afterMount(({ actions, props }) => {+ if (props.projectId > 0) {+ actions.loadConfig()+ actions.loadAvailableDefinitions()}- },- persistPinnedPropertiesSuccess: ({ config }) => {- actions.setDraftPinnedProperties([...config.pinned_properties])- const customPropertyCount = config.pinned_properties.filter(({ kind }) => kind === 'custom_property').length- posthog.capture(AccountsEvents.PinnedPropertiesSaved, {- pinned_count: config.pinned_properties.length,- custom_property_count: customPropertyCount,- relationship_count: config.pinned_properties.length - customPropertyCount,- })- },- })),- afterMount(({ actions, props }) => {- if (props.projectId > 0) {- actions.loadConfig()- actions.loadAvailableDefinitions()- }- }),-])+ }),+ ])diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.test.ts b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.test.tsindex ee20b442960c..9b4899e3aae8 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.test.ts+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.test.ts@@ -242,27 +242,33 @@ describe('accountSidebarPropertiesLogic', () => {})})- it('reports saved values and assignments as account product events', async () => {- const capture = jest.spyOn(posthog, 'capture').mockImplementation()- await mount()- await expectLogic(logic, () =>- logic.actions.saveCustomProperty('custom:property-1', 'Growth')- ).toFinishAllListeners()- expect(capture).toHaveBeenCalledWith(AccountsEvents.CustomPropertyUpdated, {- display_type: 'text',- workflow_reference: false,- source: 'account_sidebar',- })- await expectLogic(logic, () =>- logic.actions.saveRelationship('relationship:relationship-1', [2])- ).toFinishAllListeners()- expect(capture).toHaveBeenCalledWith(AccountsEvents.RoleAssigned, {- role: relationshipDefinition.name,- is_assigned: true,- assigned_user_id: 2,- source: 'account_sidebar',- })- })+ it.each([+ { source: undefined, expectedSource: 'account_sidebar' },+ { source: 'list_expansion', expectedSource: 'list_expansion' },+ ] as const)(+ 'reports saved values and assignments with $expectedSource attribution',+ async ({ source, expectedSource }) => {+ const capture = jest.spyOn(posthog, 'capture').mockImplementation()+ await mount()+ await expectLogic(logic, () =>+ logic.actions.saveCustomProperty('custom:property-1', 'Growth', source)+ ).toFinishAllListeners()+ expect(capture).toHaveBeenCalledWith(AccountsEvents.CustomPropertyUpdated, {+ display_type: 'text',+ workflow_reference: false,+ source: expectedSource,+ })+ await expectLogic(logic, () =>+ logic.actions.saveRelationship('relationship:relationship-1', [2], source)+ ).toFinishAllListeners()+ expect(capture).toHaveBeenCalledWith(AccountsEvents.RoleAssigned, {+ role: relationshipDefinition.name,+ is_assigned: true,+ assigned_user_id: 2,+ source: expectedSource,+ })+ }+ )it('keeps the editor and existing value after a failed save', async () => {silenceKeaLoadersErrors()diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.ts b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.tsindex ec655816fdcd..076c4bdf4015 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.ts+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/accountSidebarPropertiesLogic.ts@@ -51,6 +51,7 @@ export interface AccountSidebarPropertiesLogicProps {}export type AccountPropertiesPanelState = 'loading' | 'failed' | 'ready'+export type AccountPropertyEditSource = 'account_sidebar' | 'list_expansion'export interface RelationshipEditBaseline {propertyKey: string@@ -117,11 +118,13 @@ export interface accountSidebarPropertiesLogicActions {}: {definitionId: stringpropertyKey: string+ source: AccountPropertyEditSourcevalue: AccountCustomPropertyValue}) => {propertyKey: stringdefinitionId: stringvalue: AccountCustomPropertyValue+ source: AccountPropertyEditSource}persistCustomPropertyFailure: (error: string,@@ -136,6 +139,7 @@ export interface accountSidebarPropertiesLogicActions {propertyKey: stringdefinitionId: stringvalue: AccountCustomPropertyValue+ source: AccountPropertyEditSource}) => {savedPropertyKey: string@@ -143,6 +147,7 @@ export interface accountSidebarPropertiesLogicActions {propertyKey: stringdefinitionId: stringvalue: AccountCustomPropertyValue+ source: AccountPropertyEditSource}}persistRelationship: ({@@ -157,12 +162,14 @@ export interface accountSidebarPropertiesLogicActions {memberIds: number[]propertyKey: stringsingleHolder: boolean+ source: AccountPropertyEditSource}) => {propertyKey: stringdefinitionId: stringmemberIds: number[]singleHolder: booleanbaseline: RelationshipEditBaseline+ source: AccountPropertyEditSource}persistRelationshipFailure: (error: string,@@ -179,6 +186,7 @@ export interface accountSidebarPropertiesLogicActions {memberIds: number[]singleHolder: booleanbaseline: RelationshipEditBaseline+ source: AccountPropertyEditSource}) => {savedPropertyKey: string@@ -188,6 +196,7 @@ export interface accountSidebarPropertiesLogicActions {memberIds: number[]singleHolder: booleanbaseline: RelationshipEditBaseline+ source: AccountPropertyEditSource}}recordRelationshipAddition: (@@ -210,17 +219,21 @@ export interface accountSidebarPropertiesLogicActions {}saveCustomProperty: (propertyKey: string,- value: AccountCustomPropertyValue+ value: AccountCustomPropertyValue,+ source?: AccountPropertyEditSource) => {propertyKey: string+ source: AccountPropertyEditSourcevalue: AccountCustomPropertyValue}saveRelationship: (propertyKey: string,- memberIds: number[]+ memberIds: number[],+ source?: AccountPropertyEditSource) => {memberIds: number[]propertyKey: string+ source: AccountPropertyEditSource}setRelationshipEditBaseline: (baseline: RelationshipEditBaseline) => {baseline: RelationshipEditBaseline@@ -289,8 +302,16 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertieactions({editProperty: (property: AccountSidebarProperty) => ({ property }),cancelEditing: true,- saveCustomProperty: (propertyKey: string, value: AccountCustomPropertyValue) => ({ propertyKey, value }),- saveRelationship: (propertyKey: string, memberIds: number[]) => ({ propertyKey, memberIds }),+ saveCustomProperty: (+ propertyKey: string,+ value: AccountCustomPropertyValue,+ source: AccountPropertyEditSource = 'account_sidebar'+ ) => ({ propertyKey, value, source }),+ saveRelationship: (+ propertyKey: string,+ memberIds: number[],+ source: AccountPropertyEditSource = 'account_sidebar'+ ) => ({ propertyKey, memberIds, source }),setRelationshipEditBaseline: (baseline: RelationshipEditBaseline) => ({ baseline }),recordRelationshipRemoval: (propertyKey: string, memberId: number, assignmentId: string) => ({propertyKey,@@ -331,6 +352,7 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertiepropertyKey: stringdefinitionId: stringvalue: AccountCustomPropertyValue+ source: AccountPropertyEditSource}): Promise<string> => {await api.accountsCustomPropertyValuesCreate(String(props.projectId), props.accountId, {definition: definitionId,@@ -350,6 +372,7 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertiememberIds: number[]singleHolder: booleanbaseline: RelationshipEditBaseline+ source: AccountPropertyEditSource}): Promise<string> => {const projectId = String(props.projectId)const current = await api.accountsRelationshipsList(projectId, props.accountId)@@ -554,7 +577,7 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertieactions.ensureAllMembersLoaded()}},- saveCustomProperty: ({ propertyKey, value }) => {+ saveCustomProperty: ({ propertyKey, value, source }) => {const property = values.sidebarProperties.find((row) => row.key === propertyKey)if (values.savingPropertyKey ||@@ -564,9 +587,9 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertie) {return}- actions.persistCustomProperty({ propertyKey, definitionId: property.definition.id, value })+ actions.persistCustomProperty({ propertyKey, definitionId: property.definition.id, value, source })},- saveRelationship: ({ propertyKey, memberIds }) => {+ saveRelationship: ({ propertyKey, memberIds, source }) => {const property = values.sidebarProperties.find((row) => row.key === propertyKey)if (values.savingPropertyKey || property?.kind !== 'relationship' || property.editable === false) {return@@ -594,16 +617,17 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertiememberIds: selected,singleHolder: property.definition.is_single_holder !== false,baseline,+ source,})},- persistCustomPropertySuccess: ({ savedPropertyKey }) => {+ persistCustomPropertySuccess: ({ savedPropertyKey, payload }) => {const property = values.sidebarProperties.find((row) => row.key === savedPropertyKey)if (property?.kind === 'custom') {// The property name and value stay out because they can hold customer data.posthog.capture(AccountsEvents.CustomPropertyUpdated, {display_type: property.definition.display_type,workflow_reference: property.definition.has_workflow_reference,- source: 'account_sidebar',+ source: payload?.source ?? 'account_sidebar',})}refresh()@@ -616,7 +640,7 @@ export const accountSidebarPropertiesLogic: LogicWrapper<accountSidebarPropertierole: ROLE_KEY_BY_NAME[property.definition.name] ?? property.definition.name,is_assigned: memberIds.length > 0,assigned_user_id: memberIds.length === 1 ? memberIds[0] : null,- source: 'account_sidebar',+ source: payload?.source ?? 'account_sidebar',})}refresh()diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedProperties.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedProperties.tsxindex 70b5869054c2..1718a75f9068 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedProperties.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedProperties.tsx@@ -1,25 +1,28 @@+import clsx from 'clsx'+import * as businessEvolutionPng from '@posthog/brand/hoggies/png/business-evolution'import { IconGear, IconPin } from '@posthog/icons'import { LemonButton } from '@posthog/lemon-ui'import { pngHoggie } from 'lib/brand/hoggies'-import { AccountPropertyRow, AccountPropertyRowProps } from './AccountPropertyRow'+import { AccountPropertyField, AccountPropertyFieldProps } from './AccountPropertyField'import type { AccountSidebarProperty } from './accountPropertyTypes'const HedgehogBusiness = pngHoggie(businessEvolutionPng)export interface AccountPinnedPropertiesProps {properties: AccountSidebarProperty[]+ layout?: 'vertical' | 'horizontal'editingPropertyKey?: string | nullsavingPropertyKey?: string | null- availableMembers?: AccountPropertyRowProps['availableMembers']+ availableMembers?: AccountPropertyFieldProps['availableMembers']membersLoading?: booleanonConfigure: () => voidonEdit: (property: AccountSidebarProperty) => voidonCancelEdit: () => void- onSaveCustomProperty: AccountPropertyRowProps['onSaveCustomProperty']- onSaveRelationship: AccountPropertyRowProps['onSaveRelationship']+ onSaveCustomProperty: AccountPropertyFieldProps['onSaveCustomProperty']+ onSaveRelationship: AccountPropertyFieldProps['onSaveRelationship']}export function AccountPinnedPropertiesEmptyState({ onConfigure }: { onConfigure: () => void }): JSX.Element {@@ -42,6 +45,7 @@ export function AccountPinnedPropertiesEmptyState({ onConfigure }: { onConfigureexport function AccountPinnedProperties({properties,+ layout = 'vertical',editingPropertyKey = null,savingPropertyKey = null,availableMembers,@@ -60,7 +64,7 @@ export function AccountPinnedProperties({<LemonButtonsize="xsmall"icon={<IconGear />}- className="ml-auto"+ className={layout === 'horizontal' ? 'ml-1' : 'ml-auto'}tooltip="Choose pinned properties"aria-label="Configure pinned properties"onClick={onConfigure}@@ -71,20 +75,33 @@ export function AccountPinnedProperties({{properties.length === 0 ? (<AccountPinnedPropertiesEmptyState onConfigure={onConfigure} />) : (- <div className="flex flex-col gap-4 min-h-0 overflow-y-auto px-4 pt-4 pb-5">+ <div+ className={clsx(+ 'flex gap-4 min-h-0 overflow-y-auto px-4 pt-4 pb-5',+ layout === 'horizontal' ? 'flex-wrap items-start' : 'flex-col'+ )}+ >{properties.map((property) => (- <AccountPropertyRow+ <divkey={property.key}- property={property}- editing={editingPropertyKey === property.key}- saving={savingPropertyKey === property.key}- availableMembers={availableMembers}- membersLoading={membersLoading}- onEdit={() => onEdit(property)}- onCancel={onCancelEdit}- onSaveCustomProperty={onSaveCustomProperty}- onSaveRelationship={onSaveRelationship}- />+ className={clsx(+ 'min-w-0',+ layout === 'horizontal' && 'max-w-64',+ layout === 'horizontal' && editingPropertyKey === property.key && 'w-64'+ )}+ >+ <AccountPropertyField+ property={property}+ editing={editingPropertyKey === property.key}+ saving={savingPropertyKey === property.key}+ availableMembers={availableMembers}+ membersLoading={membersLoading}+ onEdit={() => onEdit(property)}+ onCancel={onCancelEdit}+ onSaveCustomProperty={onSaveCustomProperty}+ onSaveRelationship={onSaveRelationship}+ />+ </div>))}</div>)}diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedPropertiesPanel.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedPropertiesPanel.tsxnew file mode 100644index 000000000000..50959f2d676f--- /dev/null+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPinnedPropertiesPanel.tsx@@ -0,0 +1,169 @@+import clsx from 'clsx'+import { useActions, useValues } from 'kea'++import { LemonBanner, LemonSkeleton } from '@posthog/lemon-ui'++import { projectLogic } from 'scenes/projectLogic'++import {+ accountSidebarConfigLogic,+ configuratorKeysToPinnedProperties,+ pinnedPropertyToConfiguratorKey,+} from '../accountSidebarConfigLogic'+import { AccountPropertyEditSource, accountSidebarPropertiesLogic } from '../accountSidebarPropertiesLogic'+import { AccountPinnedProperties, AccountPinnedPropertiesProps } from './AccountPinnedProperties'+import { AccountPropertyConfigurator } from './AccountPropertyConfigurator'+import type { AccountPropertyOption } from './accountPropertyTypes'++export interface AccountPinnedPropertiesPanelProps {+ accountId: string+ layout?: AccountPinnedPropertiesProps['layout']+ source?: AccountPropertyEditSource+}++export function AccountPinnedPropertiesPanel({+ accountId,+ layout = 'vertical',+ source = 'account_sidebar',+}: AccountPinnedPropertiesPanelProps): JSX.Element {+ const { currentProjectId } = useValues(projectLogic)+ const projectId = currentProjectId ?? 0+ const configLogic = accountSidebarConfigLogic({ projectId })+ const {+ availableDefinitions,+ availableDefinitionsLoading,+ canSavePinnedProperties,+ config,+ configLoading,+ draftPinnedProperties,+ activeConfiguratorKey,+ stalePinnedProperties,+ } = useValues(configLogic)+ const {+ beginConfiguring,+ cancelConfiguring,+ loadAvailableDefinitions,+ loadConfig,+ savePinnedProperties,+ setDraftPinnedProperties,+ } = useActions(configLogic)+ const propertyLogic = accountSidebarPropertiesLogic({ accountId, projectId })+ const {+ sidebarProperties,+ propertiesPanelState,+ propertiesRefreshFailed,+ propertyDataLoading,+ propertySaveFailed,+ editingPropertyKey,+ savingPropertyKey,+ availableMembers,+ membersLoading,+ } = useValues(propertyLogic)+ const { loadPropertyData, editProperty, cancelEditing, saveCustomProperty, saveRelationship } =+ useActions(propertyLogic)+ const retryLoading = configLoading || availableDefinitionsLoading || propertyDataLoading+ const retryLoad = (): void => {+ if (!retryLoading) {+ loadConfig()+ loadAvailableDefinitions()+ loadPropertyData()+ }+ }+ const configuratorKey = `${source}:${accountId}`+ const propertyOptions: AccountPropertyOption[] = [+ ...(availableDefinitions?.customProperties ?? []).map((definition) => ({+ key: pinnedPropertyToConfiguratorKey({ kind: 'custom_property', id: definition.id }),+ label: definition.name,+ kind: 'custom' as const,+ })),+ ...(availableDefinitions?.relationships ?? []).map((definition) => ({+ key: pinnedPropertyToConfiguratorKey({ kind: 'relationship', id: definition.id }),+ label: definition.name,+ kind: 'relationship' as const,+ })),+ ]++ return (+ <div className="flex flex-col flex-1 min-h-0" data-attr="account-rail-properties">+ {propertiesPanelState !== 'ready' ? (+ <div className="flex flex-col gap-3 p-4">+ <span className="secondary text-secondary">Properties</span>+ {propertiesPanelState === 'failed' ? (+ <LemonBanner+ type="error"+ action={{ children: 'Try again', onClick: retryLoad, loading: retryLoading }}+ >+ Could not load pinned properties.+ </LemonBanner>+ ) : (+ <div+ className={clsx('flex gap-2', layout === 'horizontal' ? 'flex-wrap' : 'flex-col')}+ data-attr="account-pinned-properties-loading"+ >+ <LemonSkeleton className={layout === 'horizontal' ? 'h-10 w-48' : 'h-4 w-full'} />+ <LemonSkeleton className={layout === 'horizontal' ? 'h-10 w-48' : 'h-4 w-3/4'} />+ </div>+ )}+ </div>+ ) : (+ <>+ {stalePinnedProperties.length > 0 ? (+ <div className="px-4 pt-4">+ <LemonBanner type="warning">+ Some pinned properties are no longer available. Update your pins to remove them.+ </LemonBanner>+ </div>+ ) : null}+ {propertySaveFailed ? (+ <div className="px-4 pt-4">+ <LemonBanner type="error">+ Could not save this property. Review the value and try again.+ </LemonBanner>+ </div>+ ) : null}+ {propertiesRefreshFailed ? (+ <div className="px-4 pt-4">+ <LemonBanner+ type="warning"+ action={{ children: 'Try again', onClick: retryLoad, loading: retryLoading }}+ >+ Could not refresh pinned properties. These values may be out of date.+ </LemonBanner>+ </div>+ ) : null}+ <AccountPinnedProperties+ properties={sidebarProperties}+ layout={layout}+ editingPropertyKey={editingPropertyKey}+ savingPropertyKey={savingPropertyKey}+ availableMembers={availableMembers}+ membersLoading={membersLoading}+ onConfigure={() => beginConfiguring(configuratorKey)}+ onEdit={(property) => {+ if (!savingPropertyKey) {+ editProperty(property)+ }+ }}+ onCancelEdit={() => {+ if (!savingPropertyKey) {+ cancelEditing()+ }+ }}+ onSaveCustomProperty={(property, value) => saveCustomProperty(property.key, value, source)}+ onSaveRelationship={(property, memberIds) => saveRelationship(property.key, memberIds, source)}+ />+ </>+ )}+ <AccountPropertyConfigurator+ isOpen={activeConfiguratorKey === configuratorKey}+ options={propertyOptions}+ pinnedPropertyKeys={draftPinnedProperties.map(pinnedPropertyToConfiguratorKey)}+ onChange={(keys) => setDraftPinnedProperties(configuratorKeysToPinnedProperties(keys))}+ onSave={() => savePinnedProperties()}+ onCancel={cancelConfiguring}+ saving={configLoading && config !== null}+ saveDisabledReason={!configLoading && !canSavePinnedProperties ? 'No changes to save' : undefined}+ />+ </div>+ )+}diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyComponents.stories.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyComponents.stories.tsxindex 6d7c68d1db76..3997e495fc14 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyComponents.stories.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyComponents.stories.tsx@@ -9,7 +9,7 @@ import type {import { AccountPinnedProperties } from './AccountPinnedProperties'import { AccountPropertyConfigurator } from './AccountPropertyConfigurator'-import { AccountPropertyRow } from './AccountPropertyRow'+import { AccountPropertyField } from './AccountPropertyField'import type {AccountCustomProperty,AccountCustomPropertyValue,@@ -174,7 +174,7 @@ export const CustomPropertyEditors: Story = {}),}),].map((property) => (- <AccountPropertyRow+ <AccountPropertyFieldkey={property.key}property={property}editing@@ -195,7 +195,7 @@ export const DateAndDatetimeEditors: Story = {customProperty('date', 'Renewal date', 'date', '2026-11-14'),customProperty('datetime', 'Next check-in', 'datetime', '2026-09-18T14:30:00Z'),].map((property) => (- <AccountPropertyRow+ <AccountPropertyFieldkey={property.key}property={property}editing@@ -216,7 +216,7 @@ export const RelationshipEditors: Story = {relationshipProperty('owner', 'Account owner', [MEMBERS[0]], true),relationshipProperty('team', 'Account team', [MEMBERS[0], MEMBERS[1]], false),].map((property) => (- <AccountPropertyRow+ <AccountPropertyFieldkey={property.key}property={property}editingdiff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyRow.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyField.tsxsimilarity index 93%rename from products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyRow.tsxrename to products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyField.tsxindex f562fc146f51..5fa4a5939f44 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyRow.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyField.tsx@@ -19,7 +19,7 @@ const PROVENANCE = {canonical: { icon: <IconLogomark />, title: 'Managed by PostHog' },} as const-export interface AccountPropertyRowProps {+export interface AccountPropertyFieldProps {property: AccountSidebarPropertyediting?: booleansaving?: boolean@@ -31,7 +31,7 @@ export interface AccountPropertyRowProps {onSaveRelationship: (property: AccountRelationshipProperty, memberIds: number[]) => void}-export function AccountPropertyRow({+export function AccountPropertyField({property,editing = false,saving = false,@@ -41,16 +41,17 @@ export function AccountPropertyRow({onCancel,onSaveCustomProperty,onSaveRelationship,-}: AccountPropertyRowProps): JSX.Element {+}: AccountPropertyFieldProps): JSX.Element {const editable =property.editable !== false &&(property.kind === 'relationship' || isCustomPropertyEditable(property.provenance))const provenance =property.kind === 'custom' && property.provenance !== 'manual' ? PROVENANCE[property.provenance] : null+ // Keep the data-attr stable for existing selectors and autocapture.return (<div className="flex flex-col gap-1 min-w-0" data-attr="account-property-row">- <div className="flex items-center gap-1 min-w-0">+ <div className="flex items-center gap-1 min-w-0 min-h-7"><span className="text-xs text-secondary truncate">{property.definition.name}</span>{provenance ? (<Tooltip title={provenance.title}>diff --git a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyValue.tsx b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyValue.tsxindex 7852add78f81..4b5e2bf36404 100644--- a/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyValue.tsx+++ b/products/customer_analytics/frontend/scenes/CustomerAnalyticsAccountScene/components/AccountPropertyValue.tsx@@ -49,8 +49,8 @@ export function AccountPropertyValue({ property }: AccountPropertyValueProps): J}if (definition.display_type === 'link') {return (- <Link to={raw} target="_blank" className="text-sm font-medium truncate">- {raw}+ <Link to={raw} target="_blank" className="inline-flex min-w-0 max-w-full items-center text-sm font-medium">+ <span className="min-w-0 truncate">{raw}</span></Link>)}