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.

feat(today): org and project switchers in the top bar (#120293)

Adam Leith0c0dd6259c67
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 9794506b4d8c..45392d2da0f9 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -697,13 +697,13 @@ snapshots:
components-chart-legend-series-menu--single-series--light:
hash: v1.k794b7964.45544c43c187fd1d1fc7b204e7c33c7e422c5c56838cac44e5d63318c7f5e283.phbzfcS5A5m2LHaspjABfv-I6FPQ1-LnsCFRwyX81uQ
components-command-k-search--chip-and-value-suggestions--dark:
- hash: v1.k794b7964.3d0e38bf0f31ab660603386fc8b141c0498415db04cd63ac2b5d11713b648ae3.D50GXUt9LvKwA8jPSXCs-bZYmP76-jEa8mxmjL4OnMQ
+ hash: v1.k794b7964.e2cf036318e82d7af931975ced73d650a9b53723986853b5bac7ce5ae3b576bd.mkkCjEHVSszzagFa9wpCoMZM3k0NFHzhuv_ghy7a9hU
components-command-k-search--chip-and-value-suggestions--light:
- hash: v1.k794b7964.1f156fcb62177c54eddaf141565a293f383d79ced9443ad570108215f5d68627.xvKPM445SeJQj5XOeZcMd3YTDywIpPVgQ5g4kZew9O8
+ hash: v1.k794b7964.e7333bff9cf7731d6fc4de2c3de02126f269c9f18072af98231084282a7c5d65.J458vmekHctug5oj4MC67c2qudoY1nHzt0P9V_3lzx4
components-command-k-search--empty--dark:
- hash: v1.k794b7964.52a1e29412b0255fa8c98b0e8e64038bf02476fc2c7efa97959927e606feac07.0_huADuT84KGOkIAG-ugXSYtGUCyLBn8zQ-DKgqesKc
+ hash: v1.k794b7964.4484e7d68af11aaef170ca21b18f643a52c0450fcccf7145858f42058f3a7274.o3_BNw21CY4AJQQyiGz6hgboSFv6n16lHhQwWdI6SA4
components-command-k-search--empty--light:
- hash: v1.k794b7964.1d930eddcafd3da1dc745697ec13131f7c23c8e85d45c33dd7ec05572af9e099.ehdkX2oD0RewNHgJMCACOTqlWclPPF68BZVoa99w9nU
+ hash: v1.k794b7964.fad5dab496146f2d1b2d91797627e8fb1561aa7ebfa136e797405d6e4ffc0a7f.XWb09o2rM_vyj5XpvqH59nnKZIdGRyV1LuxMzax6oLg
components-compact-list--compact-list--dark:
hash: v1.k794b7964.59d9b22dc4c1fabb38cfa1c8072b3f6e3e4140bfddef6160e568f935c0ba7f29.aeZmv2PM9H27yaixZr0lFX-5hBEr1ET0-8F-DJP_QS4
components-compact-list--compact-list--light:
@@ -737,25 +737,25 @@ snapshots:
components-date-picker--past-only--light:
hash: v1.k794b7964.ffdac5431d4f98723b5e2bd51a7e8dcf13b9e4c1c0cd298018a8633419439b44.wKvYaWVSHr61dXMjL569dC82ynBF2KK3myXSvNL5Syo
components-date-picker--quill-custom-class--dark:
- hash: v1.k794b7964.196800fa2e19c935551151e14f5a0a7a9cb595379a8fcc2781d2581b3b508202.fPxxKc4mZ-DH0TS6_PhQCeS3u0ApxDcJKpKljeoI94U
+ hash: v1.k794b7964.7a204ade1c093de4d07fe5935023394b7c6e9c94539522dd006ece4e71bf9229.PJBbLak-w8nKXuwXX0qBI8WuinMRVxvWr1WIGx2b7Tw
components-date-picker--quill-custom-class--light:
- hash: v1.k794b7964.bdb6bdbb713627ce8f3d4f341e3c7a61c1b148ae9267cf1f7d84dfab187ad293.zQEuWDSrsYwPsCwmfzXTfIY32ZuWtHkWcOx2xK2AAKI
+ hash: v1.k794b7964.1723a6ccb1387204c7cf632781cc7a2d753a81a43c1a833438ea590b87c68495.F7OCGib-1s_IJomW4s1y_QdmbPDpll5CgfBVSOxxwZg
components-date-picker--quill-empty--dark:
- hash: v1.k794b7964.f9a3ff5b78cffe2a7059341ed100ef9d3203db08f8c7efdd5cfb4f075e6ebd08.96IFAY1rJhaN4zat0-DTm3Eq5rUJjiXUJJmmHPZZFeM
+ hash: v1.k794b7964.376831b51079e7e0a9d41ed928bc3152e7727f76fcebb39c7f054994e2a00ac5.BLXthIYplK8HVZNB_Ff5AHTEo-lKRzQM9f9BNgn9cFE
components-date-picker--quill-empty--light:
- hash: v1.k794b7964.1f2ebb8d2fecb1c129d331ed0aee83f5f1100d53e73a974bc06510b6e6b6a8e4.lW3yiiqF2z7f0Hd_kDnsEZu6oqOoLE5VCRJjoNQ_3ds
+ hash: v1.k794b7964.879cc53c14423171b4199c20c95c8b57ec4a937e381c16a61eb2295d60beae53.IRAYsn7DabE5BCrsaGdGUa6szwVOhopYrhrMfdZg6S0
components-date-picker--quill-small-secondary--dark:
hash: v1.k794b7964.1046ab596430e702204ef5821f50d51daa646066f533a2b2d093bde6d55f0956.u7_4Q_33HSZY_S_uVz8nKO4E6-w9gQ7X4ZPw8IQOTK8
components-date-picker--quill-small-secondary--light:
hash: v1.k794b7964.551245cbafade7ee4238d2c7c6f5cfa6455c8c8f8efcaf087282935c601e1989.VS63LAFNCCXVOXwYOgAx0uAgAhRLfLjzbmdmZe0oUrE
components-date-picker--quill-with-time--dark:
- hash: v1.k794b7964.c533b08b93332d4d3cfc50e828200fbdd70bc91c06ec444ab8caa8c6c53167f8.DqdntEiPGlhQR8a5DxQ8ZDQHARrjjgT3X15XSrPvyKg
+ hash: v1.k794b7964.2294406e7d49b8baad2ac7190084993df2446df178ab02026475039be238c255.i_cpeyKKTtKrkIKIWM-z-qARt7brpMqRxII3--THMFQ
components-date-picker--quill-with-time--light:
- hash: v1.k794b7964.5349cf0d871f76be27e003881a8d642df3592ea73123d202e6b23249c4adde23.S5rxRm-fvvyvRgPgYMotnngQoHiHuC9dqTyQgDdqcY0
+ hash: v1.k794b7964.821a2c9ec380ee33f7fb2cbbe147d63ad3f1e0bc97b1a6240caa02c1576e3b4e.Wc1vuaVL2MDV2BhePkx4sMjRFh4YA7wQTykUn_7kClE
components-date-picker--quill-with-value--dark:
- hash: v1.k794b7964.c2ff089026b2392fdd418c0cd258565dbdb0d6082869c96840acd6030dc0e4bf.4TUwwWf9vOIOBdeYP_F0E2eRaVQq_Y2ZSSFAML8nRQ4
+ hash: v1.k794b7964.5e41763ca4486ba46806d1c98d77e97e3157aa2974c266390d04291be8fcf8a6.kdHtzxgsxta51826Cvog0VrypVgDzyrJIGhIqKrvfpU
components-date-picker--quill-with-value--light:
- hash: v1.k794b7964.ed796c67db2de6d4db0126f7175d645a1736c8cbb2803b766ab4c1a6e195ea30.QaogQxbsnpCPTqNsDvA9cKv7wDJ7vYs36la8JXDboSk
+ hash: v1.k794b7964.d5a545789a84cb2f7836480568a8a755f38b1b13d843282a1add7391c8c73f97.l-KzLdydkaby1p6ijma0QiH95TAN84U4Z-CBiixWeYg
components-date-picker--with-time--dark:
hash: v1.k794b7964.d6b5eaefc7e4d9294fd47aeabca4c3190ebe88f9bc9e685fb9f9d0b9c23f52b5.AbvxCJsWjNRXKuIN2q-LDrGcW17CBouTLhMKj1-A9oM
components-date-picker--with-time--light:
@@ -7711,13 +7711,13 @@ snapshots:
products-posthog-ai-startup-chat--sidebar--light:
hash: v1.k794b7964.58229afd8d11b5a62a5d874424be2d1552fe0d92e8c40ba73cd572134148f964.kQeMc--6FcbXpOsEYMC2rzZf4xbyJOulFvfaIpNd0cI
products-posthog-ai-taskassigneefiltermenu--non-staff--dark:
- hash: v1.k794b7964.054d05f7ef960ff884a3a325564585e3fcd4aaddccafe7fe05576c4a1f300737.RK0f_iJ30LfZp1s3ONdVO_74aI7AQBYwwTR-lOGnfBY
+ hash: v1.k794b7964.4035ea833c33e4ee5a2170621229dd92f1d100cf62a6e31a76e87f9b7208929d.A-PKKpUmtDu7WAcdTGXByPOQIfE5-GNHqOQ6uIa5Dfg
products-posthog-ai-taskassigneefiltermenu--non-staff--light:
- hash: v1.k794b7964.dd00d451b735b74c96566df624c0b762fbb9345963acec33a92f55dd53438c33.Bdd4NEacLcYyK0bNVC6-ZS5RZ_KbvgaxsKX5w0dh4YM
+ hash: v1.k794b7964.068f6f8c005f286387bdaf6bfa91856bb0b3eed287c94d80983a74ea5663363a.1HycZE07eRlacyWMXxpLE6iI1aalIj2fNub2NQHSmoA
products-posthog-ai-taskassigneefiltermenu--staff--dark:
- hash: v1.k794b7964.054d05f7ef960ff884a3a325564585e3fcd4aaddccafe7fe05576c4a1f300737.2EEs0HLIs9wDUUQ1uUxpWOvzDpBJxf9CPoAkEWowStg
+ hash: v1.k794b7964.4035ea833c33e4ee5a2170621229dd92f1d100cf62a6e31a76e87f9b7208929d.psrRGt1S88jvdKLhtV2jSQ7BA1aRSlMwqM4giZf51uk
products-posthog-ai-taskassigneefiltermenu--staff--light:
- hash: v1.k794b7964.dd00d451b735b74c96566df624c0b762fbb9345963acec33a92f55dd53438c33.vjf8s-Qyv-tQITYLtwjhz7WbZMvUIVgtqDmbF_ArhII
+ hash: v1.k794b7964.068f6f8c005f286387bdaf6bfa91856bb0b3eed287c94d80983a74ea5663363a.xsldW73f4YSK9PPTcqbUdzQvps4iPX5EcQdQKZa5-04
products-posthog-ai-threadactivitygroup--long-history--dark:
hash: v1.k794b7964.8b34d1e1c80e586075052512fbf6342204ac90e7e990b4b0a2216794daffe677.RbS0dZBWhHvm3zRt-7dgogNZVBloP_Oonxbo8qrZIoA
products-posthog-ai-threadactivitygroup--long-history--light:
@@ -9483,45 +9483,45 @@ snapshots:
scenes-app-ai-observability-trace-view-trace-view-switch--on-old-view--light:
hash: v1.k794b7964.de72868c75c31f3ba3d9813b5f86064d7dbf37bc1a896b8f13032dc102758876.Xpri2jtS8YkCfKQmwMkmtGGWN8oTE_vfUOaiXtOwJK0
scenes-app-analytics--list--dark:
- hash: v1.k794b7964.abb26fec274378bcfd2eee0513d13dac2eb8cf85c0aceeb86fdea8e08f25655a.TqrSyRm1_SXs5vVYqtBsPynPESYVEMGjSbYdiwoYoHY
+ hash: v1.k794b7964.d04d2538564b66136d989b3b27bd40274cbde80df3461788d69fbd582c6feb1b.g_cmOIWl-Vilu58w3UdUztRWEQyXim78503rue5FahM
scenes-app-analytics--list--light:
- hash: v1.k794b7964.2df452766c9771889e1289f95a73f8e0e357d940ca3568cd30908c8838c5a250.5GeQANbRykvLp6TTksIGB3KdIyCcus5JIci4hzOdi6k
+ hash: v1.k794b7964.f941f377bc00b111315f5426c1586203377c2d99e0600aee50102361980bd7e2.cJPqLY4hxepDVo7h4AsbClAbqIWxqNRM7pxBxLdEXpI
scenes-app-analytics--list-empty--dark:
- hash: v1.k794b7964.61b8cac61e0cb0c46668f8740b9202f976c06512abfb0a96f90673f4f50c03fd.Fs5KYZ0rz3bW9aNkR4AeY8U4A-uVhNEhPzrb0xVkAb0
+ hash: v1.k794b7964.28bfd4490da721f0114a434a3f57449d651102cbb9cb56878bf3ef818aed50c9.gOr9xh896lxRQATwFQmmZ0kg4crOi9CFv_TKIzvOi3A
scenes-app-analytics--list-empty--light:
- hash: v1.k794b7964.f163f33e7397d83e292087c2d26a7852df8a7115dd207238b9e9c56db1f216d4.UTnKo-X_nCBTnArLxV6dX7hYpXfxpKaKPylOIS4TdbE
+ hash: v1.k794b7964.22917f5e149de11bdf6f8f0f82373728894c87dcdf3db671fd49c3992cdd7272.a-c53IBAsU-rm6qoe8TA8gqT2TCescnnMtAQgFEwg6s
scenes-app-analytics--list-error--dark:
- hash: v1.k794b7964.4de9ab34ddee89dce8194de9ba6d950bd682a7100baf2c92628f2fcdeef732e1.8EMDrLMjH_v5VkS85v9lQ-E3ix_xlm_5PiAjKo8z2ok
+ hash: v1.k794b7964.14951fce1ce32516cf3d955062d89986b51d3ee5e2934419cbbb1bc3cdf29d5c.hC88FXyKSisqae_EVmA1xyi2BFE2XsxD3QeEXmvxYCw
scenes-app-analytics--list-error--light:
- hash: v1.k794b7964.0b3822357c7057f4b4096caa49e409f04c0dcf873d1caec1142905c973b8a388.-6qSzWEy-GkipPBSWw5E7UIxgqM5hd_i7aeuO6vqLz0
+ hash: v1.k794b7964.30cd8d3591cbb659e54f76b9b88c33960630c7a59b750e66f39f22cf9cc557fd.DxB0chOBYh82mwR2a3f49VmRfQ21l7rkLRbedM-X6-g
scenes-app-analytics--list-filtered--dark:
- hash: v1.k794b7964.106ee977952d89cbdee3179f56483abb7cc115d2a0f9664bbace6fd6cd63de51.NcKdhOSoAyzy2ugEBWkHpEM_E7EwOKwnmjqL5h5z21Q
+ hash: v1.k794b7964.96b3c1d0922145158d5063f0cf38693abeccf56e12f60e4c765f09dd10a035c2.PtqxSm_cmT2BFG4cMq8x5VAHFmhzoeuMZn3nO-w5yhA
scenes-app-analytics--list-filtered--light:
- hash: v1.k794b7964.80bd667dbfebc7cc86c8673109b1e5ef913292199941bf47b80ce3eb23248237.V6MFIEJFyIG3S3W0b_BXxkxOoaZR-jb2OhU-aWrX20M
+ hash: v1.k794b7964.1a443a0bea62fa283a0042922a0704718343283e0aec51f0a6f19a2e475c6d03.XCmZyf3GxPHjZgzchA981o9Fnn--xHsTxHk8AhaJLZA
scenes-app-analytics--list-new-insight-dialog--dark:
- hash: v1.k794b7964.983417bc244b0139b676dcf72f101702ac2c9066893c9c091efaeaf720f7771f.24WgEVRBrA6BG5sl7FcJ1JUNyWv-RivTP9rr8jiWDJE
+ hash: v1.k794b7964.2c66277b72177ca5cb39f6c56ecf238d37f456eff8b18fe9e24d523890de85ee.Yz3Oxz9hcYJmU1Qlf4Cj1YzeDgghh4BC1Od3_eTHn9Q
scenes-app-analytics--list-new-insight-dialog--light:
- hash: v1.k794b7964.acf4a37b9e529157b76ec0f2a1e34aa796ef1404de92691214949ebbdef89278.lGNrQ2ek0BRv64LWku7m_OATa5UI-ElEY9F4ad0NY_I
+ hash: v1.k794b7964.f105ac8490b05d45bcec19b054e84d4c616185fdad14716d7c664425886a5eac.XTAfaMfV2y4ATXqXASq5FFn4lxFCMUlq48FdRq02udc
scenes-app-analytics--list-no-matches--dark:
- hash: v1.k794b7964.98526bded52fc586d26be8aa477781ac496a680e4458e017dfc310c48b3b61b5.ygBt3gdmzn3evrpZw9XV5vyor-3bKHLfn8jZbkBPOQw
+ hash: v1.k794b7964.f33fc9770a52182f64b0cc8a1bf25ad0a73d7d9132c46836a7ee39a0a35cb9e2.Q8Ko7o5Bw5nqCqEW7Hd36wlcO5nkgCagEMTU81AjS8M
scenes-app-analytics--list-no-matches--light:
- hash: v1.k794b7964.fbe8cd795c32098fc31475759b54b388b64d541bcefc7871e76ccccb6479e2d1.rsL0ngvVt-9wpIgvEDLpDC5a463fGWs0hauE55Yr9Qs
+ hash: v1.k794b7964.5f42742e2a80777aaf2dc1719f7bb7ca12379dbcf357c43ba560acc28d864650.F0wJbKO511f46WgWCEreEGG2cjvWep4w6dV6PYju3P4
scenes-app-analytics--list-share-dialog--dark:
- hash: v1.k794b7964.2a740b77c78ecd1a3ae672e864ae39fd5eec7e387cf425316aa439281dd3150f.FwADIGXp6NikI0I6AI9UPFH4W9t5qAX3RLMzZuNNAQk
+ hash: v1.k794b7964.dd643613a82bf457e40c1a825f3066490065e0143050bee69deaea2d466ef888.exASUOjGOpuI839M7Xi2QbY1qXf1EG5-X3dk4QsgBCk
scenes-app-analytics--list-share-dialog--light:
- hash: v1.k794b7964.80289635ba2d5d09102a332ae81ead27a88abfbddb38ea50881f99a9166ef135.5Oyi-AcklyJ4_lb0Koo5EhbOtune0QTGdCZdH02RPPA
+ hash: v1.k794b7964.cbd3e1c5743220fc1e6ae54ad2a2dc83127c9e1e0d0654a7dfdea0786b86a24b.z_TVtUkHfPIH6E79RcDWqTz6qxrb8NsSUKoN8csBVfQ
scenes-app-analytics--list-space--dark:
- hash: v1.k794b7964.35aaf1f447db1e5264a74d11d04768e6c0ddd8edf2aec3b5e3269d73c3080b71.RrvgjaIRy042jm5TBz5wFeG-bU3C_1Um1S-TbS38udI
+ hash: v1.k794b7964.72c68b41383624dc8ae9400d4b07dd56911e82792a869ca9e27b928cc011d8ef.q4I3qTVc3uriC0ZtbgrcVEzjR0YiE2cXP0hP7euKOkQ
scenes-app-analytics--list-space--light:
- hash: v1.k794b7964.2b1775021b767641cb184a7b87c779557b679473d758f1701330fdc2d4ce3dec.g2Vuc4uhu-FERFAKxbNC9HShP8-LjwOVozoeoyclWeM
+ hash: v1.k794b7964.f4f3b383b4e67bb17dfdf3fa299bbfc594f1bff2bb6604ce3796b50cc282173c.KG6XCiQ1vDUPezHFrvv-Y0ND_Hfg2zw8rQFlMY_pE2Q
scenes-app-analytics--mine--dark:
- hash: v1.k794b7964.575137546dc3a4ca2313ada20f419da755c1205fb80ec6cb705afcca5aebced4.tQsFPgxlVXj8DxL__bFN-yvNWnUnpobA5tNpEN8spss
+ hash: v1.k794b7964.8b3b59027a347cc901aa9c7ea7ff5be5c6b53c27deb0babe0c1eca44b72f0258.UR4t9igkGt-mlVw2h19gLXHoupSna-rptGEJchud78U
scenes-app-analytics--mine--light:
- hash: v1.k794b7964.32325a423e8a3bc1c346e7e35a192913c87fec97246909006fd3d2f54d88e0ba.HQCwSIzbwN2oXJkWhPbnP7PJ_gqYNs8I2IAQxLPyAMc
+ hash: v1.k794b7964.7b43206c93999e93c6339befe60f60e065d8815f33fe5528ed0c0ffc4eb2f66d.jpgl4AJhhZOuz2msG4BAQBZX_WdSmw6nxu1sdr9U22c
scenes-app-analytics--spaces--dark:
- hash: v1.k794b7964.978b19e47d5106243cfe2873e2a623a4e22cf89139df7bce365824ab34fde2b1.L4q9XBXDrhvtrZUasYZpzrKf2jCcvE7WORywHS7brOc
+ hash: v1.k794b7964.af7a9da883687a7dc621789b63f7afe91ec0d3b4edef8e558cf048f1f5198d78.NWHym8GHjobYg3atwPixXra_aZ-sfmh0debLU2N4FyE
scenes-app-analytics--spaces--light:
- hash: v1.k794b7964.be9cd5ceb8e72ad4b9eca2ad9850f502ce2653f116769d8e476fc2e0031417cf.n2krwqEQH0eDBqXdeuzf5-zISd7VZQqW4QrvhE60eJg
+ hash: v1.k794b7964.331239c6b2f17e9f7bf06838b305290780541183cf6b6c838e2043b59d26b1d6.7U1TWQtSoC7ouvmHLC5XYXX0dR2hPg7wGm8MYounoZE
scenes-app-annotations--annotations--dark:
hash: v1.k794b7964.651aae7146d31971a314f627499eafdaa3d35933cde8dd0ad47abc6eab722148.H9u02T71vFBWS4vd-5sVVqacwrqXc9xeeOHs7b4qnL4
scenes-app-annotations--annotations--light:
@@ -10623,13 +10623,13 @@ snapshots:
scenes-app-error-tracking-insights-panels--release-list--light:
hash: v1.k794b7964.f348be5ccd7694090ebd0e41d249917849bbd92cfd08545726f3372ab6d5388c.km2n6GFkB2Qo5BFRYLm8Y1lzK0TPeDG2VxuUxjDx-wQ
scenes-app-errortracking--group-page--dark:
- hash: v1.k794b7964.8f8b1a0db048a61be42e68def73e6e66a2f264bc83c355391d3d2e35450562b3.S7LOfxeFqtdCsiRQ-1ko8pNX8T2xj_4yEsClJ1-ujSw
+ hash: v1.k794b7964.4d4f9857e72e215c43df3eb4377b1cc32e11ac73c04c2968384f583b14b3c66a.KqPWU1tVezxvdcskSRZ0D63VLL8qXBRSMFQ2l1wd2yc
scenes-app-errortracking--group-page--light:
- hash: v1.k794b7964.30d23bfcc95e59b64afa33fbd9ac8f3cd2c463df1aa67c51e68e7fe183297f24.IPDLgCDPThxLxLadgGu3gf3tR5f23piGsvLfCLaHRn4
+ hash: v1.k794b7964.89516651cddb3346294fe6c923abf6e3b445e2e5b14507c2d35a7cdbecfbd980.ogef-GAH3obW5uenrv-HdNIE0a8aTqDXb-ghiQtYP1E
scenes-app-errortracking--group-page-breakdown-loading--dark:
- hash: v1.k794b7964.25df37442b7c622ffd2b4afaea1b3935963f24ec54abbf776e529883941fe649.MB8-jMOgn6pqoKmbR3aFSAy_JrTn5s1pvO5fypmtsp4
+ hash: v1.k794b7964.3ee09422b71a78560a641e62602956e0470fcf5f789ae6e673d16de33969c4fe.WEExHXYVqTjfVYUNM27gC6x37eSd-oo2izL3Ok71kFA
scenes-app-errortracking--group-page-breakdown-loading--light:
- hash: v1.k794b7964.eb7a833b8ed400a27aa100fef2b99361f656388ef589b90424abed4a2cbd84e0.HbJQWx1a7DSVbqDxQCz_Eag5vsGlc7x9MdClOI0Rop4
+ hash: v1.k794b7964.ad321d300410d6997bdd0c294def2b0125861671d2b617ba3e92110403a61c7a.FVB2fRfwB9TqxSP3TzrSEMnzuAAckmpbAvSi3i4nTWQ
scenes-app-errortracking--group-page-breakdown-modal--dark:
hash: v1.k794b7964.596b66a8f00b84945b183ea34eec6e4a81b2ed9cb26f3c226f52ddad81f2ac80.7Bu-wB5tz-xSHMExa0jcpwEM8AWPMY3U0ka_SWDpVdg
scenes-app-errortracking--group-page-breakdown-modal--light:
@@ -10639,53 +10639,53 @@ snapshots:
scenes-app-errortracking--group-page-breakdown-modal-loading--light:
hash: v1.k794b7964.d54b1c30c2e89dba1a6598e55051c48e7c3a859e0e00e5c20ae9f25d58e30a97.4AQTc2qTusRDjuPl3zkkYngfpJORzPl7_a0W5Omjiow
scenes-app-errortracking--group-page-capped-breakdown-panel--dark:
- hash: v1.k794b7964.2f45f519e5b485716ddd113a96ec9d240170444198a4d883a96aafa28789120f.OVFZvQW0oZbDTnzDI8l3mb7-Y1nHRPNSw49YAcux_DA
+ hash: v1.k794b7964.ea81076a018d1f409d9ff33b38dff512c9f5953ff984a94a62ac695d1f73b110.Auj8bnd0t3D4e6j--bLYELeFk4Du2Yzczlxl8NefNYQ
scenes-app-errortracking--group-page-capped-breakdown-panel--light:
- hash: v1.k794b7964.29a30c5e74fadd9500587dcdb8b8eb513a576a95890ec5e98e1b33c4a667263a.RmQuw_avCFHdwLxAoInX-yxGvRhJ73_hqqGxbE1f4Ys
+ hash: v1.k794b7964.4120159de4dc2fc845c21f033570c01645953f824ee84d938799dbcd4c8b4ebd.EsZ2UBqAb6ZLJX0l4Xm4Pgcdl6022VlOPbPjrDxjBXo
scenes-app-errortracking--group-page-content-sized-breakdown-panel--dark:
- hash: v1.k794b7964.2f45f519e5b485716ddd113a96ec9d240170444198a4d883a96aafa28789120f.zU52hVWTkD2XQRY0bb7-lSGUXIoWq9zP773d_x_YNac
+ hash: v1.k794b7964.ea81076a018d1f409d9ff33b38dff512c9f5953ff984a94a62ac695d1f73b110.k36Vcb1xd7ElkSDtv6XAbHL7sN9XsE4HHSSG2Qb3uTE
scenes-app-errortracking--group-page-content-sized-breakdown-panel--light:
- hash: v1.k794b7964.29a30c5e74fadd9500587dcdb8b8eb513a576a95890ec5e98e1b33c4a667263a.L6JPHFDva3RG_a5nnRbskdKSX9CAvWcRKxa-qD5dZOY
+ hash: v1.k794b7964.4120159de4dc2fc845c21f033570c01645953f824ee84d938799dbcd4c8b4ebd.tKUEVjvvqni36Go3JvjI2CUlyaNm1IsW_ooYFQUaHIk
scenes-app-errortracking--group-page-empty-with-filter--dark:
- hash: v1.k794b7964.137e7529ed11cdda672d8db11c4b0b79d610f7daf58c76b24cc251d4ac3dbf03.eoM-VF_gF4YP9mNR5uiu1NOyjGb1AGWDLdtRwTDn5Bs
+ hash: v1.k794b7964.8f5e581eefff3fb5632e1a5b369fc1c8075b391c0ff04d19128b1f8c269c54a8.6exTmojKY6_ID-g0Gjb9OMe2DewOkZ3Abp1kMNKMB2U
scenes-app-errortracking--group-page-empty-with-filter--light:
- hash: v1.k794b7964.bcde1620e898e25e911ea0be84698342f378cc19695ff539d52fc93e4b66b48f.WhHbnkcPBldau1rhmXa5NR4PARcwKo-fNH929_PrUc8
+ hash: v1.k794b7964.053d8d6c2bdddbfee3ae69c3d2f7b9614003dc19ee6f8daf208876d7877e0af8.hJ8KMuh0G_QokC9GldzKRLS9JHfl973aC8eRNa4jEIk
scenes-app-errortracking--group-page-fingerprint-list--dark:
- hash: v1.k794b7964.e3f406263bdae9d1fbe28c61f23ce1b623d99fa6bf9da6f74fb74e758fc7a354.x-6NjJbVLWxADZ3RK0HsGQENxvpIQVV2MSqVWz_oXvw
+ hash: v1.k794b7964.ac60f92121b1dde793d170168843f567ed2cbf309952ac043ff48a9e7912d2f5.uPIEkuDLHsvFS-MSvzfd_iz1K6VViBav_ildR0swhAk
scenes-app-errortracking--group-page-fingerprint-list--light:
- hash: v1.k794b7964.a230ca6b8f3f0c75c2c2a40aed25bcafcc209abd2e0835ffc7a1303dbb895c46.w4HggY0XtFC8ojdGXmwXkoslXn0lUPDSOwHvCG4H_0E
+ hash: v1.k794b7964.4478ef97fcf561064a0cdb8082a74a08539878322d4871887563c1019c446b13.UGRQJdNbamN0wl2Tf0sf4lTaHniQMZ_oQrKVDBgY21w
scenes-app-errortracking--group-page-loading--dark:
- hash: v1.k794b7964.b4890ec8432cfb97b8fb0a45d2c6ef17e8a20340028d8a069e7eb2f4ed0bf0ca.uls3aa4HMyyyrwkum3ZIiQnSGi-4DJl6s_OSLloXUgA
+ hash: v1.k794b7964.83b655400f7ba81968b14f9434531a24adc937cd1f240dfd0b3867b6c70f1861.9j7Helk2BqMTOuC64CMMGfv4QGiwVq9mvLia2uwCq_Y
scenes-app-errortracking--group-page-loading--light:
- hash: v1.k794b7964.4c881bb3244378a5d89cb9036852d3ea223fecbc7223087da3c0d831bbda8f94.ZST67Ne2G9t_fsVyWw8CPRrcYEkXxNfk9poKnVYjrVQ
+ hash: v1.k794b7964.a76b399b13090cc118f11183a168ae64ed17bbbb18048a87c9e46edd2b98af14.p6Lq-NiI09uUIYoAv1TlUsnHCv0CMEtjaqkJGIrJIns
scenes-app-errortracking--group-page-manage-fingerprints--dark:
hash: v1.k794b7964.52f3419620587e1a20f6fbc7f077f9040a9a2e79bcd4cd28079a41ca97b01dbc.WUZMWF4cyzDDXzNzsVtREz8Nk4OWXlt9vq8Oz8cZ1Tk
scenes-app-errortracking--group-page-manage-fingerprints--light:
hash: v1.k794b7964.db28198ae2f6d0a85004671089c11449715d53a01a574d0100be1e04834410f2.vmqAw4Lob3FerS7XmSm5l0w6EX4OZ-EhzAiwqefIKRY
scenes-app-errortracking--group-page-many-assignees--dark:
- hash: v1.k794b7964.8f8b1a0db048a61be42e68def73e6e66a2f264bc83c355391d3d2e35450562b3.3JPTtd_KYj1-IeGL4hUU2N8MMumOPaXSe_3xXcTq9gA
+ hash: v1.k794b7964.4d4f9857e72e215c43df3eb4377b1cc32e11ac73c04c2968384f583b14b3c66a.AcyD8cFNAGvPGkLR-YgLmOZUcjhy_IuCtqD3FA9QJyM
scenes-app-errortracking--group-page-many-assignees--light:
- hash: v1.k794b7964.30d23bfcc95e59b64afa33fbd9ac8f3cd2c463df1aa67c51e68e7fe183297f24.XVNnX7c7Lf3nSpy-PNTHQFtE7RHWNGggBtTrvg9uXY8
+ hash: v1.k794b7964.89516651cddb3346294fe6c923abf6e3b445e2e5b14507c2d35a7cdbecfbd980.23p7YQKyG3HGTmNnUTUlHK0nyESNiH8sTx5p1aC7bPs
scenes-app-errortracking--group-page-releases--dark:
- hash: v1.k794b7964.a84d612cd4564047c2c53b3f2f1bc8ee962e90b07ca478652b9ed0f2c9e8cb4e.JJJr8KYMTAtyD1LIr8bD0q10TU8HqKXsERTbqfB4e3Y
+ hash: v1.k794b7964.349726403a5f3cfe97612bccb16d2f399d11ba6c4662197865212e327c62f27b.oAoJwqc_rkYjV_4sPFSWfWljB3t1xDmCNp5Q6dSfWdE
scenes-app-errortracking--group-page-releases--light:
- hash: v1.k794b7964.b8014121934f6e9307ee43cc4690fb9f27b23a16a616b307411823f594401faf.yl2P-MMUThyrpy0dR2xs28rzocTwJ4ucxQUXH-RPXl0
+ hash: v1.k794b7964.50c3ff843431ee66be11e31a9aac6906f6fd04ed60006421491f2aef85b77404.t47T_6TwF8evNK_4rNd6nkqphJKQs8cGeZ5NysGpz5Q
scenes-app-errortracking--group-page-releases-stacked--dark:
- hash: v1.k794b7964.b8400c53d6c07fc73429352b3b22925588c6c94af8a0bf4bb6aaaf9a460ab105.FNauQu--uvxArCwGOOuJl_p0Q32XkOf8VImWadZrvCo
+ hash: v1.k794b7964.f186780233487cf560caca6fed8013e68635f227b8a427a994838914dac15404.KJbJatojWV-hMGwPLryW9idaLMdSoCig7TbdhE3BFug
scenes-app-errortracking--group-page-releases-stacked--light:
- hash: v1.k794b7964.6229ba0294619c7c881929c7375df4700325ee629f842369641e5fe2355c1cd4._sFGlcefvjCQOkjMzoP9-CWeQ054s-pQHQ0vChbYbhE
+ hash: v1.k794b7964.bbd7d8f861510cc79188ecbe20e6af110f08f96a53ef27ac75ce28bbd704f48c.bBi7jDw0DwllpcX_pkQJi-DdiBG_XAmTwS_GzqDEoRw
scenes-app-errortracking--group-page-today-rail-nav--dark:
hash: v1.k794b7964.45333b8ac34d1969ce924ac944fd203f5f894b77bd648b1ddabd334e358a84a9.idoJ_9mN1DW6iaTAberGn3zMxARWpVZq9OqWE5lDDQU
scenes-app-errortracking--group-page-today-rail-nav--light:
hash: v1.k794b7964.16e1cb61689aeecacd7d21e8cf97ff33760cc6b77a140faeec4e67e4acd03440.G88NZldjGRM_wNvECGEPrOTyyyJgpS1p4HJ7gzWR7Fs
scenes-app-errortracking--group-page-with-many-self-driving-reports--dark:
- hash: v1.k794b7964.0aa0858442d3e422f4825c4665d289c006c87b1c5a22265e447a1c0fa5e5a544.Hy3i1o_nWpWVqH4WqCEDvZTI4LQxeI2c9B6GW9rHDYA
+ hash: v1.k794b7964.80a2533ac0237e1c88e747da106127fb7f335c4dfbda4dcd9acc58d5fad4133d.-bwvh6NUGPl4apMtIctBlqZHzMtXaDazhCLw-q4AUtM
scenes-app-errortracking--group-page-with-many-self-driving-reports--light:
- hash: v1.k794b7964.80cac3321318ebc5c31c94687c12e64363487f5466b8cc85f7fca50f9c3c0f56.WC6fnC7weTWtGyyqWhXzbdP8KCrX72Wvm87Wu7ok3-E
+ hash: v1.k794b7964.cac5cd3378c99cf8988fb1f32dca796f026c93895177bc965bd6c299a244a19e.snGyXTbaNbg4mTwZrJkxoE5S241i-4iLLBt6aa9LXpk
scenes-app-errortracking--group-page-with-self-driving--dark:
- hash: v1.k794b7964.3ee3d9fc11f993a5e08bfe76abcf19a80d2c341f78568e0e3249bcbe7d3d6e71._Z3L5Eg6-Ik4IKHe9OZ9j2Cll9FoNN5Uvz-yV-ea1Lk
+ hash: v1.k794b7964.741757ca4352b367eda183895a4ed348a05fc3f6b02c171f0ce0a0f25d0b2a1e.U1UUDdUkXrd9mGMqpIWYT_jooAq20250yZ7zlyC5vVQ
scenes-app-errortracking--group-page-with-self-driving--light:
- hash: v1.k794b7964.28311218d4dc6a5ce4918213a95cc274447bdf5e06c831c32823579ca03d68ff.Iou51f1bWJA1cvV8ObqWfTaR-6LpMX94i88byVAAPKY
+ hash: v1.k794b7964.45b83e5c1a896fecd2b126a7c74a9d579bfa749f6aa201ee71bb7d5f36f60609.bSYjFVu9L-WBgCku9iTPRp2tkHve1EsW0J4An0VhWnU
scenes-app-errortracking--insights-page--dark:
hash: v1.k794b7964.547ba7d50edff3d4fd57c33937b1536edb9837c5c34fd57543b29a5fb257e848.V99ai7csLzzA-J4mPePBh5GIyIie_ulJCWMMU7bfioE
scenes-app-errortracking--insights-page--light:
@@ -10711,9 +10711,9 @@ snapshots:
scenes-app-errortracking--list-page-with-source-maps-banner--light:
hash: v1.k794b7964.b24ffe1fee7932dfaa60f7e33c45d47292175915d4d6808e8b14ad385c79a4ab.HmCwMfIGY7bB3-m_Qm7qMUMw6weAb3YaB0DsmG8g4jw
scenes-app-errortracking--list-page-with-source-maps-banner-narrow--dark:
- hash: v1.k794b7964.25fc21ca53021e7713863dbfced91bf8ffca3dbf971b43e4829a720af0dca39d.qV3HWzyRoqwXBPStErs7a6kOAS_nVtpsWf_l2hr3BGY
+ hash: v1.k794b7964.594c92db07d283fa6cdfad3710b23bb31f4d727e989ed1d2d64becfaa1c53ac7.8492KCauUtFUeZ83WjkbgnqMon4RYSVqY9D6AMl9_0I
scenes-app-errortracking--list-page-with-source-maps-banner-narrow--light:
- hash: v1.k794b7964.c60191ccfaa5f77b9d3691f63a83e908e0344a64a9a91ca35ccfe0ab560ca943.1EYQMH1U8EtHyKqW9f5JAPgdno3UEGP_LycNCelaqjU
+ hash: v1.k794b7964.3dd4b6c2de0c4c759995bfa537e9b67ca8923f21f94dd4fec9a948b3122d1746.eLWFdwl7u1yxFjaW-QcP-i8znZEURoh2qEuIm9dn4ko
scenes-app-errortracking--list-page-with-stacked-banners--dark:
hash: v1.k794b7964.aff3898ea14ab795c09e66d34c11e4b968fb1694d5825107ccc6d804636b09c5.FD3T-3N8kACVT6lTwvI6zI5uK5eFvorATmyyoPA8IjY
scenes-app-errortracking--list-page-with-stacked-banners--light:
diff --git a/frontend/src/design.md b/frontend/src/design.md
index be03ee00c51d..6ca5e198d795 100644
--- a/frontend/src/design.md
+++ b/frontend/src/design.md
@@ -194,6 +194,7 @@ Use via Tailwind utilities (`bg-primary text-primary-foreground`, `border-border
- Select: fixed options, no text input, up to ~15 items
- Select and Combobox triggers follow the button size rule. Their popup items are always default size, so an `sm` trigger opens a menu bigger than itself. This includes a `Button` that opens a picker
- Combobox: one or many values from a long or async list, filterable; multi-select shows chips; no free text
+ - Actions in a Combobox (settings, "New …") are list items, never footer buttons. See section 8
- Autocomplete: free text with optional suggestions; search, command pickers
- Picking an action:
- DropdownMenu: click-triggered list of actions
@@ -360,7 +361,13 @@ Use via Tailwind utilities (`bg-primary text-primary-foreground`, `border-border
## 8. Accessibility
-- <TODO>
+- Every action in a popup works from the keyboard alone: open the popup, reach each row with the arrow keys, and run it with Enter
+- A Combobox keeps focus in its search field, so the arrow keys move only through its items and Tab never leaves the field. A Button in `ComboboxListFooter` is therefore out of reach. Put an action such as "Settings" or "New project" in the list as a `ComboboxItem`, in a last group after a `ComboboxSeparator`
+ - Branch on the action's value in `onValueChange`, and keep the action out of the selected value
+ - A search must never hide the actions. When a logic already filters the items, pass `filter={null}`. Otherwise pass a `filter` that always keeps the actions
+ - When no other item matches, the action group's label says so. `ComboboxEmpty` never shows while the actions are in the list
+ - Precedent: `layout/today/TodaySwitcherMenu` (the org and project switchers)
+- Before handoff, drive each popup you touched with the keyboard only: open it, arrow to every row, and press Enter on each action
## 9. Review before handoff
diff --git a/frontend/src/layout/today/TodayLogo.tsx b/frontend/src/layout/today/TodayLogo.tsx
new file mode 100644
index 000000000000..4e660eefd75d
--- /dev/null
+++ b/frontend/src/layout/today/TodayLogo.tsx
@@ -0,0 +1,40 @@
+import { Avatar, AvatarFallback, AvatarImage } from '@posthog/quill'
+
+import { lettermarkColorIndex } from 'lib/lemon-ui/Lettermark/Lettermark'
+import { backendAssetUrl } from 'lib/utils/apiHost'
+
+/** quill's smallest avatar is 20px, so the tile and the menu row sizes override it. */
+const SIZE_CLASSES = {
+ tile: 'size-7 text-xs',
+ trigger: undefined,
+ row: 'size-4 text-[8px]',
+} as const
+
+export interface TodayLogoProps {
+ name: string
+ mediaId: string | null | undefined
+ /** The entity ID that picks the fallback's lettermark color, or null for a neutral fallback. */
+ colorSeed: number | string | null
+ size: keyof typeof SIZE_CLASSES
+}
+
+/** An uploaded org or project logo, or its first letter. */
+export function TodayLogo({ name, mediaId, colorSeed, size }: TodayLogoProps): JSX.Element {
+ const color = colorSeed !== null ? lettermarkColorIndex(colorSeed) : null
+ return (
+ <Avatar size="xs" className={SIZE_CLASSES[size]}>
+ {mediaId && <AvatarImage src={backendAssetUrl(`/uploaded_media/${mediaId}`)} alt="" />}
+ <AvatarFallback
+ className="font-semibold"
+ // The palette is 16 theme-independent pairs in base.scss.
+ style={
+ color
+ ? { backgroundColor: `var(--lettermark-${color}-bg)`, color: `var(--lettermark-${color}-text)` }
+ : undefined
+ }
+ >
+ {name ? String.fromCodePoint(name.codePointAt(0)!).toLocaleUpperCase() : '?'}
+ </AvatarFallback>
+ </Avatar>
+ )
+}
diff --git a/frontend/src/layout/today/TodayOrgMenu.tsx b/frontend/src/layout/today/TodayOrgMenu.tsx
index a78436b266c0..6f6aac5a8d5a 100644
--- a/frontend/src/layout/today/TodayOrgMenu.tsx
+++ b/frontend/src/layout/today/TodayOrgMenu.tsx
@@ -1,176 +1,106 @@
import { useActions, useValues } from 'kea'
import { IconGear, IconPlusSmall, IconReceipt } from '@posthog/icons'
-import {
- Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuRadioGroup,
- DropdownMenuRadioItem,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@posthog/quill'
+import { Button } from '@posthog/quill'
import { newAccountMenuLogic } from 'lib/components/Account/newAccountMenuLogic'
import { pendingInvitesLogic } from 'lib/components/Account/pendingInvitesLogic'
import { PendingInviteDot } from 'lib/components/Account/ProjectMenu'
-import { upgradeModalLogic } from 'lib/components/UpgradeModal/upgradeModalLogic'
-import { LinkPrimitive } from 'lib/lemon-ui/Link'
-import { UploadedLogo } from 'lib/lemon-ui/UploadedLogo/UploadedLogo'
-import { preflightLogic } from 'lib/logic/preflightLogic'
-import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
-import { billingLogic } from 'scenes/billing/billingLogic'
import { organizationLogic } from 'scenes/organizationLogic'
-import { inviteLogic } from 'scenes/settings/organization/inviteLogic'
-import { urls } from 'scenes/urls'
-import { userLogic } from 'scenes/userLogic'
-import { globalModalsLogic } from '~/layout/globalModalsLogic'
-import { AvailableFeature } from '~/types'
+import { TodayLogo } from './TodayLogo'
+import { OrgMenuActionKey, todayOrgMenuLogic } from './todayOrgMenuLogic'
+import { TodaySwitcherMenu, TodaySwitcherRow } from './TodaySwitcherMenu'
-const linkItem = (to: string): JSX.Element => <Button size="row" left render={<LinkPrimitive to={to} />} />
+// Invite IDs and org IDs are both UUIDs, so the prefix keeps their row values apart in one list.
+const INVITE_PREFIX = 'invite:'
+
+// pinned: autocapture data-attrs, kept from when this menu sat on the rail.
+const ACTION_ROWS: Record<OrgMenuActionKey, Pick<TodaySwitcherRow, 'label' | 'leading' | 'dataAttr'>> = {
+ 'invite-members': { label: 'Invite members', leading: <IconPlusSmall />, dataAttr: 'today-rail-invite-members' },
+ billing: { label: 'Billing & usage', leading: <IconReceipt />, dataAttr: 'today-rail-billing' },
+ 'org-settings': { label: 'Organization settings', leading: <IconGear />, dataAttr: 'today-rail-org-settings' },
+ 'new-org': { label: 'New organization', leading: <IconPlusSmall />, dataAttr: 'today-rail-new-org' },
+}
/** The org switcher shortcut opens this menu too. */
export function TodayOrgMenu(): JSX.Element {
const { currentOrganization } = useValues(organizationLogic)
- const { otherOrganizations } = useValues(userLogic)
- const { updateCurrentOrganization } = useActions(userLogic)
const { pendingInvites } = useValues(pendingInvitesLogic)
- const { preflight, isCloudOrDev } = useValues(preflightLogic)
- const { billingEntryUrl } = useValues(billingLogic)
- const { guardAvailableFeature } = useValues(upgradeModalLogic)
- const { showCreateOrganizationModal } = useActions(globalModalsLogic)
- const { showInviteModal } = useActions(inviteLogic)
- const { reportInviteMembersButtonClicked } = useActions(eventUsageLogic)
const { isOrgSwitcherOpen } = useValues(newAccountMenuLogic)
const { openOrgSwitcher, closeOrgSwitcher } = useActions(newAccountMenuLogic)
- // A switch reloads the page when it succeeds. Until then, a second pick would race the first.
- const { isSwitchingOrganization: switching } = useValues(userLogic)
-
- const organizations = [...(currentOrganization ? [currentOrganization] : []), ...otherOrganizations].sort((a, b) =>
- a.name.localeCompare(b.name)
- )
+ const { organizations, invites, orgMenuActions, orgSearchValue, isSwitchingOrganization } =
+ useValues(todayOrgMenuLogic)
+ const { setOrgSearchValue, switchOrganization, openInvite, runOrgMenuAction } = useActions(todayOrgMenuLogic)
+ const name = currentOrganization?.name ?? 'Select organization'
return (
- <DropdownMenu open={isOrgSwitcherOpen} onOpenChange={(open) => (open ? openOrgSwitcher() : closeOrgSwitcher())}>
- <Tooltip>
- <DropdownMenuTrigger
- render={
- <TooltipTrigger
- delay={0}
- render={
- <Button
- size="icon"
- aria-label={currentOrganization?.name ?? 'Select organization'}
- className="relative size-10 rounded-md data-[popup-open]:bg-[var(--fill-selected)]"
- data-attr="today-rail-org-menu"
- />
- }
- />
- }
+ <TodaySwitcherMenu
+ trigger={
+ <Button
+ size="icon"
+ aria-label={name}
+ className="relative size-10 rounded-md data-[popup-open]:bg-[var(--fill-selected)]"
+ data-attr="today-rail-org-menu"
>
- <UploadedLogo
- name={currentOrganization?.name ?? '?'}
- entityId={currentOrganization?.id ?? ''}
- mediaId={currentOrganization?.logo_media_id ?? ''}
- size="medium"
+ <TodayLogo
+ name={currentOrganization?.name ?? ''}
+ mediaId={currentOrganization?.logo_media_id}
+ colorSeed={currentOrganization?.id ?? null}
+ size="tile"
/>
{pendingInvites.length > 0 && <PendingInviteDot className="absolute top-1 right-1" />}
- </DropdownMenuTrigger>
- <TooltipContent side="right">{currentOrganization?.name ?? 'Select organization'}</TooltipContent>
- </Tooltip>
- <DropdownMenuContent side="bottom" align="start" className="w-64">
- <DropdownMenuGroup>
- <DropdownMenuLabel>Organizations</DropdownMenuLabel>
- <DropdownMenuRadioGroup
- value={currentOrganization?.id ?? ''}
- onValueChange={(id) => {
- if (id !== currentOrganization?.id && !switching) {
- closeOrgSwitcher()
- updateCurrentOrganization(id as string)
- }
- }}
- >
- {organizations.map((organization) => (
- <DropdownMenuRadioItem
- key={organization.id}
- value={organization.id}
- disabled={
- switching || ('is_active' in organization && organization.is_active === false)
- }
- data-attr="today-rail-org-item"
- >
- <UploadedLogo
- name={organization.name}
- entityId={organization.id}
- mediaId={organization.logo_media_id}
- size="xsmall"
- />
- <span className="min-w-0 truncate">{organization.name}</span>
- </DropdownMenuRadioItem>
- ))}
- </DropdownMenuRadioGroup>
- </DropdownMenuGroup>
- {pendingInvites.length > 0 && (
- <DropdownMenuGroup>
- <DropdownMenuLabel>Invitations</DropdownMenuLabel>
- {pendingInvites.map((invite) => (
- <DropdownMenuItem
- key={invite.id}
- onClick={() => {
- window.location.href = urls.inviteSignup(invite.id)
- }}
- data-attr="today-rail-org-invite"
- >
- <span className="min-w-0 truncate">{invite.organization_name}</span>
- <PendingInviteDot className="ms-auto" />
- </DropdownMenuItem>
- ))}
- </DropdownMenuGroup>
- )}
- <DropdownMenuSeparator />
- <DropdownMenuItem
- onClick={() => {
- showInviteModal()
- reportInviteMembersButtonClicked()
- }}
- data-attr="today-rail-invite-members"
- >
- <IconPlusSmall />
- Invite members
- </DropdownMenuItem>
- {isCloudOrDev && billingEntryUrl && (
- <DropdownMenuItem render={linkItem(billingEntryUrl)} data-attr="today-rail-billing">
- <IconReceipt />
- Billing & usage
- </DropdownMenuItem>
- )}
- <DropdownMenuItem render={linkItem(urls.settings('organization'))} data-attr="today-rail-org-settings">
- <IconGear />
- Organization settings
- </DropdownMenuItem>
- {preflight?.can_create_org && (
- <DropdownMenuItem
- onClick={() =>
- guardAvailableFeature(
- AvailableFeature.ORGANIZATIONS_PROJECTS,
- () => showCreateOrganizationModal(),
- { guardOnCloud: false }
- )
- }
- data-attr="today-rail-new-org"
- >
- <IconPlusSmall />
- New organization
- </DropdownMenuItem>
- )}
- </DropdownMenuContent>
- </DropdownMenu>
+ </Button>
+ }
+ triggerTooltip={name}
+ open={isOrgSwitcherOpen}
+ onOpenChange={(open) => (open ? openOrgSwitcher() : closeOrgSwitcher())}
+ searchValue={orgSearchValue}
+ onSearchChange={setOrgSearchValue}
+ searchPlaceholder="Search organizations"
+ noMatchLabel="No organizations match your search"
+ groups={[
+ {
+ label: 'Organizations',
+ rows: organizations.map((organization) => ({
+ value: organization.id,
+ label: organization.name,
+ leading: (
+ <TodayLogo
+ name={organization.name}
+ mediaId={organization.logo_media_id}
+ colorSeed={organization.id}
+ size="row"
+ />
+ ),
+ dataAttr: 'today-rail-org-item',
+ disabledReason: isSwitchingOrganization
+ ? 'Switching organization…'
+ : 'is_active' in organization && organization.is_active === false
+ ? 'This organization is inactive'
+ : null,
+ onSelect: () => switchOrganization(organization.id),
+ })),
+ },
+ {
+ label: 'Invitations',
+ rows: invites.map((invite) => ({
+ value: INVITE_PREFIX + invite.id,
+ label: invite.organization_name,
+ trailing: <PendingInviteDot className="ms-auto" />,
+ dataAttr: 'today-rail-org-invite',
+ onSelect: () => openInvite(invite.id),
+ })),
+ },
+ ]}
+ actions={orgMenuActions.map((key) => ({
+ value: key,
+ ...ACTION_ROWS[key],
+ onSelect: () => runOrgMenuAction(key),
+ }))}
+ selectedValue={currentOrganization?.id ?? null}
+ defaultWidth={256}
+ resizeKey="today-org-menu"
+ />
)
}
diff --git a/frontend/src/layout/today/TodayPopupResizeHandle.tsx b/frontend/src/layout/today/TodayPopupResizeHandle.tsx
new file mode 100644
index 000000000000..aa7bde4c4d8a
--- /dev/null
+++ b/frontend/src/layout/today/TodayPopupResizeHandle.tsx
@@ -0,0 +1,36 @@
+import { useActions } from 'kea'
+
+import { ResizeGrip, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
+
+import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
+
+/**
+ * A resize grip centered on a popup's end edge, which `resizerLogic` drags and keeps. Pass it as the popup's
+ * `popupSibling`, so the popup's overflow does not clip it. Double-clicking resets the size.
+ */
+export function TodayPopupResizeHandle({ resizerProps }: { resizerProps: ResizerLogicProps }): JSX.Element {
+ const { beginResize } = useActions(resizerLogic(resizerProps))
+ return (
+ // The tooltip follows the pointer along the edge, so it stays beside the spot the user is about to drag.
+ <Tooltip trackCursorAxis="y">
+ <TooltipTrigger
+ delay={0}
+ render={
+ <ResizeGrip
+ aria-label="Resize menu"
+ // The popup's border is the line, so only the pill shows, centered on that border.
+ className="absolute inset-y-0 end-0 z-10 translate-x-1/2 bg-transparent [--quill-resizable-hit-size:0.5rem] rtl:-translate-x-1/2"
+ data-attr="today-popup-resize"
+ onMouseDown={(event) => {
+ if (event.button === 0) {
+ event.preventDefault()
+ beginResize(event.pageX)
+ }
+ }}
+ />
+ }
+ />
+ <TooltipContent side="right">Drag to resize. Double-click to reset.</TooltipContent>
+ </Tooltip>
+ )
+}
diff --git a/frontend/src/layout/today/TodayProjectMenu.tsx b/frontend/src/layout/today/TodayProjectMenu.tsx
index 799ca654c49c..09fcc58883d5 100644
--- a/frontend/src/layout/today/TodayProjectMenu.tsx
+++ b/frontend/src/layout/today/TodayProjectMenu.tsx
@@ -1,176 +1,87 @@
import { useActions, useValues } from 'kea'
-import { useMemo, useRef } from 'react'
-import { IconChevronDown, IconGear, IconPlusSmall, IconSearch } from '@posthog/icons'
-import {
- Button,
- Combobox,
- ComboboxCollection,
- ComboboxContent,
- ComboboxEmpty,
- ComboboxGroup,
- ComboboxInput,
- ComboboxItem,
- ComboboxLabel,
- ComboboxList,
- ComboboxListFooter,
- ComboboxTrigger,
- InputGroupAddon,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@posthog/quill'
+import { IconChevronDown, IconGear, IconPlusSmall } from '@posthog/icons'
+import { Button } from '@posthog/quill'
import { newAccountMenuLogic } from 'lib/components/Account/newAccountMenuLogic'
-import { upgradeModalLogic } from 'lib/components/UpgradeModal/upgradeModalLogic'
-import { LinkPrimitive } from 'lib/lemon-ui/Link'
-import { preflightLogic } from 'lib/logic/preflightLogic'
-import { getProjectSwitchTargetUrl } from 'lib/utils/kea-router'
-import { organizationLogic } from 'scenes/organizationLogic'
+import { projectLogic } from 'scenes/projectLogic'
import { teamLogic } from 'scenes/teamLogic'
-import { urls } from 'scenes/urls'
-import { globalModalsLogic } from '~/layout/globalModalsLogic'
-import { AvailableFeature } from '~/types'
+import { TodayLogo } from './TodayLogo'
+import { ProjectMenuActionKey, todayProjectMenuLogic } from './todayProjectMenuLogic'
+import { TodaySwitcherMenu, TodaySwitcherRow } from './TodaySwitcherMenu'
-interface ProjectGroup {
- value: string
- items: string[]
+const ACTION_ROWS: Record<ProjectMenuActionKey, Pick<TodaySwitcherRow, 'label' | 'leading' | 'dataAttr'>> = {
+ 'project-settings': {
+ label: 'Project settings',
+ leading: <IconGear />,
+ dataAttr: 'today-top-bar-project-settings',
+ },
+ 'new-project': { label: 'New project', leading: <IconPlusSmall />, dataAttr: 'today-top-bar-new-project' },
}
+// The default matches the old project switcher. Users with many projects that share a prefix asked for it: their
+// names differ only near the end, so a narrower menu truncates the part that tells them apart.
+const MENU_DEFAULT_WIDTH = 335
+
/** The project switcher shortcut opens this menu too. */
export function TodayProjectMenu(): JSX.Element {
const { currentTeam } = useValues(teamLogic)
- const { currentOrganizationProjectCount, projectCreationForbiddenReason } = useValues(organizationLogic)
- const { preflight } = useValues(preflightLogic)
- const { guardAvailableFeature } = useValues(upgradeModalLogic)
- const { showCreateProjectModal } = useActions(globalModalsLogic)
+ const { currentProject } = useValues(projectLogic)
const { isProjectSwitcherOpen, projectSearchValue, projectGroups } = useValues(newAccountMenuLogic)
const { openProjectSwitcher, closeProjectSwitcher, setProjectSearchValue } = useActions(newAccountMenuLogic)
- const triggerRef = useRef<HTMLButtonElement>(null)
-
- const { groups, teamById } = useMemo(() => {
- const teams = new Map(projectGroups.flatMap((group) => group.projects.map((p) => [String(p.id), p.team])))
- return {
- groups: projectGroups.map(
- (group): ProjectGroup => ({
- value: group.name ?? 'Projects',
- items: group.projects.map((p) => String(p.id)),
- })
- ),
- teamById: teams,
- }
- }, [projectGroups])
-
- const canCreateProject = preflight?.can_create_org !== false && !projectCreationForbiddenReason
- const newProjectButton = (
- <Button
- size="row"
- left
- disabled={!canCreateProject}
- focusableWhenDisabled
- onClick={() =>
- guardAvailableFeature(
- AvailableFeature.ORGANIZATIONS_PROJECTS,
- () => {
- closeProjectSwitcher()
- showCreateProjectModal()
- },
- { currentUsage: currentOrganizationProjectCount }
- )
- }
- data-attr="today-top-bar-new-project"
- >
- <IconPlusSmall />
- New project
- </Button>
- )
+ const { projectMenuActions } = useValues(todayProjectMenuLogic)
+ const { runProjectMenuAction, switchProject } = useActions(todayProjectMenuLogic)
return (
- <Combobox
- items={groups}
- value={currentTeam ? String(currentTeam.id) : null}
- inputValue={projectSearchValue}
- open={isProjectSwitcherOpen}
- autoHighlight
- highlightItemOnHover
- itemToStringLabel={(id: string | null) => (id ? (teamById.get(id)?.name ?? '') : '')}
- onInputValueChange={(value: string) => setProjectSearchValue(value)}
- onOpenChange={(open: boolean) => (open ? openProjectSwitcher() : closeProjectSwitcher())}
- onValueChange={(id: string | null) => {
- const team = id ? teamById.get(id) : null
- if (!team || team.id === currentTeam?.id) {
- return
- }
- closeProjectSwitcher()
- window.location.href = getProjectSwitchTargetUrl(
- location.pathname,
- team.id,
- currentTeam?.project_id,
- team.project_id
- )
- }}
- >
- <ComboboxTrigger
- ref={triggerRef}
- render={
- <Button className="min-w-0 gap-1.5 px-1.5" data-attr="today-top-bar-project-menu">
- <span className="max-w-48 min-w-0 truncate">{currentTeam?.name ?? 'Select project'}</span>
- <IconChevronDown className="size-3 shrink-0 text-muted-foreground" />
- </Button>
- }
- />
- <ComboboxContent
- anchor={triggerRef}
- align="start"
- className="w-64 [&_[data-slot=combobox-input-group-wrapper]]:border-b-0"
- >
- <ComboboxInput placeholder="Search projects" autoFocus showTrigger={false} className="h-7">
- <InputGroupAddon align="inline-start">
- <IconSearch className="size-3" />
- </InputGroupAddon>
- </ComboboxInput>
- <ComboboxEmpty>No projects match your search</ComboboxEmpty>
- <ComboboxList>
- {(group: ProjectGroup) => (
- <ComboboxGroup key={group.value} items={group.items}>
- <ComboboxLabel>{group.value}</ComboboxLabel>
- <ComboboxCollection>
- {(id: string) => (
- <ComboboxItem key={id} value={id} data-attr="today-top-bar-project-item">
- <span className="min-w-0 truncate">{teamById.get(id)?.name}</span>
- </ComboboxItem>
- )}
- </ComboboxCollection>
- </ComboboxGroup>
- )}
- </ComboboxList>
- <ComboboxListFooter className="mx-0 mt-0 flex flex-col gap-0.5 bg-transparent before:hidden">
+ <TodaySwitcherMenu
+ trigger={
+ <Button className="min-w-0 gap-1.5 px-1.5" data-attr="today-top-bar-project-menu">
{currentTeam && (
- <Button
- size="row"
- left
- render={<LinkPrimitive to={urls.project(currentTeam.id, urls.settings('project'))} />}
- onClick={() => closeProjectSwitcher()}
- data-attr="today-top-bar-project-settings"
- >
- <IconGear />
- Project settings
- </Button>
+ <TodayLogo
+ name={currentTeam.name}
+ mediaId={currentProject?.logo_media_id}
+ colorSeed={null}
+ size="trigger"
+ />
)}
- {preflight?.can_create_org &&
- (canCreateProject ? (
- newProjectButton
- ) : (
- <Tooltip>
- <TooltipTrigger render={newProjectButton} />
- <TooltipContent>
- {projectCreationForbiddenReason || "You don't have permission to create a project"}
- </TooltipContent>
- </Tooltip>
- ))}
- </ComboboxListFooter>
- </ComboboxContent>
- </Combobox>
+ <span className="max-w-48 min-w-0 truncate">{currentTeam?.name ?? 'Select project'}</span>
+ <IconChevronDown className="size-3 shrink-0 text-muted-foreground" />
+ </Button>
+ }
+ open={isProjectSwitcherOpen}
+ onOpenChange={(open) => (open ? openProjectSwitcher() : closeProjectSwitcher())}
+ searchValue={projectSearchValue}
+ onSearchChange={setProjectSearchValue}
+ searchPlaceholder="Search projects"
+ noMatchLabel="No projects match your search"
+ groups={projectGroups.map((group) => ({
+ label: group.name ?? 'Projects',
+ rows: group.projects.map(({ team }) => ({
+ value: String(team.id),
+ label: team.name,
+ leading: (
+ <TodayLogo
+ name={team.name}
+ // The org's project list carries no logos, so only the current project shows its upload.
+ mediaId={team.project_id === currentProject?.id ? currentProject.logo_media_id : null}
+ colorSeed={null}
+ size="row"
+ />
+ ),
+ dataAttr: 'today-top-bar-project-item',
+ onSelect: () => switchProject(team.id, team.project_id),
+ })),
+ }))}
+ actions={projectMenuActions.map(({ key, disabledReason }) => ({
+ value: key,
+ disabledReason,
+ ...ACTION_ROWS[key],
+ onSelect: () => runProjectMenuAction(key),
+ }))}
+ selectedValue={currentTeam ? String(currentTeam.id) : null}
+ defaultWidth={MENU_DEFAULT_WIDTH}
+ resizeKey="today-project-menu"
+ />
)
}
diff --git a/frontend/src/layout/today/TodayRail.tsx b/frontend/src/layout/today/TodayRail.tsx
index e1fa0b58ffa5..ade49e99d7c2 100644
--- a/frontend/src/layout/today/TodayRail.tsx
+++ b/frontend/src/layout/today/TodayRail.tsx
@@ -1,7 +1,6 @@
import { useActions, useValues } from 'kea'
import { TodayAccountMenu } from './TodayAccountMenu'
-import { TodayOrgMenu } from './TodayOrgMenu'
import { TODAY_PANES, TODAY_RAIL_FOOTER_PANES, TODAY_RAIL_PANES } from './todayRailItems'
import { TodayRailTile } from './TodayRailTile'
import { TODAY_RAIL_WIDTH, TodayRailPane, railPaneHref, todayShellLogic } from './todayShellLogic'
@@ -28,11 +27,10 @@ export function TodayRail(): JSX.Element {
return (
<nav
aria-label="Main"
- className="TodayShell__rail flex shrink-0 flex-col items-center gap-3 bg-[var(--chrome)] pt-1.5 pb-3"
+ className="TodayShell__rail flex shrink-0 flex-col items-center gap-3 bg-[var(--chrome)] pt-3 pb-3"
// eslint-disable-next-line react/forbid-dom-props
style={{ width: TODAY_RAIL_WIDTH }}
>
- <TodayOrgMenu />
{TODAY_RAIL_PANES.map(renderTile)}
<div className="mt-auto flex w-full flex-col items-center gap-3">
{TODAY_RAIL_FOOTER_PANES.map(renderTile)}
diff --git a/frontend/src/layout/today/TodayShell.scss b/frontend/src/layout/today/TodayShell.scss
index 4c9eb9b0add4..daa7d59cf404 100644
--- a/frontend/src/layout/today/TodayShell.scss
+++ b/frontend/src/layout/today/TodayShell.scss
@@ -13,9 +13,10 @@ body {
.TodayAppLayout--top-bar {
--today-top-bar-height: 40px;
- // The rail runs the full height. The top bar spans the sidebar, the content and the side panel.
+ // The top bar runs the full width, and its first column holds the org menu above the rail, so the rail and the
+ // bar meet at one seam.
grid-template:
- 'rail top top top' var(--today-top-bar-height)
+ 'top top top top' var(--today-top-bar-height)
'rail left content side' minmax(0, 1fr) / var(--today-rail-width) calc(
var(--left-nav-width) - var(--today-rail-width)
) minmax(0, 1fr) var(--side-panel-width, 0);
@@ -54,7 +55,7 @@ body {
}
.TodayTopBar {
- // Above the rail, which comes later in the grid and would otherwise paint over focus rings at the bar's left edge.
+ // Above the rail, which comes later in the grid and would otherwise paint over the org tile where it hangs below the bar.
position: relative;
z-index: 1;
grid-area: top;
diff --git a/frontend/src/layout/today/TodaySwitcherMenu.tsx b/frontend/src/layout/today/TodaySwitcherMenu.tsx
new file mode 100644
index 000000000000..34eb6d1a34c9
--- /dev/null
+++ b/frontend/src/layout/today/TodaySwitcherMenu.tsx
@@ -0,0 +1,198 @@
+import { useValues } from 'kea'
+import { useRef } from 'react'
+
+import { IconSearch } from '@posthog/icons'
+import {
+ Combobox,
+ ComboboxCollection,
+ ComboboxContent,
+ ComboboxGroup,
+ ComboboxInput,
+ ComboboxItem,
+ ComboboxLabel,
+ ComboboxList,
+ ComboboxSeparator,
+ ComboboxTrigger,
+ InputGroupAddon,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from '@posthog/quill'
+
+import { ResizerLogicProps, resizerLogic } from 'lib/components/Resizer/resizerLogic'
+
+import { TodayPopupResizeHandle } from './TodayPopupResizeHandle'
+
+export interface TodaySwitcherRow {
+ /** Unique across every group and action of the menu. */
+ value: string
+ label: string
+ leading?: React.ReactNode
+ trailing?: React.ReactNode
+ dataAttr: string
+ /** Disables the row and says why. */
+ disabledReason?: string | null
+ onSelect: () => void
+}
+
+export interface TodaySwitcherGroup {
+ label: string
+ rows: TodaySwitcherRow[]
+}
+
+export interface TodaySwitcherMenuProps {
+ /** The trigger button, with its content. */
+ trigger: React.ReactElement
+ /** A tooltip on the trigger, for an icon-only one. */
+ triggerTooltip?: string
+ open: boolean
+ onOpenChange: (open: boolean) => void
+ searchValue: string
+ onSearchChange: (value: string) => void
+ searchPlaceholder: string
+ /** Shown in place of the groups when the search matches none of their rows. */
+ noMatchLabel: string
+ /** Already filtered by the caller's logic: the menu does not filter. */
+ groups: TodaySwitcherGroup[]
+ /** The rows after the groups. A search never hides them. */
+ actions: TodaySwitcherRow[]
+ selectedValue: string | null
+ /** The width the menu opens at, and goes back to when the user double-clicks its resize handle. */
+ defaultWidth: number
+ /** Keeps the width the user dragged the menu to. */
+ resizeKey: string
+}
+
+/** A group of the list. The actions group has no label: a separator, or the no-match line, heads it instead. */
+interface ListGroup {
+ value: string | null
+ items: string[]
+}
+
+const MIN_WIDTH = 200
+const MAX_WIDTH = 560
+
+/**
+ * A switcher in the top bar: a search field, groups of rows to pick from, and actions at the end. The actions are
+ * list items, so the arrow keys and Enter reach them (design.md, section 8). The user can drag the right edge.
+ */
+export function TodaySwitcherMenu({
+ trigger,
+ triggerTooltip,
+ open,
+ onOpenChange,
+ searchValue,
+ onSearchChange,
+ searchPlaceholder,
+ noMatchLabel,
+ groups,
+ actions,
+ selectedValue,
+ defaultWidth,
+ resizeKey,
+}: TodaySwitcherMenuProps): JSX.Element {
+ const triggerRef = useRef<HTMLButtonElement>(null)
+ const popupRef = useRef<HTMLDivElement>(null)
+ const resizerProps: ResizerLogicProps = {
+ logicKey: resizeKey,
+ persistent: true,
+ placement: 'right',
+ containerRef: popupRef,
+ minSize: MIN_WIDTH,
+ maxSize: MAX_WIDTH,
+ }
+ const { desiredSize } = useValues(resizerLogic(resizerProps))
+
+ const shownGroups = groups.filter((group) => group.rows.length > 0)
+ const listGroups: ListGroup[] = [
+ ...shownGroups.map((group) => ({ value: group.label, items: group.rows.map((row) => row.value) })),
+ ...(actions.length > 0 ? [{ value: null, items: actions.map((action) => action.value) }] : []),
+ ]
+ const rowByValue = new Map([...shownGroups.flatMap((group) => group.rows), ...actions].map((r) => [r.value, r]))
+
+ const combobox = (
+ <Combobox
+ items={listGroups}
+ // The caller's logic filters the groups, and the actions always stay.
+ filter={null}
+ value={selectedValue}
+ inputValue={searchValue}
+ open={open}
+ autoHighlight
+ highlightItemOnHover
+ itemToStringLabel={(value: string | null) => (value ? (rowByValue.get(value)?.label ?? '') : '')}
+ onInputValueChange={(value: string) => onSearchChange(value)}
+ onOpenChange={(next: boolean) => onOpenChange(next)}
+ onValueChange={(value: string | null) => {
+ if (value !== null && value !== selectedValue) {
+ rowByValue.get(value)?.onSelect()
+ }
+ }}
+ >
+ <ComboboxTrigger
+ ref={triggerRef}
+ render={triggerTooltip ? <TooltipTrigger delay={0} render={trigger} /> : trigger}
+ />
+ <ComboboxContent
+ ref={popupRef}
+ anchor={triggerRef}
+ align="start"
+ className="[&_[data-slot=combobox-input-group-wrapper]]:border-b-0"
+ // quill caps the popup at 24rem, so the cap moves out to the widest the user can drag it.
+ // eslint-disable-next-line react/forbid-dom-props
+ style={{
+ width: desiredSize ?? defaultWidth,
+ maxWidth: `min(${MAX_WIDTH}px, var(--available-width))`,
+ }}
+ popupSibling={<TodayPopupResizeHandle resizerProps={resizerProps} />}
+ >
+ <ComboboxInput placeholder={searchPlaceholder} autoFocus showTrigger={false} className="h-7">
+ <InputGroupAddon align="inline-start">
+ <IconSearch className="size-3" />
+ </InputGroupAddon>
+ </ComboboxInput>
+ <ComboboxList>
+ {(group: ListGroup) => (
+ <ComboboxGroup key={group.value ?? 'actions'} items={group.items}>
+ {group.value !== null ? (
+ <ComboboxLabel>{group.value}</ComboboxLabel>
+ ) : shownGroups.length > 0 ? (
+ <ComboboxSeparator />
+ ) : (
+ <ComboboxLabel>{noMatchLabel}</ComboboxLabel>
+ )}
+ <ComboboxCollection>
+ {(value: string) => {
+ const row = rowByValue.get(value)!
+ return (
+ <ComboboxItem
+ key={value}
+ value={value}
+ action={group.value === null}
+ disabledReason={row.disabledReason}
+ data-attr={row.dataAttr}
+ >
+ {row.leading}
+ <span className="min-w-0 truncate">{row.label}</span>
+ {row.trailing}
+ </ComboboxItem>
+ )
+ }}
+ </ComboboxCollection>
+ </ComboboxGroup>
+ )}
+ </ComboboxList>
+ </ComboboxContent>
+ </Combobox>
+ )
+
+ if (!triggerTooltip) {
+ return combobox
+ }
+ return (
+ <Tooltip>
+ {combobox}
+ <TooltipContent side="bottom">{triggerTooltip}</TooltipContent>
+ </Tooltip>
+ )
+}
diff --git a/frontend/src/layout/today/TodayTopBar.tsx b/frontend/src/layout/today/TodayTopBar.tsx
index 87d91455874e..3036c4d77dae 100644
--- a/frontend/src/layout/today/TodayTopBar.tsx
+++ b/frontend/src/layout/today/TodayTopBar.tsx
@@ -1,19 +1,28 @@
+import { TodayOrgMenu } from './TodayOrgMenu'
import { TodayProjectMenu } from './TodayProjectMenu'
import { TodayTopBarPanelTabs } from './TodayTopBarPanelTabs'
import { TodayTopBarQuickStartButton } from './TodayTopBarQuickStartButton'
import { TodayTopBarSearch } from './TodayTopBarSearch'
-/** The equal outer columns keep the search centered. */
+/**
+ * The first column is the rail's width, so the org menu sits right above the rail. The equal outer columns keep the
+ * search centered.
+ */
export function TodayTopBar(): JSX.Element {
return (
<header
data-quill
- className="TodayTopBar grid grid-cols-[minmax(max-content,1fr)_minmax(10rem,36rem)_minmax(max-content,1fr)] items-center gap-2 bg-[var(--chrome)] pe-2"
+ className="TodayTopBar grid grid-cols-[var(--today-rail-width)_minmax(max-content,1fr)_minmax(10rem,36rem)_minmax(max-content,1fr)] items-center bg-[var(--chrome)] pe-2"
>
- <div className="flex min-w-0 items-center gap-0.5">
+ <div className="flex translate-y-1 justify-center">
+ <TodayOrgMenu />
+ </div>
+ <div className="flex min-w-0 items-center">
<TodayProjectMenu />
</div>
- <TodayTopBarSearch />
+ <div className="mx-2 min-w-0">
+ <TodayTopBarSearch />
+ </div>
<div className="flex min-w-0 items-center gap-2">
<TodayTopBarQuickStartButton />
<div className="ms-auto">
diff --git a/frontend/src/layout/today/todayOrgMenuLogic.ts b/frontend/src/layout/today/todayOrgMenuLogic.ts
new file mode 100644
index 000000000000..5ea2db0e012f
--- /dev/null
+++ b/frontend/src/layout/today/todayOrgMenuLogic.ts
@@ -0,0 +1,212 @@
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
+import { router } from 'kea-router'
+
+import { matchesSwitcherSearch, newAccountMenuLogic } from 'lib/components/Account/newAccountMenuLogic'
+import { pendingInvitesLogic } from 'lib/components/Account/pendingInvitesLogic'
+import { upgradeModalLogic } from 'lib/components/UpgradeModal/upgradeModalLogic'
+import { preflightLogic } from 'lib/logic/preflightLogic'
+import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
+import { billingLogic } from 'scenes/billing/billingLogic'
+import { organizationLogic } from 'scenes/organizationLogic'
+import { inviteLogic } from 'scenes/settings/organization/inviteLogic'
+import { urls } from 'scenes/urls'
+import { userLogic } from 'scenes/userLogic'
+
+import { globalModalsLogic } from '~/layout/globalModalsLogic'
+import { AvailableFeature } from '~/types'
+
+import type { GuardAvailableFeatureFn } from '../../lib/components/UpgradeModal/upgradeModalLogic'
+import type { OrganizationBasicType, OrganizationType, PendingInviteForCurrentUser, PreflightStatus } from '../../types'
+
+export type OrgMenuActionKey = 'invite-members' | 'billing' | 'org-settings' | 'new-org'
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayOrgMenuLogicValues {
+ billingEntryUrl: string | null // billingLogic
+ currentOrganization: OrganizationType | null // organizationLogic
+ pendingInvites: PendingInviteForCurrentUser[] // pendingInvitesLogic
+ isCloudOrDev: boolean | undefined // preflightLogic
+ preflight: PreflightStatus | null // preflightLogic
+ guardAvailableFeature: GuardAvailableFeatureFn // upgradeModalLogic
+ isSwitchingOrganization: boolean // userLogic
+ otherOrganizations: OrganizationBasicType[] // userLogic
+ invites: PendingInviteForCurrentUser[]
+ orgMenuActions: OrgMenuActionKey[]
+ orgSearchValue: string
+ organizations: OrganizationBasicType[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayOrgMenuLogicActions {
+ reportInviteMembersButtonClicked: () => {
+ value: true
+ } // eventUsageLogic
+ showCreateOrganizationModal: () => {
+ value: true
+ } // globalModalsLogic
+ showInviteModal: () => {
+ value: true
+ } // inviteLogic
+ closeOrgSwitcher: () => {
+ value: true
+ } // newAccountMenuLogic
+ openOrgSwitcher: () => {
+ value: true
+ } // newAccountMenuLogic
+ updateCurrentOrganization: (
+ organizationId: string,
+ destination?: string | undefined
+ ) => {
+ destination: string | undefined
+ organizationId: string
+ } // userLogic
+ openInvite: (inviteId: string) => {
+ inviteId: string
+ }
+ runOrgMenuAction: (key: OrgMenuActionKey) => {
+ key: OrgMenuActionKey
+ }
+ setOrgSearchValue: (searchValue: string) => {
+ searchValue: string
+ }
+ switchOrganization: (organizationId: string) => {
+ organizationId: string
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayOrgMenuLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ organizations: (
+ currentOrganization: OrganizationType | null,
+ otherOrganizations: OrganizationBasicType[],
+ orgSearchValue: string
+ ) => OrganizationBasicType[]
+ invites: (
+ pendingInvites: PendingInviteForCurrentUser[],
+ orgSearchValue: string
+ ) => PendingInviteForCurrentUser[]
+ orgMenuActions: (
+ isCloudOrDev: boolean | undefined,
+ billingEntryUrl: string | null,
+ preflight: PreflightStatus | null
+ ) => OrgMenuActionKey[]
+ }
+}
+
+export type todayOrgMenuLogicType = MakeLogicType<
+ todayOrgMenuLogicValues,
+ todayOrgMenuLogicActions,
+ Record<string, any>,
+ todayOrgMenuLogicMeta
+>
+
+/** The org switcher: the orgs and pending invites the search matches, and the org actions after them. */
+export const todayOrgMenuLogic = kea<todayOrgMenuLogicType>([
+ path(['layout', 'today', 'todayOrgMenuLogic']),
+ connect(() => ({
+ values: [
+ organizationLogic,
+ ['currentOrganization'],
+ userLogic,
+ ['otherOrganizations', 'isSwitchingOrganization'],
+ pendingInvitesLogic,
+ ['pendingInvites'],
+ preflightLogic,
+ ['preflight', 'isCloudOrDev'],
+ billingLogic,
+ ['billingEntryUrl'],
+ upgradeModalLogic,
+ ['guardAvailableFeature'],
+ ],
+ actions: [
+ newAccountMenuLogic,
+ ['openOrgSwitcher', 'closeOrgSwitcher'],
+ userLogic,
+ ['updateCurrentOrganization'],
+ globalModalsLogic,
+ ['showCreateOrganizationModal'],
+ inviteLogic,
+ ['showInviteModal'],
+ eventUsageLogic,
+ ['reportInviteMembersButtonClicked'],
+ ],
+ })),
+ actions({
+ setOrgSearchValue: (searchValue: string) => ({ searchValue }),
+ switchOrganization: (organizationId: string) => ({ organizationId }),
+ openInvite: (inviteId: string) => ({ inviteId }),
+ runOrgMenuAction: (key: OrgMenuActionKey) => ({ key }),
+ }),
+ reducers({
+ orgSearchValue: [
+ '',
+ {
+ setOrgSearchValue: (_, { searchValue }) => searchValue,
+ openOrgSwitcher: () => '',
+ closeOrgSwitcher: () => '',
+ },
+ ],
+ }),
+ selectors({
+ organizations: [
+ (s) => [s.currentOrganization, s.otherOrganizations, s.orgSearchValue],
+ (
+ currentOrganization: OrganizationType | null,
+ otherOrganizations: OrganizationBasicType[],
+ orgSearchValue: string
+ ): OrganizationBasicType[] =>
+ [...(currentOrganization ? [currentOrganization] : []), ...otherOrganizations]
+ .filter((organization) => matchesSwitcherSearch(organization.name, orgSearchValue))
+ .sort((a, b) => a.name.localeCompare(b.name)),
+ ],
+ invites: [
+ (s) => [s.pendingInvites, s.orgSearchValue],
+ (pendingInvites: PendingInviteForCurrentUser[], orgSearchValue: string): PendingInviteForCurrentUser[] =>
+ pendingInvites.filter((invite) => matchesSwitcherSearch(invite.organization_name, orgSearchValue)),
+ ],
+ orgMenuActions: [
+ (s) => [s.isCloudOrDev, s.billingEntryUrl, s.preflight],
+ (
+ isCloudOrDev: boolean | undefined,
+ billingEntryUrl: string | null,
+ preflight: PreflightStatus | null
+ ): OrgMenuActionKey[] => [
+ 'invite-members',
+ ...(isCloudOrDev && billingEntryUrl ? ['billing' as const] : []),
+ 'org-settings',
+ ...(preflight?.can_create_org ? ['new-org' as const] : []),
+ ],
+ ],
+ }),
+ listeners(({ actions, values }) => ({
+ switchOrganization: ({ organizationId }) => {
+ // A switch reloads the page when it succeeds. Until then, a second pick would race the first.
+ if (organizationId === values.currentOrganization?.id || values.isSwitchingOrganization) {
+ return
+ }
+ actions.closeOrgSwitcher()
+ actions.updateCurrentOrganization(organizationId)
+ },
+ openInvite: ({ inviteId }) => {
+ window.location.href = urls.inviteSignup(inviteId)
+ },
+ runOrgMenuAction: ({ key }) => {
+ actions.closeOrgSwitcher()
+ if (key === 'invite-members') {
+ actions.showInviteModal()
+ actions.reportInviteMembersButtonClicked()
+ } else if (key === 'billing' && values.billingEntryUrl) {
+ router.actions.push(values.billingEntryUrl)
+ } else if (key === 'org-settings') {
+ router.actions.push(urls.settings('organization'))
+ } else if (key === 'new-org') {
+ values.guardAvailableFeature(
+ AvailableFeature.ORGANIZATIONS_PROJECTS,
+ () => actions.showCreateOrganizationModal(),
+ { guardOnCloud: false }
+ )
+ }
+ },
+ })),
+])
diff --git a/frontend/src/layout/today/todayProjectMenuLogic.ts b/frontend/src/layout/today/todayProjectMenuLogic.ts
new file mode 100644
index 000000000000..208631bd69ca
--- /dev/null
+++ b/frontend/src/layout/today/todayProjectMenuLogic.ts
@@ -0,0 +1,142 @@
+import { MakeLogicType, actions, connect, kea, listeners, path, selectors } from 'kea'
+import { router } from 'kea-router'
+
+import { newAccountMenuLogic } from 'lib/components/Account/newAccountMenuLogic'
+import { upgradeModalLogic } from 'lib/components/UpgradeModal/upgradeModalLogic'
+import { preflightLogic } from 'lib/logic/preflightLogic'
+import { getProjectSwitchTargetUrl } from 'lib/utils/kea-router'
+import { organizationLogic } from 'scenes/organizationLogic'
+import { teamLogic } from 'scenes/teamLogic'
+import { urls } from 'scenes/urls'
+
+import { globalModalsLogic } from '~/layout/globalModalsLogic'
+import { AvailableFeature } from '~/types'
+
+import type { GuardAvailableFeatureFn } from '../../lib/components/UpgradeModal/upgradeModalLogic'
+import type { PreflightStatus, TeamPublicType, TeamType } from '../../types'
+
+export type ProjectMenuActionKey = 'project-settings' | 'new-project'
+
+export interface ProjectMenuAction {
+ key: ProjectMenuActionKey
+ disabledReason: string | null
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayProjectMenuLogicValues {
+ currentOrganizationProjectCount: number // organizationLogic
+ projectCreationForbiddenReason: string | null // organizationLogic
+ preflight: PreflightStatus | null // preflightLogic
+ currentTeam: TeamPublicType | TeamType | null // teamLogic
+ guardAvailableFeature: GuardAvailableFeatureFn // upgradeModalLogic
+ projectMenuActions: ProjectMenuAction[]
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayProjectMenuLogicActions {
+ showCreateProjectModal: () => {
+ value: true
+ } // globalModalsLogic
+ closeProjectSwitcher: () => {
+ value: true
+ } // newAccountMenuLogic
+ runProjectMenuAction: (key: ProjectMenuActionKey) => {
+ key: ProjectMenuActionKey
+ }
+ switchProject: (
+ teamId: number,
+ projectId: number
+ ) => {
+ projectId: number
+ teamId: number
+ }
+}
+
+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
+export interface todayProjectMenuLogicMeta {
+ __keaTypeGenInternalSelectorTypes: {
+ projectMenuActions: (
+ currentTeam: TeamPublicType | TeamType | null,
+ preflight: PreflightStatus | null,
+ projectCreationForbiddenReason: string | null
+ ) => ProjectMenuAction[]
+ }
+}
+
+export type todayProjectMenuLogicType = MakeLogicType<
+ todayProjectMenuLogicValues,
+ todayProjectMenuLogicActions,
+ Record<string, any>,
+ todayProjectMenuLogicMeta
+>
+
+/** The project switcher: switching projects, and the actions at the end of the list. */
+export const todayProjectMenuLogic = kea<todayProjectMenuLogicType>([
+ path(['layout', 'today', 'todayProjectMenuLogic']),
+ connect(() => ({
+ values: [
+ teamLogic,
+ ['currentTeam'],
+ organizationLogic,
+ ['currentOrganizationProjectCount', 'projectCreationForbiddenReason'],
+ preflightLogic,
+ ['preflight'],
+ upgradeModalLogic,
+ ['guardAvailableFeature'],
+ ],
+ actions: [newAccountMenuLogic, ['closeProjectSwitcher'], globalModalsLogic, ['showCreateProjectModal']],
+ })),
+ actions({
+ runProjectMenuAction: (key: ProjectMenuActionKey) => ({ key }),
+ switchProject: (teamId: number, projectId: number) => ({ teamId, projectId }),
+ }),
+ selectors({
+ projectMenuActions: [
+ (s) => [s.currentTeam, s.preflight, s.projectCreationForbiddenReason],
+ (
+ currentTeam: TeamPublicType | TeamType | null,
+ preflight: PreflightStatus | null,
+ projectCreationForbiddenReason: string | null
+ ): ProjectMenuAction[] => [
+ ...(currentTeam ? [{ key: 'project-settings' as const, disabledReason: null }] : []),
+ ...(preflight?.can_create_org
+ ? [
+ {
+ key: 'new-project' as const,
+ disabledReason: projectCreationForbiddenReason || null,
+ },
+ ]
+ : []),
+ ],
+ ],
+ }),
+ listeners(({ actions, values }) => ({
+ switchProject: ({ teamId, projectId }) => {
+ if (teamId === values.currentTeam?.id) {
+ return
+ }
+ actions.closeProjectSwitcher()
+ window.location.href = getProjectSwitchTargetUrl(
+ location.pathname,
+ teamId,
+ values.currentTeam?.project_id,
+ projectId
+ )
+ },
+ runProjectMenuAction: ({ key }) => {
+ if (key === 'project-settings' && values.currentTeam) {
+ actions.closeProjectSwitcher()
+ router.actions.push(urls.project(values.currentTeam.id, urls.settings('project')))
+ } else if (key === 'new-project') {
+ values.guardAvailableFeature(
+ AvailableFeature.ORGANIZATIONS_PROJECTS,
+ () => {
+ actions.closeProjectSwitcher()
+ actions.showCreateProjectModal()
+ },
+ { currentUsage: values.currentOrganizationProjectCount }
+ )
+ }
+ },
+ })),
+])
diff --git a/frontend/src/lib/components/Account/newAccountMenuLogic.ts b/frontend/src/lib/components/Account/newAccountMenuLogic.ts
index b3736b46d3bc..3d10b797dad0 100644
--- a/frontend/src/lib/components/Account/newAccountMenuLogic.ts
+++ b/frontend/src/lib/components/Account/newAccountMenuLogic.ts
@@ -20,6 +20,11 @@ export interface CreateProjectItem {
export type ListItem = ProjectListItem | CreateProjectItem
+/** Whether a name matches what the user typed in an account switcher's search field. */
+export function matchesSwitcherSearch(name: string, search: string): boolean {
+ return name.toLowerCase().includes(search.trim().toLowerCase())
+}
+
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface newAccountMenuLogicValues {
currentOrganization: OrganizationType | null // organizationLogic
@@ -157,9 +162,8 @@ export const newAccountMenuLogic = kea<newAccountMenuLogicType>([
currentTeam: TeamPublicType | TeamType | null,
searchValue: string
): ListItem[] => {
- const search = searchValue.trim().toLowerCase()
const projects: ProjectListItem[] = (organization?.teams ?? [])
- .filter((team) => !search || team.name.toLowerCase().includes(search))
+ .filter((team) => matchesSwitcherSearch(team.name, searchValue))
.map((team) => ({ type: 'project', id: team.id, team, isCurrent: team.id === currentTeam?.id }))
const createItem: CreateProjectItem = {
type: 'create',
diff --git a/frontend/src/lib/components/Resizer/resizerLogic.ts b/frontend/src/lib/components/Resizer/resizerLogic.ts
index ca2125ac64ed..db5adf12de33 100644
--- a/frontend/src/lib/components/Resizer/resizerLogic.ts
+++ b/frontend/src/lib/components/Resizer/resizerLogic.ts
@@ -17,6 +17,14 @@ export type ResizerLogicProps = {
/** Fired when the "closeThreshold" is crossed */
onToggleClosed?: (closed: boolean) => void
onDoubleClick?: () => void
+ /** The smallest size a drag can set */
+ minSize?: number
+ /** The largest size a drag can set */
+ maxSize?: number
+}
+
+function clampSize(size: number, { minSize = 0, maxSize = Infinity }: ResizerLogicProps): number {
+ return Math.min(Math.max(size, minSize), maxSize)
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
@@ -89,14 +97,14 @@ export const resizerLogic = kea<resizerLogicType>([
null as number | null,
{ persist: props.persistent, prefix: props.persistPrefix },
{
- setDesiredSize: (_, { size }) => size,
+ setDesiredSize: (_, { size }) => (size === null ? null : clampSize(size, props)),
resetDesiredSize: () => null,
},
],
resizingSize: [
null as number | null,
{
- setResizingSize: (_, { size }) => size,
+ setResizingSize: (_, { size }) => (size === null ? null : clampSize(size, props)),
beginResize: () => null,
endResize: () => null,
},
diff --git a/frontend/src/lib/lemon-ui/Lettermark/Lettermark.tsx b/frontend/src/lib/lemon-ui/Lettermark/Lettermark.tsx
index 696af9f9fa17..908834fb1506 100644
--- a/frontend/src/lib/lemon-ui/Lettermark/Lettermark.tsx
+++ b/frontend/src/lib/lemon-ui/Lettermark/Lettermark.tsx
@@ -13,8 +13,8 @@ export enum LettermarkColor {
export interface LettermarkProps {
/** Name or value the lettermark should represent. */
name?: string | number | null
- /** If given, will choose a color based on the index */
- index?: number
+ /** If given, will choose a color based on the index. A string is read as a UUID. */
+ index?: number | string
/** Specify the color */
color?: LettermarkColor
/** Circular rounded style rather than square */
@@ -26,6 +26,13 @@ export interface LettermarkProps {
className?: string
}
+/** Picks one of the lettermark colors (1-based) for an entity ID. */
+export function lettermarkColorIndex(entityId: number | string): number {
+ // A whole UUID doesn't fit into the JS number type, so its last 4 bytes stand in for it.
+ const index = typeof entityId === 'string' ? parseInt(entityId.split('-').at(-1)!, 16) : entityId
+ return (index % NUM_LETTERMARK_STYLES) + 1
+}
+
/** An icon-sized lettermark.
*
* When given a string, the initial letter is shown. Numbers up to 99 are displayed in full, in integer form.
@@ -40,7 +47,7 @@ export const Lettermark = React.forwardRef<HTMLDivElement, LettermarkProps>(func
: String.fromCodePoint(name.codePointAt(0)!).toLocaleUpperCase()
: '?'
- const colorIndex = color ? color : typeof index === 'number' ? (index % NUM_LETTERMARK_STYLES) + 1 : undefined
+ const colorIndex = color ? color : index !== undefined ? lettermarkColorIndex(index) : undefined
return (
<div
diff --git a/frontend/src/lib/lemon-ui/UploadedLogo/UploadedLogo.tsx b/frontend/src/lib/lemon-ui/UploadedLogo/UploadedLogo.tsx
index a9ae91f35369..f555b84e5962 100644
--- a/frontend/src/lib/lemon-ui/UploadedLogo/UploadedLogo.tsx
+++ b/frontend/src/lib/lemon-ui/UploadedLogo/UploadedLogo.tsx
@@ -28,11 +28,6 @@ export const UploadedLogo = React.forwardRef<HTMLDivElement, UploadedLogoProps>(
const [isLoadingImage, setIsLoadingImage] = useState(true)
if (!mediaId) {
- if (typeof entityId === 'string') {
- // A whole UUID doesn't fit into the JS number type, so for simplicity
- // just using the last 4 bytes of the UUID as the entity ID
- entityId = parseInt(entityId.split('-').at(-1)!, 16)
- }
return <Lettermark index={entityId} name={name} size={size} outlined={outlinedLettermark} />
}
diff --git a/frontend/src/styles/base.scss b/frontend/src/styles/base.scss
index 6042859d90fd..f9f0d449a9c3 100644
--- a/frontend/src/styles/base.scss
+++ b/frontend/src/styles/base.scss
@@ -1242,9 +1242,10 @@
}
// Quill controls draw their own focus ring, so the Lemon accent outline must not stack on them.
+ // Base UI also marks the parts inside a highlighted item, such as a menu's radio indicator, so only the item gets it.
a:focus-visible:not([data-quill]),
button:focus-visible:not([data-quill]),
- [data-highlighted]:not(:hover, [data-quill]) {
+ [data-highlighted]:not(:hover, [data-quill], [data-highlighted] *) {
outline: 2px solid var(--color-accent);
}
diff --git a/frontend/src/styles/quill-bridge.scss b/frontend/src/styles/quill-bridge.scss
index d568d7fa5b13..7d2e36714108 100644
--- a/frontend/src/styles/quill-bridge.scss
+++ b/frontend/src/styles/quill-bridge.scss
@@ -54,6 +54,9 @@
--quill-z-modal: var(--z-modal);
--quill-z-overlay: var(--z-modal);
--quill-z-toast: var(--z-bottom-notice);
+
+ /* PostHog's icons draw thinner lines than lucide's, so quill's selection check matches their weight. */
+ --quill-indicator-stroke-width: 1.5;
}
[data-quill] {
@@ -342,3 +345,12 @@
--success: #388600;
--warning: #f7a501;
}
+
+/*
+ * Icon size. `.LemonIcon { width: 1em }` in icons.scss sits outside any layer, so it beats quill's layered icon size
+ * and leaves a PostHog icon in a quill button narrower than it is tall. That shifts the label off the column the other
+ * rows use. Inside a quill button, the width goes back to quill, which sets width and height together.
+ */
+.quill-button .LemonIcon:not([class*='size-']) {
+ width: revert-layer;
+}
diff --git a/packages/quill/packages/primitives/AGENTS.md b/packages/quill/packages/primitives/AGENTS.md
index 69308a5d592e..c0138e1b2473 100644
--- a/packages/quill/packages/primitives/AGENTS.md
+++ b/packages/quill/packages/primitives/AGENTS.md
@@ -382,6 +382,10 @@ Attached panel outside the popup: pass `popupSibling` on `SelectContent` — ren
</Combobox>
```
+`ComboboxItem` takes `tooltip` and `disabledReason` like the menu items. Never hand-wrap a disabled `ComboboxItem` in a Tooltip. Pass `action` on a row that runs an action instead of picking a value, such as "New project": it is never selected, so it drops the check mark's gutter. The selection check in `Combobox` and `Select` takes lucide's stroke of 2. An app whose row icons draw thinner lines sets `--quill-indicator-stroke-width` to match them.
+
+Something attached to the popup's edge, such as a resize handle: pass `popupSibling` on `ComboboxContent`, as on `SelectContent`. It renders in the positioner beside the popup, outside the popup's overflow, so it can sit across the edge. Position it absolute so it never resizes the popup.
+
A highlighted Combobox or Autocomplete item paints its content in the foreground color. Put `data-keep-color` on a child that must keep its own color, such as a colored product icon.
Multi-select with chips:
@@ -658,6 +662,8 @@ A Button, menu item, Checkbox or Switch that only needs a text tooltip or a disa
</Tooltip>
```
+To keep a tooltip beside the pointer as it moves along a long target, such as a resize handle, pass `trackCursorAxis` on `Tooltip`. Such a tooltip takes no hover and no clicks by default: it sits under the pointer, so a press or a release would otherwise land on it. Pass `disableHoverablePopup={false}` only if it must stay open while hovered.
+
For a row of icon buttons, share one tooltip across them so it slides from trigger to trigger instead of closing and reopening. Create a handle with `createTooltipHandle`, pass it and a `payload` to each `TooltipTrigger`, and render one `Tooltip` with the same handle that reads the payload:
```tsx
@@ -1076,6 +1082,8 @@ Reduced motion shows the finished highlight at once.
</ResizablePanelGroup>
```
+For an edge that resizes something outside a panel group, such as a popup, use `ResizeGrip`. It has the handle's look and no behavior: the caller runs the drag. It forwards its ref, so it can be a `TooltipTrigger` render target. Set `--quill-resizable-hit-size` to widen the hit area, and pass `className="bg-transparent"` when a border already draws the line.
+
### Scroll Area
```tsx
diff --git a/packages/quill/packages/primitives/src/combobox.css b/packages/quill/packages/primitives/src/combobox.css
index 094522a2893e..b755cc0555b8 100644
--- a/packages/quill/packages/primitives/src/combobox.css
+++ b/packages/quill/packages/primitives/src/combobox.css
@@ -116,6 +116,8 @@
}
.quill-combobox__item {
+ --quill-combobox-item-gap: 0.375rem;
+
/* The check indicator is absolutely positioned (start-2) and must anchor
to the item, not the scrolling popup. */
position: relative;
@@ -126,10 +128,23 @@
* or not and the check indicator (absolute start-2) sits in the gutter —
* matching checkbox/radio menu-item spacing. The `.quill-combobox__content`
* ancestor scope outranks Button's own `padding-inline`, which otherwise
- * ties and wins by source order.
+ * ties and wins by source order. An action row is never selected, so it
+ * keeps Button's own padding. The gutter is the row's padding, an icon and
+ * the item's gap, so an option's content starts exactly where an action
+ * row's label does. The gap lives in one variable, so the two cannot drift.
*/
- .quill-combobox__content .quill-combobox__item {
- padding-inline-start: 1.875rem;
+ .quill-combobox__content .quill-combobox__item:not([data-action]) {
+ /* Button's row padding and row icon size, then the item's gap. */
+ padding-inline-start: calc(0.5rem + 0.875rem + var(--quill-combobox-item-gap));
+ }
+
+ .quill-combobox__item-content {
+ gap: var(--quill-combobox-item-gap);
+ }
+
+ /* The selection check. An app whose row icons draw thinner lines sets the variable to match them. */
+ .quill-combobox__indicator-icon {
+ stroke-width: var(--quill-indicator-stroke-width, 2);
}
.quill-combobox__item[data-disabled] {
diff --git a/packages/quill/packages/primitives/src/combobox.tsx b/packages/quill/packages/primitives/src/combobox.tsx
index 18a165e77576..78e048157743 100644
--- a/packages/quill/packages/primitives/src/combobox.tsx
+++ b/packages/quill/packages/primitives/src/combobox.tsx
@@ -10,6 +10,7 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '
import { cn } from './lib/utils'
import { MenuEmpty } from './menu-empty'
import { MenuLabel } from './menu-label'
+import { hasTooltipContent, withTooltip } from './with-tooltip'
const ComboboxAnchorContext = React.createContext<React.RefObject<HTMLDivElement> | null>(null)
@@ -98,10 +99,24 @@ const ComboboxInput = React.forwardRef<
const ComboboxContent = React.forwardRef<
React.ComponentRef<typeof ComboboxPrimitive.Popup>,
- ComboboxPrimitive.Popup.Props &
- Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>
+ ComboboxPrimitive.Popup.Props & {
+ /**
+ * Rendered in the positioner as the popup's sibling, escaping the popup's overflow. Use position: absolute —
+ * in-flow content here resizes the box the positioner measures.
+ */
+ popupSibling?: React.ReactNode
+ } & Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'>
>(function ComboboxContent(
- { className, side = 'bottom', sideOffset = 6, align = 'start', alignOffset = 0, anchor: anchorProp, ...props },
+ {
+ className,
+ popupSibling,
+ side = 'bottom',
+ sideOffset = 6,
+ align = 'start',
+ alignOffset = 0,
+ anchor: anchorProp,
+ ...props
+ },
ref
) {
const contextAnchor = React.useContext(ComboboxAnchorContext)
@@ -118,6 +133,7 @@ const ComboboxContent = React.forwardRef<
anchor={anchor}
className="isolate"
>
+ {popupSibling}
<ComboboxPrimitive.Popup
ref={ref}
data-slot="combobox-content"
@@ -155,12 +171,24 @@ const ComboboxList = React.forwardRef<React.ComponentRef<typeof ComboboxPrimitiv
const ComboboxItem = React.forwardRef<
React.ComponentRef<typeof ComboboxPrimitive.Item>,
- ComboboxPrimitive.Item.Props & { title?: string }
->(function ComboboxItem({ className, children, title, ...props }, ref) {
- return (
+ ComboboxPrimitive.Item.Props & {
+ title?: string
+ /** Text shown in a tooltip beside the item. */
+ tooltip?: React.ReactNode
+ /** Disables the item and says why in a tooltip beside it. Takes the place of `tooltip` while set. */
+ disabledReason?: React.ReactNode
+ /** An action row, such as "New project". It is never selected, so it leaves out the check mark's gutter. */
+ action?: boolean
+ }
+>(function ComboboxItem({ className, children, title, tooltip, disabledReason, disabled, action, ...props }, ref) {
+ const hasReason = hasTooltipContent(disabledReason)
+ // A disabled item ignores the pointer, so the tooltip listens on a wrapper and opens beside the row.
+ return withTooltip(
<ComboboxPrimitive.Item
ref={ref}
data-slot="combobox-item"
+ data-action={action ? '' : undefined}
+ disabled={disabled || hasReason}
className={cn('quill-combobox__item', className)}
title={title ?? (typeof children === 'string' ? children : undefined)}
// The default render is a real <button>; only declare nativeButton when the
@@ -169,13 +197,15 @@ const ComboboxItem = React.forwardRef<
render={<Button size="row" left className="min-w-0 aria-selected:bg-fill-selected" />}
{...props}
>
- <span className="flex items-center gap-1.5 min-w-0 truncate">{children}</span>
+ <span className="quill-combobox__item-content flex items-center min-w-0 truncate">{children}</span>
<ComboboxPrimitive.ItemIndicator
render={<span className="pointer-events-none absolute start-2 flex items-center justify-center" />}
>
- <CheckIcon className="pointer-events-none" />
+ <CheckIcon className="quill-combobox__indicator-icon pointer-events-none size-3.5" />
</ComboboxPrimitive.ItemIndicator>
- </ComboboxPrimitive.Item>
+ </ComboboxPrimitive.Item>,
+ hasReason ? disabledReason : tooltip,
+ { target: 'block', side: 'inline-end' }
)
})
diff --git a/packages/quill/packages/primitives/src/index.ts b/packages/quill/packages/primitives/src/index.ts
index 5b0acdc8d01f..7e7a02134952 100644
--- a/packages/quill/packages/primitives/src/index.ts
+++ b/packages/quill/packages/primitives/src/index.ts
@@ -304,7 +304,7 @@ export {
type QuestionnaireShortcutMode,
} from './chat/questionnaire'
export { RadioGroup, RadioGroupItem, RadioIndicator } from './radio-group'
-export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './resizable'
+export { ResizableHandle, ResizablePanel, ResizablePanelGroup, ResizeGrip } from './resizable'
export { ScrollArea, ScrollBar, scrollShadowsCss, SCROLL_SHADOWS_STYLE_ID } from './scroll-area'
export {
Select,
diff --git a/packages/quill/packages/primitives/src/resizable.css b/packages/quill/packages/primitives/src/resizable.css
index f78250f83382..b684adcd2d11 100644
--- a/packages/quill/packages/primitives/src/resizable.css
+++ b/packages/quill/packages/primitives/src/resizable.css
@@ -18,7 +18,7 @@
.quill-resizable__handle[aria-orientation='vertical']::after {
inset-block: 0;
inset-inline-start: 50%;
- width: 4px;
+ width: var(--quill-resizable-hit-size, 4px);
transform: translateX(-50%);
}
@@ -35,7 +35,7 @@
.quill-resizable__handle[aria-orientation='horizontal']::after {
inset-block-start: 50%;
inset-inline: 0;
- height: 4px;
+ height: var(--quill-resizable-hit-size, 4px);
transform: translateY(-50%);
}
diff --git a/packages/quill/packages/primitives/src/resizable.tsx b/packages/quill/packages/primitives/src/resizable.tsx
index 0e50deff4747..cca7601334c3 100644
--- a/packages/quill/packages/primitives/src/resizable.tsx
+++ b/packages/quill/packages/primitives/src/resizable.tsx
@@ -55,4 +55,30 @@ function ResizableHandle({
)
}
-export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
+/**
+ * The look of `ResizableHandle` (a line with a pill) without a panel group, for an edge that resizes something
+ * else, such as a popup. The caller handles the drag. A `render` target, so it can sit inside a `TooltipTrigger`.
+ */
+const ResizeGrip = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<'div'> & { orientation?: 'vertical' | 'horizontal'; withHandle?: boolean }
+>(function ResizeGrip({ orientation = 'vertical', withHandle = true, className, ...props }, ref) {
+ return (
+ <div
+ ref={ref}
+ role="separator"
+ aria-orientation={orientation}
+ data-slot="resize-grip"
+ className={cn(
+ 'quill-resizable__handle flex items-center justify-center',
+ orientation === 'vertical' ? 'cursor-col-resize' : 'cursor-row-resize',
+ className
+ )}
+ {...props}
+ >
+ {withHandle && <div />}
+ </div>
+ )
+})
+
+export { ResizableHandle, ResizablePanel, ResizablePanelGroup, ResizeGrip }
diff --git a/packages/quill/packages/primitives/src/select.css b/packages/quill/packages/primitives/src/select.css
index fef658dca493..08fa28c8cb2f 100644
--- a/packages/quill/packages/primitives/src/select.css
+++ b/packages/quill/packages/primitives/src/select.css
@@ -195,6 +195,11 @@
top: var(--spacing);
}
+ /* The selection check. An app whose row icons draw thinner lines sets the variable to match them. */
+ .quill-select__indicator-icon {
+ stroke-width: var(--quill-indicator-stroke-width, 2);
+ }
+
@media (prefers-reduced-motion: reduce) {
.quill-select__content,
.quill-select__content[data-starting-style],
diff --git a/packages/quill/packages/primitives/src/select.tsx b/packages/quill/packages/primitives/src/select.tsx
index 7a4315c1d37e..03cefa44602e 100644
--- a/packages/quill/packages/primitives/src/select.tsx
+++ b/packages/quill/packages/primitives/src/select.tsx
@@ -154,7 +154,7 @@ const SelectItem = React.forwardRef<React.ComponentRef<typeof SelectPrimitive.It
<SelectPrimitive.ItemIndicator
render={<span className="pointer-events-none absolute end-2 flex items-center justify-center" />}
>
- <CheckIcon className="pointer-events-none" />
+ <CheckIcon className="quill-select__indicator-icon pointer-events-none size-3.5" />
</SelectPrimitive.ItemIndicator>
</SelectPrimitive.Item>
)
diff --git a/packages/quill/packages/primitives/src/tooltip.tsx b/packages/quill/packages/primitives/src/tooltip.tsx
index 893080a66aec..9cff41db9811 100644
--- a/packages/quill/packages/primitives/src/tooltip.tsx
+++ b/packages/quill/packages/primitives/src/tooltip.tsx
@@ -1,31 +1,43 @@
+import './tooltip.css'
+
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip'
import * as React from 'react'
import { cn } from './lib/utils'
-import './tooltip.css'
function TooltipProvider({ delay = 250, ...props }: TooltipPrimitive.Provider.Props): React.ReactElement {
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delay={delay} {...props} />
}
const TooltipGlideContext = React.createContext(false)
+const TooltipTracksCursorContext = React.createContext(false)
const createTooltipHandle = TooltipPrimitive.createHandle
-function Tooltip<Payload>({ onOpenChangeComplete, ...props }: TooltipPrimitive.Root.Props<Payload>): React.ReactElement {
+function Tooltip<Payload>({
+ onOpenChangeComplete,
+ disableHoverablePopup,
+ ...props
+}: TooltipPrimitive.Root.Props<Payload>): React.ReactElement {
// A tooltip shared through a handle glides between its triggers. It starts once the tooltip has
// opened in place, so the first placement does not slide in from the corner of the page.
const [glide, setGlide] = React.useState(false)
+ // A tooltip that follows the pointer sits under it, so it must never take a hover or a click.
+ // Otherwise a press or a release lands on the tooltip instead of the page below it.
+ const tracksCursor = props.trackCursorAxis !== undefined && props.trackCursorAxis !== 'none'
return (
<TooltipGlideContext.Provider value={glide}>
- <TooltipPrimitive.Root
- data-slot="tooltip"
- onOpenChangeComplete={(open) => {
- setGlide(open && props.handle !== undefined)
- onOpenChangeComplete?.(open)
- }}
- {...props}
- />
+ <TooltipTracksCursorContext.Provider value={tracksCursor}>
+ <TooltipPrimitive.Root
+ data-slot="tooltip"
+ onOpenChangeComplete={(open) => {
+ setGlide(open && props.handle !== undefined)
+ onOpenChangeComplete?.(open)
+ }}
+ disableHoverablePopup={disableHoverablePopup ?? tracksCursor}
+ {...props}
+ />
+ </TooltipTracksCursorContext.Provider>
</TooltipGlideContext.Provider>
)
}
@@ -48,6 +60,7 @@ const TooltipContent = React.forwardRef<
ref
) {
const glide = React.useContext(TooltipGlideContext)
+ const tracksCursor = React.useContext(TooltipTracksCursorContext)
return (
<TooltipPrimitive.Portal>
<TooltipPrimitive.Positioner
@@ -58,7 +71,7 @@ const TooltipContent = React.forwardRef<
side={side}
sideOffset={sideOffset}
data-glide={glide ? '' : undefined}
- className="quill-tooltip__positioner isolate"
+ className={cn('quill-tooltip__positioner isolate', tracksCursor && 'pointer-events-none')}
>
<TooltipPrimitive.Popup
ref={ref}