Skip to content

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

fix(signals): polish the inbox experience (#75918)

Joshua Snyder007c2fd49d02
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 46a65ea28a60..b30593747926 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6167,9 +6167,9 @@ snapshots:
scenes-app-inbox-badges--all-badges--light:
hash: v1.k794b7964.eb6c618365a2f71c3bae1048839e9bb22601b73251ca408f8148a2f100d017e9.nFG7aYMzOmD0fdEDVImBV9jAXIPzEDyS50osIR9Sfq4
scenes-app-inbox-cards--agent-run-cards--dark:
- hash: v1.k794b7964.eafcba5a360dcea9f1f81cd7a0fa13b129e431f82b0cd449591c8b1948b69ce3.2aP6yNGhopTjqr_kp2eAiKKZGb2sI66mv05_7TwAwFI
+ hash: v1.k794b7964.7cc4dbc1b4a83c8bf268f09c3d00e8b7603c512cdd0c3cc0d75f4b981e5dc5ab.wTpmY_L9kXga6yhoZsATY70EN3UhqZAs-YdxGBCZBWQ
scenes-app-inbox-cards--agent-run-cards--light:
- hash: v1.k794b7964.2f0310389210fb4cf021550235e8c94199e3a392084d32645d3a0c7b0eee85d6.5_4EeCpl7gsJi9M74RPEAahaZsqFmpJZ6qckqb7wX_g
+ hash: v1.k794b7964.0c1350cc50f4a98d14f58b5329d0e08437f276dad0b9736f094f68e853e57d2f.eq-SJ5v2scAJ-__cH2lH0HznF0weI4gaQ9Q0kYsoD4Y
scenes-app-inbox-cards--pull-request-cards--dark:
hash: v1.k794b7964.b23c84531657d326514d14d1bde04a1c927ac5e93a9607216e53513dc2db5fa7.VlAHL_A2I0CC8MS6nIzpvQZTywu0NDgSB-MwXBa0yik
scenes-app-inbox-cards--pull-request-cards--light:
@@ -6187,37 +6187,37 @@ snapshots:
scenes-app-inbox-cards--skeleton--light:
hash: v1.k794b7964.24c19ab5df1e4ccb843b1ad726752e3a98aeadaa08595e66cb4b41aff1a9e9a1.Y3z44tkU4jsAYUyXxfl72fTuZ0MKA6_S6TTNCKt5jSg
scenes-app-inbox-detail--pull-request--dark:
- hash: v1.k794b7964.b8370a8399a648e58ed67c883e2b161b69a02ac936c4e993f74a679805b39b42.gtFMLEAfUQpXBvVNSkhBzxIZIqGJ1SajDXWzwyU79wo
+ hash: v1.k794b7964.01b9f517399ad650a60b13fadac37de85f986e64c47e7e9bed1e1876493beb47.dMMi7HBrY6yXSdNP-iOeuDm3cuur7dWs7hX7XrHqvH4
scenes-app-inbox-detail--pull-request--light:
- hash: v1.k794b7964.f48ea10d3c0d1d11f3904b3323ec8b29d1aaa95762a6f5dc314be41b68a693ce.3_l-PPkzVBLxXUvZ7XV6lBoCwFONQuVyMGt8Gf6IFMA
+ hash: v1.k794b7964.aaa19249d10280a8a3a2fbe0d272bb92857594f563ba4dc65007aeea132b2348.ez2uIv2WtBJQqVFIT3-cl9KpXKAcFwGIrAJSQGFewKs
scenes-app-inbox-detail--pull-request-checks-passing--dark:
- hash: v1.k794b7964.296dae509cd0e88a9fef7adbba5235af5aef8b74c1077cb685bbd16b997c0dc6.pjqTvvIFWGFu-vDrjsSl9Fup4wniL2SMyMJNZFb3u8w
+ hash: v1.k794b7964.2c8a139c5425582bb45eeec6ac7748cb5d3154baf3e8ba9358053afe054bdbfc.m3TLZWxzKBe1SsPlqFjed6nllVHH9wE77MrN05lP_so
scenes-app-inbox-detail--pull-request-checks-passing--light:
- hash: v1.k794b7964.8ba943a5363361d2601424e24d9289871bb4f42740c06dac27d8271def4a776d.R4C955XzaYHRnuIl4FBOZ9x7v3CiQ31wU6Hr5Br3xfY
+ hash: v1.k794b7964.2f9336e37cbf3bb5421fb50d18931f05b28ce0d99d46f02e026f30e00b2bd521.ajjpV0YlDZVHkXaAebOFBV65SLb7n7MISefHfgsebZ0
scenes-app-inbox-detail--pull-request-inline-review--dark:
- hash: v1.k794b7964.d89260b7e4099b17bebc621f5fab5f60a4ea1f530f4f6a994cf638007c080780.qIhljJsqUfvb5UPvvziAxf40gPoquL8TzLdLYm2yJbs
+ hash: v1.k794b7964.9aebf006bc921af70c5fa5af9990ff0985fa97ebb819328ac40f822b4844d23f.77wJBf5d-kViD1SVpKvxhH97GZ_p6JsaPu-Onq8x2N8
scenes-app-inbox-detail--pull-request-inline-review--light:
- hash: v1.k794b7964.a0b8ef0276c5408dc8f4a446c5a5cdf9b38d3b352e49dc19395335ee6a8594a5.wjqDJQ8urXkDgA_OzMPYRbMjEi5G5Tt1lTr0rr__vPo
+ hash: v1.k794b7964.e0b8673051eb375fcb8d3c77c44c965a7554838cc7ce0d32a9408302e726ca02.PHTGsh0v-Ae3QJoxG6NbFVdJrKQNNQLH83p-oLuM7Tg
scenes-app-inbox-detail--report--dark:
- hash: v1.k794b7964.7d8d23d53f740cb1e8b997888cbcb9dbee00435eed8e5eacc1fcc6d2dad6a8d6.KYVM0YPMrcZ6XkUYksSmO8ZF3cp7sNQCEBwCrErlAzQ
+ hash: v1.k794b7964.164b9a72c712094cd45b70bd0f3159e8e39a3c654d77b8ac7900f9c46793b0e3.NzzSqFOrX32bisJz7gPiBHYu-HsrrEaTaXDkN9ok9uE
scenes-app-inbox-detail--report--light:
- hash: v1.k794b7964.c0a12c8d0c504d0ce845d3fbfe3f3e4547245de41d61b154f33ab35887c71fd1.gTimWdKq4P29_Cx0iws_O1BFE6x5s1cvRfzir9WHHXs
+ hash: v1.k794b7964.21c85a68f7f8a051553abad698e1ffb5aff9c58bea290024f9bb6e589174991f.70-jwvrc2BrUG-Y5dMO1GgHc-FlqhK7WEqKlmRT7lu0
scenes-app-inbox-detail--report-minimal--dark:
- hash: v1.k794b7964.3676de6a94630925c2e210de62205acc46b0d165c5e6dc578e4a1209d40a4f97.w8ARkpD1LiByx2d22RWyn_LDgeVRKGxyQx55Twrai2A
+ hash: v1.k794b7964.7644ad082e20b0c435bb6c601a9f660362d1aa7a96927ef121afeb2983befd61.ddMMmzCrsU2yNWGRhF5q8G91LMi_LvYJ4P-WPuUow1Y
scenes-app-inbox-detail--report-minimal--light:
- hash: v1.k794b7964.aabee1da3337a0a1026c68c81225666f19383c4cc60b5edd63caf43c23ae4432.fY3sCOLUTnDeA-xUXUwne3cOjwG8hXyhW1mL3P_JzFM
+ hash: v1.k794b7964.0a32aea4c317607d1cd1b87898ea7d281dccb06b371b4e427d937c1f86d05e88.LSZu5n6Jx__0pmRVSP_oS3PL9V5jV4U_woEkSvSxaBA
scenes-app-inbox-detail--run-failed--dark:
- hash: v1.k794b7964.5d491a322eb86759a572039987a748d8aaf5c01010679090addfbd2a75a52e29.reXybNQo0qgR8kjcxJ1fISgOZVjslxEen6cIxypw7dw
+ hash: v1.k794b7964.ad33e07815cb0e6e30df99d2063bd8e7309c45b679af8bedcdc5b2c4d856b6b0.cBKvjyVtarEyQOIyakdh7A5r0Z8LwtMQOb4cUIIiAGw
scenes-app-inbox-detail--run-failed--light:
- hash: v1.k794b7964.b8be1419a91b29151efe3c904e188f9e84cd0d40459c8d59db430f1e13d99317.Xibhj0VtymWZZNHKLVSM1ZFd0EcbM7k92ucOs9x4VH4
+ hash: v1.k794b7964.dc644c64d38b8833ca4499b0a3044f1f67194a8e782bd567fbc46bf14346dc8b.yA3wdSB6KfJUHHEcsqWj5jWKAyF3gt0mIdRu3wLF0SQ
scenes-app-inbox-detail--run-in-progress--dark:
- hash: v1.k794b7964.a2884c111c94f44a15b5da71b889c8f9c6adbbd4c2415a2ea18785645cb8572e.6PjhrAlpyqRMQJkP_DD3LcWh1wy4HqJNo6WUcgpGHgI
+ hash: v1.k794b7964.1fdc45ac3ca015d35279899793f5b24617a724ceacf503855ce21403896c528a.4NLHgaNJh-VLJBdPWNNs6ysih41hgVwiz3jHRNSrIvQ
scenes-app-inbox-detail--run-in-progress--light:
- hash: v1.k794b7964.3722e6892e9e9c2f75d7d1d08d4c92726884ee1a40514c692231c190afc91dc1.jyJSpon0uoS1ZXtY7qmR7zmxF_dJKA0QiVk39gU4mQ8
+ hash: v1.k794b7964.3280447230701a3952aaaeaa20546cf4fdd7cb6bf59e774434474db1ff1259b6.FalOTmGMllxGy34FOKz5mKdrUiSuvcektb4p-J7YWHc
scenes-app-inbox-detail--run-ready--dark:
- hash: v1.k794b7964.78d411ee566fc8dd186337dba1069824c0eec256b64f804012df7372c7bd8035.0F8uyX9EKZkjGJ24dxoJ5eImwq7Y5mzqHiGvmPvqXi8
+ hash: v1.k794b7964.6d107a93e2402c7b631a8b08a499cf66cf263d5824b8ea00d41bc71aad2e2180._kYZFhSpSDrjEmz582Sc82o8G6xkdE1zsWpLRmIQHVQ
scenes-app-inbox-detail--run-ready--light:
- hash: v1.k794b7964.478d8dd3fa8435f1f3dbb9b210b38fbeb7f83ebdfc5fb6c2ae09b7274f758df0.dBM4cFzhYVEDA31uWP-a_LJr2t2VCRRw5tGwQg3iA1w
+ hash: v1.k794b7964.fab9d3eb3072c04885cc093ae23b521cd78a483e1cb2c0c2729a5fae92ab486a.Jb-sfHDLzAMhlMxN-hfCQPegjhow5ztQwsHHU4knVys
scenes-app-inbox-pullrequestdiffview--default--dark:
hash: v1.k794b7964.564cd678d9da50089c918c63d37c816257091c6c9d7d2f957dc9c96f596d34dc.8ICzP4d5gRBF0h4CT87lZgk82tCHyXIOsszi6P3JQ-M
scenes-app-inbox-pullrequestdiffview--default--light:
@@ -6231,9 +6231,9 @@ snapshots:
scenes-app-inbox-pullrequestdiffview--split--light:
hash: v1.k794b7964.74769e897f6f9a035062fc6a3469f4c3d8300bc2d8c0cbe8bb84b77ca7c82cdd.27loOLbRLwOF7dws2J2thcoZDUDx-_IMP8Ob-nGXxrk
scenes-app-inbox-pullrequestdiffview--truncated--dark:
- hash: v1.k794b7964.a9f33212257b49f0c2e392f51b0cfd65578ffe8691c08e1c0e2fe58b018950fd.C2hRzkdQ0lvXg0bpcq6yaXOL67NYHLz77YazV00cFmQ
+ hash: v1.k794b7964.0b3e4e202fa54385e60e27040953cd6576ef81346e03c62c6fd38932ae05f1d8.cF9xbAe_hmO-rKLL45RToPLXmS8_zLnvi36jZ8OOpYY
scenes-app-inbox-pullrequestdiffview--truncated--light:
- hash: v1.k794b7964.c8211a05cd4404a003460d2c4abe79fb078edd5c7801422dbb3a5c55cc50f6a1.R85Q2EEe3EteBgaslGBlB4Vp7AdPgMstb0whb50OXyc
+ hash: v1.k794b7964.58a507666519d2ad2f2a5247605b2c903180639eae9e43580992de250bc8f258._lKwsnOWccjuN6S_pd8IgOfKLzqnIvVqmTh1uETW-TY
scenes-app-inbox-scene--empty--dark:
hash: v1.k794b7964.7e1c394905f5b9e19079d8229cdf82fc06e407e2df8c45b1f0e32a60ee057d7c.LwWT9XdFAeXgqPd2UqsInD8gyx7sQm5csEbwCpOLD6E
scenes-app-inbox-scene--empty--light:
@@ -6243,37 +6243,37 @@ snapshots:
scenes-app-inbox-scene--inbox--light:
hash: v1.k794b7964.cd4a9d438b8342df350fcc8de14e27707c460e73d08772f90fec51dcb346858d.pXZHp6MatJwXk0M_5UL2njnpvO02KcZWmTtPqoeaj6E
scenes-app-inbox-scene--self-driving-onboarding--dark:
- hash: v1.k794b7964.157a08e7eac299f9695c887ef4b94fc129b8973a8e68df1b5be6c94b14f39cd7.9L6YIsKiRmwqiuSb9bqDcddtelRDGeAcY355ZzTXaFI
+ hash: v1.k794b7964.9c0f77f61291c86c4d171c8c0b59684cc0b94eb68239488a5151e8eda4a7d27f.7phlMjtIUvtdFB8FLuy-G5iHj8QLvOrPm7v1rEPy4G0
scenes-app-inbox-scene--self-driving-onboarding--light:
- hash: v1.k794b7964.35ccf8547b124cd9adeaae5edaf9943755f7788cfd4296e2f6c254490c5e6c17.pvQ5JFSpCQy5ZVl3jGG9wuCyEMqfmS1PIXl49SD8Yzg
+ hash: v1.k794b7964.8ef3184a453d8082e2e3b7ae2716c4f40ea8c99c1b5f8a579c5bbc138985ad09.LjMg91MLj3APANRgr6pCKk697oexyrwWR0kgBpE6s4s
scenes-app-inbox-scene--self-driving-paused--dark:
hash: v1.k794b7964.e385c16a1f94b7727ed2a20922b7beaef00c3d0e32be197470756b9c0dac71f6.mPjf4UqjxfUf2fBtDcWNVyYXHBCCfXRr-ydi8ckhCIA
scenes-app-inbox-scene--self-driving-paused--light:
hash: v1.k794b7964.4af393b7f3b9cdb056c518fe5cfcc7c99e4503ad008af2b031867e6811560083.dF3I6JAteRnokBIPAdvOuUT0Gf6MwR1rhRHygDUW2V0
scenes-app-inbox-tabs--pull-requests--dark:
- hash: v1.k794b7964.dad4d6e7b9f1f68f8eaf4b31187c798dfab1631bb6bf20432ce9746f7df1de73.cqSvLKv0E6PFhnMnbn4FS6yIypKYMUKzoKniwrRI4WM
+ hash: v1.k794b7964.474d8e744637e08afd4bb7540f0f5dafd6a79342c2f547188cb436b55f9ef8e7.PiyD1Zkhkot-_DKLU3W0T5uA7rvpTUTn5bKChCa3AV4
scenes-app-inbox-tabs--pull-requests--light:
- hash: v1.k794b7964.14e9582540b6bc5b1317428e8e1d23af40ec25af89dc32f69d9c9285d21991d0.6ZsjOqA16A2bquJi7jFQdrWeRt4Mr0D39MkNEhULbq8
+ hash: v1.k794b7964.2f536248a597507f0202cdda59bcc0ffc7b3ccdc5e7b1a8178af0fecc9ecfba2.EtUqD0UhItunP8PNHDeSz5FNocV1-k92VM3nglZi1pk
scenes-app-inbox-tabs--pull-requests-empty--dark:
hash: v1.k794b7964.1d4af181c6117e856ae22c6626ec9e7fb2da7c3bfc8ff0839753630b8c319f88.-VmOVfKVBzzbKxrJnEv1bIRp_ALt4jCNOUaEdhfGGnY
scenes-app-inbox-tabs--pull-requests-empty--light:
hash: v1.k794b7964.2f37e400b13fc58fd9da0cbec33baf774d748b5f657d8e01f211279fa1cc3bc8.WUQwyDFDfAycOKSUi5hu_6_E_GoYzjvaCz81t-nCpxw
scenes-app-inbox-tabs--reports--dark:
- hash: v1.k794b7964.7357f1496b0ced08626ddaf250cd64b25f24d602520d9b474bbc6b302a5d500a.T14wP30w6OVGDJzuSsKvEzvZQ-OKxc4eZ1a3c7JEdIo
+ hash: v1.k794b7964.d95cee5559535f33bd4963fd971555034586640bf0d406b7ad052570e2046bc1._qv45Xhu9pPM4EtGFF69eh0RqPK7Wd8k02mi_VFL8e8
scenes-app-inbox-tabs--reports--light:
- hash: v1.k794b7964.a95125d53bc0563ef08e30c7c43a4fbd6a9b7485e9cfcff7e82989917c0d6868.UAllvTtrcQe4v6xoz8wRDk3HCd4iwPK-_u_ECWOWdl0
+ hash: v1.k794b7964.504f0df1e3542e3050bcb972ad0a2ae3e2aad8f0699298dc7677846bc9697387.75toSetYFL9Ki5ahkLrSbjf8xUb1UT5xjTdhq70rLaU
scenes-app-inbox-tabs--reports-empty--dark:
hash: v1.k794b7964.dbd4d6f1610597f52362997cd4eb267f76f0f83389aaad7456b520a4cb7fe3db.x3NKcd2qny9IyD98DEUibNjgw54FUFYjcSu4hzXp3uA
scenes-app-inbox-tabs--reports-empty--light:
hash: v1.k794b7964.ab92b2fbca46d78b4023ef3307438916929cedcd11115bef267c85c47d8c6f5c.tePbIytZ9KkZrM7Zq1agMtedIAjUZezv2poSPKME5NU
scenes-app-inbox-tabs--runs--dark:
- hash: v1.k794b7964.30fe310726aead4f09f594ce475c1303b7e6ff38bd1673126e64035012ffd2f2.s4aGGdrTFUM7DvYCHxLcHDyIB3Nw1JWvgR-C9IZWYyM
+ hash: v1.k794b7964.4ece3bdc6be5207a77eafc6d9005ce3a065539767d7a4da5f3f2f5f913bb3567.Wu4dnjXImAjEXPa2f8AdBAeJIwpnA-ak02ZeHI87kBo
scenes-app-inbox-tabs--runs--light:
- hash: v1.k794b7964.304943ce4896be55015e07b74573eb317592743f95964c06086e7092fb1748cb.0jLTUyO_t_0ykU7CSHoEBErQKTdAFHBofddoyiHn5Fo
+ hash: v1.k794b7964.9442c8fbd701295782fadce23184a56f86e7cb065e0ef4c86f7619cc51626ae8.GcHWMAKOH47WdIRe26bQc3uk_9GPWxqLEYiHf36jLUU
scenes-app-inbox-tabs--runs-empty--dark:
- hash: v1.k794b7964.518daac5f707800ff5992d10ba4a0dcc4537d8a75da9ef2aa5fd4b4990004eb8.OQK-NEvjEAYQowvlsEC5lLIANnbgDliAuz02JGQ7vQY
+ hash: v1.k794b7964.ed7903043c325ec7591671b53d2df134905055d743cbaf4bf2dcc33365ee95a6.jOZw9YQ97uY5xNUBtLQXMcOALI_NGOluZJLyJDTY7-k
scenes-app-inbox-tabs--runs-empty--light:
- hash: v1.k794b7964.fc11ca550f5f8f6776624816fef4c1ea404f02fa5d10f51d6d43c99bd1dc8c1b.j0aZ1w0ksh8VwU5ZviIBJFaWsyS2n7H1xs4M7WQMTXs
+ hash: v1.k794b7964.1c1e2ee4c9b76770be05d1525f39383dac46865662d7e634c037e2e31ee084d6.-Gj5SxUV7x_-pYkYfIkN3TCUPXLkWTaSklb1RzH3mRU
scenes-app-inbox-tabs--runs-loading--dark:
hash: v1.k794b7964.d38ecc24b68e0882dc1512cc6ef4bb769a00c7ff490bbf13332a6f5533413e5a.61RNA6mSoWWNHlewEQJtLjIId6TIRnnU1SLg5dkV8gQ
scenes-app-inbox-tabs--runs-loading--light:
@@ -7175,17 +7175,17 @@ snapshots:
scenes-app-sidepanels--side-panel-support--light:
hash: v1.k794b7964.87cae042d1f0a60a2c843a358cbb0c3ef2acd60284df8de0e84b9b7eb8d5084f.VMPQg6ury8nhCzIjULK0WgJTTN5h0vnVM4OZTx3A8ig
scenes-app-support-threadreportentry--fix-merged--dark:
- hash: v1.k794b7964.9b2ed403c9a96a40cdf57d0a8e6c71b8dab6f7a9343d17b16eba6d8b6d8cfe02.ubF_YTSkWvY2MEUK_U1jXy3Obh2NuJZDG7swlz7hEIs
+ hash: v1.k794b7964.e0c8db4f933b58c3af999c559176838e77f9e8b9d5b0566ec8ed08771f62cb30.FTz_l6gFhX_pFY7GyxECQ7-z2PTBJd6bvTO9emHIdM8
scenes-app-support-threadreportentry--fix-merged--light:
- hash: v1.k794b7964.829ae3009955f65e20e347921b596b84f053b63c0fefb7628200d15bc24ca4dc.s0B8u3UrlfAm03SqC5h276_MQeB4dxpKQ7OfyYC3sCU
+ hash: v1.k794b7964.4d85ada3e741f112f6ef6146670396a815049d7bf61b35635a986c4c66789772.ahIN-NvOJiFdaqqFUpzQvFlau0mrDS1EtocYjwOX_9c
scenes-app-support-threadreportentry--fix-proposed--dark:
- hash: v1.k794b7964.08572f013c4bebfa0cd3394b5bb15caa83bf8873a9ca6a6a0177141a0484b334.QNpHsOagxzWzpatB99DXnUwqAVNOKoea71jHT6_wQrI
+ hash: v1.k794b7964.e9ac3b84f6a7842f77db6062732f5a7aed01096e75c06e7cc9e6ca09e45633a7.96TR45nNq-Tc2guukMM35BbWyF8WRy0NOFfEiAl5Fas
scenes-app-support-threadreportentry--fix-proposed--light:
- hash: v1.k794b7964.88ff8b7ba4a60d059ca11c9b5ff8198feacc2f54bb876a482f5e38b64530ee6e.LgTD4VhKBOqNkpnDR7tGvkLOENb1gQs8F9wf-Ib4Pp4
+ hash: v1.k794b7964.c6c298530eeb24ccb24d03b4154c5bed13fe2c880f44c8c2f1b64c00de67d607.GL23s_Dpa4eOE1lQeklRM4jtk6sEaQ1FqSb8b5oPkvo
scenes-app-support-threadreportentry--several-reports-across-states--dark:
- hash: v1.k794b7964.bd7bb412a5652df533ddaaee34979952c4cc563214fdb9da0c2341c2ee3a42c0.2_uB4JqMmb5VC1ApVDY0uQTkdcOPfwsLn0EROX92oS4
+ hash: v1.k794b7964.4c731c34ab351c352581130456833a7c220bcd4c4e941798d3e4345fc40c463b.Z9eFNeKgXiA5Pc07ZqkMPLoc83WoFhfB2sf7_xHX-Kk
scenes-app-support-threadreportentry--several-reports-across-states--light:
- hash: v1.k794b7964.cda6dcd93ae53690e576d7cd55346d52945f7ab5a02ac997e71e2f57966ead0f.XW-a_SkxIsORQ3W4LRuIka6w6cMIRiv4ALyfr55J2i8
+ hash: v1.k794b7964.ec55e023b31b2a327072c0e9fe3b164f74d81a226aa3efae9d6fe79d98db5da6.R5v-7fBBPhhayu8hBAHgU6eyTieyIbMYD3ewFUeP_Vo
scenes-app-surveys--new-multi-question-survey-section--dark:
hash: v1.k794b7964.e4c838e9c192c01eab518de2435a2fef6d3ed65b727fe4c05af61eee010bf03d.yIm_bRCN_65TxDwWd9qVeapTEfZ5QAYSmpJbKKle8Hw
scenes-app-surveys--new-multi-question-survey-section--light:
diff --git a/frontend/src/layout/panel-layout/ai-first/NavLink.tsx b/frontend/src/layout/panel-layout/ai-first/NavLink.tsx
index 2c0ad012b260..7347af191bbc 100644
--- a/frontend/src/layout/panel-layout/ai-first/NavLink.tsx
+++ b/frontend/src/layout/panel-layout/ai-first/NavLink.tsx
@@ -41,7 +41,11 @@ export function NavLink({
const isHomePage = to === urls.projectRoot()
const currentPath = removeProjectIdIfPresent(pathname)
- const isActive = currentPath === to || (isHomePage && currentPath === urls.projectHomepage())
+ const isInbox = to === urls.inbox()
+ const isActive =
+ currentPath === to ||
+ (isHomePage && currentPath === urls.projectHomepage()) ||
+ (isInbox && currentPath.startsWith(`${to}/`))
const hasSideActionRight = !!sideAction && !isCollapsed
return (
diff --git a/frontend/src/lib/integrations/SlackChannelPicker.test.tsx b/frontend/src/lib/integrations/SlackChannelPicker.test.tsx
index e7b2bfa6a138..7bf40459bfcf 100644
--- a/frontend/src/lib/integrations/SlackChannelPicker.test.tsx
+++ b/frontend/src/lib/integrations/SlackChannelPicker.test.tsx
@@ -159,6 +159,30 @@ describe('SlackChannelPicker', () => {
expect(channelIdLookups).not.toContain('COFFPAGE9XX|#off-page-channel')
})
+ it('resolves a saved channel name when the picker is disabled without displaying its ID', async () => {
+ const { container } = render(
+ <Provider>
+ <SlackChannelPicker
+ integration={INTEGRATION}
+ value={OFF_PAGE_CHANNEL.id}
+ onChange={jest.fn()}
+ disabled
+ />
+ </Provider>
+ )
+
+ expect(container).not.toHaveTextContent(OFF_PAGE_CHANNEL.id)
+
+ await waitFor(
+ () => {
+ expect(channelIdLookups).toContain(OFF_PAGE_CHANNEL.id)
+ expect(container).toHaveTextContent(`#${OFF_PAGE_CHANNEL.name}`)
+ expect(container).not.toHaveTextContent(OFF_PAGE_CHANNEL.id)
+ },
+ { timeout: 2000 }
+ )
+ })
+
it('does not fire a direct lookup when there is no saved value', async () => {
render(
<Provider>
diff --git a/frontend/src/lib/integrations/SlackIntegrationHelpers.tsx b/frontend/src/lib/integrations/SlackIntegrationHelpers.tsx
index 895072b75e81..2e3c292325ad 100644
--- a/frontend/src/lib/integrations/SlackIntegrationHelpers.tsx
+++ b/frontend/src/lib/integrations/SlackIntegrationHelpers.tsx
@@ -69,10 +69,8 @@ const SLACK_CHANNEL_ID_PATTERN = /^[CGD][A-Z0-9]{8,}$/
const getSlackChannelOptions = (slackChannels?: SlackChannelType[] | null): LemonInputSelectOption[] | null => {
return slackChannels
? slackChannels.map((x) => {
- // Channel names are unique per workspace, so the friendly name alone identifies a channel.
- // Inaccessible private channels have no readable name, so there we keep the id to disambiguate.
const displayLabel = x.is_private_without_access
- ? `🔒Private channel (${x.id})`
+ ? '🔒Private channel'
: `${x.is_private ? '🔒' : '#'}${x.name}`
return {
key: `${x.id}|#${x.name}`,
@@ -134,7 +132,6 @@ export function SlackChannelPicker({ onChange, value, integration, disabled }: S
}
const showSlackMembershipWarning = value && isMemberOfSlackChannel(value) === false
- // Sometimes the parent will only store the channel ID and not the name, so we need to handle that
const modifiedValue = useMemo(() => {
if (value?.split('|').length === 1) {
const channel = slackChannels.find((x: SlackChannelType) => x.id === value)
@@ -157,21 +154,27 @@ export function SlackChannelPicker({ onChange, value, integration, disabled }: S
}
}, [logic, loadAllSlackChannels, disabled])
- // Workspaces with hundreds of channels can have the saved channel beyond the first page that
- // /channels returns. Without a direct lookup the channel never makes it into slackChannels, so
- // LemonInputSelect can't find an option matching the saved value's key and falls back to
- // displaying the raw value text — e.g. "C0881TYHT41|#sentry-alerts" instead of the friendly
- // "#sentry-alerts". Fire the by-id fetch for both bare and composite values so
- // the channel is merged into slackChannels regardless of bulk-list position; the label only
- // renders correctly when the option exists in the picker's options list.
+ // Read-only pickers still need a direct lookup because the saved channel may not be on the first page.
useEffect(() => {
- if (!disabled && value) {
+ if (value) {
const channelId = value.split('|')[0]
if (channelId) {
loadSlackChannelById(channelId)
}
}
- }, [loadSlackChannelById, value, disabled])
+ }, [loadSlackChannelById, value])
+
+ const fallbackOption = modifiedValue
+ ? {
+ key: modifiedValue,
+ label: modifiedValue.includes('|') ? modifiedValue.split('|')[1] : 'Slack channel',
+ }
+ : null
+ const availableOptions = slackChannelOptions() ?? []
+ const options =
+ fallbackOption && !availableOptions.some((option) => option.key === fallbackOption.key)
+ ? [...availableOptions, fallbackOption]
+ : availableOptions
return (
<>
@@ -235,23 +238,13 @@ export function SlackChannelPicker({ onChange, value, integration, disabled }: S
</Link>
</p>
}
- options={
- slackChannelOptions() ??
- (modifiedValue
- ? [
- {
- key: modifiedValue,
- label: modifiedValue?.split('|')[1] ?? modifiedValue,
- },
- ]
- : [])
- }
+ options={options}
loading={allSlackChannelsLoading || slackChannelByIdLoading}
/>
{allSlackChannels?.has_more && !allSlackChannelsLoading ? (
<p className="text-secondary text-xs mt-1 mb-0">
- Only the first page of channels is shown — type to search for a specific channel.
+ Only the first page of channels is shown. Type to search for a specific channel.
</p>
) : null}
diff --git a/frontend/src/lib/signals/SignalReportPrBadge.tsx b/frontend/src/lib/signals/SignalReportPrBadge.tsx
index 7835d3386e02..fddd16a0535c 100644
--- a/frontend/src/lib/signals/SignalReportPrBadge.tsx
+++ b/frontend/src/lib/signals/SignalReportPrBadge.tsx
@@ -1,12 +1,26 @@
-import { IconPullRequest } from '@posthog/icons'
-import { LemonTag, Link, Tooltip } from '@posthog/lemon-ui'
+import { IconPullRequest, type IconProps } from '@posthog/icons'
+import { Link, Tooltip } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
import { PR_BADGE_STATE, type PrBadgeState } from './prState'
-/**
- * PR status badge for the card's top-right corner: a state-colored tag with the pull-request
- * icon and `#1234`. When a PR URL is known the whole badge is the GitHub link itself.
- */
+function IconGitMerge(props: IconProps): JSX.Element {
+ return (
+ <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false" {...props}>
+ <path d="M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z" />
+ </svg>
+ )
+}
+
+function IconGitPullRequestClosed(props: IconProps): JSX.Element {
+ return (
+ <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false" {...props}>
+ <path d="M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75Zm-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97.97-.97a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.97.97.97.97a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-.97-.97-.97.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l.97-.97-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z" />
+ </svg>
+ )
+}
+
export function PrBadge({
prNumber,
prUrl,
@@ -16,11 +30,20 @@ export function PrBadge({
prUrl?: string | null
state: PrBadgeState
}): JSX.Element {
- const { label, type } = PR_BADGE_STATE[state]
+ const { label, className, hoverClassName } = PR_BADGE_STATE[state]
+ const StateIcon =
+ state === 'merged' ? IconGitMerge : state === 'closed' ? IconGitPullRequestClosed : IconPullRequest
const badge = (
- <LemonTag type={type} size="small" icon={<IconPullRequest />} className="font-mono tabular-nums">
- #{prNumber}
- </LemonTag>
+ <span
+ className={cn(
+ 'inline-flex h-5 items-center gap-1 rounded-full border px-1.5 text-xs font-medium transition-colors',
+ className,
+ prUrl && `cursor-pointer ${hoverClassName}`
+ )}
+ >
+ <StateIcon className="size-3" />
+ <span className="font-mono tabular-nums">#{prNumber}</span>
+ </span>
)
if (!prUrl) {
@@ -35,6 +58,7 @@ export function PrBadge({
disableClientSideRouting
onClick={(e) => e.stopPropagation()}
aria-label={`Open pull request #${prNumber} (${label}) on GitHub`}
+ className="no-underline"
>
{badge}
</Link>
diff --git a/frontend/src/lib/signals/prState.ts b/frontend/src/lib/signals/prState.ts
index 455fb09f3e3d..f43b9d903d9a 100644
--- a/frontend/src/lib/signals/prState.ts
+++ b/frontend/src/lib/signals/prState.ts
@@ -1,25 +1,29 @@
-import type { LemonTagType } from '@posthog/lemon-ui'
-
import { SignalReportStatus } from '~/scenes/inbox/types'
-/**
- * PR open/merged/closed state, mapped to muted palette tags (outlined: --success / --purple /
- * --danger). "merged" comes from `implementation_pr_merged`, the flag the GitHub webhook sets on
- * merge — report status can't stand in for it, since a report can be resolved directly without its
- * PR ever landing. A failed report means the PR never landed; everything else is still an open PR.
- *
- * Shared so every surface that shows a report's PR agrees on what its state means, including the
- * support ticket sidebar, where "did this ship?" is the question a teammate is answering.
- */
-export const PR_BADGE_STATE: Record<'open' | 'merged' | 'closed', { label: string; type: LemonTagType }> = {
- open: { label: 'open', type: 'success' },
- merged: { label: 'merged', type: 'completion' },
- closed: { label: 'closed', type: 'danger' },
+export const PR_BADGE_STATE = {
+ open: {
+ label: 'Open',
+ className: 'border-success bg-success-highlight text-success',
+ hoverClassName:
+ 'hover:border-success-dark hover:text-success-dark dark:hover:border-success-light dark:hover:text-success-light',
+ },
+ merged: {
+ label: 'Merged',
+ className:
+ 'border-[var(--color-purple-600)] bg-[color-mix(in_oklab,var(--color-purple-600)_10%,transparent)] text-[var(--color-purple-700)] dark:border-[var(--color-purple-400)] dark:bg-[color-mix(in_oklab,var(--color-purple-400)_10%,transparent)] dark:text-[var(--color-purple-300)]',
+ hoverClassName:
+ 'hover:border-[var(--color-purple-800)] hover:text-[var(--color-purple-800)] dark:hover:border-[var(--color-purple-200)] dark:hover:text-[var(--color-purple-200)]',
+ },
+ closed: {
+ label: 'Closed',
+ className: 'border-danger bg-danger-highlight text-danger',
+ hoverClassName:
+ 'hover:border-danger-dark hover:text-danger-dark dark:hover:border-danger-light dark:hover:text-danger-light',
+ },
}
export type PrBadgeState = keyof typeof PR_BADGE_STATE
-/** `status` is widened to string so callers holding the generated API enum can pass it directly. */
export function derivePrState(status: SignalReportStatus | string, prMerged: boolean): PrBadgeState {
if (prMerged) {
return 'merged'
diff --git a/frontend/src/scenes/inbox/InboxScene.tsx b/frontend/src/scenes/inbox/InboxScene.tsx
index 6e1d0a67c073..edf62f1cccd6 100644
--- a/frontend/src/scenes/inbox/InboxScene.tsx
+++ b/frontend/src/scenes/inbox/InboxScene.tsx
@@ -229,7 +229,7 @@ export function InboxScene(): JSX.Element {
// In the onboarding takeover the tabs are locked, so keep the overall pitch.
description={
onboardingMode === 'takeover'
- ? 'Self-driving for your product. Look through work done by PostHog agents – code changes and reports.'
+ ? 'Self-driving for your product. Look through code changes and reports from PostHog agents.'
: INBOX_TAB_DESCRIPTION[activeTab]
}
resourceType={{ type: 'inbox' }}
diff --git a/frontend/src/scenes/inbox/SourcesList.tsx b/frontend/src/scenes/inbox/SourcesList.tsx
index f5a753de7f58..e95dac216d84 100644
--- a/frontend/src/scenes/inbox/SourcesList.tsx
+++ b/frontend/src/scenes/inbox/SourcesList.tsx
@@ -217,7 +217,7 @@ export function SourcesList(): JSX.Element {
<Source
icon={<IconHeartPlus className="size-5 text-danger" />}
title="PostHog Health checks"
- description="Instrumentation issues – missing events, proxy gaps, outdated SDKs → Signals"
+ description="Instrumentation issues: missing events, proxy gaps, outdated SDKs → Signals"
variant="available"
checked={!!healthChecksConfig?.enabled}
loading={isHealthChecksToggling}
diff --git a/frontend/src/scenes/inbox/__mocks__/inboxMocks.ts b/frontend/src/scenes/inbox/__mocks__/inboxMocks.ts
index d4412a0abe82..11da7327b54e 100644
--- a/frontend/src/scenes/inbox/__mocks__/inboxMocks.ts
+++ b/frontend/src/scenes/inbox/__mocks__/inboxMocks.ts
@@ -81,7 +81,7 @@ export const reportTabReports: SignalReport[] = [
makeReport({
title: 'feat(onboarding): Users drop off at the SDK install step',
summary:
- 'A large share of new projects never send a first event – most stall on the SDK install step of onboarding.',
+ 'A large share of new projects never send a first event. Most stall on the SDK install step of onboarding.',
status: SignalReportStatus.READY,
priority: 'P3',
actionability: 'requires_human_input',
diff --git a/frontend/src/scenes/inbox/components/badges/SignalReportActionabilityBadge.tsx b/frontend/src/scenes/inbox/components/badges/SignalReportActionabilityBadge.tsx
index 4fbc38f0b631..c11ec58b687a 100644
--- a/frontend/src/scenes/inbox/components/badges/SignalReportActionabilityBadge.tsx
+++ b/frontend/src/scenes/inbox/components/badges/SignalReportActionabilityBadge.tsx
@@ -13,7 +13,7 @@ const ACTIONABILITY_STYLE: Record<
type: 'success',
label: 'Actionable',
tooltip:
- "The report can be solved with code. If there isn't a pull request yet, it fell below your auto-PR priority threshold – you can still start one from this report.",
+ "The report can be solved with code. If there isn't a pull request yet, it fell below your auto-PR priority threshold. You can still start one from this report.",
textColor: 'var(--success)',
},
requires_human_input: {
@@ -27,7 +27,7 @@ const ACTIONABILITY_STYLE: Record<
type: 'muted',
label: 'Not actionable',
tooltip:
- 'No useful code change can be derived – the report is too vague, lacks supporting evidence, or describes expected behavior.',
+ 'No useful code change can be derived because the report is too vague, lacks supporting evidence, or describes expected behavior.',
textColor: 'var(--color-text-secondary)',
},
}
diff --git a/frontend/src/scenes/inbox/components/badges/SignalReportBillingBadge.tsx b/frontend/src/scenes/inbox/components/badges/SignalReportBillingBadge.tsx
index 0ebd85db4310..da70661e6fd8 100644
--- a/frontend/src/scenes/inbox/components/badges/SignalReportBillingBadge.tsx
+++ b/frontend/src/scenes/inbox/components/badges/SignalReportBillingBadge.tsx
@@ -1,23 +1,29 @@
import { LemonTag, Tooltip } from '@posthog/lemon-ui'
+import { BillingExemptReasonEnumApi } from 'products/signals/frontend/generated/api.schemas'
+
import { SignalReport } from '../../types'
-const EXEMPT_TOOLTIPS: Record<string, string> = {
- posthog_health_check:
- "This report was found by PostHog's automated health checks on its own systems, so its PR is free.",
- posthog_onboarding: 'This report was created during your onboarding setup run, so its PR is free.',
+const EXEMPT_TOOLTIPS: Record<BillingExemptReasonEnumApi, string> = {
+ [BillingExemptReasonEnumApi.PosthogHealthCheck]:
+ 'This report came from a PostHog health check, so creating a pull request for it is free.',
+ [BillingExemptReasonEnumApi.PosthogOnboarding]:
+ 'This report was created during onboarding, so creating a pull request for it is free.',
+ [BillingExemptReasonEnumApi.PosthogSystem]:
+ 'This report came from a PostHog-managed signal, so creating a pull request for it is free.',
}
-const EXEMPT_TOOLTIP_DEFAULT = "This report originates from PostHog's own systems, so its PR is free."
+const EXEMPT_TOOLTIP_DEFAULT =
+ 'PostHog marked this report as free, so creating a pull request for it will not be billed.'
function refundTooltip(refund: NonNullable<SignalReport['refund']>): string {
if (refund.billing_path === 'excluded') {
- return "This PR was refunded before it was ever billed – you won't pay for it and it doesn't count toward your included PRs."
+ return "This PR was refunded before it was billed. You won't pay for it, and it doesn't count toward your included PRs."
}
if (refund.credit_amount_usd != null) {
- return `This PR was refunded – $${refund.credit_amount_usd} was credited toward your next invoice and it doesn't count toward your included PRs.`
+ return `This PR was refunded. $${refund.credit_amount_usd} was credited toward your next invoice, and it doesn't count toward your included PRs.`
}
- return "This PR was refunded – the credit is being processed and it doesn't count toward your included PRs."
+ return "This PR was refunded. The credit is being processed, and it doesn't count toward your included PRs."
}
/**
@@ -36,8 +42,10 @@ export function SignalReportBillingBadge({ report }: { report: SignalReport }):
)
}
if (report.billing_exempt_reason) {
+ const tooltip =
+ EXEMPT_TOOLTIPS[report.billing_exempt_reason as BillingExemptReasonEnumApi] ?? EXEMPT_TOOLTIP_DEFAULT
return (
- <Tooltip title={EXEMPT_TOOLTIPS[report.billing_exempt_reason] ?? EXEMPT_TOOLTIP_DEFAULT}>
+ <Tooltip title={tooltip}>
<LemonTag size="small" type="success">
Free
</LemonTag>
diff --git a/frontend/src/scenes/inbox/components/badges/SignalReportPriorityBadge.tsx b/frontend/src/scenes/inbox/components/badges/SignalReportPriorityBadge.tsx
index dc6178c0495c..2b89cee833ea 100644
--- a/frontend/src/scenes/inbox/components/badges/SignalReportPriorityBadge.tsx
+++ b/frontend/src/scenes/inbox/components/badges/SignalReportPriorityBadge.tsx
@@ -55,7 +55,7 @@ export function SignalReportPriorityBadge({
// The API passes priority strings through from agent-written artefacts, so a malformed or
// legacy value can fall outside P0–P4 despite the type — degrade to a plain chip, don't crash.
const meaning: { label: string; description: string } | undefined = PRIORITY_MEANING[priority]
- const genericLine = meaning ? `${priority} · ${meaning.label} priority – ${meaning.description}` : null
+ const genericLine = meaning ? `${priority} · ${meaning.label} priority: ${meaning.description}` : null
if (!explanation?.trim()) {
if (!genericLine) {
diff --git a/frontend/src/scenes/inbox/components/badges/sourceProductIcons.tsx b/frontend/src/scenes/inbox/components/badges/sourceProductIcons.tsx
index 8ca42eb45930..e22931df3179 100644
--- a/frontend/src/scenes/inbox/components/badges/sourceProductIcons.tsx
+++ b/frontend/src/scenes/inbox/components/badges/sourceProductIcons.tsx
@@ -20,8 +20,7 @@ import { SignalSourceProduct } from '../../types'
interface SourceProductMeta {
Icon: typeof IconBolt
- /** CSS color value applied to the icon. */
- color: string
+ colorClass: string
label: string
}
@@ -37,77 +36,77 @@ interface SourceProductMeta {
export const SOURCE_PRODUCT_META: Partial<Record<SignalSourceProduct, SourceProductMeta>> = {
[SignalSourceProduct.SessionReplay]: {
Icon: IconRewindPlay,
- color: 'var(--warning)',
+ colorClass: 'text-warning',
label: 'Session replay',
},
[SignalSourceProduct.ReplayVision]: {
Icon: IconEye,
- color: 'var(--warning)',
+ colorClass: 'text-warning',
label: 'Replay vision',
},
[SignalSourceProduct.ErrorTracking]: {
Icon: IconBug,
- color: 'var(--danger)',
+ colorClass: 'text-danger',
label: 'Error tracking',
},
[SignalSourceProduct.LlmAnalytics]: {
Icon: IconBrain,
- color: 'var(--purple)',
+ colorClass: 'text-accent',
label: 'AI observability',
},
[SignalSourceProduct.Github]: {
Icon: IconGithub,
- color: 'var(--text-secondary)',
+ colorClass: 'text-secondary',
label: 'GitHub',
},
[SignalSourceProduct.Linear]: {
Icon: IconStack,
- color: 'var(--blue)',
+ colorClass: 'text-accent',
label: 'Linear',
},
[SignalSourceProduct.Zendesk]: {
Icon: IconReceipt,
- color: 'var(--success)',
+ colorClass: 'text-success',
label: 'Zendesk',
},
[SignalSourceProduct.Conversations]: {
Icon: IconSupport,
- color: 'var(--blue)',
+ colorClass: 'text-accent',
label: 'Support',
},
[SignalSourceProduct.Pganalyze]: {
Icon: IconDatabase,
- color: 'var(--text-primary)',
+ colorClass: 'text-primary',
label: 'pganalyze',
},
[SignalSourceProduct.SignalsScout]: {
Icon: IconCompass,
- color: 'var(--purple)',
+ colorClass: 'text-accent',
label: 'Scout',
},
[SignalSourceProduct.Endpoints]: {
Icon: IconBolt,
- color: 'var(--warning)',
+ colorClass: 'text-warning',
label: 'Endpoints',
},
[SignalSourceProduct.Logs]: {
Icon: IconList,
- color: 'var(--text-secondary)',
+ colorClass: 'text-secondary',
label: 'Logs',
},
[SignalSourceProduct.HealthChecks]: {
Icon: IconHeartPlus,
- color: 'var(--danger)',
+ colorClass: 'text-danger',
label: 'Health checks',
},
[SignalSourceProduct.EngineeringAnalytics]: {
Icon: IconGear,
- color: 'var(--warning)',
+ colorClass: 'text-warning',
label: 'Engineering analytics',
},
[SignalSourceProduct.Analytics]: {
Icon: IconGraph,
- color: 'var(--blue)',
+ colorClass: 'text-accent',
label: 'Product analytics',
},
}
@@ -158,14 +157,8 @@ export function SourceProductIconRow({
{entries.map((entry) => {
const Icon = entry.meta.Icon
return (
- <span
- key={entry.key}
- className="inline-flex shrink-0 items-center"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ color: entry.meta.color }}
- aria-hidden
- >
- <Icon className="text-xs" />
+ <span key={entry.key} className="inline-flex shrink-0 items-center" aria-hidden>
+ <Icon className={`text-xs ${entry.meta.colorClass}`} />
</span>
)
})}
diff --git a/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx b/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
index c11d78eed7aa..e56bd3ef82a5 100644
--- a/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
+++ b/frontend/src/scenes/inbox/components/cards/AgentRunCard.tsx
@@ -1,27 +1,12 @@
-import { LemonTag, Link } from '@posthog/lemon-ui'
+import { Link } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
import { urls } from 'scenes/urls'
-import { isFinishedRunReport, isLiveRunReport, isQueuedRunReport } from '../../inboxMembership'
import { SignalReport } from '../../types'
import { deriveHeadline, parsePrUrlParts } from '../../utils/reportPresentation'
import { hasKnownSourceProduct, knownSourceProductEntries, SourceProductIconRow } from '../badges/sourceProductIcons'
-import { RunStatusOrb, RunVariant, VARIANT_META } from './runStatusVariant'
-
-/** Single source of truth for the four-bucket lifecycle of a run-shaped report. */
-export function resolveRunVariant(report: SignalReport): RunVariant {
- if (isQueuedRunReport(report)) {
- return 'queued'
- }
- if (isLiveRunReport(report)) {
- return 'live'
- }
- if (isFinishedRunReport(report)) {
- return report.status === 'failed' ? 'failed' : 'completed'
- }
- return 'live'
-}
+import { resolveRunVariant, RunStatusIndicator, type RunVariant } from './runStatusVariant'
const RUN_VARIANT_TIMESTAMP_LABEL: Record<RunVariant, string> = {
queued: 'Queued',
@@ -37,7 +22,6 @@ function pickTimestamp(report: SignalReport, variant: RunVariant): string {
return report.updated_at ?? report.created_at
}
-/** Source-product icon stack reused inside the run card meta row. */
function RunSourceStack({ sourceProducts }: { sourceProducts?: string[] | null }): JSX.Element | null {
const [primary, ...overflow] = knownSourceProductEntries(sourceProducts)
if (!primary) {
@@ -57,7 +41,6 @@ function RunSourceStack({ sourceProducts }: { sourceProducts?: string[] | null }
)
}
-/** PR number from an implementation PR url, e.g. `#12001`. Null when there's no PR. */
function prRef(prUrl: string | null | undefined): string | null {
const parts = prUrl ? parsePrUrlParts(prUrl) : null
return parts ? `#${parts.number}` : null
@@ -66,8 +49,7 @@ function prRef(prUrl: string | null | undefined): string | null {
export function AgentRunCard({ report }: { report: SignalReport }): JSX.Element {
const hasSource = hasKnownSourceProduct(report.source_products)
const pr = prRef(report.implementation_pr_url)
- const variant = resolveRunVariant(report)
- const meta = VARIANT_META[variant]
+ const variant = resolveRunVariant(report.status)
const timestampSource = pickTimestamp(report, variant)
const headline = deriveHeadline(report.summary)
@@ -76,7 +58,7 @@ export function AgentRunCard({ report }: { report: SignalReport }): JSX.Element
to={urls.inboxReport('runs', report.id)}
className="group flex w-full items-start gap-3 rounded border border-primary bg-surface-primary px-4 py-3.5 text-left text-inherit no-underline transition-colors duration-150 hover:border-primary hover:bg-surface-secondary"
>
- <RunStatusOrb meta={meta} />
+ <RunStatusIndicator variant={variant} className="mt-0.5" />
<div className="flex flex-col gap-1.5 min-w-0 flex-1">
<span className="break-words min-w-0 font-semibold text-sm leading-snug tracking-tight">
@@ -98,12 +80,11 @@ export function AgentRunCard({ report }: { report: SignalReport }): JSX.Element
</div>
</div>
- <div className="flex flex-col items-end justify-center gap-1.5 self-stretch shrink-0 border-l border-primary pl-3">
- <LemonTag size="small" type={meta.badgeType} className="select-none">
- {meta.label}
- </LemonTag>
- {pr ? <span className="font-mono tabular-nums text-[11px] text-tertiary">{pr}</span> : null}
- </div>
+ {pr ? (
+ <span className="self-center shrink-0 border-l border-primary pl-3 font-mono tabular-nums text-xs text-tertiary">
+ {pr}
+ </span>
+ ) : null}
</Link>
)
}
diff --git a/frontend/src/scenes/inbox/components/cards/ReportCard.tsx b/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
index 3e5303205180..2afac1bf1739 100644
--- a/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
+++ b/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
@@ -206,7 +206,7 @@ export function ReportCard({
'break-words line-clamp-2 text-xs text-tertiary italic leading-snug m-0'
)}
>
- No summary yet – still collecting context.
+ No summary yet. Still collecting context.
</p>
) : null}
@@ -285,7 +285,7 @@ export function ReportCard({
<LemonButton
type="primary"
size="small"
- tooltip="Open the full report – summary, evidence, and actions"
+ tooltip="Open the full report to see its summary, evidence, and actions"
onClick={(event) => {
event.preventDefault()
event.stopPropagation()
diff --git a/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx b/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx
index d58686aabe19..3702d19c7692 100644
--- a/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx
+++ b/frontend/src/scenes/inbox/components/cards/SignalRunCard.tsx
@@ -9,20 +9,15 @@ import { urls } from 'scenes/urls'
import { captureInboxRunOpened } from '../../inboxAnalytics'
import { SignalRun } from '../../types'
import { stripScoutPrefix } from '../../utils/scoutRunsWindow'
-import { resolveRunVariant, VARIANT_META } from './runStatusVariant'
+import { resolveRunVariant, RunStatusIndicator } from './runStatusVariant'
import { inboxCardRowClassName } from './useReportArchive'
export function SignalRunCard({ run }: { run: SignalRun }): JSX.Element {
- const meta = VARIANT_META[resolveRunVariant(run.status)]
const isScout = run.kind === 'scout'
- // Scout titles are skill code names, shown verbatim in monospace (identifiers, not prose); signal
- // titles are the originating report's title.
const displayTitle = isScout ? stripScoutPrefix(run.title) : run.title
return (
<div className={clsx('relative', inboxCardRowClassName(false))}>
- {/* The task (agent transcript) is the primary click target; the report link sits in its own
- column so it isn't nested inside this link. */}
<Link
to={urls.taskDetail(run.task_id)}
onClick={() =>
@@ -30,17 +25,11 @@ export function SignalRunCard({ run }: { run: SignalRun }): JSX.Element {
}
className="flex min-w-0 flex-1 items-start gap-2.5 text-left text-inherit no-underline"
>
- {/* One small color-coded dot carries the status — no separate orb or status tag. */}
- <span
- className={clsx('mt-1.5 block size-2 shrink-0 rounded-full', meta.dotClass)}
- role="img"
- aria-label={meta.ariaLabel}
- />
<div className="flex flex-col gap-1 min-w-0 flex-1">
<span
className={clsx(
'min-w-0 truncate text-sm leading-snug',
- isScout ? 'font-mono text-[13px]' : 'font-semibold'
+ isScout ? 'font-mono' : 'font-semibold'
)}
>
{displayTitle || 'Untitled run'}
@@ -57,7 +46,7 @@ export function SignalRunCard({ run }: { run: SignalRun }): JSX.Element {
>
{isScout ? 'Scout' : 'Signal'}
</LemonTag>
- <span>{meta.label}</span>
+ <RunStatusIndicator variant={resolveRunVariant(run.status)} />
<span aria-hidden>·</span>
<span>
Started <TZLabel time={run.created_at} className="tabular-nums align-baseline" />
diff --git a/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx b/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx
index abf51e5536c0..8bfb290a5481 100644
--- a/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx
+++ b/frontend/src/scenes/inbox/components/cards/runStatusVariant.tsx
@@ -1,30 +1,32 @@
import clsx from 'clsx'
-import { LemonTagType } from '@posthog/lemon-ui'
+import { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
-import { SignalScoutRunStatus } from '../../types'
+import { SignalReportStatus, SignalScoutRunStatus } from '../../types'
-/** The four-bucket lifecycle every run-shaped card collapses its status into. */
export type RunVariant = 'queued' | 'live' | 'completed' | 'failed'
-/** Single source of truth mapping a run status to its lifecycle variant. Shared by the card (badge +
- * orb) and the Runs tab (Live vs Past split), so the two can't drift on which statuses are terminal. */
-export function resolveRunVariant(status: SignalScoutRunStatus | null): RunVariant {
+export function resolveRunVariant(
+ status: SignalScoutRunStatus | SignalReportStatus | TaskRunStatus | null | undefined
+): RunVariant {
switch (status) {
case 'in_progress':
+ case 'pending_input':
return 'live'
case 'completed':
+ case 'ready':
+ case 'resolved':
+ case 'deleted':
+ case 'suppressed':
return 'completed'
case 'failed':
case 'cancelled':
return 'failed'
default:
- // queued / not_started / null
return 'queued'
}
}
-/** Whether a run is still live (running or pending) rather than in a terminal state. */
export function isRunLive(status: SignalScoutRunStatus | null): boolean {
const variant = resolveRunVariant(status)
return variant === 'live' || variant === 'queued'
@@ -32,8 +34,6 @@ export function isRunLive(status: SignalScoutRunStatus | null): boolean {
export interface VariantMeta {
label: string
- badgeType: LemonTagType
- orbClass: string
dotClass: string
ariaLabel: string
}
@@ -41,47 +41,48 @@ export interface VariantMeta {
export const VARIANT_META: Record<RunVariant, VariantMeta> = {
queued: {
label: 'Queued',
- badgeType: 'default',
- orbClass: 'bg-fill-primary ring-primary',
dotClass: 'bg-muted',
ariaLabel: 'Queued',
},
live: {
label: 'Running',
- badgeType: 'highlight',
- orbClass: 'bg-primary-highlight ring-primary',
dotClass: 'bg-accent animate-pulse',
ariaLabel: 'In progress',
},
completed: {
label: 'Completed',
- badgeType: 'success',
- orbClass: 'bg-success-highlight ring-success',
dotClass: 'bg-success',
ariaLabel: 'Completed',
},
failed: {
label: 'Failed',
- badgeType: 'danger',
- orbClass: 'bg-danger-highlight ring-danger',
dotClass: 'bg-danger',
ariaLabel: 'Failed',
},
}
-export function RunStatusOrb({ meta }: { meta: VariantMeta }): JSX.Element {
+export function RunStatusIndicator({
+ variant,
+ showLabel = true,
+ className,
+}: {
+ variant: RunVariant
+ showLabel?: boolean
+ className?: string
+}): JSX.Element {
+ const meta = VARIANT_META[variant]
+
return (
- <div
- className={clsx(
- 'flex items-center justify-center h-7 w-7 shrink-0 rounded-full ring-1 ring-inset',
- meta.orbClass
- )}
+ <span
+ className={clsx('inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-secondary', className)}
>
<span
- className={clsx('block h-1.5 w-1.5 rounded-full', meta.dotClass)}
- role="img"
- aria-label={meta.ariaLabel}
+ className={clsx('block size-2 shrink-0 rounded-full', meta.dotClass)}
+ role={showLabel ? undefined : 'img'}
+ aria-label={showLabel ? undefined : meta.ariaLabel}
+ aria-hidden={showLabel || undefined}
/>
- </div>
+ {showLabel ? meta.label : null}
+ </span>
)
}
diff --git a/frontend/src/scenes/inbox/components/cards/useReportRefund.ts b/frontend/src/scenes/inbox/components/cards/useReportRefund.ts
index ddb55ea75066..121b7e3bf8ee 100644
--- a/frontend/src/scenes/inbox/components/cards/useReportRefund.ts
+++ b/frontend/src/scenes/inbox/components/cards/useReportRefund.ts
@@ -83,7 +83,7 @@ export function useReportRefund({
surface: surface ?? 'list_row',
extra: { refund_reason: reason, ...(note ? { refund_note: note } : {}) },
})
- lemonToast.success("PR refunded – you won't be charged for it")
+ lemonToast.success("PR refunded. You won't be charged for it.")
onRefunded?.()
} catch (error: any) {
lemonToast.error(error?.detail || error?.error || error?.message || 'Failed to refund this PR')
diff --git a/frontend/src/scenes/inbox/components/config/AgentsRoster.tsx b/frontend/src/scenes/inbox/components/config/AgentsRoster.tsx
index 7a4bd04867d9..ea9bd44bbdb2 100644
--- a/frontend/src/scenes/inbox/components/config/AgentsRoster.tsx
+++ b/frontend/src/scenes/inbox/components/config/AgentsRoster.tsx
@@ -51,15 +51,9 @@ interface AgentSourceState {
function AgentIcon({ source }: { source: AgentRosterDefinition }): JSX.Element {
const meta = getSourceProductMeta(source.sourceProduct)
const Icon = meta?.Icon
- const color = meta?.color ?? 'var(--accent)'
return (
- <div
- className="flex items-center justify-center size-8 shrink-0 rounded ring-1 ring-inset ring-primary"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ backgroundColor: `color-mix(in srgb, ${color} 12%, transparent)` }}
- >
- {/* eslint-disable-next-line react/forbid-dom-props */}
- {Icon ? <Icon className="size-[18px]" style={{ color }} /> : null}
+ <div className="flex size-8 shrink-0 items-center justify-center rounded bg-surface-secondary ring-1 ring-inset ring-primary">
+ {Icon ? <Icon className={`text-lg ${meta.colorClass}`} /> : null}
</div>
)
}
diff --git a/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx b/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx
index fbfc19af4451..01eab44a53ac 100644
--- a/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx
+++ b/frontend/src/scenes/inbox/components/config/SlackNotificationsSection.tsx
@@ -83,7 +83,7 @@ function TeamChannelCard({ integration }: { integration: IntegrationType }): JSX
description={
<>
Post every report to one channel, whether or not a reviewer is suggested. PostHog must be in
- the channel – invite it with <code>/invite @PostHog</code>.
+ the channel. Invite it with <code>/invite @PostHog</code>.
</>
}
/>
@@ -179,7 +179,7 @@ function PerUserChannelCard({ integrations }: { integrations: IntegrationType[]
description={
<>
When you're a suggested reviewer, get pinged in your own channel. PostHog must be in the
- channel – invite it with <code>/invite @PostHog</code>.
+ channel. Invite it with <code>/invite @PostHog</code>.
</>
}
/>
diff --git a/frontend/src/scenes/inbox/components/config/agentRosterMeta.ts b/frontend/src/scenes/inbox/components/config/agentRosterMeta.ts
index 2d60eb197145..6770fe6b1299 100644
--- a/frontend/src/scenes/inbox/components/config/agentRosterMeta.ts
+++ b/frontend/src/scenes/inbox/components/config/agentRosterMeta.ts
@@ -125,7 +125,7 @@ export const AGENT_ROSTER_GROUPS: AgentRosterGroup[] = [
source: 'pganalyze',
sourceProduct: SignalSourceProduct.Pganalyze,
label: 'pganalyze',
- description: 'Postgres performance problems – slow queries and bad indexes.',
+ description: 'Postgres performance problems, including slow queries and bad indexes.',
},
],
},
diff --git a/frontend/src/scenes/inbox/components/detail/ActivityDisclosure.tsx b/frontend/src/scenes/inbox/components/detail/ActivityDisclosure.tsx
new file mode 100644
index 000000000000..e9904cdad601
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/detail/ActivityDisclosure.tsx
@@ -0,0 +1,41 @@
+import { IconChevronDown, IconChevronRight } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
+
+export function ActivityDisclosure({
+ expanded,
+ onChange,
+ label,
+ expandedLabel,
+ children,
+ disabledReason,
+ fullWidth = false,
+ className,
+}: {
+ expanded: boolean
+ onChange: (expanded: boolean) => void
+ label: React.ReactNode
+ expandedLabel?: React.ReactNode
+ children: React.ReactNode
+ disabledReason?: string
+ fullWidth?: boolean
+ className?: string
+}): JSX.Element {
+ return (
+ <div className={className}>
+ <LemonButton
+ size="xsmall"
+ type="tertiary"
+ fullWidth={fullWidth}
+ disabledReason={disabledReason}
+ onClick={() => onChange(!expanded)}
+ icon={expanded ? <IconChevronDown /> : <IconChevronRight />}
+ className={cn('max-w-full font-normal text-secondary', fullWidth && 'justify-start text-left')}
+ >
+ {expanded && expandedLabel ? expandedLabel : label}
+ </LemonButton>
+ {expanded ? <div className="mt-1 min-w-0">{children}</div> : null}
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx b/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx
index 046e1a69dc19..924e8bce6f00 100644
--- a/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx
+++ b/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx
@@ -11,7 +11,7 @@ import {
IconTerminal,
IconWarning,
} from '@posthog/icons'
-import { LemonButton, Link, Spinner, LemonSelect, LemonSkeleton, LemonTag, Tooltip } from '@posthog/lemon-ui'
+import { LemonButton, Link, LemonSelect, LemonSkeleton, LemonTag, Tooltip } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
@@ -21,7 +21,6 @@ import { SANDBOX_BIND_TASK_PARAM } from 'scenes/max/maxLogic'
import { urls } from 'scenes/urls'
import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'
-import { TaskRunStatusDot } from 'products/posthog_ai/frontend/api/primitives'
import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'
import { isPiTaskRuntime, Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
import type { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
@@ -30,11 +29,13 @@ import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'
import { SignalCard } from '../../SignalCard'
import { SignalReport, SignalReportStatus } from '../../types'
import { deriveHeadline, parsePrRepoSlug, parsePrUrlParts } from '../../utils/reportPresentation'
-import { getSourceProductMeta } from '../badges/sourceProductIcons'
+import { knownSourceProductEntries, SourceProductIconRow } from '../badges/sourceProductIcons'
+import { resolveRunVariant, RunStatusIndicator } from '../cards/runStatusVariant'
import { DetailSection } from './DetailSection'
import { ReportActivitySection } from './ReportActivitySection'
import { ReportDetailBadges } from './ReportDetail'
import { ReportTasksSection } from './ReportTasksSection'
+import { RunLogContainer } from './RunLogContainer'
/**
* Ready-state run output: a polished outcome card that links to the produced PR or report,
@@ -46,7 +47,7 @@ function RunOutputReadyCard({ report }: { report: SignalReport }): JSX.Element {
const isPr = !!prUrl
const prSlug = prUrl ? parsePrRepoSlug(prUrl) : null
const prNumber = prUrl ? (parsePrUrlParts(prUrl)?.number ?? null) : null
- const sourceMeta = getSourceProductMeta(report.source_products?.[0])
+ const [source] = knownSourceProductEntries(report.source_products)
const headline = report.title || deriveHeadline(report.summary)
return (
@@ -59,25 +60,21 @@ function RunOutputReadyCard({ report }: { report: SignalReport }): JSX.Element {
{isPr ? <IconPullRequest className="text-xs" /> : <IconCheckCircle className="text-xs" />}
</span>
{prSlug && prNumber ? (
- <span className="font-mono text-[12.5px] text-primary">
+ <span className="font-mono text-sm text-primary">
{prSlug}#{prNumber}
</span>
) : (
<span className="font-medium text-sm text-primary">Report ready</span>
)}
<span className="flex-1" />
- {sourceMeta ? (
+ {source ? (
<span className="flex items-center gap-1.5 text-xs text-tertiary">
- <span className="flex shrink-0 items-center" style={{ color: sourceMeta.color }} aria-hidden>
- <sourceMeta.Icon className="text-sm" />
- </span>
- <span>{sourceMeta.label}</span>
+ <SourceProductIconRow entries={[source]} className="flex shrink-0 items-center" />
+ <span>{source.meta.label}</span>
</span>
) : null}
</div>
- {headline ? (
- <span className="line-clamp-2 text-[12.5px] text-secondary leading-snug">{headline}</span>
- ) : null}
+ {headline ? <span className="line-clamp-2 text-sm text-secondary leading-snug">{headline}</span> : null}
<span className="flex items-center gap-1 text-xs text-tertiary">
{isPr ? 'Open the pull request' : 'Open the report'}
<IconArrowRight className="transition-transform group-hover:translate-x-0.5" />
@@ -105,7 +102,7 @@ function RunOutputWidget({ report }: { report: SignalReport }): JSX.Element {
<div className="flex flex-col gap-0.5 min-w-0 flex-1">
<span className="font-medium text-sm text-primary">Run failed</span>
<span className="text-xs text-secondary leading-snug">
- Research couldn't complete – check the linked run below for the error. The agent may retry
+ Research couldn't complete. Check the linked run below for the error. The agent may retry
automatically.
</span>
</div>
@@ -122,7 +119,7 @@ function RunOutputWidget({ report }: { report: SignalReport }): JSX.Element {
) : (
<p className="text-sm text-tertiary m-0">
{report.status === SignalReportStatus.IN_PROGRESS
- ? 'The agent is investigating – partial signals will appear here as they land.'
+ ? 'The agent is investigating. Partial signals will appear here as they arrive.'
: 'Queued for research.'}
</p>
)}
@@ -138,22 +135,13 @@ function RunOutputWidget({ report }: { report: SignalReport }): JSX.Element {
function RunStateStrip({ report }: { report: SignalReport }): JSX.Element {
const isLive =
report.status === SignalReportStatus.IN_PROGRESS || report.status === SignalReportStatus.PENDING_INPUT
- const isFailed = report.status === SignalReportStatus.FAILED
+ const variant = resolveRunVariant(report.status)
const prSlug = report.implementation_pr_url ? parsePrRepoSlug(report.implementation_pr_url) : null
const timestamp = report.updated_at ?? report.created_at
return (
<div className="flex items-center gap-x-3 gap-y-1 flex-wrap text-xs text-tertiary">
- <span className="flex items-center gap-1.5 font-medium text-secondary">
- <span
- className={
- 'inline-block size-1.5 shrink-0 rounded-full ' +
- (isFailed ? 'bg-danger' : isLive ? 'bg-primary animate-pulse' : 'bg-success')
- }
- aria-hidden
- />
- {isFailed ? 'Failed' : isLive ? 'Running' : 'Finished'}
- </span>
+ <RunStatusIndicator variant={variant} />
{prSlug ? (
<span className="flex items-center gap-1 font-mono">
<IconPullRequest className="text-sm" />
@@ -192,7 +180,7 @@ function TaskLogBody({
if (task && runId) {
return (
- <div className="h-[calc(100dvh-22rem)] min-h-[420px] w-full overflow-hidden rounded border border-primary bg-surface-primary">
+ <RunLogContainer>
{/* In-progress runs stream live; terminal runs show the static replay. */}
<ReadonlyRunSurface
taskId={task.id}
@@ -201,7 +189,7 @@ function TaskLogBody({
threadRowClassName="px-3"
threadListClassName="py-3"
/>
- </div>
+ </RunLogContainer>
)
}
@@ -212,7 +200,7 @@ function TaskLogBody({
</span>
<span className="max-w-2xl text-xs text-secondary leading-snug">
{task
- ? 'This task is queued – its agent log will appear here once the run starts.'
+ ? 'This task is queued. Its agent log will appear here once the run starts.'
: 'Once the agent links this run to a task, its agent log appears here.'}
</span>
</div>
@@ -289,7 +277,12 @@ function TaskLogSection({ report }: { report: SignalReport }): JSX.Element {
value: entry.task.id,
label: (
<span className="flex items-center gap-1.5">
- <TaskRunStatusDot status={entry.task.latest_run?.status ?? TaskRunStatus.NOT_STARTED} />
+ <RunStatusIndicator
+ variant={resolveRunVariant(
+ entry.task.latest_run?.status ?? TaskRunStatus.NOT_STARTED
+ )}
+ showLabel={false}
+ />
{entry.purposeLabel}
</span>
),
@@ -332,7 +325,7 @@ export function AgentRunDetail({ report }: { report: SignalReport }): JSX.Elemen
actionabilityExplanation={actionabilityExplanation}
/>
{isReResearch && (
- <Tooltip title="A prior research run on this report already completed – this is a re-attempt.">
+ <Tooltip title="A prior research run on this report already completed. This is another attempt.">
<LemonTag size="small" type="warning" className="cursor-help select-none">
Re-research
</LemonTag>
@@ -353,15 +346,15 @@ export function AgentRunDetail({ report }: { report: SignalReport }): JSX.Elemen
icon={<IconSearch />}
title="Evidence so far"
rightSlot={
- <span className="text-[0.6875rem] text-tertiary tabular-nums">
+ <span className="text-xs text-tertiary tabular-nums">
{evidenceCount} signal{evidenceCount === 1 ? '' : 's'}
</span>
}
>
{reportSignalsLoading && reportSignals === null ? (
- <div className="flex items-center gap-2 text-xs text-tertiary py-1">
- <Spinner className="size-3" />
- Loading signals…
+ <div className="flex flex-col gap-2 py-1">
+ <LemonSkeleton className="h-16 w-full" />
+ <LemonSkeleton className="h-16 w-full" />
</div>
) : (
<div className="flex flex-col gap-3">
diff --git a/frontend/src/scenes/inbox/components/detail/ArtefactCommit.tsx b/frontend/src/scenes/inbox/components/detail/ArtefactCommit.tsx
index 1c472012ea4f..725c0090ced6 100644
--- a/frontend/src/scenes/inbox/components/detail/ArtefactCommit.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ArtefactCommit.tsx
@@ -2,7 +2,7 @@ import { useValues } from 'kea'
import { useEffect, useState } from 'react'
import { IconChevronDown, IconChevronRight } from '@posthog/icons'
-import { Spinner } from '@posthog/lemon-ui'
+import { LemonButton, LemonCard, LemonSkeleton } from '@posthog/lemon-ui'
import { teamLogic } from 'scenes/teamLogic'
@@ -12,12 +12,6 @@ import type { CommitDiffResponseApi } from 'products/signals/frontend/generated/
import { CommitContent } from './artefactTypes'
import { DiffBlock } from './DiffBlock'
-/**
- * A `commit` artefact: the message, short sha + repo@branch, and a collapsible "View diff" that
- * lazily fetches the commit-vs-parent diff from the backend on first expand. Missing / rewritten
- * commits surface a clean message; oversized diffs show a truncation notice. Mirrors desktop
- * `ArtefactCommit`.
- */
export function ArtefactCommit({
reportId,
artefactId,
@@ -50,7 +44,9 @@ export function ArtefactCommit({
})
.catch(() => {
if (!cancelled) {
- setError("Couldn't load this commit's diff — it may have been rewritten or removed.")
+ setError(
+ "Couldn't load this commit's diff. Open the commit in GitHub to check whether it was rewritten or removed."
+ )
}
})
.finally(() => {
@@ -65,45 +61,43 @@ export function ArtefactCommit({
}, [expanded, artefactId, currentTeamId])
return (
- <div>
- <span className="block text-default text-xs">{content.message}</span>
- <span className="block font-mono text-tertiary text-[11px]">
- {content.commit_sha.slice(0, 12)} · {content.repository}@{content.branch}
- </span>
+ <LemonCard hoverEffect={false} className="w-full p-2 shadow-none">
+ <div className="flex min-w-0 items-center gap-2">
+ <span className="min-w-0 flex-1 text-xs text-default">{content.message}</span>
+ <LemonButton
+ type="tertiary"
+ size="xsmall"
+ icon={expanded ? <IconChevronDown /> : <IconChevronRight />}
+ aria-label={expanded ? 'Hide commit diff' : 'Show commit diff'}
+ onClick={() => setExpanded(!expanded)}
+ className="shrink-0"
+ />
+ </div>
{content.note?.trim() ? <span className="block text-secondary text-xs mt-1">{content.note}</span> : null}
- <button
- type="button"
- onClick={() => setExpanded((v) => !v)}
- className="mt-1.5 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-secondary transition-colors hover:bg-fill-highlight-50"
- >
- {expanded ? <IconChevronDown /> : <IconChevronRight />}
- {expanded ? 'Hide diff' : 'View diff'}
- </button>
-
{expanded ? (
- <div className="mt-1.5">
+ <div className="mt-2 border-t pt-2">
{loading ? (
- <div className="flex items-center gap-2 text-[11px] text-tertiary py-1">
- <Spinner className="size-3" />
- Fetching diff…
+ <div className="flex flex-col gap-1.5 py-1">
+ <LemonSkeleton className="h-3 w-full" />
+ <LemonSkeleton className="h-3 w-4/5" />
</div>
) : error ? (
- <span className="text-[11px] text-danger">{error}</span>
+ <span className="text-xs text-danger">{error}</span>
) : diff && diff.diff.trim() ? (
<>
<DiffBlock diff={diff.diff} />
{diff.truncated ? (
- <span className="mt-1 block text-[11px] text-tertiary italic">
- Diff truncated — open the commit in GitHub for the full change.
+ <span className="mt-1 block text-xs text-tertiary italic">
+ The diff is truncated. Open the commit in GitHub to see the full change.
</span>
) : null}
</>
) : (
- <span className="text-[11px] text-tertiary">No changes recorded for this commit.</span>
+ <span className="text-xs text-tertiary">No changes recorded for this commit.</span>
)}
</div>
) : null}
- </div>
+ </LemonCard>
)
}
diff --git a/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx b/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx
index 4f7ccccbbc63..7dd8fd2b0357 100644
--- a/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx
@@ -1,31 +1,53 @@
-import { useValues } from 'kea'
-import { useState } from 'react'
+import { type ComponentType, useState } from 'react'
-import { IconChevronDown, IconChevronRight, IconExternal } from '@posthog/icons'
-import { LemonTag, Link } from '@posthog/lemon-ui'
+import {
+ IconActivity,
+ IconArchive,
+ IconCode,
+ IconComment,
+ IconCommit,
+ IconFlag,
+ IconGitRepository,
+ IconListCheck,
+ IconListTreeConnected,
+ IconPeople,
+ IconPencil,
+ IconSearch,
+ IconShield,
+ IconTerminal,
+ IconVideoCamera,
+ IconExternal,
+} from '@posthog/icons'
+import { LemonCard, LemonTag, type LemonTagType, Link, ProfilePicture } from '@posthog/lemon-ui'
import { CodeSnippet, Language } from 'lib/components/CodeSnippet'
import { TZLabel } from 'lib/components/TZLabel'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { capitalizeFirstLetter } from 'lib/utils/strings'
-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
+import type { SignalNode } from 'scenes/debug/signals/types'
+import { urls } from 'scenes/urls'
import { Task } from 'products/posthog_ai/frontend/types/taskTypes'
+import { PRIORITY_TAG_TYPE } from '../../filterOptions'
+import { SignalCard } from '../../SignalCard'
import { EnrichedReviewer, SignalReportActionability, SignalReportPriority, SignalReportArtefact } from '../../types'
import { SignalReportActionabilityBadge } from '../badges/SignalReportActionabilityBadge'
-import { SignalReportPriorityBadge } from '../badges/SignalReportPriorityBadge'
+import { SignalCardDisclosureProvider } from '../signalCards/SignalCardShell'
import { ArtefactCommit } from './ArtefactCommit'
import { ArtefactTaskRun } from './ArtefactTaskRun'
import {
artefactAttributionLabel,
artefactLocationLabel,
artefactTypeLabel,
+ CodeReviewContent,
CodeReferenceContent,
CommitContent,
DismissalContent,
LineReferenceContent,
NoteContent,
+ RelatedToContent,
+ RepoSelectionContent,
SignalFindingContent,
SummaryChangeContent,
TaskRunArtefactContent,
@@ -88,6 +110,26 @@ const DISMISS_REASON_LABELS: Record<string, string> = {
slack_dismiss: 'Dismissed from Slack',
}
+const ARTEFACT_MARKER: Record<string, ComponentType<{ className?: string }>> = {
+ code_reference: IconCode,
+ line_reference: IconCode,
+ commit: IconCommit,
+ task_run: IconTerminal,
+ note: IconComment,
+ priority_judgment: IconFlag,
+ actionability_judgment: IconListCheck,
+ safety_judgment: IconShield,
+ signal_finding: IconSearch,
+ suggested_reviewers: IconPeople,
+ repo_selection: IconGitRepository,
+ dismissal: IconArchive,
+ video_segment: IconVideoCamera,
+ title_change: IconPencil,
+ summary_change: IconPencil,
+ related_to: IconListTreeConnected,
+ code_review: IconListCheck,
+}
+
function dismissReasonLabel(reason: string): string {
return DISMISS_REASON_LABELS[reason] ?? prettify(reason)
}
@@ -111,70 +153,38 @@ function CodeRefBlock({ code, language }: { code: string; language: Language }):
)
}
-/** Judgment rationale, hidden behind a "Show reasoning" toggle. */
-function CollapsibleReasoning({ text }: { text: string }): JSX.Element {
- const [expanded, setExpanded] = useState(false)
+function ActivityBodyCard({ children }: { children: React.ReactNode }): JSX.Element {
return (
- <div className="flex flex-col gap-1">
- <button
- type="button"
- onClick={() => setExpanded((v) => !v)}
- className="flex w-fit items-center gap-1 rounded px-1 py-0.5 text-xs text-secondary transition-colors hover:bg-fill-highlight-50"
- >
- {expanded ? <IconChevronDown /> : <IconChevronRight />}
- {expanded ? 'Hide reasoning' : 'Show reasoning'}
- </button>
- {expanded ? <span className="text-secondary text-xs">{text}</span> : null}
- </div>
+ <LemonCard hoverEffect={false} className="w-full p-2 shadow-none">
+ {children}
+ </LemonCard>
)
}
-/** A `note` artefact: a one-line preview that expands to the full markdown body. */
-function CollapsibleNote({ note, author }: { note: string; author?: string }): JSX.Element {
- const [expanded, setExpanded] = useState(false)
- const preview = note.split('\n').find((line) => line.trim()) ?? note
+function ReasoningBody({ text }: { text: string }): JSX.Element {
+ return <p className="m-0 text-xs leading-relaxed text-secondary">{text}</p>
+}
+
+function NoteBody({ note, author }: { note: string; author?: string }): JSX.Element {
return (
- <div className="flex w-full min-w-0 flex-col gap-1">
- <button
- type="button"
- onClick={() => setExpanded((v) => !v)}
- className="flex w-full min-w-0 items-center gap-1 rounded px-1 py-0.5 text-left text-xs text-secondary transition-colors hover:bg-fill-highlight-50"
- >
- {expanded ? <IconChevronDown className="shrink-0" /> : <IconChevronRight className="shrink-0" />}
- <span className="truncate">{expanded ? 'Hide note' : preview}</span>
- </button>
- {expanded ? (
- <div className="min-w-0">
- <LemonMarkdown className="text-xs text-secondary leading-normal" disableImages>
- {note}
- </LemonMarkdown>
- {author?.trim() ? <span className="mt-1 block text-tertiary text-[11px]">— {author}</span> : null}
- </div>
- ) : null}
+ <div className="w-full">
+ <LemonMarkdown className="text-xs text-secondary leading-normal" disableImages>
+ {note}
+ </LemonMarkdown>
+ {author?.trim() ? <span className="mt-1 block text-xs text-tertiary">By {author}</span> : null}
</div>
)
}
-/**
- * A `title_change` / `summary_change` artefact: shows the value the report now carries, with the
- * previous value tucked behind a "Show previous" toggle (omitted when the field had no prior value).
- * `markdown` renders the body as markdown — summaries are descriptions, titles are plain text.
- * `collapse` hides the new value behind a one-line preview (summaries can be long; titles are short
- * enough to show inline).
- */
function ContentChangeBody({
previous,
current,
markdown = false,
- collapse = false,
}: {
previous?: string | null
current: string
markdown?: boolean
- collapse?: boolean
}): JSX.Element {
- const [expanded, setExpanded] = useState(false)
- const [showPrevious, setShowPrevious] = useState(false)
const renderText = (text: string, muted: boolean): JSX.Element => {
const color = muted ? 'text-secondary' : 'text-default'
return markdown ? (
@@ -185,86 +195,201 @@ function ContentChangeBody({
<span className={`text-xs ${color}`}>{text}</span>
)
}
- const previousToggle = previous?.trim() ? (
- <>
- <button
- type="button"
- onClick={() => setShowPrevious((v) => !v)}
- className="flex w-fit items-center gap-1 rounded px-1 py-0.5 text-xs text-secondary transition-colors hover:bg-fill-highlight-50"
- >
- {showPrevious ? <IconChevronDown /> : <IconChevronRight />}
- {showPrevious ? 'Hide previous' : 'Show previous'}
- </button>
- {showPrevious ? <div className="min-w-0">{renderText(previous, true)}</div> : null}
- </>
- ) : null
-
- if (collapse) {
- const preview = current.split('\n').find((line) => line.trim()) ?? current
- return (
- <div className="flex w-full min-w-0 flex-col gap-1">
- <button
- type="button"
- onClick={() => setExpanded((v) => !v)}
- className="flex w-full min-w-0 items-center gap-1 rounded px-1 py-0.5 text-left text-xs text-secondary transition-colors hover:bg-fill-highlight-50"
- >
- {expanded ? <IconChevronDown className="shrink-0" /> : <IconChevronRight className="shrink-0" />}
- <span className="truncate">{expanded ? 'Hide new value' : preview}</span>
- </button>
- {expanded ? (
- <>
- <div className="min-w-0">{renderText(current, false)}</div>
- {previousToggle}
- </>
- ) : null}
- </div>
- )
- }
return (
- <div className="flex w-full min-w-0 flex-col gap-1">
+ <div className="flex w-full min-w-0 flex-col gap-2">
<div className="min-w-0">{renderText(current, false)}</div>
- {previousToggle}
+ {previous?.trim() ? (
+ <div className="border-l pl-2">
+ <span className="mb-0.5 block text-xs font-medium text-tertiary">Previous</span>
+ {renderText(previous, true)}
+ </div>
+ ) : null}
</div>
)
}
-/** The suggested-reviewers list as a point-in-time log entry. */
function ReviewersBody({ reviewers }: { reviewers: EnrichedReviewer[] }): JSX.Element {
if (reviewers.length === 0) {
return <span className="text-tertiary text-xs">No reviewers assigned.</span>
}
return (
- <div className="flex flex-col gap-1">
+ <div className="flex flex-wrap gap-1.5">
{reviewers.map((reviewer) => {
const name = reviewer.user?.first_name || reviewer.github_name || reviewer.github_login
return (
- <div key={reviewer.github_login} className="flex items-center gap-2 text-xs">
- <img
- src={`https://github.com/${reviewer.github_login}.png?size=28`}
- alt=""
- loading="lazy"
- className="size-[18px] shrink-0 rounded-full bg-fill-highlight-50"
- />
- <span className="truncate text-default">{name}</span>
- <Link
- to={`https://github.com/${reviewer.github_login}`}
- target="_blank"
- disableClientSideRouting
- className="ml-auto flex shrink-0 items-center gap-0.5 font-mono text-tertiary text-[11px]"
- >
- @{reviewer.github_login}
- <IconExternal />
- </Link>
- </div>
+ <Link
+ key={reviewer.github_login}
+ to={`https://github.com/${reviewer.github_login}`}
+ target="_blank"
+ disableClientSideRouting
+ className="inline-flex items-center gap-1.5 rounded px-1.5 py-1 text-xs no-underline hover:bg-fill-highlight-50"
+ >
+ <ProfilePicture user={reviewer.user} name={name} size="xs" />
+ <span className="text-default">{name}</span>
+ <span className="font-mono text-tertiary">@{reviewer.github_login}</span>
+ <IconExternal className="size-3 text-tertiary" />
+ </Link>
)
})}
</div>
)
}
-/** Per-type body for one artefact row. Content is read defensively — legacy rows may lack fields. */
-function ArtefactBody({
+function RepoSelectionBody({ content }: { content: RepoSelectionContent }): JSX.Element | null {
+ if (!content.reason?.trim()) {
+ return null
+ }
+ return <ReasoningBody text={content.reason} />
+}
+
+function SignalFindingBody({ signal }: { signal: SignalNode }): JSX.Element {
+ const [expanded, setExpanded] = useState(false)
+
+ return (
+ <div className="w-full">
+ <SignalCardDisclosureProvider expanded={expanded} onChange={setExpanded}>
+ <SignalCard signal={signal} />
+ </SignalCardDisclosureProvider>
+ </div>
+ )
+}
+
+function RelatedReportBody({ content }: { content: RelatedToContent }): JSX.Element | null {
+ if (!content.report_id) {
+ return null
+ }
+ return (
+ <Link to={urls.inboxReport('reports', content.report_id)} className="inline-flex items-center gap-1 text-xs">
+ Open report <IconExternal className="size-3" />
+ </Link>
+ )
+}
+
+const CODE_REVIEW_OUTCOME: Record<NonNullable<CodeReviewContent['outcome']>, { label: string; type: LemonTagType }> = {
+ published: { label: 'Published on GitHub', type: 'success' },
+ stored: { label: 'Review saved', type: 'muted' },
+ failed: { label: 'Review failed', type: 'danger' },
+}
+
+function CodeReviewBody({ content }: { content: CodeReviewContent }): JSX.Element | null {
+ const counts = content.counts
+ const reviewUrl = content.review_url || content.pr_url
+ const hasContent = content.repository || counts || reviewUrl
+
+ if (!hasContent) {
+ return null
+ }
+
+ return (
+ <div className="flex w-full flex-col items-start gap-1.5">
+ <div className="flex flex-wrap items-center gap-1">
+ {(counts?.must_fix ?? 0) > 0 ? (
+ <LemonTag size="small" type="danger">
+ {counts?.must_fix} must fix
+ </LemonTag>
+ ) : null}
+ {(counts?.should_fix ?? 0) > 0 ? (
+ <LemonTag size="small" type="warning">
+ {counts?.should_fix} should fix
+ </LemonTag>
+ ) : null}
+ {(counts?.consider ?? 0) > 0 ? (
+ <LemonTag size="small" type="muted">
+ {counts?.consider} consider
+ </LemonTag>
+ ) : null}
+ </div>
+ {content.repository ? (
+ <span className="font-mono text-xs text-tertiary">
+ {content.repository}
+ {content.head_branch ? `@${content.head_branch}` : ''}
+ {content.head_sha ? ` · ${content.head_sha.slice(0, 12)}` : ''}
+ </span>
+ ) : null}
+ {reviewUrl ? (
+ <Link
+ to={reviewUrl}
+ target="_blank"
+ disableClientSideRouting
+ className="inline-flex items-center gap-1 text-xs"
+ >
+ View review <IconExternal className="size-3" />
+ </Link>
+ ) : null}
+ </div>
+ )
+}
+
+function renderArtefactSummary(artefact: SignalReportArtefact): JSX.Element | null {
+ const content = artefact.content
+
+ switch (artefact.type) {
+ case 'priority_judgment': {
+ const priority = (content as { priority?: SignalReportPriority }).priority
+ return priority ? (
+ <LemonTag size="small" type={PRIORITY_TAG_TYPE[priority] ?? 'muted'}>
+ {priority}
+ </LemonTag>
+ ) : null
+ }
+ case 'actionability_judgment': {
+ const c = content as {
+ actionability?: SignalReportActionability
+ already_addressed?: boolean
+ }
+ if (!c.actionability && !c.already_addressed) {
+ return null
+ }
+ return (
+ <span className="inline-flex items-center gap-1">
+ <SignalReportActionabilityBadge actionability={c.actionability} />
+ {c.already_addressed ? (
+ <LemonTag size="small" type="warning">
+ Already addressed
+ </LemonTag>
+ ) : null}
+ </span>
+ )
+ }
+ case 'safety_judgment': {
+ const choice = (content as { choice?: boolean }).choice
+ if (typeof choice !== 'boolean') {
+ return null
+ }
+ return (
+ <LemonTag size="small" type={choice ? 'success' : 'danger'}>
+ {choice ? 'Safe to act on' : 'Unsafe'}
+ </LemonTag>
+ )
+ }
+ case 'repo_selection': {
+ const repository = (content as RepoSelectionContent).repository
+ return repository ? <span className="font-mono text-xs text-secondary">{repository}</span> : null
+ }
+ case 'dismissal': {
+ const reason = (content as DismissalContent).reason
+ return reason ? (
+ <LemonTag size="small" type="muted">
+ {dismissReasonLabel(reason)}
+ </LemonTag>
+ ) : null
+ }
+ case 'code_review': {
+ const outcome = (content as CodeReviewContent).outcome
+ const meta = outcome ? CODE_REVIEW_OUTCOME[outcome] : null
+ return meta ? (
+ <LemonTag size="small" type={meta.type}>
+ {meta.label}
+ </LemonTag>
+ ) : null
+ }
+ default:
+ return null
+ }
+}
+
+function renderArtefactBody({
reportId,
artefact,
knownTasks,
@@ -272,7 +397,7 @@ function ArtefactBody({
reportId: string
artefact: SignalReportArtefact
knownTasks?: Map<string, Task>
-}): JSX.Element {
+}): JSX.Element | null {
const content = artefact.content
switch (artefact.type) {
@@ -302,142 +427,99 @@ function ArtefactBody({
}
case 'note': {
const c = content as NoteContent
- return <CollapsibleNote note={c.note} author={c.author} />
+ return <NoteBody note={c.note} author={c.author} />
}
case 'priority_judgment': {
- const c = content as { priority?: SignalReportPriority; explanation?: string }
- return (
- <div className="flex flex-col gap-1">
- <SignalReportPriorityBadge priority={c.priority} />
- {c.explanation ? <CollapsibleReasoning text={c.explanation} /> : null}
- </div>
- )
+ const c = content as { explanation?: string }
+ return c.explanation ? <ReasoningBody text={c.explanation} /> : null
}
case 'actionability_judgment': {
- const c = content as {
- actionability?: SignalReportActionability
- already_addressed?: boolean
- explanation?: string
- }
- return (
- <div className="flex flex-col gap-1">
- <div className="flex items-center gap-2 flex-wrap">
- <SignalReportActionabilityBadge actionability={c.actionability} />
- {c.already_addressed ? (
- <LemonTag size="small" type="warning">
- Already addressed
- </LemonTag>
- ) : null}
- </div>
- {c.explanation ? <CollapsibleReasoning text={c.explanation} /> : null}
- </div>
- )
+ const c = content as { explanation?: string }
+ return c.explanation ? <ReasoningBody text={c.explanation} /> : null
}
case 'safety_judgment': {
- const c = content as { choice?: boolean; explanation?: string }
- return (
- <div className="flex flex-col gap-1">
- <LemonTag size="small" type={c.choice ? 'success' : 'danger'}>
- {c.choice ? 'Safe to act on' : 'Unsafe'}
- </LemonTag>
- {c.explanation ? <CollapsibleReasoning text={c.explanation} /> : null}
- </div>
- )
- }
- case 'signal_finding': {
- const c = content as SignalFindingContent
- const paths = c.relevant_code_paths ?? []
- return (
- <div className="flex flex-col gap-1">
- <div className="flex items-center gap-2 flex-wrap">
- <span className="font-mono text-tertiary text-[11px]">{c.signal_id}</span>
- <LemonTag size="small" type={c.verified ? 'success' : 'muted'}>
- {c.verified ? 'Verified' : 'Unverified'}
- </LemonTag>
- </div>
- {paths.length > 0 ? (
- <div className="flex flex-col">
- {paths.map((path) => (
- <span key={path} className="truncate font-mono text-secondary text-[11px]">
- {path}
- </span>
- ))}
- </div>
- ) : null}
- </div>
- )
+ const c = content as { explanation?: string }
+ return c.explanation ? <ReasoningBody text={c.explanation} /> : null
}
+ case 'signal_finding':
+ return null
case 'suggested_reviewers':
return <ReviewersBody reviewers={(content as unknown as EnrichedReviewer[]) ?? []} />
+ case 'repo_selection':
+ return <RepoSelectionBody content={content as RepoSelectionContent} />
+ case 'related_to':
+ return <RelatedReportBody content={content as RelatedToContent} />
+ case 'code_review':
+ return <CodeReviewBody content={content as CodeReviewContent} />
case 'title_change': {
const c = content as TitleChangeContent
return <ContentChangeBody previous={c.old_title} current={c.new_title ?? ''} />
}
case 'summary_change': {
const c = content as SummaryChangeContent
- return <ContentChangeBody previous={c.old_summary} current={c.new_summary ?? ''} markdown collapse />
+ return <ContentChangeBody previous={c.old_summary} current={c.new_summary ?? ''} markdown />
}
case 'dismissal': {
const c = content as DismissalContent
- return (
- <div className="flex flex-col gap-1">
- {c.reason ? (
- <LemonTag size="small" type="muted">
- {dismissReasonLabel(c.reason)}
- </LemonTag>
- ) : null}
- {c.note ? <RelevanceNote note={c.note} /> : null}
- </div>
- )
+ return c.note ? <RelevanceNote note={c.note} /> : null
}
default: {
- const preview = typeof (content as { content?: unknown })?.content === 'string'
- return <span className="text-tertiary text-xs">{preview ? String((content as any).content) : ''}</span>
+ const value = (content as { content?: unknown })?.content
+ return typeof value === 'string' && value.trim() ? (
+ <span className="text-tertiary text-xs">{value}</span>
+ ) : null
}
}
}
-/** One log row: a header (type · location · attribution · timestamp) over the per-type body. */
function ArtefactRow({
reportId,
artefact,
knownTasks,
+ knownSignals,
}: {
reportId: string
artefact: SignalReportArtefact
knownTasks?: Map<string, Task>
+ knownSignals?: Map<string, SignalNode>
}): JSX.Element {
- const { isDev } = useValues(preflightLogic)
- const [showRaw, setShowRaw] = useState(false)
+ const signalId = artefact.type === 'signal_finding' ? (artefact.content as SignalFindingContent).signal_id : null
+ const signal = signalId ? knownSignals?.get(signalId) : undefined
const location = artefactLocationLabel(artefact)
const attribution = artefactAttributionLabel(artefact)
+ const summary = renderArtefactSummary(artefact)
+ const body = signal ? <SignalFindingBody signal={signal} /> : renderArtefactBody({ reportId, artefact, knownTasks })
+ const bodyHasOwnCard = artefact.type === 'signal_finding' || artefact.type === 'commit'
+ const MarkerIcon = ARTEFACT_MARKER[artefact.type] ?? IconActivity
return (
- <div className="rounded border border-primary bg-surface-primary p-3">
- <div className="mb-1.5 flex items-center gap-2 min-w-0">
- <span className="shrink-0 font-semibold text-xs text-default">{artefactTypeLabel(artefact.type)}</span>
- {location ? <span className="truncate font-mono text-tertiary text-[11px]">{location}</span> : null}
- <div className="ml-auto flex shrink-0 items-center gap-2">
- {attribution ? <span className="text-tertiary text-[11px]">by {attribution}</span> : null}
- {isDev ? (
- <button
- type="button"
- onClick={() => setShowRaw((v) => !v)}
- className="rounded px-1 font-mono text-tertiary text-[11px] transition-colors hover:bg-fill-highlight-50"
- title="Toggle raw JSON (dev only)"
- >
- {'{ }'}
- </button>
- ) : null}
- <TZLabel time={artefact.created_at} className="text-tertiary text-[11px]" />
+ <div className="relative flex gap-3 pb-4 last:pb-0">
+ <span className="z-10 flex size-5 shrink-0 items-center justify-center rounded-full border bg-surface-primary text-secondary">
+ <MarkerIcon className="size-3" />
+ </span>
+ <div className="min-w-0 flex-1">
+ <div
+ className={
+ body
+ ? 'mb-1 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5'
+ : 'flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5'
+ }
+ >
+ <span className="font-medium text-sm text-default">{artefactTypeLabel(artefact.type)}</span>
+ {summary}
+ {location ? <span className="truncate font-mono text-xs text-tertiary">{location}</span> : null}
+ <span className="inline-flex items-center gap-1.5 text-xs text-tertiary">
+ {attribution ? <span>{attribution}</span> : null}
+ {attribution ? <span aria-hidden>·</span> : null}
+ <TZLabel time={artefact.created_at} />
+ </span>
</div>
+ {body ? (
+ <div className="min-w-0 w-full">
+ {bodyHasOwnCard ? body : <ActivityBodyCard>{body}</ActivityBodyCard>}
+ </div>
+ ) : null}
</div>
- <ArtefactBody reportId={reportId} artefact={artefact} knownTasks={knownTasks} />
- {isDev && showRaw ? (
- <pre className="mt-2 max-h-72 overflow-auto rounded bg-fill-highlight-50 p-2 text-[10px] leading-tight">
- {JSON.stringify(artefact, null, 2)}
- </pre>
- ) : null}
</div>
)
}
@@ -451,20 +533,29 @@ export function ArtefactLogList({
reportId,
artefacts,
knownTasks,
+ knownSignals,
}: {
reportId: string
artefacts: SignalReportArtefact[]
/** Tasks the detail logic already resolved, keyed by id — `task_run` rows reuse these instead of refetching. */
knownTasks?: Map<string, Task>
+ knownSignals?: Map<string, SignalNode>
}): JSX.Element | null {
if (artefacts.length === 0) {
return null
}
- const ordered = [...artefacts].sort((a, b) => a.created_at.localeCompare(b.created_at))
+ const ordered = [...artefacts].sort((a, b) => b.created_at.localeCompare(a.created_at))
return (
- <div className="flex flex-col gap-2">
+ <div className="relative">
+ <span className="absolute bottom-2.5 left-2.5 top-2.5 w-px bg-border" aria-hidden />
{ordered.map((artefact) => (
- <ArtefactRow key={artefact.id} reportId={reportId} artefact={artefact} knownTasks={knownTasks} />
+ <ArtefactRow
+ key={artefact.id}
+ reportId={reportId}
+ artefact={artefact}
+ knownTasks={knownTasks}
+ knownSignals={knownSignals}
+ />
))}
</div>
)
diff --git a/frontend/src/scenes/inbox/components/detail/ArtefactTaskRun.tsx b/frontend/src/scenes/inbox/components/detail/ArtefactTaskRun.tsx
index d4fba8fc2f9c..736da9ef109d 100644
--- a/frontend/src/scenes/inbox/components/detail/ArtefactTaskRun.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ArtefactTaskRun.tsx
@@ -1,17 +1,18 @@
import { useEffect, useState } from 'react'
-import { IconChevronDown, IconChevronRight } from '@posthog/icons'
-import { LemonTag } from '@posthog/lemon-ui'
+import { LemonSkeleton, LemonTag } from '@posthog/lemon-ui'
import api from 'lib/api'
import { identifierToHuman } from 'lib/utils/strings'
import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'
-import { TaskRunStatusDot } from 'products/posthog_ai/frontend/api/primitives'
import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'
import { Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
+import { resolveRunVariant, RunStatusIndicator } from '../cards/runStatusVariant'
+import { ActivityDisclosure } from './ActivityDisclosure'
import { isCustomAgentTaskRun, taskRunTypeLabel, TaskRunArtefactContent } from './artefactTypes'
+import { RunLogContainer } from './RunLogContainer'
/**
* A `task_run` artefact: the linked task badged from its `(product, type)` (signals-pipeline runs
@@ -74,39 +75,45 @@ export function ArtefactTaskRun({
const replayOnly = isHistoricalRun || isTerminalRunStatus(task?.latest_run?.status)
const isCustom = isCustomAgentTaskRun(content)
- if (error) {
- return <span className="text-[11px] text-danger">Couldn't load this task.</span>
- }
-
return (
- <div>
- <button
- type="button"
- disabled={!task}
- onClick={() => setExpanded((v) => !v)}
- className="flex w-full items-center gap-2 rounded px-1 py-0.5 text-left text-xs transition-colors enabled:hover:bg-fill-highlight-50 disabled:cursor-default"
- >
- {expanded ? (
- <IconChevronDown className="shrink-0 text-tertiary" />
- ) : (
- <IconChevronRight className="shrink-0 text-tertiary" />
- )}
- <TaskRunStatusDot status={status} />
- <LemonTag size="small" type="muted">
- {taskRunTypeLabel(content)}
- </LemonTag>
- {isCustom ? (
- <LemonTag size="small" type="completion">
- {identifierToHuman(content.product)}
+ <ActivityDisclosure
+ expanded={expanded}
+ onChange={setExpanded}
+ disabledReason={
+ !task ? (error ? 'Refresh the page to retry loading this task' : 'Task details are loading') : undefined
+ }
+ fullWidth
+ label={
+ <span className="flex min-w-0 items-center gap-2">
+ <RunStatusIndicator variant={resolveRunVariant(status)} showLabel={false} />
+ <LemonTag size="small" type="muted">
+ {taskRunTypeLabel(content)}
</LemonTag>
- ) : null}
- <span className="truncate text-secondary">
- {loading ? 'Loading task…' : (task?.title ?? content.task_id)}
+ {isCustom ? (
+ <LemonTag size="small" type="completion">
+ {identifierToHuman(content.product)}
+ </LemonTag>
+ ) : null}
+ {loading ? (
+ <LemonSkeleton className="h-3 w-32" />
+ ) : (
+ <span className={error ? 'truncate text-danger' : 'truncate text-secondary'}>
+ {error
+ ? "Couldn't load this task. Refresh the page to try again."
+ : (task?.title ?? content.task_id)}
+ </span>
+ )}
</span>
- </button>
-
- {expanded && task && runId ? (
- <div className="mt-2 h-[420px] overflow-hidden rounded border border-primary bg-surface-primary">
+ }
+ expandedLabel={
+ <span className="flex min-w-0 items-center gap-2">
+ <RunStatusIndicator variant={resolveRunVariant(status)} showLabel={false} />
+ <span className="truncate text-secondary">Hide task run</span>
+ </span>
+ }
+ >
+ {task && runId ? (
+ <RunLogContainer>
<ReadonlyRunSurface
taskId={task.id}
runId={runId}
@@ -114,8 +121,8 @@ export function ArtefactTaskRun({
threadRowClassName="px-3"
threadListClassName="py-3"
/>
- </div>
+ </RunLogContainer>
) : null}
- </div>
+ </ActivityDisclosure>
)
}
diff --git a/frontend/src/scenes/inbox/components/detail/DiscussReportButton.tsx b/frontend/src/scenes/inbox/components/detail/DiscussReportButton.tsx
index 2884cdc1c94a..8e9d6a0e381b 100644
--- a/frontend/src/scenes/inbox/components/detail/DiscussReportButton.tsx
+++ b/frontend/src/scenes/inbox/components/detail/DiscussReportButton.tsx
@@ -1,7 +1,7 @@
import { useActions, useValues } from 'kea'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
-import { IconMessage } from '@posthog/icons'
+import { IconSparkles } from '@posthog/icons'
import { LemonButton, lemonToast } from '@posthog/lemon-ui'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea'
@@ -11,50 +11,52 @@ import { captureInboxReportAction } from '../../inboxAnalytics'
import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'
import { SignalReport } from '../../types'
-/**
- * Discuss opens a small popover with a textarea so the user poses their question up front, then kicks
- * off a fresh research task whose prompt is the report link (for the agent to open and read) followed
- * by that question. Discuss never changes the report's state, so it stays available for every report –
- * including resolved and archived ones.
- */
export function DiscussReportButton({ report, reportUrl }: { report: SignalReport; reportUrl: string }): JSX.Element {
const { isDiscussing, aiConsentDisabledReason } = useValues(inboxTaskKickoffLogic)
const { discussReport } = useActions(inboxTaskKickoffLogic)
+ const buttonRef = useRef<HTMLButtonElement>(null)
const [isOpen, setIsOpen] = useState(false)
const [question, setQuestion] = useState('')
const submit = (): void => {
const trimmed = question.trim()
- if (!trimmed) {
+ // Cmd/Ctrl + Enter submits straight from the textarea, so it never sees the button's
+ // `loading`/`disabledReason` – each guard has to hold here too, or an impatient second
+ // press fires another paid task run for the same report.
+ if (!trimmed || isDiscussing) {
return
}
- // Enter submits straight from the textarea, so it never sees the button's `disabledReason`.
- // Say why and leave the popover as it is, rather than clearing the draft into a rejected action.
if (aiConsentDisabledReason) {
lemonToast.error(aiConsentDisabledReason)
return
}
captureInboxReportAction({ report, actionType: 'discuss', surface: 'detail_pane' })
+ // The popover stays open on its spinner until the run is created and we navigate to it, so
+ // the request is visibly in flight and a failure leaves the draft question to retry with.
discussReport(report, reportUrl, trimmed)
- setIsOpen(false)
- setQuestion('')
}
return (
<Popover
visible={isOpen}
- onClickOutside={() => setIsOpen(false)}
+ onClickOutside={(event) => {
+ if (event.target instanceof Node && buttonRef.current?.contains(event.target)) {
+ return
+ }
+ setIsOpen(false)
+ }}
placement="bottom-end"
overlay={
<div className="flex flex-col gap-2 p-2 w-[22rem]">
<LemonTextArea
value={question}
onChange={setQuestion}
- onPressEnter={submit}
- placeholder="What would you like to discuss about this report?"
+ onPressCmdEnter={submit}
+ placeholder="What would you like to ask about this report?"
maxLength={4000}
rows={4}
autoFocus
+ rightFooter={<span className="text-xs text-tertiary">Cmd/Ctrl + Enter to ask AI</span>}
/>
<div className="flex justify-end">
<LemonButton
@@ -66,20 +68,24 @@ export function DiscussReportButton({ report, reportUrl }: { report: SignalRepor
aiConsentDisabledReason ?? (question.trim() ? undefined : 'Enter a question first')
}
>
- Discuss
+ Ask AI
</LemonButton>
</div>
</div>
}
>
<LemonButton
+ ref={buttonRef}
type="secondary"
size="small"
- icon={<IconMessage />}
+ icon={<IconSparkles />}
+ sideIcon={null}
+ active={isOpen}
+ loading={isDiscussing}
onClick={() => setIsOpen((open) => !open)}
- tooltip="Ask an agent about this report"
+ tooltip="Ask AI about this report"
>
- Discuss
+ Ask AI
</LemonButton>
</Popover>
)
diff --git a/frontend/src/scenes/inbox/components/detail/InboxDetail.stories.tsx b/frontend/src/scenes/inbox/components/detail/InboxDetail.stories.tsx
index 3b09e1c4b20c..83f8a88bb67b 100644
--- a/frontend/src/scenes/inbox/components/detail/InboxDetail.stories.tsx
+++ b/frontend/src/scenes/inbox/components/detail/InboxDetail.stories.tsx
@@ -30,7 +30,7 @@ const mixedPrChecks = {
url: 'https://github.com/PostHog/posthog/actions/runs/12001/jobs/1',
},
{
- name: 'Backend CI / Django tests – Core (persons-on-events off), Python 3.13, ClickHouse 26.3',
+ name: 'Backend CI / Django tests: Core (persons-on-events off), Python 3.13, ClickHouse 26.3',
status: 'in_progress',
conclusion: null,
url: 'https://github.com/PostHog/posthog/actions/runs/12001/jobs/2',
diff --git a/frontend/src/scenes/inbox/components/detail/PullRequestDiffView.tsx b/frontend/src/scenes/inbox/components/detail/PullRequestDiffView.tsx
index 6468243e8fc8..d3253402e46a 100644
--- a/frontend/src/scenes/inbox/components/detail/PullRequestDiffView.tsx
+++ b/frontend/src/scenes/inbox/components/detail/PullRequestDiffView.tsx
@@ -263,7 +263,7 @@ export function PullRequestDiffView({
}, [files, isDarkModeOn, diffStyle, onLineNumberClick])
if (parseFailed) {
- return <p className="m-0 text-sm text-danger">Couldn't parse this diff — it may be in an unexpected format.</p>
+ return <p className="m-0 text-sm text-danger">Couldn't parse this diff. It may be in an unexpected format.</p>
}
if (files.length === 0) {
@@ -288,7 +288,7 @@ export function PullRequestDiffView({
))}
{truncated ? (
<p className="m-0 text-xs text-tertiary italic">
- Diff truncated — open the pull request in GitHub for the full change.
+ The diff is truncated. Open the pull request in GitHub for the full change.
</p>
) : null}
</div>
diff --git a/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx b/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx
index cb6d407a39bf..43629aa4963c 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx
@@ -15,7 +15,9 @@ import { DetailSection } from './DetailSection'
* `ReportActivitySection`.
*/
export function ReportActivitySection({ report }: { report: SignalReport }): JSX.Element | null {
- const { reportArtefacts, reportTasks } = useValues(inboxReportDetailLogic({ reportId: report.id, report }))
+ const { reportArtefacts, reportSignals, reportTasks } = useValues(
+ inboxReportDetailLogic({ reportId: report.id, report })
+ )
if (!reportArtefacts || reportArtefacts.length === 0) {
return null
@@ -24,6 +26,7 @@ export function ReportActivitySection({ report }: { report: SignalReport }): JSX
// The logic already resolved the research/implementation tasks; hand them to the `task_run` rows
// so they don't re-fetch the same tasks the Runs section just loaded.
const knownTasks = new Map((reportTasks ?? []).map((entry) => [entry.task.id, entry.task]))
+ const knownSignals = new Map((reportSignals ?? []).map((signal) => [signal.signal_id, signal]))
return (
<DetailSection
@@ -31,13 +34,18 @@ export function ReportActivitySection({ report }: { report: SignalReport }): JSX
title="Activity"
collapsible
defaultCollapsed
- rightSlot={
- <span className="text-[0.6875rem] text-tertiary tabular-nums">
+ meta={
+ <span className="text-xs text-tertiary tabular-nums">
{reportArtefacts.length} {reportArtefacts.length === 1 ? 'entry' : 'entries'}
</span>
}
>
- <ArtefactLogList reportId={report.id} artefacts={reportArtefacts} knownTasks={knownTasks} />
+ <ArtefactLogList
+ reportId={report.id}
+ artefacts={reportArtefacts}
+ knownTasks={knownTasks}
+ knownSignals={knownSignals}
+ />
</DetailSection>
)
}
diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx
index 0fd060876264..ab64bbea05fb 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx
@@ -82,9 +82,9 @@ export function ReportDetailBadges({
)
}
-/** Shared explainer for the finding count in the meta line and the Evidence section. */
-const FINDINGS_TOOLTIP =
- 'Signals are the individual pieces of evidence – from your connected sources and scouts – that were grouped into this report.'
+/** Shared explainer for the signal count in the meta line and the Evidence section. */
+const SIGNALS_TOOLTIP =
+ 'Signals are the individual pieces of evidence from your connected sources and scouts that were grouped into this report.'
/**
* Single meta line under the title: status/actionability chips, then dot-separated stats
@@ -110,7 +110,7 @@ function ReportDetailMeta({
const stats: ReactNode[] = []
if (evidenceCount > 0) {
stats.push(
- <Tooltip title={FINDINGS_TOOLTIP}>
+ <Tooltip title={SIGNALS_TOOLTIP}>
<span className="tabular-nums cursor-help">
{evidenceCount} signal{evidenceCount === 1 ? '' : 's'}
</span>
@@ -375,7 +375,7 @@ export function InboxDetailFrame({
</LemonMarkdown>
) : (
<p className={`text-sm text-tertiary m-0${summaryPending ? ' italic' : ''}`}>
- No summary yet – an agent is still investigating.
+ No summary yet. An agent is still investigating.
</p>
)}
{trailingCharts.length > 0 && (
@@ -403,7 +403,7 @@ export function InboxDetailFrame({
collapsible
onToggleCollapsed={captureSectionToggle('evidence')}
rightSlot={
- <Tooltip title={FINDINGS_TOOLTIP}>
+ <Tooltip title={SIGNALS_TOOLTIP}>
<span className="text-[0.6875rem] text-tertiary tabular-nums cursor-help">
{evidenceCount} signal{evidenceCount === 1 ? '' : 's'}
</span>
diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
index 5f4ebd06ead1..b22ba7c78245 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
@@ -112,7 +112,7 @@ export function useReportDetailActions(report: SignalReport): ReportDetailAction
label: 'Refund',
icon: <IconReceipt />,
loading: isRefunding,
- tooltip: "Refund this PR – you won't pay for it and it won't count toward your included PRs",
+ tooltip: "Refund this PR. You won't pay for it and it won't count toward your included PRs.",
disabledReason: refundDisabledReason ?? undefined,
onClick: onRefundClick,
}
diff --git a/frontend/src/scenes/inbox/components/detail/ReportFeedbackFooter.tsx b/frontend/src/scenes/inbox/components/detail/ReportFeedbackFooter.tsx
index f984e0ca66ad..39d4a08b9641 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportFeedbackFooter.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportFeedbackFooter.tsx
@@ -10,7 +10,7 @@ import { InboxReportFeedbackSentiment } from '../../inboxAnalytics'
import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'
import { SignalReport } from '../../types'
-// Matches the cap on the sibling inbox dialogs (Dismiss, Refund, Discuss); the note rides along as
+// Matches the cap on the sibling inbox dialogs (Dismiss, Refund, agent question); the note rides along as
// an analytics property, so keep it under the client's per-property limit.
const FEEDBACK_NOTE_MAX_LENGTH = 4000
@@ -83,7 +83,7 @@ export function ReportFeedbackFooter({ report }: { report: SignalReport }): JSX.
{feedbackNoteSent && <span>Note added</span>}
</div>
{feedbackNoteOpen && (
- <div className="flex flex-col items-start gap-2 max-w-prose">
+ <div className="flex w-full max-w-prose flex-col items-start gap-2">
<LemonTextArea
value={feedbackNoteDraft}
onChange={setFeedbackNoteDraft}
@@ -92,8 +92,10 @@ export function ReportFeedbackFooter({ report }: { report: SignalReport }): JSX.
// keystroke, so the field carries its own name for screen readers.
aria-label="Add a note about this report"
maxLength={FEEDBACK_NOTE_MAX_LENGTH}
- rows={3}
+ minRows={5}
+ maxRows={12}
autoFocus={openedHere}
+ className="w-full"
data-attr="inbox-report-feedback-note"
/>
<LemonButton
diff --git a/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx b/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx
index 811a8a0cc963..7740914e9d22 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx
@@ -2,18 +2,19 @@ import { useActions, useValues } from 'kea'
import { combineUrl } from 'kea-router'
import { IconChevronDown, IconChevronRight, IconExternal, IconTerminal } from '@posthog/icons'
-import { Link, Spinner } from '@posthog/lemon-ui'
+import { LemonSkeleton, Link } from '@posthog/lemon-ui'
import { urls } from 'scenes/urls'
import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'
-import { TaskRunStatusDot } from 'products/posthog_ai/frontend/api/primitives'
import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'
import { TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
import { inboxReportDetailLogic, ReportTaskEntry } from '../../logics/inboxReportDetailLogic'
import { SignalReport } from '../../types'
+import { resolveRunVariant, RunStatusIndicator } from '../cards/runStatusVariant'
import { DetailSection } from './DetailSection'
+import { RunLogContainer } from './RunLogContainer'
/**
* Renders the report's linked tasks inline (latest status + purpose). Each row expands in place to
@@ -28,9 +29,9 @@ export function ReportTasksSection({ report }: { report: SignalReport }): JSX.El
if (reportTasksLoading && !reportTasks) {
return (
<DetailSection icon={<IconTerminal />} title="Runs" collapsible>
- <div className="flex items-center gap-2 text-xs text-tertiary py-1">
- <Spinner className="size-3" />
- Loading runs…
+ <div className="flex flex-col gap-2 py-1">
+ <LemonSkeleton className="h-8 w-full" />
+ <LemonSkeleton className="h-8 w-full" />
</div>
</DetailSection>
)
@@ -86,7 +87,7 @@ function TaskRow({
) : (
<IconChevronRight className="shrink-0 text-tertiary" />
)}
- <TaskRunStatusDot status={status} />
+ <RunStatusIndicator variant={resolveRunVariant(status)} showLabel={false} />
<span className="truncate text-secondary">{purposeLabel}</span>
</button>
<Link
@@ -107,7 +108,7 @@ function TaskRow({
// The viewer's virtualized thread owns scroll, so this box only bounds the height and
// clips — an `overflow-y-auto` here would nest a second scrollbar. Content is kept off
// the border via `threadRowClassName`/`threadListClassName`, not padding on this box.
- <div className="h-[420px] overflow-hidden rounded border border-primary bg-surface-primary">
+ <RunLogContainer>
<ReadonlyRunSurface
taskId={task.id}
runId={runId}
@@ -115,10 +116,10 @@ function TaskRow({
threadRowClassName="px-3"
threadListClassName="py-3"
/>
- </div>
+ </RunLogContainer>
) : (
<div className="rounded border border-primary bg-surface-primary px-3 py-2.5 text-xs text-secondary leading-snug">
- This run hasn’t started yet – its agent log will appear here once it does.
+ This run hasn't started yet. Its agent log will appear here once it does.
</div>
)}
</div>
diff --git a/frontend/src/scenes/inbox/components/detail/RunLogContainer.tsx b/frontend/src/scenes/inbox/components/detail/RunLogContainer.tsx
new file mode 100644
index 000000000000..df29d040862b
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/detail/RunLogContainer.tsx
@@ -0,0 +1,5 @@
+export function RunLogContainer({ children }: { children: React.ReactNode }): JSX.Element {
+ return (
+ <div className="h-96 w-full overflow-hidden rounded border border-primary bg-surface-primary">{children}</div>
+ )
+}
diff --git a/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx b/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx
index e1d774941766..4d70a646c753 100644
--- a/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx
+++ b/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx
@@ -246,7 +246,7 @@ function ReviewerRow({
)
return (
- <div className="group flex items-start gap-2 rounded px-1.5 py-1.5">
+ <div className="group grid grid-cols-[minmax(8rem,10rem)_minmax(0,1fr)_auto] items-center gap-2 rounded px-1.5 py-1.5">
{/* no row hover: the row isn't clickable, only the remove button (revealed on group hover) is */}
<Tooltip
title={
@@ -257,7 +257,7 @@ function ReviewerRow({
: `${displayName} hasn't connected their GitHub account to PostHog. Ask them to do so in Settings!`
}
>
- <span className={!reviewer.user ? 'opacity-75' : undefined}>
+ <span className={!reviewer.user ? 'min-w-0 opacity-75' : 'min-w-0'}>
{/* The GitHub handle's link is merged into the name: clicking it opens the
reviewer's GitHub profile, flagged by the external-link icon. */}
{githubUrl ? (
@@ -275,7 +275,7 @@ function ReviewerRow({
</Tooltip>
<div className="flex flex-col min-w-0 flex-1 gap-0.5">
{reviewer.relevant_commits.length > 0 && (
- <span className="text-[0.6875rem] text-tertiary">
+ <span className="text-xs text-tertiary">
{reviewer.relevant_commits.map((commit, i) => (
<span key={commit.sha}>
{i > 0 && ', '}
@@ -290,7 +290,7 @@ function ReviewerRow({
))}
</span>
)}
- {reason && <span className="text-[0.6875rem] text-tertiary leading-snug">{reason}</span>}
+ {reason && <span className="text-xs text-tertiary leading-snug">{reason}</span>}
</div>
<LemonButton
size="xsmall"
diff --git a/frontend/src/scenes/inbox/components/detail/artefactTypes.ts b/frontend/src/scenes/inbox/components/detail/artefactTypes.ts
index c6315d815b47..923bf1db0e2d 100644
--- a/frontend/src/scenes/inbox/components/detail/artefactTypes.ts
+++ b/frontend/src/scenes/inbox/components/detail/artefactTypes.ts
@@ -58,6 +58,29 @@ export interface DismissalContent {
note?: string
}
+export interface RepoSelectionContent {
+ repository?: string | null
+ reason?: string
+}
+
+export interface RelatedToContent {
+ report_id?: string
+}
+
+export interface CodeReviewContent {
+ repository?: string
+ head_sha?: string
+ head_branch?: string
+ outcome?: 'published' | 'stored' | 'failed'
+ pr_url?: string | null
+ review_url?: string | null
+ counts?: {
+ must_fix?: number
+ should_fix?: number
+ consider?: number
+ }
+}
+
export interface TitleChangeContent {
old_title?: string | null
new_title: string
@@ -88,6 +111,7 @@ export const ARTEFACT_TYPE_LABELS: Record<string, string> = {
title_change: 'Title edited',
summary_change: 'Summary edited',
related_to: 'Related report',
+ code_review: 'Code review',
}
export function artefactTypeLabel(type: string): string {
@@ -119,18 +143,11 @@ export function artefactLocationLabel(artefact: SignalReportArtefact): string |
return null
}
-/**
- * Attribution byline source: "{first name or email}" for a human write, "agent" for a
- * task-attributed write, or null for a system/pipeline write (no byline). Only one of
- * `created_by` / `task_id` is set per row.
- */
+/** The human responsible for an activity, when there is one. */
export function artefactAttributionLabel(artefact: SignalReportArtefact): string | null {
if (artefact.created_by) {
return artefact.created_by.first_name?.trim() || artefact.created_by.email
}
- if (artefact.task_id) {
- return 'agent'
- }
return null
}
@@ -167,11 +184,11 @@ export function deriveTaskPurpose(content: TaskRunArtefactContent): DerivedPurpo
if (content.type === 'scout') {
return { purpose: 'other', purposeLabel: 'Scout' }
}
- return { purpose: 'other', purposeLabel: `Signals — ${identifierToHuman(content.type)}` }
+ return { purpose: 'other', purposeLabel: `Signals: ${identifierToHuman(content.type)}` }
}
return {
purpose: 'other',
- purposeLabel: `${identifierToHuman(content.product)} — ${identifierToHuman(content.type)}`,
+ purposeLabel: `${identifierToHuman(content.product)}: ${identifierToHuman(content.type)}`,
}
}
diff --git a/frontend/src/scenes/inbox/components/findings/FindingsPanel.tsx b/frontend/src/scenes/inbox/components/findings/FindingsPanel.tsx
index fee5ef991533..8c1814f53f13 100644
--- a/frontend/src/scenes/inbox/components/findings/FindingsPanel.tsx
+++ b/frontend/src/scenes/inbox/components/findings/FindingsPanel.tsx
@@ -263,9 +263,8 @@ function FindingsHeader({
<span className="text-base font-semibold text-default">Scout signals</span>
</div>
<p className="mb-0 text-sm text-secondary">
- Everything your scouts have surfaced recently, in one place — newest first: the signals they emitted and
- the inbox reports they authored or edited. See what's been found across the whole troop and which scout
- found it.
+ Everything your scouts have surfaced recently, newest first: the signals they emitted and the inbox
+ reports they authored or edited. See what's been found across the whole troop and which scout found it.
</p>
{tallyParts.length > 0 && (
<span className="text-xs text-muted">
diff --git a/frontend/src/scenes/inbox/components/onboarding/InboxOnboarding.tsx b/frontend/src/scenes/inbox/components/onboarding/InboxOnboarding.tsx
index 4499f26277db..6e26831b5a37 100644
--- a/frontend/src/scenes/inbox/components/onboarding/InboxOnboarding.tsx
+++ b/frontend/src/scenes/inbox/components/onboarding/InboxOnboarding.tsx
@@ -40,7 +40,7 @@ function PrPricingInfo(): JSX.Element {
<p className="mb-2">We aim for the $15 cost to go down significantly in the coming months.</p>
<p className="mb-0">
The truth is that capable enough models <em>currently</em> cost quite a bit, so we're pricing
- with a very limited margin – similarly to our strategy with other PostHog tools. Like with our
+ with a very limited margin, similarly to our strategy with other PostHog tools. Like with our
other tools, we will be passing savings along to you.
</p>
</>
@@ -58,7 +58,7 @@ const BEATS: Beat[] = [
label: 'Pull requests, ready to merge.',
description: (
<>
- Agents read your product data and open a PR for anything safe to ship – with the diff, tests, and
+ Agents read your product data and open a PR for anything safe to ship, with the diff, tests, and
reviewers already lined up.
</>
),
@@ -74,7 +74,7 @@ const BEATS: Beat[] = [
description: (
<>
Not everything is a clean code change. When something needs your judgment, agents file a report with the
- context and what they'd do – you decide.
+ context and what they'd do. You decide.
</>
),
subtext: 'Reports without PRs are free.',
@@ -125,7 +125,7 @@ function CommandCard(): JSX.Element {
<div>
<h2 className="-mt-1 mb-1 text-base font-semibold">One command. That's the whole setup.</h2>
<p className="m-0 text-sm text-secondary">
- Run it in your project's repo – there are no in-app steps to click through.
+ Run it in your project's repo. There are no in-app steps to click through.
</p>
</div>
<SelfDrivingCommand size="md" />
diff --git a/frontend/src/scenes/inbox/components/onboarding/InboxOnboardingPreviews.tsx b/frontend/src/scenes/inbox/components/onboarding/InboxOnboardingPreviews.tsx
index 973acd448c89..c6e66dd7b12b 100644
--- a/frontend/src/scenes/inbox/components/onboarding/InboxOnboardingPreviews.tsx
+++ b/frontend/src/scenes/inbox/components/onboarding/InboxOnboardingPreviews.tsx
@@ -29,7 +29,7 @@ const PULL_REQUEST_SAMPLE: Omit<SignalReport, 'created_at' | 'updated_at'> = {
id: 'onboarding-preview-pr',
title: 'fix(compression): stop 4K streams dropping to single-threaded encode',
summary:
- 'Middle-out throughput fell 41% above 2160p after the Anton migration – the Weissman score slid from 5.2 to 2.9 and p95 encode time tripled. This repins the chunk scheduler and restores both to pre-migration numbers.',
+ 'Middle-out throughput fell 41% above 2160p after the Anton migration. The Weissman score slid from 5.2 to 2.9 and p95 encode time tripled. This repins the chunk scheduler and restores both to pre-migration numbers.',
status: SignalReportStatus.READY,
total_weight: 0,
signal_count: 3,
@@ -44,9 +44,9 @@ const PULL_REQUEST_SAMPLE: Omit<SignalReport, 'created_at' | 'updated_at'> = {
// A "needs your call" report: no clean code change, a judgment to make.
const REPORT_SAMPLE: Omit<SignalReport, 'created_at' | 'updated_at'> = {
id: 'onboarding-preview-report',
- title: 'Hooli traffic is hammering the Pipernet beta – throttle or let it ride?',
+ title: 'Hooli traffic is hammering the Pipernet beta. Throttle or let it ride?',
summary:
- "Sign-ups from Hooli IP ranges jumped 6× overnight and mostly bounce at onboarding. Could be Gavin's team load-testing us, or real interest worth keeping – worth your call before we rate-limit.",
+ "Sign-ups from Hooli IP ranges jumped 6× overnight and mostly bounce at onboarding. This could be Gavin's team load-testing us or real interest worth keeping. Review it before we rate-limit.",
status: SignalReportStatus.READY,
total_weight: 0,
signal_count: 5,
diff --git a/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx b/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx
index 10f5a074ac5f..f08ed781c46f 100644
--- a/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx
+++ b/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx
@@ -1,4 +1,5 @@
import { useActions, useMountedLogic, useValues } from 'kea'
+import { combineUrl, router } from 'kea-router'
import { IconBolt, IconCheckCircle, IconChevronRight, IconCompass, IconGithub, IconServer } from '@posthog/icons'
import { LemonModal, LemonSkeleton, LemonTag, Link } from '@posthog/lemon-ui'
@@ -10,7 +11,7 @@ import { slackChannelDisplayName } from 'lib/integrations/slackChannel'
import { IconSlack } from 'lib/lemon-ui/icons'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { cn } from 'lib/utils/css-classes'
-import { urls } from 'scenes/urls'
+import { GithubIntegration } from 'scenes/integrations/components/GithubIntegration'
import { scoutFleetLogic } from '../../logics/scoutFleetLogic'
import { scoutMcpServersLogic } from '../../logics/scoutMcpServersLogic'
@@ -25,6 +26,7 @@ import { SlackNotificationsSection } from '../config/SlackNotificationsSection'
import { AgentSetupModalKey, agentSetupModalLogic } from './agentSetupModalLogic'
import { InboxUsageWidget } from './InboxUsageWidget'
import { InstallationSetupSection } from './InstallationSetupSection'
+import { SetupSection } from './SetupSection'
type WidgetTone = 'todo' | 'done' | 'neutral'
/** Visual weight reflecting how important / frequently edited a part of the setup is. */
@@ -40,7 +42,6 @@ interface SetupWidgetCardProps {
loading?: boolean
/** One-line context, shown on `lg` cards only. */
description?: string
- /** Modal-backed widgets pass `onClick`; link-out widgets (Code access, MCP) pass `to`. */
onClick?: () => void
to?: string
/** Extra content under the status (e.g. MCP brand icons). */
@@ -205,6 +206,7 @@ function ScoutTroopWidget(): JSX.Element {
function CodeAccessWidget(): JSX.Element {
const { getIntegrationsByKind, integrationsLoading } = useValues(integrationsLogic)
+ const { openSetupModal } = useActions(agentSetupModalLogic)
const hasGithub = getIntegrationsByKind(['github']).length > 0
return (
<SetupWidgetCard
@@ -213,8 +215,8 @@ function CodeAccessWidget(): JSX.Element {
size="md"
tone={hasGithub ? 'done' : 'todo'}
loading={integrationsLoading && !hasGithub}
- status={hasGithub ? 'GitHub connected' : 'Foundational – connect to start'}
- to={urls.settings('environment-integrations', 'integration-github')}
+ status={hasGithub ? 'GitHub connected' : 'Foundational. Connect to start.'}
+ onClick={() => openSetupModal('github')}
/>
)
}
@@ -293,15 +295,14 @@ function NotificationsWidget(): JSX.Element {
)
}
-/** Section heading styled like a LemonTabs label (same 14px scale, tertiary color) so the
- * rail reads as a sibling of the tab bar rather than a louder header. */
-export function SetupSection({ title, children }: { title: string; children: React.ReactNode }): JSX.Element {
- return (
- <div className="flex flex-col">
- <h4 className="text-sm font-medium text-tertiary mt-0 mb-3.5">{title}</h4>
- <div className="flex flex-col gap-1.5">{children}</div>
- </div>
- )
+/**
+ * The GitHub OAuth round trip returns to `next`, and this modal opens from the rail beside any of the
+ * list tabs – so `next` has to be wherever the user actually started, not a fixed tab. `setup=github`
+ * comes back with them so the modal reopens showing the result.
+ */
+function GithubSetupBody(): JSX.Element {
+ const { location, searchParams } = useValues(router)
+ return <GithubIntegration next={combineUrl(location.pathname, { ...searchParams, setup: 'github' }).url} />
}
const SETUP_MODALS: Record<
@@ -326,6 +327,12 @@ const SETUP_MODALS: Record<
width: 560,
body: <SlackNotificationsSection />,
},
+ github: {
+ title: 'GitHub',
+ description: 'Connect GitHub so agents can read repositories and open pull requests.',
+ width: 760,
+ body: <GithubSetupBody />,
+ },
'mcp-servers': {
title: 'MCP servers',
description: 'Shared external tools available to scheduled Scouts.',
@@ -354,8 +361,7 @@ function SetupModal(): JSX.Element {
/**
* The agent-setup widgets, grouped into Agents / Connections. Each widget shows
* status and nudges the user to finish that part of the setup. Signal sources and Scout troop
- * (most edited) are largest; connections medium. Code access links out to settings;
- * the rest open a management modal.
+ * (most edited) are largest; connections medium and open management modals.
*
* Rendered two ways: `rail` (a column to the right of the tabs on wide viewports) and
* `stacked` (the Configuration tab body on narrow viewports).
diff --git a/frontend/src/scenes/inbox/components/shell/DismissReportDialog.tsx b/frontend/src/scenes/inbox/components/shell/DismissReportDialog.tsx
index 0db02a2dc5f9..2fdfaf7a2aae 100644
--- a/frontend/src/scenes/inbox/components/shell/DismissReportDialog.tsx
+++ b/frontend/src/scenes/inbox/components/shell/DismissReportDialog.tsx
@@ -70,7 +70,7 @@ export function openDismissReportDialog({
LemonDialog.openForm({
title,
description,
- maxWidth: '30rem',
+ maxWidth: '36rem',
initialValues: { reason: null as DismissalReasonValue | null, note: '' },
content: (
<div className="flex flex-col gap-3">
@@ -83,7 +83,8 @@ export function openDismissReportDialog({
<LemonTextArea
placeholder="What made this report wrong, or not worth fixing?"
maxLength={4000}
- rows={3}
+ minRows={5}
+ maxRows={12}
/>
</LemonField>
</div>
diff --git a/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx b/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx
index 6fe63cf96ff4..0176a0df9293 100644
--- a/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx
+++ b/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx
@@ -40,7 +40,7 @@ function FilterPopover({
onVisibilityChange={setVisible}
matchWidth={false}
actionable
- placement="bottom-start"
+ placement="bottom-end"
overlay={<div className="min-w-[200px] max-w-[260px] p-1 deprecated-space-y-px">{children}</div>}
>
<button
@@ -98,10 +98,12 @@ function ScoutSubFilter({
scoutNames,
scoutFilter,
onToggle,
+ onClear,
}: {
scoutNames: string[]
scoutFilter: string[]
onToggle: (scout: string) => void
+ onClear: () => void
}): JSX.Element {
const [expanded, setExpanded] = useState(scoutFilter.length > 0)
// Auto-expand whenever a scout selection appears — including URL navigation or persisted-state
@@ -114,17 +116,26 @@ function ScoutSubFilter({
}, [scoutFilter.length])
return (
<div className="pl-5">
- <button
- type="button"
- onClick={() => setExpanded(!expanded)}
- className="flex w-full items-center gap-1 rounded px-1.5 py-1 text-left text-xs text-muted transition-colors hover:bg-surface-secondary"
- >
- <IconChevronDown className={`shrink-0 text-sm transition-transform ${expanded ? '' : '-rotate-90'}`} />
- <span>
- Filter by scout
- {scoutFilter.length > 0 && <span className="text-default"> · {scoutFilter.length}</span>}
- </span>
- </button>
+ <div className="flex items-center justify-between gap-1">
+ <button
+ type="button"
+ onClick={() => setExpanded(!expanded)}
+ className="flex min-w-0 flex-1 items-center gap-1 rounded px-1.5 py-1 text-left text-xs text-muted transition-colors hover:bg-surface-secondary"
+ >
+ <IconChevronDown
+ className={`shrink-0 text-sm transition-transform ${expanded ? '' : '-rotate-90'}`}
+ />
+ <span>
+ Filter by scout
+ {scoutFilter.length > 0 && <span className="text-default"> · {scoutFilter.length}</span>}
+ </span>
+ </button>
+ {scoutFilter.length > 0 && (
+ <LemonButton size="xsmall" type="tertiary" onClick={onClear}>
+ Clear
+ </LemonButton>
+ )}
+ </div>
{expanded && (
<div className="max-h-48 overflow-y-auto deprecated-space-y-px">
{scoutNames.map((skillName) => (
@@ -162,7 +173,8 @@ export function InboxSearchFilterBar({
}: InboxSearchFilterBarProps): JSX.Element {
const { searchQuery, sortField, sortDirection, sourceProductFilter, scoutFilter, priorityFilter } =
useValues(inboxFiltersLogic)
- const { setSearchQuery, setSort, toggleSourceProduct, toggleScout, togglePriority } = useActions(inboxFiltersLogic)
+ const { setSearchQuery, setSort, toggleSourceProduct, toggleScout, clearScoutFilter, togglePriority } =
+ useActions(inboxFiltersLogic)
const { scoutConfigs } = useValues(scoutFleetLogic)
const activeSort = INBOX_SORT_OPTIONS.find((o) => o.field === sortField && o.direction === sortDirection)
@@ -176,7 +188,7 @@ export function InboxSearchFilterBar({
return (
<div className="flex items-center gap-2 flex-wrap w-full">
<LemonInput
- className="min-w-[220px] max-w-[420px]"
+ className="min-w-[220px] max-w-[420px] [&_.LemonInput__input]:pr-4"
type="search"
value={searchQuery}
onChange={setSearchQuery}
@@ -225,6 +237,7 @@ export function InboxSearchFilterBar({
scoutNames={scoutNames}
scoutFilter={scoutFilter}
onToggle={toggleScout}
+ onClear={clearScoutFilter}
/>
)}
</div>
diff --git a/frontend/src/scenes/inbox/components/shell/InstallationSetupSection.tsx b/frontend/src/scenes/inbox/components/shell/InstallationSetupSection.tsx
index 886ee1df72be..d9eaac6a2d14 100644
--- a/frontend/src/scenes/inbox/components/shell/InstallationSetupSection.tsx
+++ b/frontend/src/scenes/inbox/components/shell/InstallationSetupSection.tsx
@@ -3,8 +3,8 @@ import { useMountedLogic } from 'kea'
import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic'
-import { SetupSection } from './AgentSetupColumn'
import { InstallationCard } from './InstallationCard'
+import { SetupSection } from './SetupSection'
/**
* The "Installation" block of the inbox setup column, present only while a wizard run is in flight.
diff --git a/frontend/src/scenes/inbox/components/shell/RefundReportDialog.tsx b/frontend/src/scenes/inbox/components/shell/RefundReportDialog.tsx
index bb4be1c1449b..9e4cf6543cea 100644
--- a/frontend/src/scenes/inbox/components/shell/RefundReportDialog.tsx
+++ b/frontend/src/scenes/inbox/components/shell/RefundReportDialog.tsx
@@ -46,7 +46,7 @@ export function openRefundReportDialog({ reportTitle, onConfirm }: OpenRefundRep
<LemonRadio value={value} onChange={onChange} options={REFUND_REASON_OPTIONS} />
)}
</LemonField>
- <LemonField name="note" label="Note" info="Optional – helps us review refunds">
+ <LemonField name="note" label="Note" info="Optional. Helps us review refunds.">
<LemonTextArea placeholder="Optional: add detail" maxLength={4000} rows={3} />
</LemonField>
</div>
diff --git a/frontend/src/scenes/inbox/components/shell/SetupSection.tsx b/frontend/src/scenes/inbox/components/shell/SetupSection.tsx
new file mode 100644
index 000000000000..4a6a7a939120
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/shell/SetupSection.tsx
@@ -0,0 +1,10 @@
+/** Section heading styled like a LemonTabs label (same 14px scale, tertiary color) so the
+ * rail reads as a sibling of the tab bar rather than a louder header. */
+export function SetupSection({ title, children }: { title: string; children: React.ReactNode }): JSX.Element {
+ return (
+ <div className="flex flex-col">
+ <h4 className="text-sm font-medium text-tertiary mt-0 mb-3.5">{title}</h4>
+ <div className="flex flex-col gap-1.5">{children}</div>
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.test.ts b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.test.ts
new file mode 100644
index 000000000000..b1e9001a6cb3
--- /dev/null
+++ b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.test.ts
@@ -0,0 +1,40 @@
+import { router } from 'kea-router'
+
+import { initKeaTests } from '~/test/init'
+
+import { agentSetupModalLogic } from './agentSetupModalLogic'
+
+describe('agentSetupModalLogic', () => {
+ let logic: ReturnType<typeof agentSetupModalLogic.build>
+
+ beforeEach(() => {
+ initKeaTests()
+ })
+
+ afterEach(() => {
+ logic?.unmount()
+ })
+
+ it('restores the GitHub modal from the callback URL and only removes GitHub parameters when closed', () => {
+ router.actions.push('/inbox/config', {
+ setup: 'github',
+ integration_id: '12',
+ installation_id: '34',
+ github_setup_error: 'pending',
+ error_message: 'Try again',
+ github_install_pending: '1',
+ source: 'saved-filter',
+ })
+ const callbackPath = router.values.location.pathname
+
+ logic = agentSetupModalLogic()
+ logic.mount()
+
+ expect(logic.values.openModal).toBe('github')
+
+ logic.actions.closeSetupModal()
+
+ expect(router.values.location.pathname).toBe(callbackPath)
+ expect(router.values.searchParams).toEqual({ source: 'saved-filter' })
+ })
+})
diff --git a/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
index f785e9b71d7f..d43eb789d00d 100644
--- a/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
+++ b/frontend/src/scenes/inbox/components/shell/agentSetupModalLogic.ts
@@ -1,7 +1,10 @@
-import { MakeLogicType, actions, kea, path, reducers } from 'kea'
+import { MakeLogicType, actions, kea, listeners, path, reducers } from 'kea'
+import { router, urlToAction } from 'kea-router'
+
+import { urls } from 'scenes/urls'
/** Setup widgets whose management UI opens in a modal. */
-export type AgentSetupModalKey = 'signal-sources' | 'scout-troop' | 'slack' | 'mcp-servers'
+export type AgentSetupModalKey = 'signal-sources' | 'scout-troop' | 'slack' | 'github' | 'mcp-servers'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface agentSetupModalLogicValues {
@@ -20,7 +23,6 @@ export interface agentSetupModalLogicActions {
export type agentSetupModalLogicType = MakeLogicType<agentSetupModalLogicValues, agentSetupModalLogicActions>
-/** Tracks which agent-setup widget's modal is open (one at a time), driven from the widget strip. */
export const agentSetupModalLogic = kea<agentSetupModalLogicType>([
path(['scenes', 'inbox', 'components', 'shell', 'agentSetupModalLogic']),
@@ -38,4 +40,45 @@ export const agentSetupModalLogic = kea<agentSetupModalLogicType>([
},
],
}),
+
+ listeners({
+ openSetupModal: ({ key }) => {
+ if (key !== 'github' || router.values.searchParams.setup === 'github') {
+ return
+ }
+ router.actions.replace(
+ router.values.location.pathname,
+ { ...router.values.searchParams, setup: 'github' },
+ router.values.hashParams
+ )
+ },
+ closeSetupModal: () => {
+ if (router.values.searchParams.setup !== 'github') {
+ return
+ }
+ const {
+ setup: _setup,
+ integration_id: _integrationId,
+ installation_id: _installationId,
+ github_setup_error: _githubSetupError,
+ error_message: _errorMessage,
+ github_install_pending: _githubInstallPending,
+ ...searchParams
+ } = router.values.searchParams
+ router.actions.replace(router.values.location.pathname, searchParams, router.values.hashParams)
+ },
+ }),
+
+ urlToAction(({ actions, values }) => ({
+ [urls.inbox()]: (_, searchParams) => {
+ if (searchParams.setup === 'github' && values.openModal !== 'github') {
+ actions.openSetupModal('github')
+ }
+ },
+ [urls.inbox(':tab')]: (_, searchParams) => {
+ if (searchParams.setup === 'github' && values.openModal !== 'github') {
+ actions.openSetupModal('github')
+ }
+ },
+ })),
])
diff --git a/frontend/src/scenes/inbox/components/signalCards/ConversationsTicketSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/ConversationsTicketSignalCard.tsx
index 5ee7e441455a..60c8f05fffc4 100644
--- a/frontend/src/scenes/inbox/components/signalCards/ConversationsTicketSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/ConversationsTicketSignalCard.tsx
@@ -4,7 +4,6 @@ import { Link } from '@posthog/lemon-ui'
import { IconMicrosoftTeams, IconSlack } from 'lib/lemon-ui/icons'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { LemonTag, type LemonTagType } from 'lib/lemon-ui/LemonTag'
-import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
import { urls } from 'scenes/urls'
import type { ConversationsTicketSignalExtraApi } from 'products/signals/frontend/generated/api.schemas'
@@ -110,7 +109,6 @@ export function ConversationsTicketSignalCard({ signal }: SignalCardProps): JSX.
</span>
</span>
</LemonTag>
- <span>{humanFriendlyDetailedTime(extra.created_at)}</span>
</div>
<div className="flex items-center mt-2">
<span className="flex-1" />
diff --git a/frontend/src/scenes/inbox/components/signalCards/ExternalSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/ExternalSignalCard.tsx
index af9edcd7c44e..7e930d66b062 100644
--- a/frontend/src/scenes/inbox/components/signalCards/ExternalSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/ExternalSignalCard.tsx
@@ -40,9 +40,8 @@ export function StatePillBadge({ pill }: { pill: StatePill }): JSX.Element {
/**
* Presentational shell for external-source signal cards (GitHub, Linear, Zendesk, pganalyze).
- * Captures the common anatomy — brand-icon header, optional state pill + title, markdown body,
- * a chip meta row, and a footer with timestamps on the left and a prominent external link on the
- * right. Product-specific colourings (label chips, priority indicators) are passed in via `metaChips`.
+ * Captures the common anatomy: brand-icon header, optional state pill and title, markdown body,
+ * a chip meta row, and a prominent external link. Product-specific colors are passed in via `metaChips`.
*/
export function ExternalSignalCard({
signal,
@@ -50,7 +49,6 @@ export function ExternalSignalCard({
statePill,
children,
metaChips,
- footerLeft,
link,
}: {
signal: SignalNode
@@ -62,8 +60,6 @@ export function ExternalSignalCard({
children?: React.ReactNode
/** Chip row (labels, tags, priority, status). Caller-rendered for product-specific colours. */
metaChips?: React.ReactNode
- /** Footer left content, typically timestamps. */
- footerLeft?: React.ReactNode
/** Primary external link-out. Always opens in a new tab. */
link?: { to: string; label: string }
}): JSX.Element {
@@ -83,19 +79,12 @@ export function ExternalSignalCard({
{metaChips && <div className="flex items-center gap-1.5 flex-wrap">{metaChips}</div>}
- {(footerLeft || link) && (
+ {link && (
<div className="flex items-center gap-2 flex-wrap text-xs text-tertiary mt-2">
- {footerLeft}
<span className="flex-1" />
- {link && (
- <Link
- to={link.to}
- target="_blank"
- className="flex items-center gap-1 text-xs font-medium shrink-0"
- >
- {link.label} <IconExternal className="size-3" />
- </Link>
- )}
+ <Link to={link.to} target="_blank" className="flex items-center gap-1 text-xs font-medium shrink-0">
+ {link.label} <IconExternal className="size-3" />
+ </Link>
</div>
)}
</SignalCardShell>
diff --git a/frontend/src/scenes/inbox/components/signalCards/GenericSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/GenericSignalCard.tsx
index 817e5bbe70f7..f6af69a59318 100644
--- a/frontend/src/scenes/inbox/components/signalCards/GenericSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/GenericSignalCard.tsx
@@ -1,19 +1,9 @@
-import clsx from 'clsx'
-import { useState } from 'react'
-
-import { IconChevronRight } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
-
-import { TZLabel } from 'lib/components/TZLabel'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { SignalCardShell } from './SignalCardShell'
import type { SignalCardProps } from './types'
-/** Fallback card for signals without a dedicated renderer. Shows content, timestamp, and raw metadata. */
export function GenericSignalCard({ signal }: SignalCardProps): JSX.Element {
- const [showRaw, setShowRaw] = useState(false)
-
return (
<SignalCardShell signal={signal}>
{signal.content && (
@@ -21,30 +11,6 @@ export function GenericSignalCard({ signal }: SignalCardProps): JSX.Element {
{signal.content}
</LemonMarkdown>
)}
-
- <div className="text-xs text-tertiary">
- <TZLabel time={signal.timestamp} />
- </div>
-
- {Object.keys(signal.extra).length > 0 && (
- <div className="mt-2">
- <LemonButton
- size="xsmall"
- type="tertiary"
- onClick={() => setShowRaw(!showRaw)}
- icon={
- <IconChevronRight className={clsx('size-3 transition-transform', showRaw && 'rotate-90')} />
- }
- >
- Raw metadata
- </LemonButton>
- {showRaw && (
- <pre className="text-xs mt-1 p-2 bg-surface-secondary rounded overflow-x-auto max-h-60">
- {JSON.stringify(signal.extra, null, 2)}
- </pre>
- )}
- </div>
- )}
</SignalCardShell>
)
}
diff --git a/frontend/src/scenes/inbox/components/signalCards/GithubIssueSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/GithubIssueSignalCard.tsx
index 41ba9bd7aca1..dcd3b467c1e7 100644
--- a/frontend/src/scenes/inbox/components/signalCards/GithubIssueSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/GithubIssueSignalCard.tsx
@@ -1,7 +1,6 @@
import { IconLock } from '@posthog/icons'
import { LemonTag } from 'lib/lemon-ui/LemonTag'
-import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
import type { GithubIssueSignalExtraApi } from 'products/signals/frontend/generated/api.schemas'
@@ -53,20 +52,12 @@ export function GithubIssueSignalCard({ signal }: SignalCardProps): JSX.Element
</>
)
- const footerLeft = (
- <span>
- Opened {humanFriendlyDetailedTime(extra.created_at)}
- {extra.updated_at !== extra.created_at && ` · Updated ${humanFriendlyDetailedTime(extra.updated_at)}`}
- </span>
- )
-
return (
<ExternalSignalCard
signal={signal}
title={<span className="font-medium">#{extra.number}</span>}
statePill={statePillFromState(extra.state)}
metaChips={metaChips}
- footerLeft={footerLeft}
link={{ to: extra.html_url, label: 'View on GitHub' }}
>
{signal.content}
diff --git a/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.test.tsx b/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.test.tsx
index 3a140f53bb1d..76ca353cb7c5 100644
--- a/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.test.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.test.tsx
@@ -54,6 +54,8 @@ describe('HealthCheckSignalCard', () => {
expect(screen.getByText('SDK migration recommended')).toBeInTheDocument()
expect(screen.getByText('Outdated SDK')).toBeInTheDocument()
+ expect(container).toHaveTextContent('Health checks · Instrumentation issue · 2026-07-13T00:00:00Z')
+ expect(screen.getAllByText('2026-07-13T00:00:00Z')).toHaveLength(1)
expect(container).toHaveTextContent('com.posthog.java:posthog → com.posthog:posthog-server')
expect(container).not.toHaveTextContent('Not reported →')
})
diff --git a/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.tsx
index 476b1f851181..6a9774de5573 100644
--- a/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/HealthCheckSignalCard.tsx
@@ -3,7 +3,6 @@ import { Fragment } from 'react'
import { LemonTag, Link } from '@posthog/lemon-ui'
import type { LemonTagType } from '@posthog/lemon-ui'
-import { TZLabel } from 'lib/components/TZLabel'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import type {
@@ -214,9 +213,6 @@ export function HealthCheckSignalCard({ signal }: SignalCardProps): JSX.Element
<Link to={extra.link} className="text-xs font-medium">
Open in PostHog
</Link>
- <span className="text-xs text-tertiary">
- <TZLabel time={signal.timestamp} />
- </span>
</div>
</div>
</SignalCardShell>
diff --git a/frontend/src/scenes/inbox/components/signalCards/LinearIssueSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/LinearIssueSignalCard.tsx
index 36b3efd63504..fc14d7e59506 100644
--- a/frontend/src/scenes/inbox/components/signalCards/LinearIssueSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/LinearIssueSignalCard.tsx
@@ -2,8 +2,6 @@ import clsx from 'clsx'
import { LemonTag } from '@posthog/lemon-ui'
-import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
-
import type { LinearIssueSignalExtraApi } from 'products/signals/frontend/generated/api.schemas'
import { ExternalSignalCard, type StatePill } from './ExternalSignalCard'
@@ -78,20 +76,12 @@ export function LinearIssueSignalCard({ signal }: SignalCardProps): JSX.Element
</>
)
- const footerLeft = (
- <span>
- Opened {humanFriendlyDetailedTime(extra.created_at)}
- {extra.updated_at !== extra.created_at && <> · Updated {humanFriendlyDetailedTime(extra.updated_at)}</>}
- </span>
- )
-
return (
<ExternalSignalCard
signal={signal}
title={<span className="font-mono">{title}</span>}
statePill={statePillForState(extra)}
metaChips={metaChips}
- footerLeft={footerLeft}
link={{ to: extra.url, label: 'View in Linear' }}
>
{signal.content}
diff --git a/frontend/src/scenes/inbox/components/signalCards/LlmAnalyticsSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/LlmAnalyticsSignalCard.tsx
index a2ea0bdbd09d..4da5764936cf 100644
--- a/frontend/src/scenes/inbox/components/signalCards/LlmAnalyticsSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/LlmAnalyticsSignalCard.tsx
@@ -206,7 +206,7 @@ export function LlmEvalReportSignalCard({ signal }: SignalCardProps): JSX.Elemen
)}
<div className="text-xs text-tertiary mt-1">
- Run · {humanFriendlyDetailedTime(extra.period_start)} – {humanFriendlyDetailedTime(extra.period_end)}
+ Run · {humanFriendlyDetailedTime(extra.period_start)} to {humanFriendlyDetailedTime(extra.period_end)}
</div>
<div className="mt-2">
diff --git a/frontend/src/scenes/inbox/components/signalCards/LogsAlertSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/LogsAlertSignalCard.tsx
index 3a8223ab3e98..75de73964622 100644
--- a/frontend/src/scenes/inbox/components/signalCards/LogsAlertSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/LogsAlertSignalCard.tsx
@@ -93,7 +93,7 @@ function FiringBody({ extra }: { extra: LogsAlertStateChangeSignalExtraApi }): J
</p>
<div className="flex items-baseline gap-2">
<span className="text-lg font-semibold">
- <span className="text-danger">{extra.result_count === null ? '–' : extra.result_count}</span>
+ <span className="text-danger">{extra.result_count === null ? 'N/A' : extra.result_count}</span>
{' / '}
{extra.threshold_count}
</span>
diff --git a/frontend/src/scenes/inbox/components/signalCards/PgAnalyzeSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/PgAnalyzeSignalCard.tsx
index f7a909425ce5..1c7c28f88aff 100644
--- a/frontend/src/scenes/inbox/components/signalCards/PgAnalyzeSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/PgAnalyzeSignalCard.tsx
@@ -2,7 +2,6 @@ import { IconExternal } from '@posthog/icons'
import { Link } from '@posthog/lemon-ui'
import { CodeSnippet, Language } from 'lib/components/CodeSnippet'
-import { TZLabel } from 'lib/components/TZLabel'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
import { LemonTag, type LemonTagType } from 'lib/lemon-ui/LemonTag'
import { safeHttpUrl } from 'scenes/inbox/utils/reportPresentation'
@@ -104,11 +103,6 @@ export function PgAnalyzeSignalCard({ signal }: SignalCardProps): JSX.Element {
<ExternalSignalCard
signal={signal}
metaChips={metaChips}
- footerLeft={
- <span className="flex items-center gap-1">
- Synced <TZLabel time={extra.synced_at} />
- </span>
- }
link={externalUrl ? { to: externalUrl, label: 'View in pganalyze' } : undefined}
>
<LemonMarkdown className="text-sm text-secondary mb-2" disableImages>
diff --git a/frontend/src/scenes/inbox/components/signalCards/ScannerFindingSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/ScannerFindingSignalCard.tsx
index 37704e8a2050..f57386313d02 100644
--- a/frontend/src/scenes/inbox/components/signalCards/ScannerFindingSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/ScannerFindingSignalCard.tsx
@@ -78,7 +78,7 @@ export function ScannerFindingSignalCard({ signal }: SignalCardProps): JSX.Eleme
extra.recording_active_seconds != null ? humanFriendlyDuration(extra.recording_active_seconds) : undefined
const totalDuration = extra.recording_duration != null ? humanFriendlyDuration(extra.recording_duration) : undefined
- const findingWindow = `${colonDelimitedDuration(extra.start_time, 2)} – ${colonDelimitedDuration(extra.end_time, 2)}`
+ const findingWindow = `${colonDelimitedDuration(extra.start_time, 2)} to ${colonDelimitedDuration(extra.end_time, 2)}`
return (
<SignalCardShell
diff --git a/frontend/src/scenes/inbox/components/signalCards/SessionReplaySignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/SessionReplaySignalCard.tsx
index c755fcd50e1d..9f3ef079beb1 100644
--- a/frontend/src/scenes/inbox/components/signalCards/SessionReplaySignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/SessionReplaySignalCard.tsx
@@ -152,7 +152,7 @@ export function SessionReplaySignalCard({ signal }: SignalCardProps): JSX.Elemen
<span className="font-mono">{extra.distinct_id.slice(0, 10)}…</span>
<span>·</span>
<span className="font-mono">
- {extra.start_time} – {extra.end_time}
+ {extra.start_time} to {extra.end_time}
</span>
{(activeDuration || totalDuration) && (
<>
diff --git a/frontend/src/scenes/inbox/components/signalCards/SignalCardShell.tsx b/frontend/src/scenes/inbox/components/signalCards/SignalCardShell.tsx
index e9f2dec61a41..5a34bd274289 100644
--- a/frontend/src/scenes/inbox/components/signalCards/SignalCardShell.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/SignalCardShell.tsx
@@ -1,23 +1,47 @@
+import { createContext, useContext } from 'react'
+
+import { IconChevronDown, IconChevronRight } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { TZLabel } from 'lib/components/TZLabel'
+import { LemonCard } from 'lib/lemon-ui/LemonCard'
import { ScoutLink } from 'lib/signals/ScoutLink'
import { scoutDisplayName, signalCardSourceLine } from 'lib/signals/signalCardSourceLine'
import type { SignalNode } from 'scenes/debug/signals/types'
import { getSourceProductMeta } from '../badges/sourceProductIcons'
-/**
- * Header shared by every signal card: the source product's brand icon, the human
- * "Product · Signal type" line, and an optional label/right slot.
- */
+interface SignalCardDisclosureState {
+ expanded: boolean
+ onChange: (expanded: boolean) => void
+}
+
+const SignalCardDisclosureContext = createContext<SignalCardDisclosureState | null>(null)
+
+export function SignalCardDisclosureProvider({
+ expanded,
+ onChange,
+ children,
+}: SignalCardDisclosureState & { children: React.ReactNode }): JSX.Element {
+ return (
+ <SignalCardDisclosureContext.Provider value={{ expanded, onChange }}>
+ {children}
+ </SignalCardDisclosureContext.Provider>
+ )
+}
+
export function SignalCardHeader({
signal,
label,
rightSlot,
+ disclosure,
}: {
signal: SignalNode
/** Optional bold title shown after the source line (e.g. an entity name). */
label?: React.ReactNode
/** Optional content rendered at the end of the header (e.g. a severity badge). */
rightSlot?: React.ReactNode
+ disclosure?: SignalCardDisclosureState | null
}): JSX.Element {
const meta = getSourceProductMeta(signal.source_product)
const Icon = meta?.Icon
@@ -30,20 +54,17 @@ export function SignalCardHeader({
const scoutName = typeof scoutSkillName === 'string' ? scoutDisplayName(scoutSkillName) : null
return (
- <div className="flex items-center gap-2 mb-2">
+ <div
+ className={disclosure && !disclosure.expanded ? 'flex items-center gap-2' : 'flex items-center gap-2 mb-2'}
+ >
{Icon ? (
- <span
- className="inline-flex shrink-0 items-center"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ color: meta?.color }}
- aria-hidden
- >
- <Icon className="text-base" />
+ <span className="inline-flex shrink-0 items-center" aria-hidden>
+ <Icon className={`text-base ${meta.colorClass}`} />
</span>
) : (
<span className="size-2.5 rounded-full shrink-0 bg-border" />
)}
- <span className="text-xs font-medium text-tertiary">
+ <span className="text-xs font-medium text-tertiary whitespace-nowrap">
{scoutName && typeof scoutSkillName === 'string' ? (
<>
Scout · <ScoutLink skillName={scoutSkillName} className="text-tertiary" />
@@ -51,10 +72,22 @@ export function SignalCardHeader({
) : (
signalCardSourceLine(signal)
)}
+ {' · '}
+ <TZLabel time={signal.timestamp} />
</span>
{label && <span className="text-xs font-medium text-primary flex-1 truncate">{label}</span>}
<span className="flex-1" />
{rightSlot}
+ {disclosure ? (
+ <LemonButton
+ type="tertiary"
+ size="xsmall"
+ icon={disclosure.expanded ? <IconChevronDown /> : <IconChevronRight />}
+ aria-label={disclosure.expanded ? 'Collapse signal details' : 'Expand signal details'}
+ onClick={() => disclosure.onChange(!disclosure.expanded)}
+ className="shrink-0"
+ />
+ ) : null}
</div>
)
}
@@ -71,10 +104,12 @@ export function SignalCardShell({
rightSlot?: React.ReactNode
children: React.ReactNode
}): JSX.Element {
+ const disclosure = useContext(SignalCardDisclosureContext)
+
return (
- <div className="border rounded p-3 bg-surface-primary">
- <SignalCardHeader signal={signal} label={label} rightSlot={rightSlot} />
- {children}
- </div>
+ <LemonCard hoverEffect={false} className={disclosure ? 'p-2 shadow-none' : 'p-3 shadow-sm'}>
+ <SignalCardHeader signal={signal} label={label} rightSlot={rightSlot} disclosure={disclosure} />
+ {!disclosure || disclosure.expanded ? children : null}
+ </LemonCard>
)
}
diff --git a/frontend/src/scenes/inbox/components/signalCards/SignalsScoutSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/SignalsScoutSignalCard.tsx
index bbcb8a3a2383..60bf89562312 100644
--- a/frontend/src/scenes/inbox/components/signalCards/SignalsScoutSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/SignalsScoutSignalCard.tsx
@@ -160,7 +160,7 @@ export function SignalsScoutSignalCard({ signal }: SignalCardProps): JSX.Element
{/* Time window the finding refers to. */}
{timeRange && (
<div className="text-xs text-tertiary mb-2">
- {humanFriendlyDetailedTime(timeRange.date_from)} – {humanFriendlyDetailedTime(timeRange.date_to)}
+ {humanFriendlyDetailedTime(timeRange.date_from)} to {humanFriendlyDetailedTime(timeRange.date_to)}
</div>
)}
diff --git a/frontend/src/scenes/inbox/components/signalCards/ZendeskTicketSignalCard.tsx b/frontend/src/scenes/inbox/components/signalCards/ZendeskTicketSignalCard.tsx
index 427105783565..b63e4e237436 100644
--- a/frontend/src/scenes/inbox/components/signalCards/ZendeskTicketSignalCard.tsx
+++ b/frontend/src/scenes/inbox/components/signalCards/ZendeskTicketSignalCard.tsx
@@ -1,5 +1,4 @@
import { LemonTag, type LemonTagType } from 'lib/lemon-ui/LemonTag'
-import { humanFriendlyDetailedTime } from 'lib/utils/datetime'
import type { ZendeskTicketSignalExtraApi } from 'products/signals/frontend/generated/api.schemas'
@@ -101,7 +100,6 @@ export function ZendeskTicketSignalCard({ signal }: SignalCardProps): JSX.Elemen
signal={signal}
statePill={statePill}
metaChips={metaChips}
- footerLeft={<span>Created {humanFriendlyDetailedTime(extra.created_at)}</span>}
link={{ to: cleanZendeskUrl(extra.url), label: 'Open in Zendesk' }}
>
{signal.content}
diff --git a/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx b/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
index 85ba45d64b17..879349c4ff98 100644
--- a/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
+++ b/frontend/src/scenes/inbox/components/tabs/RunsTab.tsx
@@ -2,7 +2,7 @@ import { IconBrain } from '@posthog/icons'
import { SignalRun } from '../../types'
import { CardSkeleton } from '../cards/CardSkeleton'
-import { isRunLive } from '../cards/runStatusVariant'
+import { isRunLive, RunStatusIndicator } from '../cards/runStatusVariant'
import { SignalRunCard } from '../cards/SignalRunCard'
/**
@@ -24,15 +24,11 @@ export function RunsTab({ runs, loading }: { runs: SignalRun[]; loading: boolean
<CardSkeleton count={4} variant="cards" />
) : runs.length === 0 ? (
<div className="mx-auto max-w-md flex flex-col items-center text-center py-16 gap-2">
- <div className="flex items-center justify-center h-12 w-12 rounded-full bg-fill-primary text-secondary mb-1">
+ <div className="flex size-10 items-center justify-center rounded-full bg-fill-primary text-secondary mb-1">
<IconBrain className="text-2xl" />
</div>
<h3 className="text-base font-semibold m-0">No runs yet</h3>
- <p className="text-sm text-tertiary m-0">
- Self-driving agent runs.
- <br />
- Scouts exploring your data and per-signal agents show up here.
- </p>
+ <p className="text-sm text-tertiary m-0">Scout and agent runs will appear here.</p>
</div>
) : (
<>
@@ -42,8 +38,8 @@ export function RunsTab({ runs, loading }: { runs: SignalRun[]; loading: boolean
isLive
runs={liveRuns}
empty={{
- title: 'Nothing in motion right now',
- description: 'Active runs show up here as soon as self-driving kicks one off.',
+ title: 'No active runs',
+ description: 'New runs appear here when scouts or agents start working.',
}}
/>
{pastRuns.length > 0 && <RunsSection title="Past" count={pastRuns.length} runs={pastRuns} />}
@@ -65,19 +61,17 @@ function RunsSection({ title, count, isLive, runs, empty }: RunsSectionProps): J
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2 cursor-default select-none">
- <span className="font-semibold text-[13px] text-default">{title}</span>
+ <span className="font-semibold text-sm text-default">{title}</span>
<span className="text-xs text-tertiary tabular-nums">{count}</span>
- {isLive && count > 0 && (
- <span className="inline-flex h-1.5 w-1.5 animate-pulse rounded-full bg-accent" aria-hidden />
- )}
+ {isLive && count > 0 ? <RunStatusIndicator variant="live" showLabel={false} /> : null}
</div>
{runs.length === 0 && empty ? (
<div className="flex items-center gap-3 cursor-default select-none rounded border border-dashed border-primary bg-surface-secondary px-4 py-3.5">
- <div className="flex items-center justify-center h-8 w-8 shrink-0 rounded-full bg-fill-primary ring-1 ring-inset ring-primary">
+ <div className="flex size-10 shrink-0 items-center justify-center rounded-full bg-fill-primary ring-1 ring-inset ring-primary">
<IconBrain className="text-tertiary" />
</div>
<div className="flex flex-col gap-0.5 min-w-0 flex-1">
- <span className="font-medium text-[13px] text-default">{empty.title}</span>
+ <span className="font-medium text-sm text-default">{empty.title}</span>
<span className="text-xs text-tertiary leading-snug">{empty.description}</span>
</div>
</div>
diff --git a/frontend/src/scenes/inbox/filterOptions.tsx b/frontend/src/scenes/inbox/filterOptions.tsx
index b55de4085900..f596e6a8e5c9 100644
--- a/frontend/src/scenes/inbox/filterOptions.tsx
+++ b/frontend/src/scenes/inbox/filterOptions.tsx
@@ -8,6 +8,7 @@ import {
IconCompass,
IconDatabase,
IconEye,
+ IconGear,
IconGithub,
IconGraph,
IconList,
@@ -90,6 +91,11 @@ export const INBOX_SOURCE_OPTIONS: { value: string; label: string; icon: JSX.Ele
{ value: 'conversations', label: 'Support', icon: <IconSupport /> },
{ value: 'pganalyze', label: 'pganalyze', icon: <IconDatabase /> },
{ value: 'analytics', label: 'Product analytics', icon: <IconGraph /> },
+ {
+ value: 'engineering_analytics',
+ label: 'Engineering analytics',
+ icon: <IconGear />,
+ },
{ value: 'signals_scout', label: 'Scout', icon: <IconCompass /> },
]
diff --git a/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts b/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
index 7a2831d68835..04ae1e2ce623 100644
--- a/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
+++ b/frontend/src/scenes/inbox/inboxTaskKickoffLogic.ts
@@ -65,7 +65,7 @@ function buildCreatePrReportPrompt(report: SignalReport, feedback?: string): str
function buildDiscussReportPrompt(reportUrl: string, question: string): string {
// The task is already linked to the report, but including the URL lets the agent open and read
// the full report itself. The user's question follows after a blank line for clear separation.
- return `Let's discuss this PostHog Inbox report: ${reportUrl}\n\n${question.trim()}`
+ return `Answer this question about the PostHog Inbox report at ${reportUrl}:\n\n${question.trim()}`
}
async function createReportTask(
@@ -222,13 +222,13 @@ export const inboxTaskKickoffLogic = kea<inboxTaskKickoffLogicType>([
report,
SIGNAL_REPORT_TASK_DISCUSSION_RELATIONSHIP,
buildDiscussReportPrompt(reportUrl, question),
- 'Discuss report',
+ 'Ask AI about report',
DISCUSS_RUNTIME
)
captureInboxReportActionCompleted({ report, actionType: 'discuss', outcome: 'success' })
actions.discussReportSuccess()
} catch (error: any) {
- lemonToast.error(error?.detail || error?.message || 'Failed to start discussion')
+ lemonToast.error(error?.detail || error?.message || "Couldn't ask AI about this report. Try again.")
captureInboxReportActionCompleted({ report, actionType: 'discuss', outcome: 'failure' })
actions.discussReportFailure()
}
diff --git a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.test.ts b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.test.ts
index 9d48c4a69107..1051f8ddd455 100644
--- a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.test.ts
+++ b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.test.ts
@@ -153,4 +153,37 @@ describe('inboxFiltersLogic', () => {
])
})
})
+
+ describe('scout filters', () => {
+ let logic: ReturnType<typeof inboxFiltersLogic.build>
+
+ beforeEach(() => {
+ localStorage.clear()
+ initKeaTests()
+ useMocks({ get: { '/api/projects/:team_id/signals/reports/available_reviewers/': () => [200, {}] } })
+ logic = inboxFiltersLogic()
+ logic.mount()
+ })
+
+ afterEach(() => {
+ logic.unmount()
+ })
+
+ it('clears scouts without resetting the other filters', () => {
+ logic.actions.setFilters({
+ ...DEFAULT_STATE,
+ sourceProductFilter: ['error_tracking'],
+ scoutFilter: ['error-tracking-scout', 'ci-flakes-scout'],
+ priorityFilter: ['P1'],
+ searchQuery: 'checkout',
+ })
+
+ expectLogic(logic, () => logic.actions.clearScoutFilter()).toMatchValues({
+ sourceProductFilter: ['error_tracking'],
+ scoutFilter: [],
+ priorityFilter: ['P1'],
+ searchQuery: 'checkout',
+ })
+ })
+ })
})
diff --git a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
index ba910fc6c80b..4844310ca76f 100644
--- a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
@@ -195,6 +195,9 @@ export interface inboxFiltersLogicActions {
clearFilters: () => {
value: true
}
+ clearScoutFilter: () => {
+ value: true
+ }
loadAvailableReviewers: ({ query }?: { query?: string }) => {
query?: string
}
@@ -300,6 +303,7 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
setSort: (field: InboxSortField, direction: InboxSortDirection) => ({ field, direction }),
toggleSourceProduct: (source: string) => ({ source }),
toggleScout: (scout: string) => ({ scout }),
+ clearScoutFilter: true,
togglePriority: (priority: SignalReportPriority) => ({ priority }),
// Atomically apply a full filter set. Used when hydrating from a shared URL so the whole view
// is restored in one action — one list refresh, no fan-out race between partial states.
@@ -350,6 +354,7 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
setSort: () => captureQueryChange('sort'),
toggleSourceProduct: () => captureQueryChange('source_product'),
toggleScout: () => captureQueryChange('scout'),
+ clearScoutFilter: () => captureQueryChange('scout'),
togglePriority: () => captureQueryChange('priority'),
clearFilters: () => captureQueryChange('clear'),
setFilters: () => captureQueryChange('url'),
@@ -426,6 +431,7 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
{
toggleScout: (state, { scout }) =>
state.includes(scout) ? state.filter((s) => s !== scout) : [...state, scout],
+ clearScoutFilter: () => [],
setFilters: (_, { filters }) => filters.scoutFilter,
clearFilters: () => [],
},
@@ -471,6 +477,7 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
setSort: toUrl,
toggleSourceProduct: toUrl,
toggleScout: toUrl,
+ clearScoutFilter: toUrl,
togglePriority: toUrl,
setSearchQuery: toUrl,
clearFilters: toUrl,
diff --git a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
index c2fec71a2103..fa7820f70bc9 100644
--- a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts
@@ -767,7 +767,7 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([
loadReportDiff: () => null,
loadReportDiffSuccess: () => null,
loadReportDiffFailure: () =>
- "Couldn't load the diff — the branch may have been merged, deleted, or rewritten.",
+ "Couldn't load the diff. The branch may have been merged, deleted, or rewritten.",
},
],
// The commit artefact the current `reportDiff` was loaded for, so the artefact poll re-fetches
diff --git a/frontend/src/scenes/inbox/types.ts b/frontend/src/scenes/inbox/types.ts
index 790425e6e1b0..b730810ee4bb 100644
--- a/frontend/src/scenes/inbox/types.ts
+++ b/frontend/src/scenes/inbox/types.ts
@@ -179,7 +179,7 @@ export const INBOX_TAB_DESCRIPTION: Record<InboxTabKey, string> = {
pulls: 'Pull requests agents opened to resolve reports. Review and merge them on GitHub.',
reports: 'Issues and opportunities agents found in your product data, researched and prioritized for your review.',
'not-actionable':
- 'Reports judged not actionable – too vague, missing supporting evidence, or describing expected behavior.',
+ 'Reports judged not actionable because they are too vague, lack supporting evidence, or describe expected behavior.',
runs: 'Project-wide list of agent runs, for debugging.',
archived: 'Reports you archived. You can restore them to the inbox at any time.',
config: 'Set up signal sources, scouts, and how autonomously agents can act.',
diff --git a/frontend/src/scenes/integrations/components/GithubIntegration.tsx b/frontend/src/scenes/integrations/components/GithubIntegration.tsx
new file mode 100644
index 000000000000..8af4bf9d0c7f
--- /dev/null
+++ b/frontend/src/scenes/integrations/components/GithubIntegration.tsx
@@ -0,0 +1,112 @@
+import { useActions, useValues } from 'kea'
+
+import { IconChevronDown } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import api from 'lib/api'
+import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
+import { integrationsLogic } from 'lib/integrations/integrationsLogic'
+import { LemonMenu } from 'lib/lemon-ui/LemonMenu'
+import { teamLogic } from 'scenes/teamLogic'
+import { urls } from 'scenes/urls'
+
+import type { GitHubAvailableInstallationApi } from 'products/integrations/frontend/generated/api.schemas'
+
+import { Integration, useIntegrations } from './Integration'
+
+export function GithubIntegration({ next }: { next?: string }): JSX.Element {
+ const { currentTeam } = useValues(teamLogic)
+ const { linkedGithubInstallationLoading, githubAvailableInstallations } = useValues(integrationsLogic)
+ const { linkExistingGithubInstallation, loadGithubAvailableInstallations } = useActions(integrationsLogic)
+ const githubIntegrations = useIntegrations('github')
+
+ // integrationsLogic is a singleton mounted from dozens of unrelated surfaces, so this fetch
+ // hangs off the GitHub setup UI instead of the shared integrations load.
+ useOnMountEffect(() => {
+ loadGithubAvailableInstallations()
+ })
+
+ const settingsPath = next ?? urls.settings('environment-integrations')
+ const authorizationUrl = api.integrations.authorizeUrl({
+ next: currentTeam?.id ? urls.project(currentTeam.id, settingsPath) : settingsPath,
+ kind: 'github',
+ })
+
+ const installations = githubAvailableInstallations ?? []
+ const isConnected = githubIntegrations.length > 0
+ const canLinkExisting = !isConnected && installations.length > 0
+ const multipleInstallations = installations.length > 1
+
+ return (
+ <Integration kind="github">
+ <div className="flex flex-col gap-y-2">
+ <div className="flex flex-wrap gap-2">
+ {/* This leaves PostHog entirely, and a GitHub App installs at most once per
+ account, so GitHub offers install where it's missing and configure where it
+ isn't. Connecting is only a promise we can keep while this project has
+ nothing linked; past that the honest label is the destination. */}
+ <LemonButton type="secondary" disableClientSideRouting to={authorizationUrl}>
+ {isConnected ? 'Manage on GitHub' : 'Connect organization'}
+ </LemonButton>
+ {canLinkExisting && (
+ <GitHubInstallationLink
+ installations={installations}
+ loading={linkedGithubInstallationLoading}
+ onLink={linkExistingGithubInstallation}
+ />
+ )}
+ </div>
+ {isConnected && (
+ <p className="text-secondary text-xs mb-0">
+ Install the PostHog app on another GitHub account, or change which repositories this
+ installation can see.
+ </p>
+ )}
+ {canLinkExisting && (
+ <p className="text-secondary text-xs mb-0">
+ {multipleInstallations
+ ? 'Choose an existing GitHub installation to connect to this project.'
+ : 'A GitHub App installs once per organization. Link the installation you already have instead of reinstalling.'}
+ </p>
+ )}
+ </div>
+ </Integration>
+ )
+}
+
+export function GitHubInstallationLink({
+ installations,
+ loading,
+ onLink,
+}: {
+ installations: GitHubAvailableInstallationApi[]
+ loading: boolean
+ onLink: (installationId?: string) => void
+}): JSX.Element | null {
+ if (installations.length === 0) {
+ return null
+ }
+
+ if (installations.length === 1) {
+ return (
+ <LemonButton type="secondary" loading={loading} onClick={() => onLink()}>
+ Link existing installation
+ </LemonButton>
+ )
+ }
+
+ return (
+ <LemonMenu
+ items={installations.map((installation) => ({
+ key: installation.installation_id,
+ label: installation.account_name ?? `Installation ${installation.installation_id}`,
+ disabledReason: loading ? 'Linking an installation' : undefined,
+ onClick: () => onLink(installation.installation_id),
+ }))}
+ >
+ <LemonButton type="secondary" loading={loading} sideIcon={<IconChevronDown />}>
+ Link existing installation
+ </LemonButton>
+ </LemonMenu>
+ )
+}
diff --git a/frontend/src/scenes/integrations/components/Integration.tsx b/frontend/src/scenes/integrations/components/Integration.tsx
new file mode 100644
index 000000000000..442d32b407e9
--- /dev/null
+++ b/frontend/src/scenes/integrations/components/Integration.tsx
@@ -0,0 +1,28 @@
+import { useValues } from 'kea'
+import { PropsWithChildren, useMemo } from 'react'
+
+import { integrationsLogic } from 'lib/integrations/integrationsLogic'
+import { IntegrationView } from 'lib/integrations/IntegrationView'
+
+import { IntegrationKind, IntegrationType } from '~/types'
+
+export function Integration({ kind, children }: PropsWithChildren<{ kind: IntegrationKind }>): JSX.Element {
+ const integrations = useIntegrations(kind)
+
+ return (
+ <div className="flex flex-col">
+ <div className="flex flex-col gap-y-2">
+ {integrations.map((integration) => (
+ <IntegrationView key={integration.id} integration={integration} />
+ ))}
+ <div className="flex">{children}</div>
+ </div>
+ </div>
+ )
+}
+
+export function useIntegrations(kind: IntegrationKind): IntegrationType[] {
+ const { getIntegrationsByKind } = useValues(integrationsLogic)
+
+ return useMemo(() => getIntegrationsByKind([kind] satisfies IntegrationKind[]), [getIntegrationsByKind, kind])
+}
diff --git a/frontend/src/scenes/integrations/components/Integrations.tsx b/frontend/src/scenes/integrations/components/Integrations.tsx
index 4fb03ca79900..86ec7a51b0cd 100644
--- a/frontend/src/scenes/integrations/components/Integrations.tsx
+++ b/frontend/src/scenes/integrations/components/Integrations.tsx
@@ -1,21 +1,18 @@
-import { useActions, useValues } from 'kea'
-import { PropsWithChildren, useMemo, useState } from 'react'
+import { useValues } from 'kea'
+import { useState } from 'react'
-import { IconChevronDown } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
import api from 'lib/api'
-import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
-import { integrationsLogic } from 'lib/integrations/integrationsLogic'
-import { IntegrationView } from 'lib/integrations/IntegrationView'
-import { LemonMenu } from 'lib/lemon-ui/LemonMenu'
import { GitLabSetupModal } from 'scenes/integrations/gitlab/GitLabSetupModal'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
-import { IntegrationKind, IntegrationType } from '~/types'
+import { IntegrationKind } from '~/types'
-import type { GitHubAvailableInstallationApi } from 'products/integrations/frontend/generated/api.schemas'
+import { Integration } from './Integration'
+
+export { GithubIntegration, GitHubInstallationLink } from './GithubIntegration'
export function GitLabIntegration(): JSX.Element {
const [isOpen, setIsOpen] = useState<boolean>(false)
@@ -33,103 +30,6 @@ export function LinearIntegration({ next }: { next?: string }): JSX.Element {
return <OAuthIntegration kind="linear" connectText="Connect workspace" next={next} />
}
-export function GithubIntegration({ next }: { next?: string }): JSX.Element {
- const { currentTeam } = useValues(teamLogic)
- const { linkedGithubInstallationLoading, githubAvailableInstallations } = useValues(integrationsLogic)
- const { linkExistingGithubInstallation, loadGithubAvailableInstallations } = useActions(integrationsLogic)
- const githubIntegrations = useIntegrations('github')
-
- // integrationsLogic is a singleton mounted from dozens of unrelated surfaces, so this fetch
- // hangs off the GitHub setup UI instead of the shared integrations load.
- useOnMountEffect(() => {
- loadGithubAvailableInstallations()
- })
-
- const settingsPath = next ?? urls.settings('environment-integrations')
- const authorizationUrl = api.integrations.authorizeUrl({
- next: currentTeam?.id ? urls.project(currentTeam.id, settingsPath) : settingsPath,
- kind: 'github',
- })
-
- const installations = githubAvailableInstallations ?? []
- const isConnected = githubIntegrations.length > 0
- const canLinkExisting = !isConnected && installations.length > 0
- const multipleInstallations = installations.length > 1
-
- return (
- <Integration kind="github">
- <div className="flex flex-col gap-y-2">
- <div className="flex flex-wrap gap-2">
- {/* This leaves PostHog entirely, and a GitHub App installs at most once per
- account, so GitHub offers install where it's missing and configure where it
- isn't. Connecting is only a promise we can keep while this project has
- nothing linked; past that the honest label is the destination. */}
- <LemonButton type="secondary" disableClientSideRouting to={authorizationUrl}>
- {isConnected ? 'Manage on GitHub' : 'Connect organization'}
- </LemonButton>
- {canLinkExisting && (
- <GitHubInstallationLink
- installations={installations}
- loading={linkedGithubInstallationLoading}
- onLink={linkExistingGithubInstallation}
- />
- )}
- </div>
- {isConnected && (
- <p className="text-secondary text-xs mb-0">
- Install the PostHog app on another GitHub account, or change which repositories this
- installation can see.
- </p>
- )}
- {canLinkExisting && (
- <p className="text-secondary text-xs mb-0">
- {multipleInstallations
- ? 'Choose an existing GitHub installation to connect to this project.'
- : 'A GitHub App installs once per organization. Link the installation you already have instead of reinstalling.'}
- </p>
- )}
- </div>
- </Integration>
- )
-}
-
-export function GitHubInstallationLink({
- installations,
- loading,
- onLink,
-}: {
- installations: GitHubAvailableInstallationApi[]
- loading: boolean
- onLink: (installationId?: string) => void
-}): JSX.Element | null {
- if (installations.length === 0) {
- return null
- }
-
- if (installations.length === 1) {
- return (
- <LemonButton type="secondary" loading={loading} onClick={() => onLink()}>
- Link existing installation
- </LemonButton>
- )
- }
-
- return (
- <LemonMenu
- items={installations.map((installation) => ({
- key: installation.installation_id,
- label: installation.account_name ?? `Installation ${installation.installation_id}`,
- disabledReason: loading ? 'Linking an installation' : undefined,
- onClick: () => onLink(installation.installation_id),
- }))}
- >
- <LemonButton type="secondary" loading={loading} sideIcon={<IconChevronDown />}>
- Link existing installation
- </LemonButton>
- </LemonMenu>
- )
-}
-
export function JiraIntegration({ next }: { next?: string }): JSX.Element {
return <OAuthIntegration kind="jira" connectText="Connect site" next={next} />
}
@@ -158,24 +58,3 @@ const OAuthIntegration = ({
</Integration>
)
}
-
-const Integration = ({ kind, children }: PropsWithChildren<{ kind: IntegrationKind }>): JSX.Element => {
- const integrations = useIntegrations(kind)
-
- return (
- <div className="flex flex-col">
- <div className="flex flex-col gap-y-2">
- {integrations?.map((integration) => (
- <IntegrationView key={integration.id} integration={integration} />
- ))}
- <div className="flex">{children}</div>
- </div>
- </div>
- )
-}
-
-const useIntegrations = (kind: IntegrationKind): IntegrationType[] => {
- const { getIntegrationsByKind } = useValues(integrationsLogic)
-
- return useMemo(() => getIntegrationsByKind([kind] satisfies IntegrationKind[]), [getIntegrationsByKind, kind])
-}