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(aio): trace view presentational components (#108227)

Carlos Marchalcea668c04510
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 322d5410b6ca..44ca754b1265 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7910,6 +7910,430 @@ snapshots:
hash: v1.k794b7964.065a9980470f35b7f51d4e5943b3990752fd4245f5537e67744683bc40e68f73.RrP5nFq9CZ--jD-uCfFALgQcsBQase6zp2D996rVI6k
scenes-app-ai-observability-trace--without-content--light:
hash: v1.k794b7964.cdee9ec2c6fded05ad4a583ba11574423b6fbe1685ec0c4c1f777e233845c467.87Jht5vUQnHMpxJ1KeqOIPgUtSlmqRwKAZhhEkgC2EM
+ scenes-app-ai-observability-trace-view-error-callout--default--dark:
+ hash: v1.k794b7964.f3cc0d019890ebf6131a4e0f459b0418570284b309afcbe62990ed78e1558d44.QmJUyYcoSwOqZ-njvnBWLafphOzcvUxYczUi71gJ6zA
+ scenes-app-ai-observability-trace-view-error-callout--default--light:
+ hash: v1.k794b7964.d200a30306f7ff6426a7a4bd3cdd2c976b1a41dd6a2df1a730e3f8aac32fa333.5nkRW-tpv7omJDnX7x37fvscXLEiv0pnA-G03A1IsXw
+ scenes-app-ai-observability-trace-view-eval-results--agent-evals--dark:
+ hash: v1.k794b7964.b646391bb0c982671d380cb38a955975050cbc1544c6a39abe64c8fc43d18dce.TD3rbZ7fSDMEqdVw1SnvmYet1fzf-UQdfjnAZffOOB8
+ scenes-app-ai-observability-trace-view-eval-results--agent-evals--light:
+ hash: v1.k794b7964.e7b42f7adab2b2ca753b3653e3f51c3e5b2275de05a2169a32fd15d19efbbc1f.dF8nsDqoKP3-Hv5FTeF23ulsc5mSapGHi4ZVY-UwaNM
+ scenes-app-ai-observability-trace-view-eval-results--empty--dark:
+ hash: v1.k794b7964.6acde65763287ea8316f128d35efd46c5f5f71d1b95bebcdba41c66b5d82660d._KG4K8VBYs18TDr67HEdJ9WK_AlflIwFCdFiAOSA7Gw
+ scenes-app-ai-observability-trace-view-eval-results--empty--light:
+ hash: v1.k794b7964.7c26e1a845fec5990d61402f6be2ca21c126e86c559d99f9f3d79b81ba92577d.DNLL20qd9SUBW7f0dpDGXBon-dhsYDNWq_Rt9luBvVY
+ scenes-app-ai-observability-trace-view-eval-results--load-error--dark:
+ hash: v1.k794b7964.70758f7bf1b270cb1ec601cc04be1ca5c653f15d32247e122befb4b4455c0f1b.iCaq08mG2E9eUCa05DVQNVT-YS3zW2w9aitiozSxOrg
+ scenes-app-ai-observability-trace-view-eval-results--load-error--light:
+ hash: v1.k794b7964.faed728e451b6a1d118b59d0af7bbacef4770e7682f7ba01a3a7720b7ca21b7d.3LS6yOQ5x37_zjy5eMQQ0y9jxJpl8DLyyc0rSw0VVkc
+ scenes-app-ai-observability-trace-view-eval-results--loading--dark:
+ hash: v1.k794b7964.326c787e8946a8eaa727967f3afb0dcfe40355390e420d34df84ca594f94410f.STt5QG0NoV7MjnXwQGVbdsJEA9Pa6drfyaiuPWeyzCA
+ scenes-app-ai-observability-trace-view-eval-results--loading--light:
+ hash: v1.k794b7964.c2193c953b9f6410a018135730f03a16effbae102e843e7cb86d31a585ff25a0.ZnwmN5ZhvryitB3fPLZmzGRm31kQtra85ZjR7rR2Wdg
+ scenes-app-ai-observability-trace-view-eval-results--narrow--dark:
+ hash: v1.k794b7964.0d9f5ea29085fdce3b5416a6cd7629cf7487718b3287170e35a0444ce84f7130.wjDaCjEydB47et5XF4RnA6PcbBO28LdcXTXUdgJkqOg
+ scenes-app-ai-observability-trace-view-eval-results--narrow--light:
+ hash: v1.k794b7964.066e10797c7eeef745043b8e1c5bd2f6f726db2dc927ffabef178c65f92ae47c.lcwsAGwJT5CDGqDhrFvHUGPF8K-C_VpfqDlMnf1v8yM
+ scenes-app-ai-observability-trace-view-eval-results--results--dark:
+ hash: v1.k794b7964.6878e01169aa5df1d0a472e54502445cb4dac02f049402c42bd77405678202ad.joUtOO1BtYJsiG77d2Oor5OLT2b0ojMFPXxBUcvMV4w
+ scenes-app-ai-observability-trace-view-eval-results--results--light:
+ hash: v1.k794b7964.28feede2cc8e1490cacc3434a878109a1b3e891c5d335fa4cfd5e8b2c12a7d4c.1hm9PJZxIAjDh8vetWyBPYQds9ck3Vwu0nJdGafQNnQ
+ scenes-app-ai-observability-trace-view-eval-results--with-targets--dark:
+ hash: v1.k794b7964.3668c4cab9a050d2d21e9cd1274b5e348da24fedf3264ede6cc9a19c59be0eae.8Zc5q6EnyO2a8nC1KKbD86vECGtDU-mLzxroEIqaQks
+ scenes-app-ai-observability-trace-view-eval-results--with-targets--light:
+ hash: v1.k794b7964.5b99a44a4fe9414c181d52304bee27dc0411488565499a069379edfca998ac53.xqNk1JI7RXzSiB36VQL2Tx8jNZjLqTB3V3y-7UVMqLw
+ scenes-app-ai-observability-trace-view-input-and-output--empty-object--dark:
+ hash: v1.k794b7964.6ed3f97001d8b595545a78f37627d3e09c188a3dcd782c8ab3389c65cbd4210f.2U9W7fXNr-OZRXfkmXy1ICFu5-dSKZUsMMWOtbf4PWw
+ scenes-app-ai-observability-trace-view-input-and-output--empty-object--light:
+ hash: v1.k794b7964.927709e7d16173be121974c440de5c35c6429a807603f2df45db1f069dc61e21.5ua_RY2_lntHF6eFwK_PWbn4Z2BwgnPHsX5GOys1gTk
+ scenes-app-ai-observability-trace-view-input-and-output--key-values--dark:
+ hash: v1.k794b7964.b1c8ff838fb028f12e2f3257d5c12e741c72d8acd06460a7acf22e30cebd8e2f.ugkMVqUdUIAs3ftYXXt0SvAQbF-Pra51N851JE1nUo8
+ scenes-app-ai-observability-trace-view-input-and-output--key-values--light:
+ hash: v1.k794b7964.01102a5169ae4c8944b45cbfb401900af667dfac1a2063788ca42093b1ce1795.cxQfXM7vdTz__hEm0RdmdJRqwBVznwTf_udY5p3EBDM
+ scenes-app-ai-observability-trace-view-input-and-output--narrow--dark:
+ hash: v1.k794b7964.b7a2438cb7389656a01744ce2855d0ad017597d522a6d294593809d0799f801e.bBVSDoou3TgVQ32a3wsfAPPVf1WG-2dt2WTMdVWUwtg
+ scenes-app-ai-observability-trace-view-input-and-output--narrow--light:
+ hash: v1.k794b7964.2093a8432528d040a3c433caf91227eaffa82246e46ad5cb466ca8755717ae4f.vfvKmUf9vZ_2nN_Ce3gnb9jFFewE19_zoTiWQBc16rE
+ scenes-app-ai-observability-trace-view-input-and-output--nothing-captured--dark:
+ hash: v1.k794b7964.6d24d0a35b6c649c100c4247c718aa12795e0d0e88ee733712a14b66ce44855b.j_Rlr-Qpq0Ao6NdLr9xTRW_nCe9BE_KlegtujABtBEQ
+ scenes-app-ai-observability-trace-view-input-and-output--nothing-captured--light:
+ hash: v1.k794b7964.c4736210c4020316c3919c07b130f2dfced3d9b3bf1d3bf20812de5e6cbe09cb.MK4OlUcpeZYowFy5QKVBrtDb406UljEJQPsGZOeWHMU
+ scenes-app-ai-observability-trace-view-input-and-output--plain-text--dark:
+ hash: v1.k794b7964.7fd00d08731a5408c839a1ed97b520656422ac32c37f772b00e4a3668ef12736.c2p_t6b1B2m0KcGIt_muoyQtWpBNr3Zkqpwo9lbCUno
+ scenes-app-ai-observability-trace-view-input-and-output--plain-text--light:
+ hash: v1.k794b7964.97ad5bdd65b3c34c9e6c6f3b390f3115f508b7693a2c680423e23f9d024662d9.b-jgoZRjotFxvic1lbik9_7TPwWOEE9TwfAoBWztiw4
+ scenes-app-ai-observability-trace-view-message-block--assistant--dark:
+ hash: v1.k794b7964.cd556a182e7867b028e9ac2d68e7eb0961e2484ba7bae2642116547c141657e5.DUKbPYe9Sc_Wya3lRsP4FdUvkYsgzx8i6JHbGwMfBHk
+ scenes-app-ai-observability-trace-view-message-block--assistant--light:
+ hash: v1.k794b7964.0d44644ead3800e9679d3f1c2520c1639ae72a855a9ff01bb9b3ac8678cd82b1.2_Sb_uwxi0mEqw2o7U9y6GTg6O1cx15HQFYgDsOnUoA
+ scenes-app-ai-observability-trace-view-message-block--collapsed--dark:
+ hash: v1.k794b7964.be7e7b08ce2db022ae551302403db12a5055c8f46313a495672a766897a6ccd4.NBpv1MJ0Iy4gGxUut63yi0fiCqF85E5w50QH681ry6s
+ scenes-app-ai-observability-trace-view-message-block--collapsed--light:
+ hash: v1.k794b7964.f5ccbcc2fe17843e0dd3b1fc57ee6de4bb244b7e1211234f0abce4521482a2d1.UKyINf3OQ-5hl2zZDO9gWD2Zx4eMkNw8iBhLKyZeDXc
+ scenes-app-ai-observability-trace-view-message-block--collapsed-without-text--dark:
+ hash: v1.k794b7964.b48a7d61fe5d9a34695ae02650d975a443eb558d2ec7b2c042d7220358868a48.VHRoUYTlY7r6D2croO2QQKNJBE4E90D-RxjV5316oNk
+ scenes-app-ai-observability-trace-view-message-block--collapsed-without-text--light:
+ hash: v1.k794b7964.59b23d7b72f75763d5dda25ba2c02e00d5df57d9519260dfb37091c659e3ae79.DjiKoZDz1y_cKDjq0in991jcJ881B5mNNjIB24qJ1LA
+ scenes-app-ai-observability-trace-view-message-block--system--dark:
+ hash: v1.k794b7964.a95baf3683da3bed2678648b77be1744ca61820445b4bfd774d125fe5343b731.zjCPBWuACZFzpvbOJA_a92ji9tmbdGVgeD6kycn_3Ug
+ scenes-app-ai-observability-trace-view-message-block--system--light:
+ hash: v1.k794b7964.ffba007bef0bb3d88a7d76cf05f6bd7eae8626cb2027b38afa684ec669c233ae.bAErL7JXROqNqeiqMP_6sOznuplGxjmqckTMhGYVh3w
+ scenes-app-ai-observability-trace-view-message-block--thinking-and-tool-call--dark:
+ hash: v1.k794b7964.cde60354c80299d3638977425db0cb4757b64384a4d7be14fc8eb9a7847f13fa.fBRYJkJEyUAN64ETcPb7Lp8_oMRRN5uI8dTgEvWyPw4
+ scenes-app-ai-observability-trace-view-message-block--thinking-and-tool-call--light:
+ hash: v1.k794b7964.007f73323ef9783d2b4f1f9a1582f5661e10bc6bacda198c80f134132e400756.fSHkBlIzRWnP8opjiiK5eHDqWsx3fzrU_RSWPKi4hXU
+ scenes-app-ai-observability-trace-view-message-block--tool-call--dark:
+ hash: v1.k794b7964.a02691eee1ea1c9906c82f586cdcfea5165beb5ef4c2e6356b22c916a31421c7.HaO2MuOIOHjpzP0q9xC9yslC9Im8GH_YzSSKCB54Y54
+ scenes-app-ai-observability-trace-view-message-block--tool-call--light:
+ hash: v1.k794b7964.6128a2326c16123f218224e1bf59abe1d6a97fed2660179ea34858c27f3332fa.pExPoU2LSuFmqRg6hMpK3SqbMhEHfkHHt6z0acuw6i0
+ scenes-app-ai-observability-trace-view-message-block--user--dark:
+ hash: v1.k794b7964.06c39754d406961c9223886ea6172e17f53b0005148331494b834fc154ad375c.cnu-SPUEcBLnZLLrrTs5Xift7I0b68OqW5VFLlPZJSA
+ scenes-app-ai-observability-trace-view-message-block--user--light:
+ hash: v1.k794b7964.b4b7179eb3dc99260a5079ea3e66db17296dae1813f51f361e2d8cdcde068a79.8FSywSvT9cazg6VDni0eQqUmYSiNdyFOqQWU4l5O1r0
+ scenes-app-ai-observability-trace-view-message-list--empty--dark:
+ hash: v1.k794b7964.4f05d4f5f99b6027270f90e5a3cf13dc5418c30e6d547d2ce4baf7de7287c99d.7VnA30m9nzAAqL5Su5thmPHfpMB9wz94aYF4Owgmxho
+ scenes-app-ai-observability-trace-view-message-list--empty--light:
+ hash: v1.k794b7964.49bfa3cb93c9d64fa6e9d650f1f865ceef9d0b91cae0230b9ddcacafd8a9a1e4.bZwTkbihyN1C4tN_k4o6AiSIQ7cUicH8RTqZb6PvXD4
+ scenes-app-ai-observability-trace-view-message-list--generation--dark:
+ hash: v1.k794b7964.a38436788515925c935e750163b81957440955d22346abe58bb8a7f39bdac069.9SUnSHUn1prItAtw8ZXx7J6L_3KZqGmCoextQ393D9Y
+ scenes-app-ai-observability-trace-view-message-list--generation--light:
+ hash: v1.k794b7964.de6359a12bdf0af62d212270dedfbbf99ce7d60b88eb07e3bcfdbbfd043b8c59.ZQBfNXse7oBpVb-mwDxybppoEft0m4YO-7pTOn9rr7k
+ scenes-app-ai-observability-trace-view-message-list--last-open--dark:
+ hash: v1.k794b7964.66cca1d67844e9ba325ea2ed6f36b397c1197c2091fa336002ac772025196d02.Z0m_dt0_uc7W4wbgc6VnW3ZVwuHxCDcJUAGGdp4PEGI
+ scenes-app-ai-observability-trace-view-message-list--last-open--light:
+ hash: v1.k794b7964.438797f632ec95b50fad0658345b0358fccd93b9f6b87d2a391217426a1b2b61.1q137oV0x987ZE28znmEoo6SLshEP2WZhFvDXEY-gBo
+ scenes-app-ai-observability-trace-view-message-list--narrow--dark:
+ hash: v1.k794b7964.9310f0eefef378c737ca4e44b4d1a2d3e38e6305c5e4cc70d2a4bc2f9f8eda7c.IF9xZYzFYjD8y2l47MzuXBqDYd8ggNBDDVKTAUJbgvg
+ scenes-app-ai-observability-trace-view-message-list--narrow--light:
+ hash: v1.k794b7964.4467600f1ba37f5086725162c9fb5610de46ffe4eaac4d34b39e829c2a5cde66.dkvpGMQsjeHHqIH1kj1URXvOR5haLaIZOHYi-qmaE0A
+ scenes-app-ai-observability-trace-view-message-part--attachments--dark:
+ hash: v1.k794b7964.f38ba4776f7c5a04f3c82d53733885ff1ea224730e06b7387dfdafe057c18f1d.-Q2BWh9mkOmVjbS1eBjPMOQBev8yP9gBkFNvwDjVNJI
+ scenes-app-ai-observability-trace-view-message-part--attachments--light:
+ hash: v1.k794b7964.8d72e9e8a686492e364fdea917366f8e787025aab310f9c7ac81dbae53043b92.Ycy8QI-t4AfzYL0r_3qpmvZFDpollrOd_5Qo_4hKMCg
+ scenes-app-ai-observability-trace-view-message-part--data-file-download--dark:
+ hash: v1.k794b7964.797c3483371564c447f93b3af1fb103dddfdb942cec07810ca1e4ab51551813a.DOleCZ4DGgQaf8_DansiJO-oZH0bO5z_zSB179rHXac
+ scenes-app-ai-observability-trace-view-message-part--data-file-download--light:
+ hash: v1.k794b7964.5b685a7846fcc635e4ba405e07cca88ce3ca5892eaa10515e61122ccea376ec3.kWFWKgJPJztBnD6mYz8ysxhGhFOzXt5cRrB9TCVO-xk
+ scenes-app-ai-observability-trace-view-message-part--external-audio-chip--dark:
+ hash: v1.k794b7964.1668e921fedb995574a4b3e91aebeddcf4913e91b48056266ff04f34f8ce3f4b.A--jgAQ_KGPNzVpKAtFxLoYUNmyJB5mhWjDXk6B6ACw
+ scenes-app-ai-observability-trace-view-message-part--external-audio-chip--light:
+ hash: v1.k794b7964.f6588b1089e2c8485db09937487d1dbb407624a5bac48606cc451401838a86ed.Eg6dLA5Vm4KP9oi81ls_63eu6-Xcw6yVty9sJ9KY6g4
+ scenes-app-ai-observability-trace-view-message-part--markdown--dark:
+ hash: v1.k794b7964.4385bae904016b38820a4d06711555eec59108a7252157a137bc02de36854ae0.z6osxQgqm-14KrtTIeHs2ZX47pZSf1rtpnJtdX7AMKQ
+ scenes-app-ai-observability-trace-view-message-part--markdown--light:
+ hash: v1.k794b7964.dd8bc7887156d9372f87205b5801b2ea0b1c22adb1d6e1f0c880d0ea99b73c6c.BwTpEkTgJKxI_PTa059w1xYoPovIjjCB4j09ezC1gc8
+ scenes-app-ai-observability-trace-view-message-part--rejected-image-url-chip--dark:
+ hash: v1.k794b7964.ffa887a95170af0e93399d18bb89c47b9201786ad221ed58cd444886b5cad147.pT9dc4YbvgbZbkJ1PsNjgmKJbRkHzH-E-QDTa6khwv0
+ scenes-app-ai-observability-trace-view-message-part--rejected-image-url-chip--light:
+ hash: v1.k794b7964.9a5fc2945cf6d7f17a8ce5a956eb68562853e5161005e796ee082072bd99cd50.sRgGnT-zoCxQcV9X0MhXIIYhb02VA3NcSyxXXH4GIn8
+ scenes-app-ai-observability-trace-view-message-part--same-origin-audio-player--dark:
+ hash: v1.k794b7964.75dd2e4471ee1910c45b20e074e5fe58f74fd5dee58f07d51d9175448653fd48.C4Q61KYEwqStIb8mcDeXhEmY2DH93698Pu_2R3HoOCo
+ scenes-app-ai-observability-trace-view-message-part--same-origin-audio-player--light:
+ hash: v1.k794b7964.2107f96162e0de8e501f9a4bf7d6cb012beb99568bfd734a67d3f3474bbb436d.4Dga3M4CTxa0is9W-1gEpsKS9Ddzx-mdwQNL_dbxqeo
+ scenes-app-ai-observability-trace-view-message-part--text--dark:
+ hash: v1.k794b7964.2719c4ef4aa62f83a4912d00b7d183988dfd44a67b28882171664d48e84e4e8a.YAcJTXkSx4rfLvh_0QmDSN-AKVuOTf8tkMIbZHSa1ds
+ scenes-app-ai-observability-trace-view-message-part--text--light:
+ hash: v1.k794b7964.3fee5a0e9da977874a3e5b225e587fc756e4ea27fef5eaa02c93294958357b23.Wb-A1a8b48ytxuqYBIk2LOEjMkH0jB3sg7N7iKpUwzA
+ scenes-app-ai-observability-trace-view-message-part--thinking--dark:
+ hash: v1.k794b7964.eac1539807b03b0926aaeada919986a2392a7308f6bd9163a0d33a89f32da0ed.eWEw-weUCYM9FJacDBbPtfP4LEgNJv-UDpiMtz30SJ4
+ scenes-app-ai-observability-trace-view-message-part--thinking--light:
+ hash: v1.k794b7964.048a8f6f4301b26ee164e204ca96c31dd12b4b6684e7712faa0ef789626f19e8.tHo3tXViu8bZCdUQtDWTHyHjC6surwiQu1wvVjQSS00
+ scenes-app-ai-observability-trace-view-message-part--tool-call--dark:
+ hash: v1.k794b7964.411ae9958ccb4fbf7801081a1b3b68297a59b075633e8938e7710d3d72a7bbaa._2vYQePJTw8Uv0Fv2hcRRA8YmtwrA0Au8uSpMorMCbU
+ scenes-app-ai-observability-trace-view-message-part--tool-call--light:
+ hash: v1.k794b7964.5c5ffe37c7198b38629092f3e77f4c13d6b17335952d34e73d656f49f92cf23d._ZLOnktgWwUsM280eFnlXOwSaM4gvkH94-uGEymxfiI
+ scenes-app-ai-observability-trace-view-message-part--tool-call-error--dark:
+ hash: v1.k794b7964.82b22f4c10a39f0aa9826b69c13ae643149e1a1c417cad2658edb5df53759082.AgL9H1xNLACw2MqAYxsQcPGO6i9Y3Y2x5Xg4Ikb5_Ng
+ scenes-app-ai-observability-trace-view-message-part--tool-call-error--light:
+ hash: v1.k794b7964.9c640525c426692ef4419bb2122ff247fdec849da7b0f9bd2920499b227870d8.MtXCXbZkKYltcu1oDBwF0_z-CizjoAsEaL5UtK3AcaA
+ scenes-app-ai-observability-trace-view-message-part--tool-call-multiline-args--dark:
+ hash: v1.k794b7964.0072496f4b97ec00108b138e09cfefc2008acf2001d63bc93152b80252f692fa.W-BkAWOeT5GTkqKVYKYWdOLT-mljqcjQDQKAKig_n0s
+ scenes-app-ai-observability-trace-view-message-part--tool-call-multiline-args--light:
+ hash: v1.k794b7964.9574ac70d0b3fcabc0a60c1fb7b677ceb53a636337094f215b45862c289c8ee8.oELNCo2z_5ClcAdMZJArSx-p3v0tTepDm2JSRpUOC_Y
+ scenes-app-ai-observability-trace-view-node-detail--content-load-error--dark:
+ hash: v1.k794b7964.f8fdba7601160c5e3ae32e997e2b571c43ee4735a5d3164a18af1fc387b830e9.v1Ybpavq8kWeP78qkS3yCKLOvhwNJK2C8fYLrLadHpE
+ scenes-app-ai-observability-trace-view-node-detail--content-load-error--light:
+ hash: v1.k794b7964.9c41bf277ca69973253ee4511786bb860e3b41c3136e7642956f1cc2f3478099.NGDcm0HC3GXzNonYv7TeTVtn696qxLC1DswZcApxOyw
+ scenes-app-ai-observability-trace-view-node-detail--evals-load-error--dark:
+ hash: v1.k794b7964.8e974f8628c9cc06a2f376f029a8d4d1e5e6755bfc4e15cf1425d50ac27d5507.8xlC3RbKsMdoSiqaBI0oIq7qF844Mjm5g4b4yhjjEKA
+ scenes-app-ai-observability-trace-view-node-detail--evals-load-error--light:
+ hash: v1.k794b7964.50777b9d2294d5daefde05454f4d88c77100bc9cf1bb00cba7417e45659441de.zNzJetAUSwx_LsQxfGzn5GiP0drok5qlGDjtdBA1f74
+ scenes-app-ai-observability-trace-view-node-detail--evals-tab--dark:
+ hash: v1.k794b7964.b32052d233df672ac33d635e9e60682b279b0a85b8197d5c037923f1060ecb67.pjxZIIGAyjrunK5zd2J1auEwmwS2okFOGDJHtPnCBS0
+ scenes-app-ai-observability-trace-view-node-detail--evals-tab--light:
+ hash: v1.k794b7964.56c0cd429a52b1707971a0d892f22346a5757ed5eb5bd2e576305ab85d5daaf5.HHwjHccgpak73NKgv5Gfmd5RhUWYNgNe1x4qE6iJxDw
+ scenes-app-ai-observability-trace-view-node-detail--failed-generation-with-image--dark:
+ hash: v1.k794b7964.c161e39c0753e90108d0026cbc0bdc6963e8540346685edf024fd8dedf32ec4c.A2Eid0pxBKQqtQ4wohIT_9dHMqvB3fQB5UigMmuDLDA
+ scenes-app-ai-observability-trace-view-node-detail--failed-generation-with-image--light:
+ hash: v1.k794b7964.62b20116cea57133232ac1dece2202ebba254c0b3859cc612849260bb0b2ecf3.oL2-yh23MsPWV1OkVTpdLy3dDD3WmozQvgdyTJ6Zhy0
+ scenes-app-ai-observability-trace-view-node-detail--generation--dark:
+ hash: v1.k794b7964.2df8fdf6dc793d257b67e5008d5eda41e84ba0bbe273b83107422978e658de94.ZiE7cJNaJo122jFPjBNebUelNaR6IymDDYLp0DNwMaI
+ scenes-app-ai-observability-trace-view-node-detail--generation--light:
+ hash: v1.k794b7964.d3e200bcb35e781dc2ffad15181a67d6fb4d66e7fde0a3025b72eb0975df0379.cvK5iJEjH6T9frYTbRB0t6onVxZuarvymDgXy_IkktU
+ scenes-app-ai-observability-trace-view-node-detail--generation-details-tab--dark:
+ hash: v1.k794b7964.716b0f6bb91a503370b0a8cf67ffd3ed062b8cd15b0b933c85cecf277f7e2b16._a9wWv9pQypwAFmXxwdB2kzknPb6PtxiQb9vtpMFdwE
+ scenes-app-ai-observability-trace-view-node-detail--generation-details-tab--light:
+ hash: v1.k794b7964.4b7dbd012bbb2afb964557f2e99a1e0fa9934f127afc6c2600ff488f011ad116.YR2Ge5xB6wKEkYHASHqOw7G4Bb2sWeD5s9f-OB4vkHs
+ scenes-app-ai-observability-trace-view-node-detail--loading-content--dark:
+ hash: v1.k794b7964.2d90eece99469675f26ef42b6f4fe6f48d079e332feb97b7765685a40d94f4f4.YL2C14b4uB3Fn2TZLgXFV4bQAqIGAO5f_FkL6AVoaeE
+ scenes-app-ai-observability-trace-view-node-detail--loading-content--light:
+ hash: v1.k794b7964.cf9a3c2e94e2eb5fe6894eb36e0ae9a281576566db56c07b3572ccd68705ad5f.qqbO6Jz6ulA0mpCtCLvWLk3R3hkGF74AhK4lGaiWw-o
+ scenes-app-ai-observability-trace-view-node-detail--narrow--dark:
+ hash: v1.k794b7964.6d632701e8ecef39a1b88e032e3486dab3b39e3a9c0dd915334a996d91dd5559.x-QiRfCcdfrPsmFpYo5FCYmT8PZYuEYeTZoodRBxgNw
+ scenes-app-ai-observability-trace-view-node-detail--narrow--light:
+ hash: v1.k794b7964.65f977cc28f26fea6c1ef77f35e0388c61126976e6830720ef6e6c9fab1ae804.W28SdeaY7mwSD5t87nNtphGqtrkYVuXgbvEBHk3NHXQ
+ scenes-app-ai-observability-trace-view-node-detail--nothing-captured--dark:
+ hash: v1.k794b7964.190b2c059d38d9a4716b35b1e9c40289f527206b095aa1751f36c57b1a08f83f.CYx8ZM77Xrh0mipyOxjxDW89lmpREnNVg_WJG6JB5pk
+ scenes-app-ai-observability-trace-view-node-detail--nothing-captured--light:
+ hash: v1.k794b7964.c25dcd37e1256ce57a18d5b14719b431c974fe360b9097bc25628354f3f65b2e.UJizBxDMm7WoFJWlPPo6jv_tswAx-pRdrF5wuFpXs5Y
+ scenes-app-ai-observability-trace-view-node-detail--span-details-tab--dark:
+ hash: v1.k794b7964.c8765f600847c62e2d29705c6833a4e43707668a4c53f57e918e8c958e25d401.KDRSsssfGhhPMk88hskuIT4xCo_HEmeHTjs17yqXbaM
+ scenes-app-ai-observability-trace-view-node-detail--span-details-tab--light:
+ hash: v1.k794b7964.41fc5ef9596bc156984a062c2918b5f97ae64de1d3aaec135a5f049d52a9759d.Uxf29Uc_AYpUfd8fak42dEkJaYSyOaMlgH2OLwvTtWM
+ scenes-app-ai-observability-trace-view-node-detail--span-input-output--dark:
+ hash: v1.k794b7964.780db7d7869f3813e6982a1a4772d64ac638b6bfd4f67af5ff7c1af15a90ec45.qwr3VdnMjXPDE-1e7FBMZyuFnFP7De3FhkKSGtvonB8
+ scenes-app-ai-observability-trace-view-node-detail--span-input-output--light:
+ hash: v1.k794b7964.f4bd0c0bdb3bc1798c840a27ddd69cf143412bcbca29066f0de55fe22d9c7839.RSVgXhMFw1qdXf6DIcIMybeQLjTJqmON0AEYdM-Yi7s
+ scenes-app-ai-observability-trace-view-node-detail--with-error--dark:
+ hash: v1.k794b7964.c8738b258fcc296e359dd79434a649f7db699a8e4962261f71a015b09384574e.h3AQS336jkEfDQaxuGRGG5ULNxBK8J63SAMLz2dNx6w
+ scenes-app-ai-observability-trace-view-node-detail--with-error--light:
+ hash: v1.k794b7964.501e82359c3f544a1c71848d3aec9ae003cb67b73adc58a8763ff92c69917dbb.Ia-6XmopuYjE7La38FGhkUEEA0c55yavYiFjtTWWGYc
+ scenes-app-ai-observability-trace-view-node-kind-glyph--all-kinds--dark:
+ hash: v1.k794b7964.d092355849e660b2450465e4eeaf6e78e7d435f22117ba6b9c7d831cbbe8e278.K9O8_ysBelMXcyNmH-O56K6JW4EVlEhGPXPFAgFbKJI
+ scenes-app-ai-observability-trace-view-node-kind-glyph--all-kinds--light:
+ hash: v1.k794b7964.6c06343a3a86261be77777dfd696cbd19475e37f2e40aac6454c5c31aaee04a4.zxbWqQoxK9x_PPaB2F3JNq3OLTHL_kE2OFU_Y_6av7c
+ scenes-app-ai-observability-trace-view-node-properties--failed-generation-with-unknown-stats--dark:
+ hash: v1.k794b7964.9ce2e4f0bc0d7662beb1bfa403529b224bd3f769880f5cd7fc9a5cee123d77b7.65C8iRWCR_N5_2zFsHqgwwQ9uWbwHmmVi3_90DhHy0Y
+ scenes-app-ai-observability-trace-view-node-properties--failed-generation-with-unknown-stats--light:
+ hash: v1.k794b7964.6875d3ede7bbc7f0b3a9cfc8e4efb27c3f364a775b2983522cfb973223e952f2.G6Dt-Xxgtsn10UFslOig8FZlj36LSLXAC2yLXSYX5Ss
+ scenes-app-ai-observability-trace-view-node-properties--generation--dark:
+ hash: v1.k794b7964.256a3268344b6bd6a14c4f167d1dee56a8d52e79b0f969a960f367dccd19f4eb.NsE8DOjOZ7mVcioSwamefJeJpwBEUwlEtIB1S6_efXc
+ scenes-app-ai-observability-trace-view-node-properties--generation--light:
+ hash: v1.k794b7964.98edc4674ac3c273056c21634dbf92514b4d7278aab282a1012f5ecb016efbbe.WVo_6NKBDH1h9aOotSsbuY1GgWuhexFKPg6gufoWRsg
+ scenes-app-ai-observability-trace-view-node-properties--span--dark:
+ hash: v1.k794b7964.5e1c11110bec07c1bb4b7052a5b9646d558977d886dee209a2f2fe3ed068ce67.tlF3eCUZCUUgSjp6aUtkYCflg8JLJfyE4OQyeYdHnbY
+ scenes-app-ai-observability-trace-view-node-properties--span--light:
+ hash: v1.k794b7964.96ac13ca8a5b976d1dc985b8089e1efaf2fefa2660d7f608b906e7b41bfc9e9c.akwOJ6brI9Ot9LgL6ekHtJ_Ry56UB2x2FB6j3nUD7iw
+ scenes-app-ai-observability-trace-view-node-properties--span-without-session-or-person--dark:
+ hash: v1.k794b7964.38af119f9a91e407590e39fc3dc427b8888e73d2a27109f5898bddcfee656451.SCjkFD5YNxCfYGj_d7wFoYkPgzBpKAScu2ukyibxgtw
+ scenes-app-ai-observability-trace-view-node-properties--span-without-session-or-person--light:
+ hash: v1.k794b7964.abf6d23ff3a81716d4964579479b7cbf36f0fa0241822675bdb4a23e09945eb5.xoL1GWJbEksTU5X17Hyep4Z7Orlv6oSNWbiyyXlktnY
+ scenes-app-ai-observability-trace-view-node-stat-chips--default--dark:
+ hash: v1.k794b7964.7dab9efc20d01450f5ff65051589f674ad0ae5043b12fc6263dc89ff507e6157.LAIT1zMlGMXQ4tCGjuV3uS1_xSfvAh2KD217Sezafk0
+ scenes-app-ai-observability-trace-view-node-stat-chips--default--light:
+ hash: v1.k794b7964.4a89b6b9e410030b74baa52e37ab4f0f00b83b1508d96d7589537d04e27f5ad5.oJfAWQiGG9wzk5IQ1psiHu2gUWVnHaZiIArG_KEgQ7Y
+ scenes-app-ai-observability-trace-view-node-stat-chips--narrow--dark:
+ hash: v1.k794b7964.0b344b4b6514e6bc3829b6757d0839e438635d7abc4dd3c242449f7508536b4a.wyNZThg6UJJoaU0cDZdTkeJq_FqpQKClk_ySLRdxZNA
+ scenes-app-ai-observability-trace-view-node-stat-chips--narrow--light:
+ hash: v1.k794b7964.a28ec48867fde546073a89175bccecac9843ca650949769899d3ec3d6eec6761.CBoo7K4tzIl6oXU-3DpYyw2aX_zjGy0Lyx8_56Lteck
+ scenes-app-ai-observability-trace-view-node-stats-line--compact--dark:
+ hash: v1.k794b7964.11f201ea5f13da9e31edc3c01ed93287a17edb544dd289e15265647d9049be67.eZtNWyGZrn7Rhp6VPVH4R1wd80188XdQmMt0RaT5Wwg
+ scenes-app-ai-observability-trace-view-node-stats-line--compact--light:
+ hash: v1.k794b7964.1962984b3666ffe13b15b5dd300a051b59d7de5e4f24240197ac0dfb5482b556.hbjaH3vbC70BoKIHZy-M1_m_lxAKdmeY5DgUSMG90Qo
+ scenes-app-ai-observability-trace-view-node-stats-line--full--dark:
+ hash: v1.k794b7964.60ceca7bf226b4e46bdd685abdc91e2055f71de8fb979c141ff186eded2c2b8f.wY7sVww_WJgW7pyqhtcEsmKk2yB5hp9xf5KuwpRuyiw
+ scenes-app-ai-observability-trace-view-node-stats-line--full--light:
+ hash: v1.k794b7964.3c519033c647b835ec3258e581d5e2fb25d4eae281b1ec7e0c4c4d6f82c94a17.b0FcLnU8j_wD1NaGAtIPFcTVj46-T6ZGocLfPxbvpLw
+ scenes-app-ai-observability-trace-view-node-stats-line--latency-only--dark:
+ hash: v1.k794b7964.031b14a3c0d333dd181e6f4dae958daa285d64cb8951c02ea832451dd35618bf.pYQ5tW9iRNq1Dw5J15PD5bED8saHM0KLuRXBgFnGs1E
+ scenes-app-ai-observability-trace-view-node-stats-line--latency-only--light:
+ hash: v1.k794b7964.91ade8ab1c9ad938db711f0e7397a2806286c6e60105080c1a28f02b221541ae.frC_wosSvWt5iva5efIdRFJHYgx-u_-eBkC2IIKR4Bw
+ scenes-app-ai-observability-trace-view-raw-event--default--dark:
+ hash: v1.k794b7964.588f7b7080870b49a1843d57a4862568bdf75946a3083878d4ce684c526b55fc.IWW3KumcjDHjv5wufqlZoywc_PdTfJuYRCcobTNwZc0
+ scenes-app-ai-observability-trace-view-raw-event--default--light:
+ hash: v1.k794b7964.6feab338f432d042f8e53f328dc7709cdc79bd2fda46b6274db876c9c3ef078b.R-d9RNKhCeOY388cXbLAQhzde0lPGMMo-Dfbk3gRf6Q
+ scenes-app-ai-observability-trace-view-thread--anthropic-thinking-and-tools--dark:
+ hash: v1.k794b7964.b3d0fe41e4ce3167d04d9c3f1fdb4b25414b9c27f3d9b26dc4122e5490b97663.rVseBKdzxKu43YsBqrE-cO9KxX7roQd9qLgsEj49jPo
+ scenes-app-ai-observability-trace-view-thread--anthropic-thinking-and-tools--light:
+ hash: v1.k794b7964.826b7b8d8db1aabdd3cd34195d2341bd2bf311228ec286891ade0760b925f413.u1a3MLXSqVmGWAjGm0LJ0yXz2Y-9Cdrkms1uUZdKPP0
+ scenes-app-ai-observability-trace-view-thread--empty--dark:
+ hash: v1.k794b7964.772a6f824d906394bf1ba626cf6e5f3d754316599d9c89e95e781cef8d4655bd.ydSmfYZk05NDYvHeZC9oRGL9ZskiLdiwoQWp51WzubE
+ scenes-app-ai-observability-trace-view-thread--empty--light:
+ hash: v1.k794b7964.452eb12baf987aa0e5cfb52c1a10a6e5c51b92ec186827759a01bbfdb4cee491.edoRtjBU6faNu38d32Ew5iRkTWxJ3RQ3qRi_tznCycw
+ scenes-app-ai-observability-trace-view-thread--error-without-messages--dark:
+ hash: v1.k794b7964.d072b017ee77c29d0eba3f8a5ae15a2f63edd9e4aef052371c7a924c7d796cfe.GlRHz_4pIhtOQHQs0VrsKveS0VrDE4VjuD3TLwgJ-IE
+ scenes-app-ai-observability-trace-view-thread--error-without-messages--light:
+ hash: v1.k794b7964.37e0397bc8ac07257759dc18025f8c2787a1730cdebf392e700c1307d49c2b75.66qOOb0q11in-Omm-ArL8Xfr09wdCCYRijtXjk8N9DY
+ scenes-app-ai-observability-trace-view-thread--image-input-with-error--dark:
+ hash: v1.k794b7964.10d636c7559a25e66b17140445ddc81e64c86227a53777de3361b3e3139b6fcd.Iv_7m3XW9y78EXvDCTLNfk-hmv7aJIGEuj-Ydq9ElP0
+ scenes-app-ai-observability-trace-view-thread--image-input-with-error--light:
+ hash: v1.k794b7964.427c25b2c17800207a09b427bd5022fc7c35a66d89b7485bcde127137a410cec.Tb6OzKrK5aukGNqRLLegxDIi6Qe_JGpImEX8rqPMD3s
+ scenes-app-ai-observability-trace-view-thread--loading--dark:
+ hash: v1.k794b7964.d19bc82013117a8c7c4eab890f02c545447f1f6bc1fb8dc60ab23a03fe2aaabe.qKU9q9cnJS-tZNtvV9U5Kf4gXB1BgxYq1Y6LYzWJnKE
+ scenes-app-ai-observability-trace-view-thread--loading--light:
+ hash: v1.k794b7964.8fdee179c8b2b4ff693725aeb8e0a839d840d909b64f3dcae4fce46113dc19d3.Vct70fod44mKrVJnlNyuMwxEDIe0mf2AINQgswX_OTI
+ scenes-app-ai-observability-trace-view-thread--narrow--dark:
+ hash: v1.k794b7964.3c0c74ff1660020306dec4753c2299825cb9b9b3bbc0e23aa787ffcd88f1fcdd.TIEtenMN4VaABuomhnXtPd8Te1FLztFunboEeFUC42I
+ scenes-app-ai-observability-trace-view-thread--narrow--light:
+ hash: v1.k794b7964.20889e22c8b6ad7e3f2470948a378a255c5a05af0abb39d381b3c3f6294fd61b.sWWVyhDZVjYKoFIIGHlybAL8anLVxCUl8tpCf4bocyA
+ scenes-app-ai-observability-trace-view-thread--single-turn--dark:
+ hash: v1.k794b7964.585779bf793f95487d7c3980fdf9e957177fe5147773d9393284527695fc2066.aZ347zsv4VoCCm4w5KXL5nojmboH5c4o887Zcu8Ucpg
+ scenes-app-ai-observability-trace-view-thread--single-turn--light:
+ hash: v1.k794b7964.e879179ae9b2b47eaf580e0ef6fcbbb838f52ade6746031a3f8ed668577fb4e4.6thRsaMxB9gomGWGSUqLtCnmVTdkKQZdqZx19aymKyI
+ scenes-app-ai-observability-trace-view-thread--system-only--dark:
+ hash: v1.k794b7964.772a6f824d906394bf1ba626cf6e5f3d754316599d9c89e95e781cef8d4655bd.9hH4Z90sTumOjlOdrtyXYXTm_WniKPgGHs1kSy8PAig
+ scenes-app-ai-observability-trace-view-thread--system-only--light:
+ hash: v1.k794b7964.452eb12baf987aa0e5cfb52c1a10a6e5c51b92ec186827759a01bbfdb4cee491.ZIlIxIh-lQNXA-dEuGofnrenjVRjGgF8uch_9fp-WqU
+ scenes-app-ai-observability-trace-view-thread-bubble--assistant--dark:
+ hash: v1.k794b7964.81506360f7ed9cb1493c6185af28fad6ba393c4fdc4182f0ed58082a61feb127.3WezhJg9DLucKhiP-EYc3a95RZrZjhkRswT9SDzz7mc
+ scenes-app-ai-observability-trace-view-thread-bubble--assistant--light:
+ hash: v1.k794b7964.7453356c417deaa8dc17ab9227c8c74611f84cb67c29a157810ab130cc745fd0.ZIc1Zotbtgk6WyRoz-tTgUfX1iegZXxbUq1CFfu6Vlg
+ scenes-app-ai-observability-trace-view-thread-bubble--assistant-selectable--dark:
+ hash: v1.k794b7964.9f5c88f0d06074c53c675d7f32489cb9fb51729ffee9b62ae5ad294a3b522f42.60dQKy4pXFeAbwC7Aj2iQlP9seQHpA8mBfOLCUaFVCc
+ scenes-app-ai-observability-trace-view-thread-bubble--assistant-selectable--light:
+ hash: v1.k794b7964.a7c547a1c48e311f1cf64ced49b4ea3025ff93d94bd63cab52ad2244481dbd74.79wz-B7pI2avOapkn-qckimbwZ6M0vtkhg8A1U7XMIw
+ scenes-app-ai-observability-trace-view-thread-bubble--internal-tool-call--dark:
+ hash: v1.k794b7964.32e9b428121d4f8c80488d784a95bbd87452e214b3b8808ceae6a1fda4cd6f13.cLM8_cIi_nkyS6s5yohky7klFDbJ3QczUEOQYM7dlmA
+ scenes-app-ai-observability-trace-view-thread-bubble--internal-tool-call--light:
+ hash: v1.k794b7964.fddcc2353f5dc6078ec04c47cb21f2057bef8353af6debbe179ed1e15a043f8c.vq-uiOjHY4HIyDU1E3k1rNFIhUb92YBe8vt4jHs6lNY
+ scenes-app-ai-observability-trace-view-thread-bubble--user--dark:
+ hash: v1.k794b7964.83049135b36c7c60b327513dd970b891a15d630015793f09249af6b7ee1c986d.GrIDy7IWCkKLQlJvpkXlAH88GMaRd1do31KkJYgPulc
+ scenes-app-ai-observability-trace-view-thread-bubble--user--light:
+ hash: v1.k794b7964.dd15cd15404960e41da1858c221014fdbb5794c0aaaeed26fdef452f29d9d1b4.TLy_nshagl46pCrU4_B9ettsxuh41HD1cYsF_zz5ykQ
+ scenes-app-ai-observability-trace-view-thread-turn--active--dark:
+ hash: v1.k794b7964.e7192baf87f3201541ed7bd8d4778133c2921f84dc70316e344fcc739400b740.ccqL7cWBvIv3JJ7u-YzBj1SINqJK3YeC6HMcNLO-JgM
+ scenes-app-ai-observability-trace-view-thread-turn--active--light:
+ hash: v1.k794b7964.816b6d3e74aa9ce252ef9ce9d50511b20ee25eacba16ba9060490adfa394a062.lhxT3ubdLO1_hwYeIpZuyfFDwjgo5TDiC71xrbI47-A
+ scenes-app-ai-observability-trace-view-thread-turn--default--dark:
+ hash: v1.k794b7964.585779bf793f95487d7c3980fdf9e957177fe5147773d9393284527695fc2066.GXGmk7RfrPTtXVnZjkDy_VoIfYxfH8GYp8OsFv0DNek
+ scenes-app-ai-observability-trace-view-thread-turn--default--light:
+ hash: v1.k794b7964.e879179ae9b2b47eaf580e0ef6fcbbb838f52ade6746031a3f8ed668577fb4e4.xdgurQgA09bERMKo8sGJsDDm2EUwUlEluHFwaTYvPbE
+ scenes-app-ai-observability-trace-view-thread-turn--with-error--dark:
+ hash: v1.k794b7964.909ba48aa0b1f664036a5f22fad341be78fc8c1a058a8117ed2e3c870c18a7c3.foFLxGwVGgGhafMdp8x2w6_GQp8BBEed6O5W5zizT0A
+ scenes-app-ai-observability-trace-view-thread-turn--with-error--light:
+ hash: v1.k794b7964.d5676030474b4b9abadf20b5788257628abdbb126f3f41a84ccba7d938790c65.qaUZ9puKwLwSRbLEoqGeK5MDWRqju8VXMkfMxfRux1g
+ scenes-app-ai-observability-trace-view-trace-header--default--dark:
+ hash: v1.k794b7964.89f74988daa805a5decedf40f47256dc0776cf10499f7927bccec49753e659b8.BAtU5Cxiu3j-JRB9Z_iy032Q7TVs-L0M01FCCizn3n0
+ scenes-app-ai-observability-trace-view-trace-header--default--light:
+ hash: v1.k794b7964.f3720db8274ecdff7dfbd9cf3169b84b0a949c3b4231c009dabd014d116b46e1.lbPNx31DLkeINRl7ge6N1JDf_qtiHu7snOXRZvpMfH8
+ scenes-app-ai-observability-trace-view-trace-header--errored--dark:
+ hash: v1.k794b7964.be74b48b9dd1bc8dc63725b475cc6de8133e6ec3a8e99a26c40e3bb7a1847c9b.KLWPm-WdZjT7u4J7EETQRamQieR3a-RxxMCWo_cl1ps
+ scenes-app-ai-observability-trace-view-trace-header--errored--light:
+ hash: v1.k794b7964.231b1a427d9e84ee1c8d77025a0369227a80ba33006fd72d8066efc86caddcaf.23SGisFFQgEXte1lfQB7ZpNH7WjAvH1CleqGu7hxGXQ
+ scenes-app-ai-observability-trace-view-trace-header--narrow--dark:
+ hash: v1.k794b7964.27a5697d3abcb7ec0beef7c786d7a062d4cad10661f4f2b0a12fd13f18e68ca2.QFyabg8rXByyhb9o4PrGGt4mcRuHOuqEJ9zKTwGNSnE
+ scenes-app-ai-observability-trace-view-trace-header--narrow--light:
+ hash: v1.k794b7964.9fca5efe3c2de8d82b73848a8d53c57cc8beb108f927b4243c83f5e16e6814db.dlDT_i8yO4AuXDskXau5HcG0BzAI_n0LYfiX8aENnIw
+ scenes-app-ai-observability-trace-view-trace-mode-tabs--default--dark:
+ hash: v1.k794b7964.7cf093e59c368f216040a0f9b171d6b057d836cd6b4d7494c80afcd54b572236.zG0PO1xmIJKZL2YNOK6NgCIO7yYwaEwPKBIis66MOYs
+ scenes-app-ai-observability-trace-view-trace-mode-tabs--default--light:
+ hash: v1.k794b7964.abf38a7627d80aa64c4187501a9c6ad8dcc39e0b57402841cbf862df1a41a226.N9uBDDVrhCVpW_R4XVKjwUetTWFX-JKeukwde_hvsHQ
+ scenes-app-ai-observability-trace-view-trace-split-view--narrow--dark:
+ hash: v1.k794b7964.7e4eef01f6f5dca0671db52b44959fdc401a61dec4d72ca3730a7276033c73ee.NS9WNST2qDaBnvQacs6Lnro9dedItLwYX7M40RNgJxo
+ scenes-app-ai-observability-trace-view-trace-split-view--narrow--light:
+ hash: v1.k794b7964.ded5e968a67c4320629b0f901fa730f910f2834c9f40c3d97387292adfcb152b.8FRo3OoaPxQ1APgMEPZHj383PgDDceYhIqgLdw2AVF0
+ scenes-app-ai-observability-trace-view-trace-split-view--wide--dark:
+ hash: v1.k794b7964.de2a820711a2fa54e331418de03479f34a810918428671e748d96ff8ec626e75.FvRGj12dKd9x80dd6eZA-8zSYxEfYY9SjM8U7ppJ7Hg
+ scenes-app-ai-observability-trace-view-trace-split-view--wide--light:
+ hash: v1.k794b7964.10d8fea74a8b8391ed1e4d7032c28ec59dd4c7f563d125c4457e0a6c5fda5760.ZBCF1r2ncQn_YgJwqteofzEm6lLN8TyR6B5AMcCY2PU
+ scenes-app-ai-observability-trace-view-trace-summary-bar--anonymous--dark:
+ hash: v1.k794b7964.22bb158491ce6dc72c586ea7664c6a5d8d1b7f10433f72ca97b12f8e297e8b4f.wNzipnDEZUhFixV4sC1lovXgnQd4aG-IYt5KYv3iCKM
+ scenes-app-ai-observability-trace-view-trace-summary-bar--anonymous--light:
+ hash: v1.k794b7964.e80f4704ffc1df7e945dde873a5e57f6f49bb0ac7e7d675549b9b4c6306a47ba.wGCbLulW5M_YgqIRH-Jgd1WZEiMHNuYwyFC3LwX9JTI
+ scenes-app-ai-observability-trace-view-trace-summary-bar--default--dark:
+ hash: v1.k794b7964.2a753f268cb807139d05c4ec6b25ce3d678dae17080c1ca58f77bf016f870f70.3EutJBqsRbeiZ9AWjbwglU4vKNXtBgStUuBvTbYAgQ8
+ scenes-app-ai-observability-trace-view-trace-summary-bar--default--light:
+ hash: v1.k794b7964.724f2543cbf912bb1bef760ec8e32c4830192c4d808089a45e8dfb1ff64a7d63.uYJH8qmuUKeJW-DIp4BjSoyjFnRGPF_wmUNOX3LrtyM
+ scenes-app-ai-observability-trace-view-trace-summary-bar--long-slug-id--dark:
+ hash: v1.k794b7964.8ee748c67476ca6b7e0deca741ec6caf86c92caed3749030d71a7c0c68df9bc7.9Cy9mFwSXUC-HnW9ZufjJ7NIXhfKmWcvVj7dfUg8zv8
+ scenes-app-ai-observability-trace-view-trace-summary-bar--long-slug-id--light:
+ hash: v1.k794b7964.91510acc263da4572cdd54a1072d89d308d9d12f3a689353abcbef13bdf452ca.pBf3neAQB4BRTb9-4IRDujW7q1F_GF-pTHV3UHv9PnQ
+ scenes-app-ai-observability-trace-view-trace-summary-bar--narrow--dark:
+ hash: v1.k794b7964.daebccd14686a4ffa02937c8621dc74845153b053e2c5581ac18055fc85c2011.Jwh3UjTBshXuWKYsYsjgLLcwNkROjdAxPLk5xY7oQys
+ scenes-app-ai-observability-trace-view-trace-summary-bar--narrow--light:
+ hash: v1.k794b7964.89c5f822021e4c9c6581b1867d29be28fa87cf638297617fe1dd9f46c87310df.mx9UHOPdDLvPVcF_QQQRTgNGytxi_bTrB_AJBimtWjQ
+ scenes-app-ai-observability-trace-view-trace-summary-bar--short-id--dark:
+ hash: v1.k794b7964.b0dd60321acfc66eff4b4fe61c0123016d6ef51e83d18e1a33989d71056cf4c4.rhGXCqb0ZHRrzjcvMjSYO0_vKIrG0vZRA9yacMU9g4A
+ scenes-app-ai-observability-trace-view-trace-summary-bar--short-id--light:
+ hash: v1.k794b7964.bbfc40a18f0a11428e95c34e2783676e785e9e7730f88d7efb397ad11b954fad.A7axwdw43M17lj8qq6VSnmn7SyIXVP2oOIQzdvKA9m8
+ scenes-app-ai-observability-trace-view-trace-timeline--agent-run--dark:
+ hash: v1.k794b7964.96ceaef4cd703d36753e7b6071612547f6854073f804a52b50d9c7c6fd6d5718.i6JAjAgngbls2Ro2Z9eLdkQwjEiXw1Zt2Fnz32p1wVs
+ scenes-app-ai-observability-trace-view-trace-timeline--agent-run--light:
+ hash: v1.k794b7964.470a0ec1335995a1c7eb6f4c985150740281868a5228b17cf2fed2b6e17235e2.VTOvXh6XaTSLF9z1Trz8XWvAO2NISSZnFRpbCQoM7Uc
+ scenes-app-ai-observability-trace-view-trace-timeline--default--dark:
+ hash: v1.k794b7964.c6f8c8a7554f03a05f92be850452d2395135b8f62e5c4313f03af13c9d93c3ae.ZaBym0KGgKl37RISSxGCB-pj0LRY-ODAn8kxUYfvKw4
+ scenes-app-ai-observability-trace-view-trace-timeline--default--light:
+ hash: v1.k794b7964.5414bfc3cba3c5fa47a90490947e734af5675b2cfc18fc689a7de6a1b0a8c179.FaVXK2tCqJ__JcD1pf4-fiJR1C_P0qrqI8sYSNwatpo
+ scenes-app-ai-observability-trace-view-trace-timeline--empty--dark:
+ hash: v1.k794b7964.63c8a2e1b86059b45cd000b61e24cd19765f33c868c876f95d108977244318b6.93yZAlo2gWoPX3oymnpDwF4CkZbfjD6e9RXRwKVPGw4
+ scenes-app-ai-observability-trace-view-trace-timeline--empty--light:
+ hash: v1.k794b7964.e46415049a1dceedad2134490b9da3c9d3628884511ad955ade031bdd949ddd4.lg18T6qpfcvHwEZdg1OKoXJKNAH3Uot3XsHGL6KjP0k
+ scenes-app-ai-observability-trace-view-trace-timeline--failed-steps--dark:
+ hash: v1.k794b7964.c72bc27ea4e569cbdacd516c8332760fbfaf4049d06c89c0e61a72340fe1a21c.SyEhbDwuuh2b2ngrjH06Uhn9Ak5Rtc5HXrUeCQS-MJ8
+ scenes-app-ai-observability-trace-view-trace-timeline--failed-steps--light:
+ hash: v1.k794b7964.0410559691b3532af6b1b83f689171d905738ee631df7d80aea5dd56c8a498c5.8yJ3PrO3tdFo77AzUf7zjS9fc-omKESsc4yemFMM0SY
+ scenes-app-ai-observability-trace-view-trace-timeline--long-session--dark:
+ hash: v1.k794b7964.873826b369bedb5af131b48feaee9f9cca6a60b1f72ee8e337a1ddfa053c8fb6.eBu6k642SJSN3GpjTRAQxzn_q0-r9dLSSMGETuDh-Ho
+ scenes-app-ai-observability-trace-view-trace-timeline--long-session--light:
+ hash: v1.k794b7964.ebace1ba8081833f411fa17819160a4f57476d72ae82d32770607942a530c5c3.NHsTyXaMF_-HDJJrNutT5YCN6Xa9rJG7Hd4de8qrjpQ
+ scenes-app-ai-observability-trace-view-trace-timeline--narrow--dark:
+ hash: v1.k794b7964.0861d56f21c47067545604f6a23c3e932b0169fec1476c27d696562f10a506bf.BrXbchxZ3mFMJsoiFSg8BXBPBnXMXBn2PYk3pD4zsRY
+ scenes-app-ai-observability-trace-view-trace-timeline--narrow--light:
+ hash: v1.k794b7964.a94aafab392e438d8a5fe14492641f1832758a60b8917d955ec9c93be703dd90.h6FnRlCxIWdusfVKk9XQ1pyL3APpucySd106nSaQrtw
+ scenes-app-ai-observability-trace-view-trace-timeline--unknown-latency--dark:
+ hash: v1.k794b7964.7730a2b3770b10e409eef4c6a86610831683b14aa08145997147ca2cb6bf0795.0qxynAXIKe7WjkMoQNTZwDXLKbHrJVIjIh3ZwzaOPew
+ scenes-app-ai-observability-trace-view-trace-timeline--unknown-latency--light:
+ hash: v1.k794b7964.5647196090ec187214388c33b9a880a56038e4817bddb4cb216126f20e84b578.J4-wMZdmCzadsiUDl5ir54BgY-gcV4R09j2A6YoDwT8
+ scenes-app-ai-observability-trace-view-trace-tree--deep-agent-tree--dark:
+ hash: v1.k794b7964.53e1d8f04927c1fd17a2d63017f8ff66c9c5a43c2ac13385dd24d44e3baa21dc.8oaBpscoUfIlPXZul7-mdIF_Ho3VmTK_sbeomLUaRSs
+ scenes-app-ai-observability-trace-view-trace-tree--deep-agent-tree--light:
+ hash: v1.k794b7964.2c4cddaf2938441fce39f3a0e77dd8844a250987f32eadeca460e52d389c08ca.bV2qcNxh9T_8I_u5G2mLsWTU--M6IzqFyW-Am6a9Xqg
+ scenes-app-ai-observability-trace-view-trace-tree--default--dark:
+ hash: v1.k794b7964.d4ebe2948b81461147ab163ca53a3c326f6c12ac6c473be30b6a51c5aecb01ed.Ldn_qgsAmkrcEQVwMxEbLqt4cWLfHf1iYK7g_oMcx9I
+ scenes-app-ai-observability-trace-view-trace-tree--default--light:
+ hash: v1.k794b7964.50df951391cd6bc0f5e4d9ca4eb028179ba09dd46e5729e03443e7ec7baf872c.WFbswKjNOigpwGXQma_cKnIou_eOFIAYteZk3dEODWc
+ scenes-app-ai-observability-trace-view-trace-tree--with-error--dark:
+ hash: v1.k794b7964.49bcf33ea7d9485de1491f2f394942fe8c2b3f3c60c38b02830559f9babe9b25.O3kcgj4f_nTEYVTQz21xh7LEWUGCsIg3GX6ZOns1J3c
+ scenes-app-ai-observability-trace-view-trace-tree--with-error--light:
+ hash: v1.k794b7964.af1fd17ae2d695333f26c996659da787d7d05f8a26f8f21f4c0fa0bf607c2ca7.mHloh6BTqqEpkyzpfRwQzVsQR7uc1tcUIGWRhDDujZs
+ scenes-app-ai-observability-trace-view-trace-view--error-trace--dark:
+ hash: v1.k794b7964.599c9445609ed72cf749ae7528396a1311f0e2521b7e0ed0e426ddc9fc03c38e.wUYbcoLv-KCwJ9NoJJrBxE6sV_Fc_4IIpFGHrEboKqw
+ scenes-app-ai-observability-trace-view-trace-view--error-trace--light:
+ hash: v1.k794b7964.a8da7581409840f7f4368331b0a911e731e52c12fb934c5e1543ae961122ed46.YID83KnbvF5cCoIbYi1NorMl3faoHi_kY0xBFWIisPU
+ scenes-app-ai-observability-trace-view-trace-view--generation-selected--dark:
+ hash: v1.k794b7964.7989c9e77bd8136fb9b1bfce2872dbb0b78b9c4526c2c510ed14f0c6b4e59739.PNe_2hniIB34Cw36gqucK4sxQo-4sPpMSECQCuvg_jA
+ scenes-app-ai-observability-trace-view-trace-view--generation-selected--light:
+ hash: v1.k794b7964.8da284aa3fd303a7f99554b18ed2a7e20481e9d4efcfc7ce714ace0ba65295dc.8w5YNLKTmiDU3Sk0zwmlJj9Bkx1A92iwtf48Ivz6r3U
+ scenes-app-ai-observability-trace-view-trace-view--load-error--dark:
+ hash: v1.k794b7964.c4e963947f61276470d35e280b1b69130365cde0f3153efba7bfbab805e496de.B2FhLvOWBsI-x3axjIDbfrTFGaYKLtFR32l7sn4SCfI
+ scenes-app-ai-observability-trace-view-trace-view--load-error--light:
+ hash: v1.k794b7964.cec7d2df892ecaa2cbab4184709163677ecace52f174fca25c9f5a56ebdc4397.nfzU7nBUjwhYY1aS3LMVla9Glv9K7hZ_kAoBPd287i8
+ scenes-app-ai-observability-trace-view-trace-view--loading--dark:
+ hash: v1.k794b7964.c910f2eba675b4f2eb5043ba351f102249db88619bec5e8012a7272e8688d7f0.L_OrPnP5gqpkCvI0E0_m8LMdbHR_FV1gMUU6LxDuDwY
+ scenes-app-ai-observability-trace-view-trace-view--loading--light:
+ hash: v1.k794b7964.1f54d609e54318c9e0f9f1899ee8ca7bf4b0a15097de855b21c6d27806fb0025.gnPyfTsQdjTlj7UtrOYn-fH_b-Z--AipIH1rgB9In_0
+ scenes-app-ai-observability-trace-view-trace-view--narrow--dark:
+ hash: v1.k794b7964.ddf70f48e257a7d7f6f33b72ed6c8939e860111ccd64b648feed1a4440b2a0f4.6nVI3nDwnmKLDGmdcQzpbpfsGIjJ7xMOVtRpWNzsxbU
+ scenes-app-ai-observability-trace-view-trace-view--narrow--light:
+ hash: v1.k794b7964.ebcb2b8dcfdf1792faa0f278a50789b38ce6d99ce369382a1dd5708010054268.1xy2zptkIPtDJxpuzh9tedKxmUE1AV6lsy30RtSon1k
+ scenes-app-ai-observability-trace-view-trace-view--sample-anthropic-thinking-tool-use--dark:
+ hash: v1.k794b7964.3cbdff3426f3edcae67c7b64ceeefc0474e8f0b387dc1df11e74210699e10b44.MMJUyQiF4E9QeDIwor3PcTmupz4n8OqGR-FHHuic5V0
+ scenes-app-ai-observability-trace-view-trace-view--sample-anthropic-thinking-tool-use--light:
+ hash: v1.k794b7964.590a6eaff8315f61e7014dec10e6b76ad62e2276bd6b192a62752c9df92f38e7.Tx9-RxKj-RoPdf-KYfQQSu1g-oVRmwL8cLuk6C3jmLs
+ scenes-app-ai-observability-trace-view-trace-view--sample-claude-code-session--dark:
+ hash: v1.k794b7964.8f2db49aff986042a4ce7e93a0d8af45438f8895c11750b832e4aab9b88b0f1f.kd3dJJiOAhDc9_UyGSPZQ9NtePjGHi6sntFdU8Dgjpo
+ scenes-app-ai-observability-trace-view-trace-view--sample-claude-code-session--light:
+ hash: v1.k794b7964.918b029246c131d679792d600443866bea3a84d4ccf54b7436e171a891fdeae6.wOV-R0JOaigQwD5JZGj9LrWZ0WgmoPAtgMp7Pkd2J5M
+ scenes-app-ai-observability-trace-view-trace-view--sample-lang-chain-image-error--dark:
+ hash: v1.k794b7964.3d1f6c313a8f35a17bef5c0c1e6835e86ee2231a2653134c39778c8d288f5db3.nnh4BgR42aNDqtcIhGB9G1oD30coKun5HTU-wfVjznk
+ scenes-app-ai-observability-trace-view-trace-view--sample-lang-chain-image-error--light:
+ hash: v1.k794b7964.237023c556967dacce06dca0afc49697ff4dbd6afccc1248366feca2c21cc6cd.Bh4R1giQ-5gRwsPQUrV1kOO2ljZTLaIl80NMNSSwIzo
+ scenes-app-ai-observability-trace-view-trace-view--sample-open-ai-agents-with-evals--dark:
+ hash: v1.k794b7964.299785b9e5f10b28be2bccaf56e673a6f112f2d51dcdd4318afca90518dc5f4c.SFBeWI-nmkNEi2JGsCl6kG8y2e-ahRSo6FvJfdkPlf0
+ scenes-app-ai-observability-trace-view-trace-view--sample-open-ai-agents-with-evals--light:
+ hash: v1.k794b7964.3357a3f15e82121ea28ee6bc90a3d0ffc6fd8807cfdd2e77329fc475eacae149.pRZlmnw9ls3z0dR2Ri4OLeLLUNKLE7pURFRi7cWKu98
+ scenes-app-ai-observability-trace-view-trace-view--span-selected--dark:
+ hash: v1.k794b7964.a627385c064141e6dcc1c4982b480253e078f86dadf70ed946b2053e6582eb3e.LqyOLP_eIAZNH0bQ6WAyzn-RWqWFqzv2HOutDpa8ziI
+ scenes-app-ai-observability-trace-view-trace-view--span-selected--light:
+ hash: v1.k794b7964.4ea31459d2d9e900d92ddbd3e9da8ae1b5f3ea0628d11164c83f7bcd888a7f56.e2V0WEspClwP7l0Culkfh-XzRnZxsEDxs2BOuVfvxjI
+ scenes-app-ai-observability-trace-view-trace-view--thread-mode--dark:
+ hash: v1.k794b7964.0acba892f985205101410c7bb58d2456a042d725f0f9502ab56ddc089523b136.uZVgX0z8V5BNDPDqFzrkKq74B_KYx6RK4vk-qAYkExw
+ scenes-app-ai-observability-trace-view-trace-view--thread-mode--light:
+ hash: v1.k794b7964.d6ff099b8cea000fa7e023a88144ab469da1c25db023ea5109a3891e4e4057d2._lPiHxUc9NbaPT_2V4hII9vj7InrIT8M83NHjTXEC2M
+ scenes-app-ai-observability-trace-view-trace-view--timeline-mode--dark:
+ hash: v1.k794b7964.70302b15caaea759a5d9db2ae961f99b0ad7213e975e226aee93c0c359315510.zf3TUMVc-R1rm5IyKav2tNPs54xcTB98Dvm2mGeWEjw
+ scenes-app-ai-observability-trace-view-trace-view--timeline-mode--light:
+ hash: v1.k794b7964.efb8b37e950b518d97cd742ef44b75d249ac94d327c5a2965d4a7697ec60c01e._j6psG-8_2R2QiOtYdPV4doYlMJNoP5LsmxS5A7OCFw
scenes-app-aigateway--empty--dark:
hash: v1.k794b7964.a79751753cae893fcc58a4c977084260de54c1cedfbaf95e007c24e17b349bc0.P3gRNI2aaymd2jiM8kkbBUuRCvPxY4EGX66u3hdLODw
scenes-app-aigateway--empty--light:
diff --git a/products/ai_observability/frontend/redesign/trace/components/AttachmentChip.tsx b/products/ai_observability/frontend/redesign/trace/components/AttachmentChip.tsx
new file mode 100644
index 000000000000..902116c4dea6
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/AttachmentChip.tsx
@@ -0,0 +1,33 @@
+import { IconDocument } from '@posthog/icons'
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { AttachmentLink } from './AttachmentLink'
+import { classifyAttachmentUrl } from './attachmentUrl'
+
+export interface AttachmentChipProps {
+ label: string
+ url: string | null
+}
+
+export function AttachmentChip({ label, url }: AttachmentChipProps): JSX.Element {
+ const chip = (
+ <LemonTag icon={<IconDocument />} className="self-start">
+ {label}
+ </LemonTag>
+ )
+ if (!url) {
+ return chip
+ }
+ return (
+ <AttachmentLink
+ url={url}
+ urlKind={classifyAttachmentUrl(url)}
+ downloadName={label}
+ linkDataAttr="trace-view-attachment-link"
+ downloadDataAttr="trace-view-attachment-download"
+ className="self-start"
+ >
+ {chip}
+ </AttachmentLink>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/AttachmentImage.tsx b/products/ai_observability/frontend/redesign/trace/components/AttachmentImage.tsx
new file mode 100644
index 000000000000..2ad17a79294b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/AttachmentImage.tsx
@@ -0,0 +1,28 @@
+import { AttachmentLink } from './AttachmentLink'
+import { classifyAttachmentUrl } from './attachmentUrl'
+
+export interface AttachmentImageProps {
+ url: string
+ alt: string
+}
+
+export function AttachmentImage({ url, alt }: AttachmentImageProps): JSX.Element {
+ const image = (
+ <img src={url} alt={alt} className="block max-h-48 max-w-full rounded border border-primary object-contain" />
+ )
+ const urlKind = classifyAttachmentUrl(url)
+ if (urlKind === null) {
+ return image
+ }
+ return (
+ <AttachmentLink
+ url={url}
+ urlKind={urlKind}
+ downloadName={alt}
+ linkDataAttr="trace-view-attachment-image-link"
+ downloadDataAttr="trace-view-attachment-image-download"
+ >
+ {image}
+ </AttachmentLink>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/AttachmentLink.tsx b/products/ai_observability/frontend/redesign/trace/components/AttachmentLink.tsx
new file mode 100644
index 000000000000..06f0e86946af
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/AttachmentLink.tsx
@@ -0,0 +1,46 @@
+import { Link } from '@posthog/lemon-ui'
+
+import { AttachmentUrlKind } from './attachmentUrl'
+
+export interface AttachmentLinkProps {
+ url: string
+ urlKind: AttachmentUrlKind
+ downloadName: string
+ linkDataAttr: string
+ downloadDataAttr: string
+ className?: string
+ children: React.ReactNode
+}
+
+export function AttachmentLink({
+ url,
+ urlKind,
+ downloadName,
+ linkDataAttr,
+ downloadDataAttr,
+ className,
+ children,
+}: AttachmentLinkProps): JSX.Element {
+ if (urlKind === 'external' || urlKind === 'sameOrigin') {
+ return (
+ <Link
+ to={url}
+ target="_blank"
+ disableClientSideRouting={urlKind === 'sameOrigin'}
+ className={className}
+ data-attr={linkDataAttr}
+ >
+ {children}
+ </Link>
+ )
+ }
+ if (urlKind === 'data') {
+ return (
+ // eslint-disable-next-line react/forbid-elements
+ <a href={url} download={downloadName} className={className} data-attr={downloadDataAttr}>
+ {children}
+ </a>
+ )
+ }
+ return <>{children}</>
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/AttachmentPart.tsx b/products/ai_observability/frontend/redesign/trace/components/AttachmentPart.tsx
new file mode 100644
index 000000000000..6dd8847d2d2f
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/AttachmentPart.tsx
@@ -0,0 +1,42 @@
+import { AttachmentMediaType } from '../types'
+import { AttachmentChip } from './AttachmentChip'
+import { AttachmentImage } from './AttachmentImage'
+import { classifyAttachmentUrl } from './attachmentUrl'
+
+export interface AttachmentPartProps {
+ mediaType: AttachmentMediaType
+ name: string | null
+ mimeType: string | null
+ url: string | null
+}
+
+export function AttachmentPart({ mediaType, name, mimeType, url }: AttachmentPartProps): JSX.Element {
+ if (url === null) {
+ return <AttachmentChip label={name ?? mimeType ?? mediaType} url={null} />
+ }
+ const isMediaPlayer = mediaType === 'audio' || mediaType === 'video'
+ const urlKind = classifyAttachmentUrl(url)
+ const canPlayInline = urlKind === 'data' || urlKind === 'sameOrigin'
+ // The CSP's media-src blocks external audio/video, so those fall back to a chip.
+ if (urlKind === null || mediaType === 'file' || (isMediaPlayer && !canPlayInline)) {
+ return <AttachmentChip label={name ?? mimeType ?? mediaType} url={url} />
+ }
+ const caption = [name, mimeType].filter((value): value is string => value !== null).join(' · ')
+ return (
+ <figure className="m-0 flex max-w-full flex-col items-start gap-1">
+ {mediaType === 'image' ? (
+ <AttachmentImage url={url} alt={name ?? 'Attached image'} />
+ ) : mediaType === 'audio' ? (
+ <audio controls src={url} className="max-w-full" aria-label={caption || mediaType} />
+ ) : (
+ <video
+ controls
+ src={url}
+ className="max-h-48 max-w-full rounded border border-primary"
+ aria-label={caption || mediaType}
+ />
+ )}
+ {caption ? <figcaption className="break-all text-xs text-secondary">{caption}</figcaption> : null}
+ </figure>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.stories.tsx
new file mode 100644
index 000000000000..fa229b20c5af
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.stories.tsx
@@ -0,0 +1,13 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { ErrorCallout } from './ErrorCallout'
+
+const meta: Meta<typeof ErrorCallout> = {
+ title: 'Scenes-App/AI observability/Trace view/Error callout',
+ component: ErrorCallout,
+}
+export default meta
+
+export const Default: StoryObj<typeof ErrorCallout> = {
+ args: { message: 'RateLimitError: 429 Too Many Requests, retry after 12s' },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.tsx b/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.tsx
new file mode 100644
index 000000000000..6ec3886cfc79
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ErrorCallout.tsx
@@ -0,0 +1,13 @@
+import { LemonBanner } from '@posthog/lemon-ui'
+
+export interface ErrorCalloutProps {
+ message: string
+}
+
+export function ErrorCallout({ message }: ErrorCalloutProps): JSX.Element {
+ return (
+ <LemonBanner type="error">
+ <span className="font-mono text-sm whitespace-pre-wrap break-words">{message}</span>
+ </LemonBanner>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/EvalOutcomeTag.tsx b/products/ai_observability/frontend/redesign/trace/components/EvalOutcomeTag.tsx
new file mode 100644
index 000000000000..7a54425a7fa5
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/EvalOutcomeTag.tsx
@@ -0,0 +1,27 @@
+import { IconCheck, IconClock, IconMinus, IconWarning, IconX } from '@posthog/icons'
+import { LemonTag, LemonTagType } from '@posthog/lemon-ui'
+
+import { EvalOutcome } from '../types'
+
+const OUTCOME_STYLES: Record<EvalOutcome, { type: LemonTagType; icon: JSX.Element | undefined }> = {
+ pass: { type: 'success', icon: <IconCheck /> },
+ fail: { type: 'danger', icon: <IconX /> },
+ error: { type: 'danger', icon: <IconWarning /> },
+ pending: { type: 'default', icon: <IconClock /> },
+ inconclusive: { type: 'muted', icon: <IconMinus /> },
+ unrated: { type: 'default', icon: undefined },
+}
+
+export interface EvalOutcomeTagProps {
+ outcome: EvalOutcome
+ label: string
+}
+
+export function EvalOutcomeTag({ outcome, label }: EvalOutcomeTagProps): JSX.Element {
+ const { type, icon } = OUTCOME_STYLES[outcome]
+ return (
+ <LemonTag type={type} icon={icon} size="small" className="max-w-full" title={label}>
+ <span className="truncate">{label}</span>
+ </LemonTag>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/EvalResultList.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/EvalResultList.stories.tsx
new file mode 100644
index 000000000000..c930fd7a3f3a
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/EvalResultList.stories.tsx
@@ -0,0 +1,31 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { openaiAgentsEvals } from '../sampleFixtures/openaiAgentsWithEvals'
+import { FIXTURE_EVALS, FIXTURE_TRACE_EVALS, withWidth } from '../storyFixtures'
+import { EvalResultList } from './EvalResultList'
+
+const meta: Meta<typeof EvalResultList> = {
+ title: 'Scenes-App/AI observability/Trace view/Eval results',
+ component: EvalResultList,
+ args: { onSelectNode: () => {} },
+}
+export default meta
+
+type Story = StoryObj<typeof EvalResultList>
+
+export const Results: Story = { args: { evals: { status: 'ready', results: FIXTURE_EVALS } } }
+export const WithTargets: Story = { args: { evals: { status: 'ready', results: FIXTURE_TRACE_EVALS } } }
+export const Narrow: Story = {
+ args: { evals: { status: 'ready', results: FIXTURE_TRACE_EVALS } },
+ decorators: [withWidth(420)],
+}
+export const AgentEvals: Story = { args: { evals: { status: 'ready', results: openaiAgentsEvals } } }
+export const Loading: Story = {
+ args: { evals: { status: 'loading' } },
+ decorators: [withWidth(720)],
+ parameters: { testOptions: { waitForLoadersToDisappear: false } },
+}
+export const Empty: Story = { args: { evals: { status: 'ready', results: [] } } }
+export const LoadError: Story = {
+ args: { evals: { status: 'error', errorMessage: 'Evaluation results could not be loaded. Try again later.' } },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/EvalResultList.tsx b/products/ai_observability/frontend/redesign/trace/components/EvalResultList.tsx
new file mode 100644
index 000000000000..63ccc992f6be
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/EvalResultList.tsx
@@ -0,0 +1,29 @@
+import { LemonSkeleton } from '@posthog/lemon-ui'
+
+import { EvalsState } from '../types'
+import { ErrorCallout } from './ErrorCallout'
+import { EvalResultRow } from './EvalResultRow'
+
+export interface EvalResultListProps {
+ evals: EvalsState
+ onSelectNode: (nodeId: string) => void
+}
+
+export function EvalResultList({ evals, onSelectNode }: EvalResultListProps): JSX.Element {
+ if (evals.status === 'loading') {
+ return <LemonSkeleton repeat={3} className="h-8" />
+ }
+ if (evals.status === 'error') {
+ return <ErrorCallout message={evals.errorMessage} />
+ }
+ if (evals.results.length === 0) {
+ return <p className="m-0 text-secondary">No evaluations ran on this step.</p>
+ }
+ return (
+ <ul className="m-0 list-none divide-y divide-primary rounded border border-primary bg-surface-primary p-0">
+ {evals.results.map((result) => (
+ <EvalResultRow key={result.id} result={result} onSelectNode={onSelectNode} />
+ ))}
+ </ul>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/EvalResultRow.tsx b/products/ai_observability/frontend/redesign/trace/components/EvalResultRow.tsx
new file mode 100644
index 000000000000..5f5c586edb9a
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/EvalResultRow.tsx
@@ -0,0 +1,53 @@
+import { LemonTag, Link } from '@posthog/lemon-ui'
+
+import { TZLabel } from 'lib/components/TZLabel'
+
+import { EvalResult } from '../types'
+import { EvalOutcomeTag } from './EvalOutcomeTag'
+
+export interface EvalResultRowProps {
+ result: EvalResult
+ onSelectNode: (nodeId: string) => void
+}
+
+export function EvalResultRow({ result, onSelectNode }: EvalResultRowProps): JSX.Element {
+ const { target } = result
+ return (
+ <li className="flex flex-col gap-1 px-3 py-2">
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-1">
+ {result.href ? (
+ <Link
+ to={result.href}
+ className="font-semibold text-sm"
+ data-attr="trace-view-eval-link"
+ targetBlankIcon={false}
+ >
+ {result.name}
+ </Link>
+ ) : (
+ <span className="font-semibold text-sm">{result.name}</span>
+ )}
+ <EvalOutcomeTag outcome={result.outcome} label={result.label} />
+ {result.isBackfill ? (
+ <LemonTag type="muted" size="small" title="A backfill over past data produced this result.">
+ Backfill
+ </LemonTag>
+ ) : null}
+ <span className="ml-auto flex items-center gap-2 text-xs text-secondary">
+ {target ? (
+ <Link
+ onClick={() => onSelectNode(target.nodeId)}
+ className="max-w-60 truncate font-mono"
+ title={`Show ${target.label}`}
+ data-attr="trace-view-eval-target"
+ >
+ {target.label}
+ </Link>
+ ) : null}
+ <TZLabel time={result.timestamp} timestampStyle="absolute" formatDate="MMM D," formatTime="HH:mm" />
+ </span>
+ </div>
+ {result.reasoning ? <p className="m-0 text-secondary text-xs">{result.reasoning}</p> : null}
+ </li>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/IOPanel.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/IOPanel.stories.tsx
new file mode 100644
index 000000000000..64f35a335b86
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/IOPanel.stories.tsx
@@ -0,0 +1,21 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { withWidth } from '../storyFixtures'
+import { IOPanel } from './IOPanel'
+
+const meta: Meta<typeof IOPanel> = {
+ title: 'Scenes-App/AI observability/Trace view/Input and output',
+ component: IOPanel,
+}
+export default meta
+
+type Story = StoryObj<typeof IOPanel>
+
+const input = { question: 'Why did my invoice go up this month?', account_id: 'acct_42' }
+const output = { answer: 'Your team added two seats on August 12.', sources: ['help-seats', 'help-proration'] }
+
+export const KeyValues: Story = { args: { input, output } }
+export const PlainText: Story = { args: { input: 'Why did my invoice go up?', output: 'Two seats were added.' } }
+export const NothingCaptured: Story = { args: { input: null, output: undefined } }
+export const EmptyObject: Story = { args: { input: {}, output: 'Two seats were added.' } }
+export const Narrow: Story = { args: { input, output }, decorators: [withWidth(380)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/IOPanel.tsx b/products/ai_observability/frontend/redesign/trace/components/IOPanel.tsx
new file mode 100644
index 000000000000..6150479e7930
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/IOPanel.tsx
@@ -0,0 +1,15 @@
+import { IOSection } from './IOSection'
+
+export interface IOPanelProps {
+ input: unknown
+ output: unknown
+}
+
+export function IOPanel({ input, output }: IOPanelProps): JSX.Element {
+ return (
+ <div className="flex flex-col gap-2">
+ <IOSection title="Input" value={input} />
+ <IOSection title="Output" value={output} />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/IOSection.tsx b/products/ai_observability/frontend/redesign/trace/components/IOSection.tsx
new file mode 100644
index 000000000000..0b5fa768f501
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/IOSection.tsx
@@ -0,0 +1,52 @@
+import { useState } from 'react'
+
+import { LemonSegmentedButton } from '@posthog/lemon-ui'
+
+import { isPlainObject, toDisplayText } from './jsonText'
+import { KeyValueTable } from './KeyValueTable'
+
+type IOFormat = 'pretty' | 'json'
+
+export interface IOSectionProps {
+ title: string
+ value: unknown
+}
+
+export function IOSection({ title, value }: IOSectionProps): JSX.Element {
+ const [format, setFormat] = useState<IOFormat>('pretty')
+ const isEmpty =
+ value === null ||
+ value === undefined ||
+ value === '' ||
+ (isPlainObject(value) && Object.keys(value).length === 0)
+
+ return (
+ <section className="rounded border border-primary bg-surface-primary">
+ <header className="flex items-center justify-between gap-2 border-b border-primary px-3 py-1.5">
+ <h4 className="m-0 text-xs font-semibold">{title}</h4>
+ {isPlainObject(value) ? (
+ <LemonSegmentedButton
+ size="xsmall"
+ value={format}
+ onChange={setFormat}
+ options={[
+ { value: 'pretty', label: 'Pretty', 'data-attr': 'trace-view-io-pretty' },
+ { value: 'json', label: 'JSON', 'data-attr': 'trace-view-io-json' },
+ ]}
+ />
+ ) : null}
+ </header>
+ <div className="px-3 py-2">
+ {isEmpty ? (
+ <span className="text-secondary text-sm">Nothing captured.</span>
+ ) : isPlainObject(value) && format === 'pretty' ? (
+ <KeyValueTable entries={Object.entries(value)} />
+ ) : typeof value === 'string' ? (
+ <p className="m-0 whitespace-pre-wrap break-words text-sm">{value}</p>
+ ) : (
+ <pre className="m-0 max-h-96 overflow-auto text-xs">{toDisplayText(value)}</pre>
+ )}
+ </div>
+ </section>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/KeyValueTable.tsx b/products/ai_observability/frontend/redesign/trace/components/KeyValueTable.tsx
new file mode 100644
index 000000000000..566f6d007ab3
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/KeyValueTable.tsx
@@ -0,0 +1,27 @@
+import { cn } from 'lib/utils/css-classes'
+
+import { toDisplayText } from './jsonText'
+
+export interface KeyValueTableProps {
+ entries: [string, unknown][]
+ className?: string
+}
+
+export function KeyValueTable({ entries, className }: KeyValueTableProps): JSX.Element {
+ return (
+ <dl className={cn('m-0 grid grid-cols-[max-content_1fr] gap-x-6 gap-y-2 text-sm', className)}>
+ {entries.map(([key, value]) => (
+ <div key={key} className="contents">
+ <dt className="font-mono text-xs text-[var(--data-color-1)]">{key}</dt>
+ <dd className="m-0 min-w-0">
+ {typeof value === 'string' ? (
+ <span className="whitespace-pre-wrap break-words">{value}</span>
+ ) : (
+ <pre className="m-0 overflow-auto text-xs">{toDisplayText(value)}</pre>
+ )}
+ </dd>
+ </div>
+ ))}
+ </dl>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageBlock.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageBlock.stories.tsx
new file mode 100644
index 000000000000..90cfd53d392b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageBlock.stories.tsx
@@ -0,0 +1,24 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { anthropicThinkingMessages } from '../sampleFixtures/anthropicMessagesThinkingToolUse'
+import { FIXTURE_GENERATION_MESSAGES } from '../storyFixtures'
+import { MessageBlock } from './MessageBlock'
+
+const meta: Meta<typeof MessageBlock> = {
+ title: 'Scenes-App/AI observability/Trace view/Message block',
+ component: MessageBlock,
+ args: { defaultOpen: true },
+}
+export default meta
+
+export const System: StoryObj<typeof MessageBlock> = { args: { message: FIXTURE_GENERATION_MESSAGES[0] } }
+export const ToolCall: StoryObj<typeof MessageBlock> = { args: { message: FIXTURE_GENERATION_MESSAGES[2] } }
+export const User: StoryObj<typeof MessageBlock> = { args: { message: FIXTURE_GENERATION_MESSAGES[1] } }
+export const Assistant: StoryObj<typeof MessageBlock> = { args: { message: FIXTURE_GENERATION_MESSAGES[3] } }
+export const Collapsed: StoryObj<typeof MessageBlock> = {
+ args: { message: FIXTURE_GENERATION_MESSAGES[0], defaultOpen: false },
+}
+export const CollapsedWithoutText: StoryObj<typeof MessageBlock> = {
+ args: { message: FIXTURE_GENERATION_MESSAGES[2], defaultOpen: false },
+}
+export const ThinkingAndToolCall: StoryObj<typeof MessageBlock> = { args: { message: anthropicThinkingMessages[1] } }
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageBlock.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageBlock.tsx
new file mode 100644
index 000000000000..0f71cf21f133
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageBlock.tsx
@@ -0,0 +1,63 @@
+import { useState } from 'react'
+
+import { IconChevronRight } from '@posthog/icons'
+
+import { cn } from 'lib/utils/css-classes'
+
+import { MessageRole, ThreadMessage } from '../types'
+import { MessagePartView } from './MessagePartView'
+
+const ROLE_COLORS: Record<MessageRole, string> = {
+ system: 'text-warning',
+ user: 'text-[var(--color-blue-700)] dark:text-[var(--color-blue-300)]',
+ assistant: 'text-[var(--data-color-14)]',
+ tool: 'text-secondary',
+}
+
+function previewText(message: ThreadMessage): string | null {
+ for (const part of message.parts) {
+ if (part.kind === 'text') {
+ return part.text
+ }
+ }
+ return null
+}
+
+export interface MessageBlockProps {
+ message: ThreadMessage
+ defaultOpen: boolean
+}
+
+export function MessageBlock({ message, defaultOpen }: MessageBlockProps): JSX.Element {
+ const [isOpen, setIsOpen] = useState(defaultOpen)
+ const preview = isOpen ? null : previewText(message)
+
+ return (
+ <section className="flex flex-col">
+ <button
+ type="button"
+ aria-expanded={isOpen}
+ onClick={() => setIsOpen(!isOpen)}
+ data-attr="trace-view-message-toggle"
+ className="flex min-w-0 items-center gap-1.5 rounded border border-primary bg-surface-secondary px-2 py-1 text-left hover:bg-fill-button-tertiary-hover"
+ >
+ <IconChevronRight
+ className={cn('shrink-0 text-secondary transition-transform motion-reduce:transition-none', {
+ 'rotate-90': isOpen,
+ })}
+ />
+ <span className={cn('shrink-0 font-mono text-xs font-semibold uppercase', ROLE_COLORS[message.role])}>
+ {message.role}
+ </span>
+ {preview ? <span className="min-w-0 truncate text-xs text-secondary">{preview}</span> : null}
+ </button>
+ {isOpen ? (
+ <div className="flex flex-col gap-2 px-3 py-2 text-sm">
+ {message.parts.map((part, index) => (
+ <MessagePartView key={index} part={part} />
+ ))}
+ </div>
+ ) : null}
+ </section>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageList.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageList.stories.tsx
new file mode 100644
index 000000000000..f5e55eb8b410
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageList.stories.tsx
@@ -0,0 +1,18 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_GENERATION_MESSAGES, withWidth } from '../storyFixtures'
+import { MessageList } from './MessageList'
+
+const meta: Meta<typeof MessageList> = {
+ title: 'Scenes-App/AI observability/Trace view/Message list',
+ component: MessageList,
+ args: { emptyText: 'No input captured.', defaultOpen: 'all' },
+}
+export default meta
+
+type Story = StoryObj<typeof MessageList>
+
+export const Generation: Story = { args: { messages: FIXTURE_GENERATION_MESSAGES } }
+export const LastOpen: Story = { args: { messages: FIXTURE_GENERATION_MESSAGES, defaultOpen: 'last' } }
+export const Empty: Story = { args: { messages: [] } }
+export const Narrow: Story = { args: { messages: FIXTURE_GENERATION_MESSAGES }, decorators: [withWidth(420)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageList.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageList.tsx
new file mode 100644
index 000000000000..673376f1bb69
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageList.tsx
@@ -0,0 +1,27 @@
+import { ThreadMessage } from '../types'
+import { MessageBlock } from './MessageBlock'
+
+export type MessageListDefaultOpen = 'all' | 'last'
+
+export interface MessageListProps {
+ messages: ThreadMessage[]
+ emptyText: string
+ defaultOpen: MessageListDefaultOpen
+}
+
+export function MessageList({ messages, emptyText, defaultOpen }: MessageListProps): JSX.Element {
+ if (messages.length === 0) {
+ return <p className="m-0 text-sm text-secondary">{emptyText}</p>
+ }
+ return (
+ <div className="flex flex-col gap-3">
+ {messages.map((message, index) => (
+ <MessageBlock
+ key={message.id}
+ message={message}
+ defaultOpen={defaultOpen === 'all' || index === messages.length - 1}
+ />
+ ))}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageMarkdown.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageMarkdown.tsx
new file mode 100644
index 000000000000..c46c992c2d8b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageMarkdown.tsx
@@ -0,0 +1,22 @@
+import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
+import { cn } from 'lib/utils/css-classes'
+
+export interface MessageMarkdownProps {
+ text: string
+ className?: string
+}
+
+export function MessageMarkdown({ text, className }: MessageMarkdownProps): JSX.Element {
+ // Message text comes from models and end users, so it gets LemonMarkdown's untrusted-content settings.
+ return (
+ <LemonMarkdown
+ className={cn('text-sm', className)}
+ lowKeyHeadings
+ disableImages
+ disableMentions
+ disableDocsRedirect
+ >
+ {text}
+ </LemonMarkdown>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessagePartView.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/MessagePartView.stories.tsx
new file mode 100644
index 000000000000..10692d8bf930
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessagePartView.stories.tsx
@@ -0,0 +1,74 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import {
+ FIXTURE_ATTACHMENT_DATA_FILE,
+ FIXTURE_ATTACHMENT_EXTERNAL_AUDIO,
+ FIXTURE_ATTACHMENT_PARTS,
+ FIXTURE_ATTACHMENT_REJECTED_IMAGE_URL,
+ FIXTURE_ATTACHMENT_SAME_ORIGIN_AUDIO,
+} from '../storyFixtures'
+import { MessagePartView } from './MessagePartView'
+
+const meta: Meta<typeof MessagePartView> = {
+ title: 'Scenes-App/AI observability/Trace view/Message part',
+ component: MessagePartView,
+}
+export default meta
+
+type Story = StoryObj<typeof MessagePartView>
+
+export const Text: Story = { args: { part: { kind: 'text', text: 'Your team went from 4 to 6 seats.' } } }
+export const Markdown: Story = {
+ args: {
+ part: {
+ kind: 'text',
+ text: '## Seat changes\n\n- **Before:** 4 seats\n- **After:** 6 seats\n\nSee `lookup_invoice` for the full breakdown.',
+ },
+ },
+}
+export const Thinking: Story = {
+ args: { part: { kind: 'thinking', text: 'The user asks about invoices, check seats first.' } },
+}
+export const ToolCall: Story = {
+ args: {
+ part: { kind: 'toolCall', name: 'lookup_invoice', args: { month: '2026-08' }, result: { total_usd: 180 } },
+ },
+}
+export const ToolCallMultilineArgs: Story = {
+ args: {
+ part: {
+ kind: 'toolCall',
+ name: 'run_python',
+ args: {
+ language: 'python',
+ code: 'def total(rows):\n return sum(row["amount"] for row in rows)\n\nprint(total(invoice_rows))',
+ timeout_s: 30,
+ },
+ result: { stdout: '180\n', exit_code: 0 },
+ },
+ },
+}
+export const ToolCallError: Story = {
+ args: {
+ part: {
+ kind: 'toolCall',
+ name: 'lookup_invoice',
+ args: { month: '2026-08' },
+ result: 'Timeout',
+ isError: true,
+ },
+ },
+}
+export const Attachments: Story = {
+ render: () => (
+ <div className="flex flex-col gap-4">
+ {FIXTURE_ATTACHMENT_PARTS.map((part, index) => (
+ <MessagePartView key={index} part={part} />
+ ))}
+ </div>
+ ),
+}
+export const ExternalAudioChip: Story = { args: { part: FIXTURE_ATTACHMENT_EXTERNAL_AUDIO } }
+export const SameOriginAudioPlayer: Story = { args: { part: FIXTURE_ATTACHMENT_SAME_ORIGIN_AUDIO } }
+export const DataFileDownload: Story = { args: { part: FIXTURE_ATTACHMENT_DATA_FILE } }
+export const RejectedImageUrlChip: Story = { args: { part: FIXTURE_ATTACHMENT_REJECTED_IMAGE_URL } }
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessagePartView.tsx b/products/ai_observability/frontend/redesign/trace/components/MessagePartView.tsx
new file mode 100644
index 000000000000..b70761da2eae
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessagePartView.tsx
@@ -0,0 +1,24 @@
+import { MessagePart } from '../types'
+import { AttachmentPart } from './AttachmentPart'
+import { MessageMarkdown } from './MessageMarkdown'
+import { ThinkingPart } from './ThinkingPart'
+import { ToolCallPart } from './ToolCallPart'
+
+export interface MessagePartViewProps {
+ part: MessagePart
+}
+
+export function MessagePartView({ part }: MessagePartViewProps): JSX.Element {
+ switch (part.kind) {
+ case 'text':
+ return <MessageMarkdown text={part.text} />
+ case 'thinking':
+ return <ThinkingPart text={part.text} />
+ case 'toolCall':
+ return <ToolCallPart name={part.name} args={part.args} result={part.result} isError={part.isError} />
+ case 'attachment':
+ return (
+ <AttachmentPart mediaType={part.mediaType} name={part.name} mimeType={part.mimeType} url={part.url} />
+ )
+ }
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/MessageSection.tsx b/products/ai_observability/frontend/redesign/trace/components/MessageSection.tsx
new file mode 100644
index 000000000000..ec3f93610589
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/MessageSection.tsx
@@ -0,0 +1,18 @@
+import { ThreadMessage } from '../types'
+import { MessageList, MessageListDefaultOpen } from './MessageList'
+
+export interface MessageSectionProps {
+ title: string
+ messages: ThreadMessage[]
+ emptyText: string
+ defaultOpen: MessageListDefaultOpen
+}
+
+export function MessageSection({ title, messages, emptyText, defaultOpen }: MessageSectionProps): JSX.Element {
+ return (
+ <section className="flex flex-col gap-1.5">
+ <h4 className="m-0 text-xs font-semibold text-secondary">{title}</h4>
+ <MessageList messages={messages} emptyText={emptyText} defaultOpen={defaultOpen} />
+ </section>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeDetail.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeDetail.stories.tsx
new file mode 100644
index 000000000000..af38a59a37bf
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeDetail.stories.tsx
@@ -0,0 +1,92 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { useState } from 'react'
+
+import { langchainCerebrasImageError } from '../sampleFixtures/langchainCerebrasImageError'
+import {
+ FIXTURE_EVALS,
+ FIXTURE_GENERATION_INPUT,
+ FIXTURE_GENERATION_OUTPUT,
+ FIXTURE_GENERATION_PROPERTIES,
+ FIXTURE_SPAN_PROPERTIES,
+ FIXTURE_TREE,
+ withWidth,
+} from '../storyFixtures'
+import { NodeDetailTab } from '../types'
+import { NodeDetail, NodeDetailProps } from './NodeDetail'
+
+const generation = FIXTURE_TREE[0].children[1]
+const span = FIXTURE_TREE[0].children[0]
+
+const base: Omit<NodeDetailProps, 'tab' | 'onTabChange'> = {
+ node: generation,
+ content: { kind: 'messages', input: FIXTURE_GENERATION_INPUT, output: FIXTURE_GENERATION_OUTPUT },
+ error: null,
+ properties: FIXTURE_GENERATION_PROPERTIES,
+ evals: { status: 'ready', results: FIXTURE_EVALS },
+ raw: { event: '$ai_generation', id: 'gen-answer' },
+ onViewInThread: () => {},
+ onSelectNode: () => {},
+}
+
+const failedGeneration = langchainCerebrasImageError.tree[0].children[0].children[0]
+
+function Stateful(props: Omit<NodeDetailProps, 'tab' | 'onTabChange'> & { initialTab?: NodeDetailTab }): JSX.Element {
+ const [tab, setTab] = useState<NodeDetailTab>(props.initialTab ?? 'messages')
+ return <NodeDetail {...props} tab={tab} onTabChange={setTab} />
+}
+
+const meta: Meta<typeof Stateful> = {
+ title: 'Scenes-App/AI observability/Trace view/Node detail',
+ component: Stateful,
+}
+export default meta
+
+type Story = StoryObj<typeof Stateful>
+
+export const Generation: Story = { args: base }
+export const SpanInputOutput: Story = {
+ args: {
+ ...base,
+ node: span,
+ content: { kind: 'io', input: { query: 'invoice went up' }, output: { hits: 3 } },
+ properties: FIXTURE_SPAN_PROPERTIES,
+ onViewInThread: null,
+ },
+}
+export const GenerationDetailsTab: Story = { args: { ...base, initialTab: 'details' } }
+export const SpanDetailsTab: Story = {
+ args: { ...base, node: span, properties: FIXTURE_SPAN_PROPERTIES, onViewInThread: null, initialTab: 'details' },
+}
+export const LoadingContent: Story = {
+ args: { ...base, content: { kind: 'loading' } },
+ parameters: { testOptions: { waitForLoadersToDisappear: false } },
+}
+export const ContentLoadError: Story = {
+ args: { ...base, content: { kind: 'error', message: 'This step could not be loaded. Try again later.' } },
+}
+export const WithError: Story = {
+ args: {
+ ...base,
+ node: { ...generation, hasError: true },
+ error: 'RateLimitError: 429 Too Many Requests',
+ content: { kind: 'messages', input: FIXTURE_GENERATION_INPUT.slice(0, 2), output: [] },
+ },
+}
+export const NothingCaptured: Story = { args: { ...base, content: { kind: 'messages', input: [], output: [] } } }
+export const EvalsTab: Story = { args: { ...base, initialTab: 'evals' } }
+export const EvalsLoadError: Story = {
+ args: {
+ ...base,
+ initialTab: 'evals',
+ evals: { status: 'error', errorMessage: 'Evaluation results could not be loaded. Try again later.' },
+ },
+}
+export const Narrow: Story = { args: base, decorators: [withWidth(520)] }
+export const FailedGenerationWithImage: Story = {
+ args: {
+ ...langchainCerebrasImageError.details[failedGeneration.id],
+ node: failedGeneration,
+ onViewInThread: () => {},
+ onSelectNode: () => {},
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeDetail.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeDetail.tsx
new file mode 100644
index 000000000000..cc9787836ff3
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeDetail.tsx
@@ -0,0 +1,67 @@
+import { LemonTabs } from '@posthog/lemon-ui'
+
+import { EvalsState, NodeContent, NodeDetailTab, NodeProperties, TraceTreeNode } from '../types'
+import { EvalResultList } from './EvalResultList'
+import { NodeDetailHeader } from './NodeDetailHeader'
+import { NodeMessagesTab } from './NodeMessagesTab'
+import { NodePropertyList } from './NodePropertyList'
+import { NodeRawTab } from './NodeRawTab'
+
+export interface NodeDetailProps {
+ node: TraceTreeNode
+ tab: NodeDetailTab
+ onTabChange: (tab: NodeDetailTab) => void
+ content: NodeContent
+ error: string | null
+ properties: NodeProperties
+ evals: EvalsState
+ raw: Record<string, unknown>
+ onViewInThread: (() => void) | null
+ onSelectNode: (nodeId: string) => void
+}
+
+export function NodeDetail(props: NodeDetailProps): JSX.Element {
+ return (
+ <div className="flex min-w-0 flex-col gap-2">
+ <NodeDetailHeader node={props.node} />
+ <LemonTabs<NodeDetailTab>
+ size="small"
+ activeKey={props.tab}
+ onChange={props.onTabChange}
+ data-attr="trace-view-detail-tabs"
+ tabs={[
+ {
+ key: 'messages',
+ label: 'Messages',
+ 'data-attr': 'trace-view-detail-tab-messages',
+ content: (
+ <NodeMessagesTab
+ content={props.content}
+ error={props.error}
+ onViewInThread={props.onViewInThread}
+ />
+ ),
+ },
+ {
+ key: 'details',
+ label: 'Details',
+ 'data-attr': 'trace-view-detail-tab-details',
+ content: <NodePropertyList node={props.node} properties={props.properties} />,
+ },
+ {
+ key: 'evals',
+ label: 'Evals',
+ 'data-attr': 'trace-view-detail-tab-evals',
+ content: <EvalResultList evals={props.evals} onSelectNode={props.onSelectNode} />,
+ },
+ {
+ key: 'raw',
+ label: 'Raw',
+ 'data-attr': 'trace-view-detail-tab-raw',
+ content: <NodeRawTab raw={props.raw} />,
+ },
+ ]}
+ />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeDetailHeader.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeDetailHeader.tsx
new file mode 100644
index 000000000000..9344fdb84f22
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeDetailHeader.tsx
@@ -0,0 +1,29 @@
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { TraceTreeNode } from '../types'
+import { NodeKindGlyph } from './NodeKindGlyph'
+import { NodeStatChips } from './NodeStatChips'
+
+export interface NodeDetailHeaderProps {
+ node: TraceTreeNode
+}
+
+export function NodeDetailHeader({ node }: NodeDetailHeaderProps): JSX.Element {
+ return (
+ <header className="flex flex-col gap-1.5">
+ <div className="flex items-center gap-2 min-w-0">
+ <NodeKindGlyph kind={node.kind} size="medium" />
+ <h3 className="m-0 truncate text-base font-semibold">{node.name}</h3>
+ </div>
+ <div className="flex flex-wrap items-center gap-1">
+ <NodeStatChips stats={node.stats} />
+ {node.model ? (
+ <LemonTag weight="normal" className="font-mono">
+ {node.model}
+ </LemonTag>
+ ) : null}
+ {node.hasError ? <LemonTag type="danger">Error</LemonTag> : null}
+ </div>
+ </header>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.stories.tsx
new file mode 100644
index 000000000000..cd801fd25d24
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.stories.tsx
@@ -0,0 +1,21 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { NodeKindGlyph } from './NodeKindGlyph'
+
+const meta: Meta<typeof NodeKindGlyph> = {
+ title: 'Scenes-App/AI observability/Trace view/Node kind glyph',
+ component: NodeKindGlyph,
+}
+export default meta
+
+export const AllKinds: StoryObj<typeof NodeKindGlyph> = {
+ render: () => (
+ <div className="flex gap-2 items-center">
+ <NodeKindGlyph kind="trace" />
+ <NodeKindGlyph kind="span" />
+ <NodeKindGlyph kind="generation" />
+ <NodeKindGlyph kind="embedding" />
+ <NodeKindGlyph kind="generation" size="medium" />
+ </div>
+ ),
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.tsx
new file mode 100644
index 000000000000..d1a34c73fa66
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeKindGlyph.tsx
@@ -0,0 +1,34 @@
+import { cn } from 'lib/utils/css-classes'
+
+import { TraceNodeKind } from '../types'
+import { NODE_KIND_COLORS } from './nodeKindColors'
+
+const KIND_LABELS: Record<TraceNodeKind, { letter: string; label: string }> = {
+ trace: { letter: 'T', label: 'Trace' },
+ span: { letter: 'S', label: 'Span' },
+ generation: { letter: 'G', label: 'Generation' },
+ embedding: { letter: 'E', label: 'Embedding' },
+}
+
+export interface NodeKindGlyphProps {
+ kind: TraceNodeKind
+ size?: 'small' | 'medium'
+}
+
+export function NodeKindGlyph({ kind, size = 'small' }: NodeKindGlyphProps): JSX.Element {
+ const { letter, label } = KIND_LABELS[kind]
+ return (
+ <span
+ role="img"
+ aria-label={label}
+ title={label}
+ className={cn(
+ 'inline-flex shrink-0 items-center justify-center rounded font-semibold text-white',
+ NODE_KIND_COLORS[kind].glyphBg,
+ size === 'small' ? 'size-4 text-xxs' : 'size-5 text-xs'
+ )}
+ >
+ {letter}
+ </span>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeMessagesTab.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeMessagesTab.tsx
new file mode 100644
index 000000000000..7e8e13a930bd
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeMessagesTab.tsx
@@ -0,0 +1,55 @@
+import { IconMessage } from '@posthog/icons'
+import { LemonButton, LemonSkeleton } from '@posthog/lemon-ui'
+
+import { NodeContent } from '../types'
+import { ErrorCallout } from './ErrorCallout'
+import { IOPanel } from './IOPanel'
+import { MessageSection } from './MessageSection'
+
+export interface NodeMessagesTabProps {
+ content: NodeContent
+ error: string | null
+ onViewInThread: (() => void) | null
+}
+
+export function NodeMessagesTab({ content, error, onViewInThread }: NodeMessagesTabProps): JSX.Element {
+ return (
+ <div className="flex flex-col gap-3">
+ {error ? <ErrorCallout message={error} /> : null}
+ {content.kind === 'loading' ? (
+ <LemonSkeleton repeat={3} className="h-16" />
+ ) : content.kind === 'error' ? (
+ <ErrorCallout message={content.message} />
+ ) : content.kind === 'messages' ? (
+ <>
+ <MessageSection
+ title="Input"
+ messages={content.input}
+ emptyText="No input captured."
+ defaultOpen="last"
+ />
+ <MessageSection
+ title="Output"
+ messages={content.output}
+ emptyText="No output captured."
+ defaultOpen="all"
+ />
+ </>
+ ) : (
+ <IOPanel input={content.input} output={content.output} />
+ )}
+ {onViewInThread && content.kind !== 'loading' ? (
+ <LemonButton
+ type="secondary"
+ size="small"
+ icon={<IconMessage />}
+ className="self-start"
+ onClick={onViewInThread}
+ data-attr="trace-view-view-in-thread"
+ >
+ View in thread
+ </LemonButton>
+ ) : null}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.stories.tsx
new file mode 100644
index 000000000000..0eff69ee0e12
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.stories.tsx
@@ -0,0 +1,34 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { langchainCerebrasImageError } from '../sampleFixtures/langchainCerebrasImageError'
+import { FIXTURE_GENERATION_PROPERTIES, FIXTURE_SPAN_PROPERTIES, FIXTURE_TREE } from '../storyFixtures'
+import { NodePropertyList } from './NodePropertyList'
+
+const meta: Meta<typeof NodePropertyList> = {
+ title: 'Scenes-App/AI observability/Trace view/Node properties',
+ component: NodePropertyList,
+}
+export default meta
+
+type Story = StoryObj<typeof NodePropertyList>
+
+const failedGeneration = langchainCerebrasImageError.tree[0].children[0].children[0]
+
+export const Generation: Story = {
+ args: { node: FIXTURE_TREE[0].children[1], properties: FIXTURE_GENERATION_PROPERTIES },
+}
+export const Span: Story = {
+ args: { node: FIXTURE_TREE[0].children[0], properties: FIXTURE_SPAN_PROPERTIES },
+}
+export const SpanWithoutSessionOrPerson: Story = {
+ args: {
+ node: FIXTURE_TREE[0].children[0],
+ properties: { ...FIXTURE_SPAN_PROPERTIES, sessionId: null, person: null },
+ },
+}
+export const FailedGenerationWithUnknownStats: Story = {
+ args: {
+ node: failedGeneration,
+ properties: langchainCerebrasImageError.details[failedGeneration.id].properties,
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.tsx b/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.tsx
new file mode 100644
index 000000000000..2b7b19638194
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodePropertyList.tsx
@@ -0,0 +1,76 @@
+import { ReactNode } from 'react'
+
+import { TZLabel } from 'lib/components/TZLabel'
+
+import { NodeProperties, TraceTreeNode } from '../types'
+import { formatCacheTokens, formatCostUsd, formatLatencyMs, formatTokenCounts } from './formatStats'
+
+const UNKNOWN_VALUE = <span className="text-secondary">Unknown</span>
+
+type PropertyRow = [label: string, value: ReactNode]
+
+export interface NodePropertyListProps {
+ node: TraceTreeNode
+ properties: NodeProperties
+}
+
+export function NodePropertyList({ node, properties }: NodePropertyListProps): JSX.Element {
+ const { stats } = node
+ const time = (
+ <TZLabel
+ time={properties.timestamp}
+ timestampStyle="absolute"
+ formatDate="MMM D,"
+ formatTime="HH:mm:ss"
+ showSeconds
+ className="font-mono"
+ />
+ )
+ const tokens = formatTokenCounts(stats.inputTokens, stats.outputTokens) ?? UNKNOWN_VALUE
+ const cache = formatCacheTokens(stats.cacheReadTokens, stats.cacheWriteTokens)
+ const latency = stats.latencyMs !== null ? formatLatencyMs(stats.latencyMs) : UNKNOWN_VALUE
+ const cost = stats.costUsd !== null ? formatCostUsd(stats.costUsd) : UNKNOWN_VALUE
+ const prompt =
+ properties.promptName && properties.promptVersion !== null
+ ? `${properties.promptName} v${properties.promptVersion}`
+ : properties.promptName
+
+ const rows: PropertyRow[] =
+ node.kind === 'generation'
+ ? [
+ ['Model', node.model],
+ ['Provider', properties.provider],
+ ['Temperature', properties.temperature !== null ? String(properties.temperature) : null],
+ ['Tokens', tokens],
+ ['Cache', cache],
+ ['Latency', latency],
+ ['Cost', cost],
+ ['Prompt', prompt],
+ ['Session', properties.sessionId],
+ ['Time', time],
+ ]
+ : [
+ ['Name', node.name],
+ ['Kind', node.kind],
+ ['Time', time],
+ ['Person', properties.person],
+ ['Latency', latency],
+ ['Tokens', tokens],
+ ['Cache', cache],
+ ['Cost', cost],
+ ['Session', properties.sessionId],
+ ]
+
+ return (
+ <dl className="m-0 grid grid-cols-[max-content_1fr] items-baseline gap-x-8 gap-y-2 text-sm">
+ {rows
+ .filter(([, value]) => value !== null)
+ .map(([label, value]) => (
+ <div key={label} className="contents">
+ <dt className="text-secondary">{label}</dt>
+ <dd className="m-0 min-w-0 font-mono text-xs break-all">{value}</dd>
+ </div>
+ ))}
+ </dl>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.stories.tsx
new file mode 100644
index 000000000000..491dac715328
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.stories.tsx
@@ -0,0 +1,19 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { NodeRawTab } from './NodeRawTab'
+
+const meta: Meta<typeof NodeRawTab> = {
+ title: 'Scenes-App/AI observability/Trace view/Raw event',
+ component: NodeRawTab,
+}
+export default meta
+
+export const Default: StoryObj<typeof NodeRawTab> = {
+ args: {
+ raw: {
+ event: '$ai_generation',
+ id: 'gen-answer',
+ properties: { $ai_model: 'gpt-4.1-mini', $ai_latency: 1.88, $ai_input_tokens: 1822 },
+ },
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.tsx
new file mode 100644
index 000000000000..2ccb3f7ea15a
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeRawTab.tsx
@@ -0,0 +1,13 @@
+import { JSONViewer } from 'lib/components/JSONViewer'
+
+export interface NodeRawTabProps {
+ raw: Record<string, unknown>
+}
+
+export function NodeRawTab({ raw }: NodeRawTabProps): JSX.Element {
+ return (
+ <div className="overflow-auto rounded border border-primary bg-surface-primary p-2">
+ <JSONViewer src={raw} name={null} collapsed={2} sortKeys />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.stories.tsx
new file mode 100644
index 000000000000..c2f1a1d85f32
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.stories.tsx
@@ -0,0 +1,15 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_STATS, withWidth } from '../storyFixtures'
+import { NodeStatChips } from './NodeStatChips'
+
+const meta: Meta<typeof NodeStatChips> = {
+ title: 'Scenes-App/AI observability/Trace view/Node stat chips',
+ component: NodeStatChips,
+}
+export default meta
+
+type Story = StoryObj<typeof NodeStatChips>
+
+export const Default: Story = { args: { stats: FIXTURE_STATS } }
+export const Narrow: Story = { args: { stats: FIXTURE_STATS }, decorators: [withWidth(160)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.tsx
new file mode 100644
index 000000000000..120b728004dd
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeStatChips.tsx
@@ -0,0 +1,20 @@
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { NodeStats } from '../types'
+import { statParts } from './formatStats'
+
+export interface NodeStatChipsProps {
+ stats: NodeStats
+}
+
+export function NodeStatChips({ stats }: NodeStatChipsProps): JSX.Element {
+ return (
+ <div className="flex flex-wrap gap-1">
+ {statParts(stats).map((part) => (
+ <LemonTag key={part} weight="normal" className="font-mono">
+ {part}
+ </LemonTag>
+ ))}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.stories.tsx
new file mode 100644
index 000000000000..e64507cc3935
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.stories.tsx
@@ -0,0 +1,27 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_STATS } from '../storyFixtures'
+import { NodeStatsLine } from './NodeStatsLine'
+
+const meta: Meta<typeof NodeStatsLine> = {
+ title: 'Scenes-App/AI observability/Trace view/Node stats line',
+ component: NodeStatsLine,
+}
+export default meta
+
+type Story = StoryObj<typeof NodeStatsLine>
+
+export const Full: Story = { args: { stats: FIXTURE_STATS, model: 'gpt-4.1-mini' } }
+export const Compact: Story = { args: { stats: FIXTURE_STATS, model: 'gpt-4.1-mini', compact: true } }
+export const LatencyOnly: Story = {
+ args: {
+ stats: {
+ costUsd: null,
+ inputTokens: null,
+ outputTokens: null,
+ cacheReadTokens: null,
+ cacheWriteTokens: null,
+ latencyMs: 260,
+ },
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.tsx b/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.tsx
new file mode 100644
index 000000000000..1936c6b54763
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/NodeStatsLine.tsx
@@ -0,0 +1,19 @@
+import { cn } from 'lib/utils/css-classes'
+
+import { NodeStats } from '../types'
+import { compactStatParts, statParts } from './formatStats'
+
+export interface NodeStatsLineProps {
+ stats: NodeStats
+ model?: string | null
+ compact?: boolean
+ className?: string
+}
+
+export function NodeStatsLine({ stats, model, compact = false, className }: NodeStatsLineProps): JSX.Element | null {
+ const parts = [...(compact ? compactStatParts(stats) : statParts(stats)), ...(model ? [model] : [])]
+ if (parts.length === 0) {
+ return null
+ }
+ return <span className={cn('font-mono text-xs text-secondary truncate', className)}>{parts.join(' · ')}</span>
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/PersonChip.tsx b/products/ai_observability/frontend/redesign/trace/components/PersonChip.tsx
new file mode 100644
index 000000000000..3684f94bbe73
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/PersonChip.tsx
@@ -0,0 +1,18 @@
+import { IconPerson } from '@posthog/icons'
+import { LemonTag, Link } from '@posthog/lemon-ui'
+
+import { LabeledLink } from '../types'
+
+export interface PersonChipProps {
+ person: LabeledLink
+}
+
+export function PersonChip({ person }: PersonChipProps): JSX.Element {
+ return (
+ <Link to={person.href} subtle>
+ <LemonTag icon={<IconPerson />} weight="normal">
+ {person.label}
+ </LemonTag>
+ </Link>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ThinkingPart.tsx b/products/ai_observability/frontend/redesign/trace/components/ThinkingPart.tsx
new file mode 100644
index 000000000000..f028de6d9085
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ThinkingPart.tsx
@@ -0,0 +1,14 @@
+import { MessageMarkdown } from './MessageMarkdown'
+
+export interface ThinkingPartProps {
+ text: string
+}
+
+export function ThinkingPart({ text }: ThinkingPartProps): JSX.Element {
+ return (
+ <details className="text-secondary">
+ <summary className="cursor-pointer text-xs font-semibold">Thinking</summary>
+ <MessageMarkdown text={text} className="mt-1" />
+ </details>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/Thread.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/Thread.stories.tsx
new file mode 100644
index 000000000000..18bc8eba9916
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/Thread.stories.tsx
@@ -0,0 +1,35 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { anthropicMessagesThinkingToolUse } from '../sampleFixtures/anthropicMessagesThinkingToolUse'
+import { langchainCerebrasImageError } from '../sampleFixtures/langchainCerebrasImageError'
+import { FIXTURE_GENERATION_MESSAGES, FIXTURE_TURN, withWidth } from '../storyFixtures'
+import { ConversationTurn } from '../types'
+import { Thread } from './Thread'
+
+const meta: Meta<typeof Thread> = {
+ title: 'Scenes-App/AI observability/Trace view/Thread',
+ component: Thread,
+ args: { onSelectMessage: () => {} },
+}
+export default meta
+
+type Story = StoryObj<typeof Thread>
+
+function ready(turns: ConversationTurn[]): Story['args'] {
+ return { conversation: { status: 'ready', turns, activeTurnId: 'trace-1' } }
+}
+
+export const SingleTurn: Story = { args: ready([FIXTURE_TURN]) }
+export const Loading: Story = {
+ args: { conversation: { status: 'loading' } },
+ decorators: [withWidth(720)],
+ parameters: { testOptions: { waitForLoadersToDisappear: false } },
+}
+export const Empty: Story = { args: ready([{ ...FIXTURE_TURN, messages: [] }]) }
+export const SystemOnly: Story = { args: ready([{ ...FIXTURE_TURN, messages: [FIXTURE_GENERATION_MESSAGES[0]] }]) }
+export const ErrorWithoutMessages: Story = {
+ args: ready([{ ...FIXTURE_TURN, messages: [], error: 'APIConnectionError: Connection reset by peer' }]),
+}
+export const AnthropicThinkingAndTools: Story = { args: { conversation: anthropicMessagesThinkingToolUse.thread } }
+export const ImageInputWithError: Story = { args: { conversation: langchainCerebrasImageError.thread } }
+export const Narrow: Story = { args: ready([FIXTURE_TURN]), decorators: [withWidth(420)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/Thread.tsx b/products/ai_observability/frontend/redesign/trace/components/Thread.tsx
new file mode 100644
index 000000000000..cc385f0c0070
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/Thread.tsx
@@ -0,0 +1,42 @@
+import { LemonSkeleton } from '@posthog/lemon-ui'
+
+import { ConversationState } from '../types'
+import { conversationalMessages } from './conversationalMessages'
+import { ThreadTurn } from './ThreadTurn'
+
+export interface ThreadProps {
+ conversation: ConversationState
+ onSelectMessage: (sourceNodeId: string) => void
+}
+
+export function Thread({ conversation, onSelectMessage }: ThreadProps): JSX.Element {
+ if (conversation.status === 'loading') {
+ return (
+ <div className="flex flex-col gap-3" role="status" aria-busy="true" aria-label="Loading conversation">
+ <LemonSkeleton className="h-10 w-2/3 self-end" />
+ <LemonSkeleton className="h-24 w-4/5" />
+ <LemonSkeleton className="h-10 w-1/2 self-end" />
+ </div>
+ )
+ }
+ const { turns, activeTurnId } = conversation
+ if (turns.every((turn) => conversationalMessages(turn.messages).length === 0 && !turn.error)) {
+ return (
+ <p className="m-0 text-secondary">
+ This trace has no conversation to show. Switch to Spans to see its steps.
+ </p>
+ )
+ }
+ return (
+ <div className="flex flex-col gap-3">
+ {turns.map((turn) => (
+ <ThreadTurn
+ key={turn.id}
+ turn={turn}
+ isActive={turns.length > 1 && turn.id === activeTurnId}
+ onSelectMessage={onSelectMessage}
+ />
+ ))}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.stories.tsx
new file mode 100644
index 000000000000..4987edd6dcd8
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.stories.tsx
@@ -0,0 +1,24 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_GENERATION_MESSAGES } from '../storyFixtures'
+import { ThreadBubble } from './ThreadBubble'
+
+const meta: Meta<typeof ThreadBubble> = {
+ title: 'Scenes-App/AI observability/Trace view/Thread bubble',
+ component: ThreadBubble,
+ decorators: [
+ (Story) => (
+ <div className="flex flex-col">
+ <Story />
+ </div>
+ ),
+ ],
+}
+export default meta
+
+type Story = StoryObj<typeof ThreadBubble>
+
+export const User: Story = { args: { message: FIXTURE_GENERATION_MESSAGES[1] } }
+export const AssistantSelectable: Story = { args: { message: FIXTURE_GENERATION_MESSAGES[3], onSelect: () => {} } }
+export const Assistant: Story = { args: { message: FIXTURE_GENERATION_MESSAGES[3] } }
+export const InternalToolCall: Story = { args: { message: FIXTURE_GENERATION_MESSAGES[2], onSelect: () => {} } }
diff --git a/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.tsx b/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.tsx
new file mode 100644
index 000000000000..e70b33b4eadd
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ThreadBubble.tsx
@@ -0,0 +1,43 @@
+import { IconArrowRight } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
+
+import { ThreadMessage } from '../types'
+import { MessagePartView } from './MessagePartView'
+
+export interface ThreadBubbleProps {
+ message: ThreadMessage
+ onSelect?: () => void
+}
+
+export function ThreadBubble({ message, onSelect }: ThreadBubbleProps): JSX.Element {
+ const isUser = message.role === 'user'
+ const baseClassName = cn(
+ 'flex flex-col gap-2 text-left text-sm',
+ 'max-w-4/5 rounded-lg px-3 py-2',
+ isUser ? 'self-end bg-fill-highlight-100' : 'self-start border border-primary bg-surface-primary',
+ message.isInternal && 'text-secondary'
+ )
+
+ const content = message.parts.map((part, index) => <MessagePartView key={index} part={part} />)
+
+ if (!onSelect) {
+ return <div className={baseClassName}>{content}</div>
+ }
+
+ return (
+ <div className={cn(baseClassName, 'flex-row items-start justify-between')}>
+ <div className="flex min-w-0 flex-col gap-2">{content}</div>
+ <LemonButton
+ size="xsmall"
+ type="tertiary"
+ icon={<IconArrowRight />}
+ onClick={onSelect}
+ tooltip="View this step"
+ aria-label="View this step"
+ data-attr="trace-view-thread-view-step"
+ />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.stories.tsx
new file mode 100644
index 000000000000..c12c5cb5d56d
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.stories.tsx
@@ -0,0 +1,32 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_ATTACHMENT_PARTS, FIXTURE_TURN } from '../storyFixtures'
+import { ThreadTurn } from './ThreadTurn'
+
+const meta: Meta<typeof ThreadTurn> = {
+ title: 'Scenes-App/AI observability/Trace view/Thread turn',
+ component: ThreadTurn,
+ args: { turn: FIXTURE_TURN, onSelectMessage: () => {} },
+}
+export default meta
+
+export const Default: StoryObj<typeof ThreadTurn> = { args: { isActive: false } }
+export const Active: StoryObj<typeof ThreadTurn> = { args: { isActive: true } }
+export const WithError: StoryObj<typeof ThreadTurn> = {
+ args: {
+ isActive: false,
+ turn: {
+ ...FIXTURE_TURN,
+ messages: [
+ {
+ id: 'm-user-image',
+ role: 'user',
+ parts: [{ kind: 'text', text: 'What does this chart show?' }, FIXTURE_ATTACHMENT_PARTS[0]],
+ isInternal: false,
+ sourceNodeId: 'gen-answer',
+ },
+ ],
+ error: 'BadRequestError: 400 This model does not accept image input',
+ },
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.tsx b/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.tsx
new file mode 100644
index 000000000000..53fd8d43cdee
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ThreadTurn.tsx
@@ -0,0 +1,51 @@
+import { useState } from 'react'
+
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { cn } from 'lib/utils/css-classes'
+import { pluralize } from 'lib/utils/strings'
+
+import { ConversationTurn } from '../types'
+import { conversationalMessages } from './conversationalMessages'
+import { ErrorCallout } from './ErrorCallout'
+import { ThreadBubble } from './ThreadBubble'
+
+export interface ThreadTurnProps {
+ turn: ConversationTurn
+ isActive: boolean
+ onSelectMessage: (sourceNodeId: string) => void
+}
+
+export function ThreadTurn({ turn, isActive, onSelectMessage }: ThreadTurnProps): JSX.Element {
+ const [showInternal, setShowInternal] = useState(false)
+ const conversational = conversationalMessages(turn.messages)
+ const hiddenCount = conversational.filter((message) => message.isInternal).length
+ const visible = showInternal ? conversational : conversational.filter((message) => !message.isInternal)
+
+ return (
+ <div className={cn('flex flex-col gap-3', isActive && 'rounded-lg p-3 ring-1 ring-[var(--color-accent)]')}>
+ {hiddenCount > 0 ? (
+ <LemonButton
+ size="xsmall"
+ type="tertiary"
+ className="self-center"
+ onClick={() => setShowInternal(!showInternal)}
+ data-attr="trace-view-toggle-hidden-messages"
+ >
+ {showInternal ? 'Hide internal messages' : `Show ${pluralize(hiddenCount, 'internal message')}`}
+ </LemonButton>
+ ) : null}
+ {visible.map((message) => {
+ const sourceNodeId = message.sourceNodeId
+ return (
+ <ThreadBubble
+ key={message.id}
+ message={message}
+ onSelect={sourceNodeId ? () => onSelectMessage(sourceNodeId) : undefined}
+ />
+ )
+ })}
+ {turn.error ? <ErrorCallout message={turn.error} /> : null}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TimelineAxis.tsx b/products/ai_observability/frontend/redesign/trace/components/TimelineAxis.tsx
new file mode 100644
index 000000000000..63bbd240df24
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TimelineAxis.tsx
@@ -0,0 +1,25 @@
+import { formatLatencyMs } from './formatStats'
+import { TimelineTick } from './timelineTicks'
+
+export interface TimelineAxisProps {
+ ticks: TimelineTick[]
+ totalMs: number
+}
+
+export function TimelineAxis({ ticks, totalMs }: TimelineAxisProps): JSX.Element {
+ return (
+ <div className="relative h-5 font-mono text-xs text-secondary">
+ {ticks.map((tick) => (
+ <span
+ key={tick.valueMs}
+ className="absolute top-0.5 pl-0.5"
+ // Tick positions come from the trace duration, so they cannot be static Tailwind classes.
+ style={{ left: `${tick.fraction * 100}%` }}
+ >
+ {formatLatencyMs(tick.valueMs)}
+ </span>
+ ))}
+ <span className="absolute top-0.5 right-0 pr-1 font-semibold">{formatLatencyMs(totalMs)}</span>
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TimelineRow.tsx b/products/ai_observability/frontend/redesign/trace/components/TimelineRow.tsx
new file mode 100644
index 000000000000..668f75e7fe81
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TimelineRow.tsx
@@ -0,0 +1,87 @@
+import { IconWarning } from '@posthog/icons'
+
+import { cn } from 'lib/utils/css-classes'
+
+import { TimelineRowData } from '../types'
+import { formatLatencyMs } from './formatStats'
+import { NODE_KIND_COLORS } from './nodeKindColors'
+import { NodeKindGlyph } from './NodeKindGlyph'
+import { timelineBarGeometry } from './timelineBarGeometry'
+import { TimelineTick } from './timelineTicks'
+
+export const TIMELINE_COLUMNS = 'grid-cols-[minmax(8rem,14rem)_1fr]'
+
+const ERROR_BAR_COLORS = { barBg: 'bg-danger-highlight', barBorder: 'border-danger' }
+
+export interface TimelineRowProps {
+ row: TimelineRowData
+ totalMs: number
+ ticks: TimelineTick[]
+ isSelected: boolean
+ onSelect: () => void
+}
+
+export function TimelineRow({ row, totalMs, ticks, isSelected, onSelect }: TimelineRowProps): JSX.Element {
+ const { leftPercent, widthPercent } = timelineBarGeometry(row.startMs, row.durationMs ?? 0, totalMs)
+ const barColors = row.hasError ? ERROR_BAR_COLORS : NODE_KIND_COLORS[row.kind]
+ return (
+ <button
+ type="button"
+ onClick={onSelect}
+ data-attr="trace-view-timeline-row"
+ className={cn(
+ 'grid w-full items-center border-b border-primary text-left hover:bg-fill-button-tertiary-hover',
+ TIMELINE_COLUMNS,
+ isSelected && 'bg-fill-button-tertiary-active'
+ )}
+ >
+ <span
+ className="flex min-w-0 items-center gap-1.5 py-1 pr-2 text-sm"
+ style={{ paddingLeft: `${0.5 + row.depth * 0.625}rem` }}
+ >
+ <NodeKindGlyph kind={row.kind} />
+ <span className={cn('truncate', row.hasError && 'text-danger')}>{row.name}</span>
+ {row.hasError ? <IconWarning className="shrink-0 text-danger" role="img" aria-label="Error" /> : null}
+ </span>
+ <span className="relative h-6">
+ {ticks.map((tick) => (
+ <span
+ key={tick.valueMs}
+ aria-hidden
+ className="absolute inset-y-0 w-px bg-[var(--color-border-primary)]"
+ style={{ left: `${tick.fraction * 100}%` }}
+ />
+ ))}
+ {row.durationMs === null ? (
+ <>
+ <span
+ aria-hidden
+ title="Latency unknown"
+ className={cn(
+ 'absolute top-1/2 ml-0.5 size-2 -translate-y-1/2 rotate-45 border',
+ barColors.barBg,
+ barColors.barBorder
+ )}
+ style={{ left: `${leftPercent}%` }}
+ />
+ <span className="sr-only">Latency unknown</span>
+ </>
+ ) : (
+ <span
+ className={cn(
+ 'absolute top-1 bottom-1 truncate rounded-sm border px-1 font-mono text-xxs leading-4',
+ barColors.barBg,
+ barColors.barBorder
+ )}
+ style={{
+ left: `${leftPercent}%`,
+ width: `${widthPercent}%`,
+ }}
+ >
+ {formatLatencyMs(row.durationMs)}
+ </span>
+ )}
+ </span>
+ </button>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/ToolCallPart.tsx b/products/ai_observability/frontend/redesign/trace/components/ToolCallPart.tsx
new file mode 100644
index 000000000000..49349e02448e
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/ToolCallPart.tsx
@@ -0,0 +1,47 @@
+import { IconWrench } from '@posthog/icons'
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { isPlainObject, toDisplayText } from './jsonText'
+import { KeyValueTable } from './KeyValueTable'
+
+export interface ToolCallPartProps {
+ name: string
+ args: unknown
+ result?: unknown
+ isError?: boolean
+}
+
+function ToolCallValue({ value }: { value: unknown }): JSX.Element {
+ return (
+ <div className="max-h-60 overflow-auto px-2 py-1">
+ {isPlainObject(value) && Object.keys(value).length > 0 ? (
+ <KeyValueTable entries={Object.entries(value)} className="gap-x-4 gap-y-1 font-mono text-xs" />
+ ) : (
+ <pre className="m-0 text-xs">{toDisplayText(value)}</pre>
+ )}
+ </div>
+ )
+}
+
+export function ToolCallPart({ name, args, result, isError }: ToolCallPartProps): JSX.Element {
+ return (
+ <div className="rounded border border-primary bg-surface-primary">
+ <div className="flex items-center gap-1.5 border-b border-primary px-2 py-1 text-xs font-semibold">
+ <IconWrench className="text-secondary" />
+ <span className="font-mono">{name}</span>
+ {isError ? (
+ <LemonTag type="danger" size="small">
+ Error
+ </LemonTag>
+ ) : null}
+ </div>
+ <ToolCallValue value={args} />
+ {result !== undefined ? (
+ <>
+ <div className="border-t border-primary px-2 py-1 text-xs font-semibold text-secondary">Result</div>
+ <ToolCallValue value={result} />
+ </>
+ ) : null}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceHeader.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceHeader.stories.tsx
new file mode 100644
index 000000000000..40bd9172295b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceHeader.stories.tsx
@@ -0,0 +1,26 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { withWidth } from '../storyFixtures'
+import { TraceHeader } from './TraceHeader'
+
+const meta: Meta<typeof TraceHeader> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace header',
+ component: TraceHeader,
+ args: {
+ name: 'answer-billing-question',
+ hasError: false,
+ olderHref: '/older',
+ newerHref: null,
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof TraceHeader>
+
+export const Default: Story = {}
+export const Errored: Story = { args: { hasError: true } }
+export const Narrow: Story = {
+ args: { name: 'a-very-long-trace-name-that-should-truncate-cleanly' },
+ decorators: [withWidth(360)],
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceHeader.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceHeader.tsx
new file mode 100644
index 000000000000..f5b7511ebae9
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceHeader.tsx
@@ -0,0 +1,34 @@
+import { IconArrowLeft } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { LabeledLink } from '../types'
+import { TraceNeighbourLinks } from './TraceNeighbourLinks'
+import { TraceStatusBadge } from './TraceStatusBadge'
+
+export interface TraceHeaderProps {
+ name: string
+ hasError: boolean
+ olderHref: string | null
+ newerHref: string | null
+ backLink: LabeledLink
+}
+
+export function TraceHeader({ name, hasError, olderHref, newerHref, backLink }: TraceHeaderProps): JSX.Element {
+ return (
+ <header className="flex flex-wrap items-center gap-2">
+ <LemonButton
+ size="small"
+ icon={<IconArrowLeft />}
+ to={backLink.href}
+ tooltip={backLink.label}
+ aria-label={backLink.label}
+ data-attr="trace-view-back"
+ />
+ <h1 className="m-0 min-w-0 truncate text-lg font-semibold">{name}</h1>
+ <TraceStatusBadge hasError={hasError} />
+ <div className="ml-auto">
+ <TraceNeighbourLinks olderHref={olderHref} newerHref={newerHref} />
+ </div>
+ </header>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceIdChip.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceIdChip.tsx
new file mode 100644
index 000000000000..4209e10b25c3
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceIdChip.tsx
@@ -0,0 +1,28 @@
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'
+
+const HEX_ID_PATTERN = /^[0-9a-f-]{16,}$/i
+
+export interface TraceIdChipProps {
+ traceId: string
+}
+
+export function TraceIdChip({ traceId }: TraceIdChipProps): JSX.Element {
+ return (
+ <LemonTag weight="normal">
+ <CopyToClipboardInline
+ explicitValue={traceId}
+ description="trace ID"
+ className="font-mono"
+ iconSize="xsmall"
+ >
+ {HEX_ID_PATTERN.test(traceId) ? (
+ <span>{traceId.slice(0, 8)}</span>
+ ) : (
+ <span className="block max-w-48 truncate">{traceId}</span>
+ )}
+ </CopyToClipboardInline>
+ </LemonTag>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.stories.tsx
new file mode 100644
index 000000000000..5cc0b88b42df
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.stories.tsx
@@ -0,0 +1,18 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { useState } from 'react'
+
+import { TraceMode } from '../types'
+import { TraceModeTabs } from './TraceModeTabs'
+
+function Stateful(): JSX.Element {
+ const [mode, setMode] = useState<TraceMode>('spans')
+ return <TraceModeTabs mode={mode} onModeChange={setMode} />
+}
+
+const meta: Meta<typeof Stateful> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace mode tabs',
+ component: Stateful,
+}
+export default meta
+
+export const Default: StoryObj<typeof Stateful> = {}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.tsx
new file mode 100644
index 000000000000..e72c95152b83
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceModeTabs.tsx
@@ -0,0 +1,23 @@
+import { LemonTabs } from '@posthog/lemon-ui'
+
+import { TraceMode } from '../types'
+
+export interface TraceModeTabsProps {
+ mode: TraceMode
+ onModeChange: (mode: TraceMode) => void
+}
+
+export function TraceModeTabs({ mode, onModeChange }: TraceModeTabsProps): JSX.Element {
+ return (
+ <LemonTabs<TraceMode>
+ activeKey={mode}
+ onChange={onModeChange}
+ data-attr="trace-view-mode-tabs"
+ tabs={[
+ { key: 'spans', label: 'Spans', 'data-attr': 'trace-view-mode-spans' },
+ { key: 'thread', label: 'Thread', 'data-attr': 'trace-view-mode-thread' },
+ { key: 'timeline', label: 'Timeline', 'data-attr': 'trace-view-mode-timeline' },
+ ]}
+ />
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceNeighbourLinks.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceNeighbourLinks.tsx
new file mode 100644
index 000000000000..d4b6cbcf940b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceNeighbourLinks.tsx
@@ -0,0 +1,32 @@
+import { IconChevronDown } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+export interface TraceNeighbourLinksProps {
+ olderHref: string | null
+ newerHref: string | null
+}
+
+export function TraceNeighbourLinks({ olderHref, newerHref }: TraceNeighbourLinksProps): JSX.Element {
+ return (
+ <div className="flex gap-1">
+ <LemonButton
+ size="small"
+ icon={<IconChevronDown className="rotate-180" />}
+ to={newerHref ?? undefined}
+ disabledReason={newerHref ? undefined : 'No newer trace'}
+ tooltip="Newer trace"
+ aria-label="Newer trace"
+ data-attr="trace-view-newer-trace"
+ />
+ <LemonButton
+ size="small"
+ icon={<IconChevronDown />}
+ to={olderHref ?? undefined}
+ disabledReason={olderHref ? undefined : 'No older trace'}
+ tooltip="Older trace"
+ aria-label="Older trace"
+ data-attr="trace-view-older-trace"
+ />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.stories.tsx
new file mode 100644
index 000000000000..4b671731261b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.stories.tsx
@@ -0,0 +1,40 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import {
+ FIXTURE_EVALS,
+ FIXTURE_GENERATION_INPUT,
+ FIXTURE_GENERATION_OUTPUT,
+ FIXTURE_GENERATION_PROPERTIES,
+ FIXTURE_TREE,
+ withWidth,
+} from '../storyFixtures'
+import { TraceSplitView } from './TraceSplitView'
+
+const generation = FIXTURE_TREE[0].children[1]
+
+const meta: Meta<typeof TraceSplitView> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace split view',
+ component: TraceSplitView,
+ args: {
+ tree: FIXTURE_TREE,
+ selectedNodeId: generation.id,
+ onSelectNode: () => {},
+ detail: {
+ node: generation,
+ tab: 'messages',
+ onTabChange: () => {},
+ content: { kind: 'messages', input: FIXTURE_GENERATION_INPUT, output: FIXTURE_GENERATION_OUTPUT },
+ error: null,
+ properties: FIXTURE_GENERATION_PROPERTIES,
+ evals: { status: 'ready', results: FIXTURE_EVALS },
+ raw: {},
+ onViewInThread: () => {},
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof TraceSplitView>
+
+export const Wide: Story = { decorators: [withWidth(1100)] }
+export const Narrow: Story = { decorators: [withWidth(520)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.tsx
new file mode 100644
index 000000000000..dea08a17e399
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceSplitView.tsx
@@ -0,0 +1,29 @@
+import { TraceTreeNode } from '../types'
+import { NodeDetail, NodeDetailProps } from './NodeDetail'
+import { TraceTree } from './TraceTree'
+
+export interface TraceSplitViewProps {
+ tree: TraceTreeNode[]
+ selectedNodeId: string | null
+ onSelectNode: (id: string) => void
+ detail: Omit<NodeDetailProps, 'onSelectNode'> | null
+}
+
+export function TraceSplitView({ tree, selectedNodeId, onSelectNode, detail }: TraceSplitViewProps): JSX.Element {
+ return (
+ <div className="@container">
+ <div className="flex flex-col gap-4 @3xl:flex-row @3xl:items-start">
+ <aside className="w-full shrink-0 @3xl:w-72">
+ <TraceTree nodes={tree} selectedNodeId={selectedNodeId} onSelectNode={onSelectNode} />
+ </aside>
+ <div className="min-w-0 flex-1 @3xl:sticky @3xl:top-[var(--scene-title-section-height,50px)] @3xl:max-h-[calc(100vh-var(--scene-title-section-height,50px))] @3xl:overflow-y-auto">
+ {detail ? (
+ <NodeDetail {...detail} onSelectNode={onSelectNode} />
+ ) : (
+ <p className="m-0 text-secondary">Select a step to see its details.</p>
+ )}
+ </div>
+ </div>
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceStatusBadge.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceStatusBadge.tsx
new file mode 100644
index 000000000000..a9320c9d517b
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceStatusBadge.tsx
@@ -0,0 +1,15 @@
+import { LemonTag } from '@posthog/lemon-ui'
+
+export interface TraceStatusBadgeProps {
+ hasError: boolean
+}
+
+export function TraceStatusBadge({ hasError }: TraceStatusBadgeProps): JSX.Element {
+ return hasError ? (
+ <LemonTag type="danger" size="small">
+ Error
+ </LemonTag>
+ ) : (
+ <LemonTag size="small">Trace</LemonTag>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.stories.tsx
new file mode 100644
index 000000000000..2307d269dddf
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.stories.tsx
@@ -0,0 +1,27 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { FIXTURE_STATS, withWidth } from '../storyFixtures'
+import { TraceSummaryBar } from './TraceSummaryBar'
+
+const meta: Meta<typeof TraceSummaryBar> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace summary bar',
+ component: TraceSummaryBar,
+ args: {
+ traceId: '3f9c2a71-5b8e-4d0f-a1c2-7e6d5b4a3c21',
+ timestamp: '2026-09-01T10:15:00Z',
+ person: { label: '[email protected]', href: '/person/ana' },
+ totals: FIXTURE_STATS,
+ },
+}
+export default meta
+
+type Story = StoryObj<typeof TraceSummaryBar>
+
+// The bar is an inline-size container, which contributes no intrinsic width, so an unsized story root collapses to zero.
+const wide: Story = { decorators: [withWidth(960)] }
+
+export const Default: Story = wide
+export const Anonymous: Story = { ...wide, args: { person: null } }
+export const ShortId: Story = { ...wide, args: { traceId: 'notes-run-42' } }
+export const LongSlugId: Story = { ...wide, args: { traceId: 'support-chat-session-2026-09-01-weekly-billing-review' } }
+export const Narrow: Story = { decorators: [withWidth(420)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.tsx
new file mode 100644
index 000000000000..58c8122dcee2
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceSummaryBar.tsx
@@ -0,0 +1,37 @@
+import { LemonTag } from '@posthog/lemon-ui'
+
+import { TZLabel } from 'lib/components/TZLabel'
+
+import { NodeStats, LabeledLink } from '../types'
+import { NodeStatsLine } from './NodeStatsLine'
+import { PersonChip } from './PersonChip'
+import { TraceIdChip } from './TraceIdChip'
+
+export interface TraceSummaryBarProps {
+ traceId: string
+ timestamp: string
+ person: LabeledLink | null
+ totals: NodeStats
+}
+
+export function TraceSummaryBar({ traceId, timestamp, person, totals }: TraceSummaryBarProps): JSX.Element {
+ return (
+ <div className="@container">
+ <div className="flex flex-wrap items-center gap-x-3 gap-y-1">
+ <div className="flex min-w-0 flex-wrap items-center gap-1.5">
+ <TraceIdChip traceId={traceId} />
+ <LemonTag weight="normal">
+ <TZLabel
+ time={timestamp}
+ timestampStyle="absolute"
+ formatDate="MMM D, YYYY"
+ formatTime="HH:mm"
+ />
+ </LemonTag>
+ {person ? <PersonChip person={person} /> : null}
+ </div>
+ <NodeStatsLine stats={totals} className="@2xl:ml-auto" />
+ </div>
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.stories.tsx
new file mode 100644
index 000000000000..682651b3daea
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.stories.tsx
@@ -0,0 +1,43 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { claudeCodePluginSession } from '../sampleFixtures/claudeCodePluginSession'
+import { langchainCerebrasImageError } from '../sampleFixtures/langchainCerebrasImageError'
+import { openaiAgentsWithEvals } from '../sampleFixtures/openaiAgentsWithEvals'
+import { FIXTURE_TIMELINE_ROWS, withWidth } from '../storyFixtures'
+import { TraceTimeline } from './TraceTimeline'
+
+const meta: Meta<typeof TraceTimeline> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace timeline',
+ component: TraceTimeline,
+ args: { rows: FIXTURE_TIMELINE_ROWS, totalMs: 2310, selectedNodeId: 'gen-answer', onSelectNode: () => {} },
+}
+export default meta
+
+type Story = StoryObj<typeof TraceTimeline>
+
+export const Default: Story = {}
+export const AgentRun: Story = {
+ args: { ...openaiAgentsWithEvals.timeline, selectedNodeId: openaiAgentsWithEvals.initialNodeId },
+}
+export const FailedSteps: Story = {
+ args: { ...langchainCerebrasImageError.timeline, selectedNodeId: langchainCerebrasImageError.initialNodeId },
+}
+export const LongSession: Story = { args: { ...claudeCodePluginSession.timeline, selectedNodeId: null } }
+export const Empty: Story = { args: { rows: [] } }
+export const UnknownLatency: Story = {
+ args: {
+ rows: [
+ ...FIXTURE_TIMELINE_ROWS,
+ {
+ id: 'span-feedback',
+ kind: 'span',
+ name: 'record-feedback',
+ depth: 1,
+ startMs: 1500,
+ durationMs: null,
+ hasError: false,
+ },
+ ],
+ },
+}
+export const Narrow: Story = { decorators: [withWidth(520)] }
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.tsx
new file mode 100644
index 000000000000..8337fb2ef21c
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceTimeline.tsx
@@ -0,0 +1,38 @@
+import { cn } from 'lib/utils/css-classes'
+
+import { TimelineRowData } from '../types'
+import { TimelineAxis } from './TimelineAxis'
+import { TIMELINE_COLUMNS, TimelineRow } from './TimelineRow'
+import { timelineTicks } from './timelineTicks'
+
+export interface TraceTimelineProps {
+ rows: TimelineRowData[]
+ totalMs: number
+ selectedNodeId: string | null
+ onSelectNode: (id: string) => void
+}
+
+export function TraceTimeline({ rows, totalMs, selectedNodeId, onSelectNode }: TraceTimelineProps): JSX.Element {
+ if (rows.length === 0) {
+ return <p className="m-0 text-secondary">This trace has no timed steps.</p>
+ }
+ const ticks = timelineTicks(totalMs)
+ return (
+ <div className="overflow-hidden rounded border border-primary bg-surface-primary">
+ <div className={cn('grid border-b border-primary', TIMELINE_COLUMNS)}>
+ <span className="px-2 py-0.5 text-xs font-semibold text-secondary">Step</span>
+ <TimelineAxis ticks={ticks} totalMs={totalMs} />
+ </div>
+ {rows.map((row) => (
+ <TimelineRow
+ key={row.id}
+ row={row}
+ totalMs={totalMs}
+ ticks={ticks}
+ isSelected={row.id === selectedNodeId}
+ onSelect={() => onSelectNode(row.id)}
+ />
+ ))}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceTree.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceTree.stories.tsx
new file mode 100644
index 000000000000..ec2135a3e1ad
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceTree.stories.tsx
@@ -0,0 +1,43 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { useState } from 'react'
+
+import { claudeCodePluginSession } from '../sampleFixtures/claudeCodePluginSession'
+import { FIXTURE_TREE, withWidth } from '../storyFixtures'
+import { TraceTreeNode } from '../types'
+import { TraceTree } from './TraceTree'
+
+function Stateful({
+ nodes,
+ initialSelectedId = 'gen-answer',
+}: {
+ nodes: TraceTreeNode[]
+ initialSelectedId?: string
+}): JSX.Element {
+ const [selected, setSelected] = useState<string | null>(initialSelectedId)
+ return <TraceTree nodes={nodes} selectedNodeId={selected} onSelectNode={setSelected} />
+}
+
+const meta: Meta<typeof Stateful> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace tree',
+ component: Stateful,
+ decorators: [withWidth(280)],
+}
+export default meta
+
+type Story = StoryObj<typeof Stateful>
+
+export const Default: Story = { args: { nodes: FIXTURE_TREE } }
+export const DeepAgentTree: Story = {
+ args: { nodes: claudeCodePluginSession.tree, initialSelectedId: claudeCodePluginSession.initialNodeId },
+}
+export const WithError: Story = {
+ args: {
+ nodes: [
+ {
+ ...FIXTURE_TREE[0],
+ hasError: true,
+ children: [{ ...FIXTURE_TREE[0].children[1], hasError: true }],
+ },
+ ],
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceTree.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceTree.tsx
new file mode 100644
index 000000000000..b26118d29f5a
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceTree.tsx
@@ -0,0 +1,24 @@
+import { TraceTreeNode } from '../types'
+import { TraceTreeRow } from './TraceTreeRow'
+
+export interface TraceTreeProps {
+ nodes: TraceTreeNode[]
+ selectedNodeId: string | null
+ onSelectNode: (id: string) => void
+}
+
+export function TraceTree({ nodes, selectedNodeId, onSelectNode }: TraceTreeProps): JSX.Element {
+ return (
+ <ul aria-label="Trace steps" className="m-0 list-none rounded border border-primary bg-surface-primary p-1">
+ {nodes.map((node) => (
+ <TraceTreeRow
+ key={node.id}
+ node={node}
+ depth={0}
+ selectedNodeId={selectedNodeId}
+ onSelectNode={onSelectNode}
+ />
+ ))}
+ </ul>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceTreeRow.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceTreeRow.tsx
new file mode 100644
index 000000000000..d1e57e2225e0
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceTreeRow.tsx
@@ -0,0 +1,62 @@
+import { IconWarning } from '@posthog/icons'
+
+import { cn } from 'lib/utils/css-classes'
+
+import { TraceTreeNode } from '../types'
+import { NodeKindGlyph } from './NodeKindGlyph'
+import { NodeStatsLine } from './NodeStatsLine'
+
+export interface TraceTreeRowProps {
+ node: TraceTreeNode
+ depth: number
+ selectedNodeId: string | null
+ onSelectNode: (id: string) => void
+}
+
+export function TraceTreeRow({ node, depth, selectedNodeId, onSelectNode }: TraceTreeRowProps): JSX.Element {
+ const isSelected = node.id === selectedNodeId
+ return (
+ <li>
+ <button
+ type="button"
+ onClick={() => onSelectNode(node.id)}
+ aria-current={isSelected ? 'true' : undefined}
+ data-attr="trace-view-tree-node"
+ className={cn(
+ 'flex w-full min-w-0 items-start gap-2 rounded py-1 pr-1.5 text-left hover:bg-fill-button-tertiary-hover',
+ isSelected && 'bg-fill-button-tertiary-active'
+ )}
+ // Depth is data, so the indent cannot be a static Tailwind class.
+ style={{ paddingLeft: `${0.375 + depth * 0.75}rem` }}
+ >
+ <NodeKindGlyph kind={node.kind} />
+ <span className="flex min-w-0 flex-col">
+ <span
+ className={cn(
+ 'flex min-w-0 items-center gap-1 text-sm',
+ isSelected ? 'font-semibold' : 'font-medium',
+ node.hasError && 'text-danger'
+ )}
+ >
+ <span className="truncate">{node.name}</span>
+ {node.hasError ? <IconWarning className="shrink-0" role="img" aria-label="Error" /> : null}
+ </span>
+ <NodeStatsLine stats={node.stats} model={node.model} compact />
+ </span>
+ </button>
+ {node.children.length > 0 ? (
+ <ul className="m-0 list-none p-0">
+ {node.children.map((child) => (
+ <TraceTreeRow
+ key={child.id}
+ node={child}
+ depth={depth + 1}
+ selectedNodeId={selectedNodeId}
+ onSelectNode={onSelectNode}
+ />
+ ))}
+ </ul>
+ ) : null}
+ </li>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceView.stories.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceView.stories.tsx
new file mode 100644
index 000000000000..c8b3d59c2f25
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceView.stories.tsx
@@ -0,0 +1,128 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { useState } from 'react'
+
+import { anthropicMessagesThinkingToolUse } from '../sampleFixtures/anthropicMessagesThinkingToolUse'
+import { claudeCodePluginSession } from '../sampleFixtures/claudeCodePluginSession'
+import { langchainCerebrasImageError } from '../sampleFixtures/langchainCerebrasImageError'
+import { openaiAgentsWithEvals } from '../sampleFixtures/openaiAgentsWithEvals'
+import { SampleTraceFixture } from '../sampleFixtures/sampleTraceFixture'
+import { FIXTURE_TRACE, withWidth } from '../storyFixtures'
+import { NodeDetailTab, TraceMode, TraceTreeNode } from '../types'
+import { TraceView } from './TraceView'
+
+function findNode(nodes: TraceTreeNode[], id: string): TraceTreeNode | null {
+ for (const node of nodes) {
+ if (node.id === id) {
+ return node
+ }
+ const found = findNode(node.children, id)
+ if (found) {
+ return found
+ }
+ }
+ return null
+}
+
+const ERRORED_NODE_IDS = new Set(['trace-1', 'gen-answer'])
+
+function markErrors(nodes: TraceTreeNode[]): TraceTreeNode[] {
+ return nodes.map((node) => ({
+ ...node,
+ hasError: ERRORED_NODE_IDS.has(node.id),
+ children: markErrors(node.children),
+ }))
+}
+
+const FIXTURE_ERROR_TRACE: SampleTraceFixture = {
+ ...FIXTURE_TRACE,
+ header: { ...FIXTURE_TRACE.header, hasError: true },
+ tree: markErrors(FIXTURE_TRACE.tree),
+ details: {
+ ...FIXTURE_TRACE.details,
+ 'gen-answer': { ...FIXTURE_TRACE.details['gen-answer'], error: 'RateLimitError: 429 Too Many Requests' },
+ },
+}
+
+interface PlaygroundProps {
+ fixture: SampleTraceFixture
+ initialMode: TraceMode
+ initialNodeId?: string
+}
+
+function Playground({ fixture, initialMode, initialNodeId }: PlaygroundProps): JSX.Element {
+ const [mode, setMode] = useState<TraceMode>(initialMode)
+ const [selectedNodeId, setSelectedNodeId] = useState(initialNodeId ?? fixture.initialNodeId)
+ const [tab, setTab] = useState<NodeDetailTab>('messages')
+ const node = findNode(fixture.tree, selectedNodeId) ?? fixture.tree[0]
+ const selectAndShowSpans = (id: string): void => {
+ setSelectedNodeId(id)
+ setMode('spans')
+ }
+ return (
+ <TraceView
+ status="ready"
+ header={fixture.header}
+ summary={fixture.summary}
+ mode={mode}
+ onModeChange={setMode}
+ tree={fixture.tree}
+ selectedNodeId={selectedNodeId}
+ onSelectNode={setSelectedNodeId}
+ onSelectFromView={selectAndShowSpans}
+ detail={{
+ ...fixture.details[node.id],
+ node,
+ tab,
+ onTabChange: setTab,
+ onViewInThread: node.kind === 'generation' ? () => setMode('thread') : null,
+ }}
+ thread={fixture.thread}
+ timeline={fixture.timeline}
+ />
+ )
+}
+
+const meta: Meta<typeof Playground> = {
+ title: 'Scenes-App/AI observability/Trace view/Trace view',
+ component: Playground,
+ parameters: { layout: 'padded' },
+}
+export default meta
+
+type Story = StoryObj<typeof Playground>
+
+export const SpanSelected: Story = {
+ args: { fixture: FIXTURE_TRACE, initialMode: 'spans', initialNodeId: 'span-retrieve' },
+}
+export const GenerationSelected: Story = { args: { fixture: FIXTURE_TRACE, initialMode: 'spans' } }
+export const ErrorTrace: Story = { args: { fixture: FIXTURE_ERROR_TRACE, initialMode: 'spans' } }
+export const ThreadMode: Story = { args: { fixture: FIXTURE_TRACE, initialMode: 'thread' } }
+export const TimelineMode: Story = { args: { fixture: FIXTURE_TRACE, initialMode: 'timeline' } }
+export const Narrow: Story = {
+ args: { fixture: FIXTURE_TRACE, initialMode: 'spans' },
+ decorators: [withWidth(520)],
+}
+export const SampleAnthropicThinkingToolUse: Story = {
+ args: { fixture: anthropicMessagesThinkingToolUse, initialMode: 'spans' },
+}
+export const SampleClaudeCodeSession: Story = { args: { fixture: claudeCodePluginSession, initialMode: 'spans' } }
+export const SampleLangChainImageError: Story = {
+ args: { fixture: langchainCerebrasImageError, initialMode: 'spans' },
+}
+export const SampleOpenAIAgentsWithEvals: Story = {
+ args: { fixture: openaiAgentsWithEvals, initialMode: 'spans' },
+}
+export const Loading: StoryObj<typeof TraceView> = {
+ render: () => <TraceView status="loading" />,
+ decorators: [withWidth(1100)],
+ parameters: { testOptions: { waitForLoadersToDisappear: false } },
+}
+export const LoadError: StoryObj<typeof TraceView> = {
+ render: () => (
+ <TraceView
+ status="error"
+ errorMessage="This trace is outside the loaded time range."
+ backLink={{ label: 'Back to traces', href: '/traces' }}
+ />
+ ),
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceView.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceView.tsx
new file mode 100644
index 000000000000..8480dec632c4
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceView.tsx
@@ -0,0 +1,62 @@
+import { ConversationState, LabeledLink, TimelineRowData, TraceMode, TraceTreeNode } from '../types'
+import { NodeDetailProps } from './NodeDetail'
+import { Thread } from './Thread'
+import { TraceHeader, TraceHeaderProps } from './TraceHeader'
+import { TraceModeTabs } from './TraceModeTabs'
+import { TraceSplitView } from './TraceSplitView'
+import { TraceSummaryBar, TraceSummaryBarProps } from './TraceSummaryBar'
+import { TraceTimeline } from './TraceTimeline'
+import { TraceViewError } from './TraceViewError'
+import { TraceViewLoading } from './TraceViewLoading'
+
+export interface TraceViewReadyProps {
+ header: TraceHeaderProps
+ summary: TraceSummaryBarProps
+ mode: TraceMode
+ onModeChange: (mode: TraceMode) => void
+ tree: TraceTreeNode[]
+ selectedNodeId: string | null
+ onSelectNode: (id: string) => void
+ onSelectFromView: (id: string) => void
+ detail: Omit<NodeDetailProps, 'onSelectNode'> | null
+ thread: ConversationState
+ timeline: { rows: TimelineRowData[]; totalMs: number }
+}
+
+export type TraceViewProps =
+ | { status: 'loading' }
+ | { status: 'error'; errorMessage: string; backLink: LabeledLink }
+ | ({ status: 'ready' } & TraceViewReadyProps)
+
+export function TraceView(props: TraceViewProps): JSX.Element {
+ if (props.status === 'loading') {
+ return <TraceViewLoading />
+ }
+ if (props.status === 'error') {
+ return <TraceViewError message={props.errorMessage} backLink={props.backLink} />
+ }
+ return (
+ <div className="flex flex-col gap-3">
+ <TraceHeader {...props.header} />
+ <TraceSummaryBar {...props.summary} />
+ <TraceModeTabs mode={props.mode} onModeChange={props.onModeChange} />
+ {props.mode === 'spans' ? (
+ <TraceSplitView
+ tree={props.tree}
+ selectedNodeId={props.selectedNodeId}
+ onSelectNode={props.onSelectNode}
+ detail={props.detail}
+ />
+ ) : props.mode === 'thread' ? (
+ <Thread conversation={props.thread} onSelectMessage={props.onSelectFromView} />
+ ) : (
+ <TraceTimeline
+ rows={props.timeline.rows}
+ totalMs={props.timeline.totalMs}
+ selectedNodeId={props.selectedNodeId}
+ onSelectNode={props.onSelectFromView}
+ />
+ )}
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceViewError.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceViewError.tsx
new file mode 100644
index 000000000000..aaff6d018174
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceViewError.tsx
@@ -0,0 +1,21 @@
+import { IconArrowLeft } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { LabeledLink } from '../types'
+
+export interface TraceViewErrorProps {
+ message: string
+ backLink: LabeledLink
+}
+
+export function TraceViewError({ message, backLink }: TraceViewErrorProps): JSX.Element {
+ return (
+ <div className="flex flex-col items-start gap-2 py-8">
+ <h2 className="m-0 text-lg font-semibold">We couldn't load this trace</h2>
+ <p className="m-0 text-secondary">{message}</p>
+ <LemonButton type="secondary" icon={<IconArrowLeft />} to={backLink.href}>
+ {backLink.label}
+ </LemonButton>
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/TraceViewLoading.tsx b/products/ai_observability/frontend/redesign/trace/components/TraceViewLoading.tsx
new file mode 100644
index 000000000000..ce20f145510d
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/TraceViewLoading.tsx
@@ -0,0 +1,19 @@
+import { LemonSkeleton } from '@posthog/lemon-ui'
+
+export function TraceViewLoading(): JSX.Element {
+ return (
+ <div className="flex flex-col gap-3" role="status" aria-busy="true" aria-label="Loading trace">
+ <LemonSkeleton className="h-7 w-1/3" />
+ <LemonSkeleton className="h-5 w-1/2" />
+ <LemonSkeleton className="h-8 w-60" />
+ <div className="@container">
+ <div className="flex flex-col gap-4 @3xl:flex-row">
+ <div className="flex w-full shrink-0 flex-col gap-2 @3xl:w-72">
+ <LemonSkeleton repeat={5} className="h-8" />
+ </div>
+ <LemonSkeleton className="h-64 min-w-0 flex-1" />
+ </div>
+ </div>
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.test.ts b/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.test.ts
new file mode 100644
index 000000000000..de17ee66306d
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.test.ts
@@ -0,0 +1,19 @@
+import { classifyAttachmentUrl } from './attachmentUrl'
+
+describe('classifyAttachmentUrl', () => {
+ it.each([
+ ['data:image/png;base64,iVBORw0KGgo=', 'data'],
+ ['blob:https://app.example.com/x', 'sameOrigin'],
+ ['/api/projects/1/ai_blob/abc', 'sameOrigin'],
+ ['https://media.example.com/a.mp3', 'external'],
+ ['javascript:alert(1)', null],
+ ['vbscript:x', null],
+ ['JAVASCRIPT:alert(1)', null],
+ ['//evil.example.com/x', null],
+ ['/\\evil.example.com/x', null],
+ ['', null],
+ [null, null],
+ ] as const)('classifies %p as %p', (url, expected) => {
+ expect(classifyAttachmentUrl(url)).toBe(expected)
+ })
+})
diff --git a/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.ts b/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.ts
new file mode 100644
index 000000000000..fcd115e138bb
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/attachmentUrl.ts
@@ -0,0 +1,20 @@
+export type AttachmentUrlKind = 'data' | 'sameOrigin' | 'external' | null
+
+export function classifyAttachmentUrl(url: string | null): AttachmentUrlKind {
+ if (!url) {
+ return null
+ }
+ if (/^data:/i.test(url)) {
+ return 'data'
+ }
+ // blob: never leaves the page's origin, same as a relative path. A path whose second
+ // character is `/` or `\` is protocol-relative (browsers normalize `\` to `/` here too), so
+ // the browser resolves it against an arbitrary host instead of the app.
+ if (/^blob:/i.test(url) || /^\/(?![/\\])/.test(url)) {
+ return 'sameOrigin'
+ }
+ if (/^https?:\/\//i.test(url)) {
+ return 'external'
+ }
+ return null
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/conversationalMessages.ts b/products/ai_observability/frontend/redesign/trace/components/conversationalMessages.ts
new file mode 100644
index 000000000000..acfc64354d68
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/conversationalMessages.ts
@@ -0,0 +1,5 @@
+import { ThreadMessage } from '../types'
+
+export function conversationalMessages(messages: ThreadMessage[]): ThreadMessage[] {
+ return messages.filter((message) => message.role !== 'system')
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/formatStats.test.ts b/products/ai_observability/frontend/redesign/trace/components/formatStats.test.ts
new file mode 100644
index 000000000000..f2b347ac0376
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/formatStats.test.ts
@@ -0,0 +1,83 @@
+import { NodeStats } from '../types'
+import {
+ compactStatParts,
+ formatCacheTokens,
+ formatCostUsd,
+ formatLatencyMs,
+ formatTokenCounts,
+ statParts,
+} from './formatStats'
+
+describe('formatStats', () => {
+ it.each([
+ [0, '$0'],
+ [0.0004, '<$0.001'],
+ [0.0021, '$0.0021'],
+ [0.0154, '$0.0154'],
+ [0.1257, '$0.1257'],
+ [0.5, '$0.50'],
+ [0.999, '$0.999'],
+ [1.5, '$1.50'],
+ ])('formats cost %p as %p', (cost, expected) => {
+ expect(formatCostUsd(cost)).toBe(expected)
+ })
+
+ it.each([
+ [420, '420ms'],
+ [1840, '1.84s'],
+ [999.6, '1s'],
+ [59_996, '1m'],
+ [754_000, '12m\u00a034s'],
+ ])('formats latency %p as %p', (ms, expected) => {
+ expect(formatLatencyMs(ms)).toBe(expected)
+ })
+
+ it.each([
+ [2180, 266, '2,180 in · 266 out'],
+ [128, null, '128 in'],
+ [null, 266, '266 out'],
+ [null, null, null],
+ ])('formats %p input and %p output tokens as %p', (inputTokens, outputTokens, expected) => {
+ expect(formatTokenCounts(inputTokens, outputTokens)).toBe(expected)
+ })
+
+ it.each([
+ [56210, 1585, '56,210 read · 1,585 write'],
+ [1024, null, '1,024 read'],
+ [null, 29, '29 write'],
+ [0, 0, null],
+ [null, null, null],
+ ])('formats %p cache reads and %p cache writes as %p', (readTokens, writeTokens, expected) => {
+ expect(formatCacheTokens(readTokens, writeTokens)).toBe(expected)
+ })
+
+ const unknownStats: NodeStats = {
+ costUsd: null,
+ inputTokens: null,
+ outputTokens: null,
+ cacheReadTokens: null,
+ cacheWriteTokens: null,
+ latencyMs: null,
+ }
+
+ it.each<[string, Partial<NodeStats>, string[]]>([
+ ['latency only', { latencyMs: 90 }, ['90ms']],
+ [
+ 'zero cost with cache reads and writes',
+ { costUsd: 0, inputTokens: 10, outputTokens: 5, cacheReadTokens: 8, cacheWriteTokens: 3 },
+ ['$0', '10 in · 5 out', '8 cache read', '3 cache write'],
+ ],
+ ['cache writes without reads', { cacheWriteTokens: 1585 }, ['1,585 cache write']],
+ ])('statParts omits unknown stats for %s', (_label, stats, expected) => {
+ expect(statParts({ ...unknownStats, ...stats })).toEqual(expected)
+ })
+
+ it.each<[string, Partial<NodeStats>, string[]]>([
+ ['both token sides', { inputTokens: 10, outputTokens: 5, cacheReadTokens: 8 }, ['15 tok']],
+ ['only input tokens', { inputTokens: 10 }, ['10 tok']],
+ ['only output tokens', { outputTokens: 5, latencyMs: 420 }, ['420ms', '5 tok']],
+ ['nothing known', {}, []],
+ ])('compactStatParts with %s', (_label, stats, expected) => {
+ expect(compactStatParts({ ...unknownStats, ...stats })).toEqual(expected)
+ })
+})
diff --git a/products/ai_observability/frontend/redesign/trace/components/formatStats.ts b/products/ai_observability/frontend/redesign/trace/components/formatStats.ts
new file mode 100644
index 000000000000..234c6617b0a5
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/formatStats.ts
@@ -0,0 +1,72 @@
+import { humanFriendlyDuration } from 'lib/utils/durations'
+import { humanFriendlyNumber } from 'lib/utils/numbers'
+
+import { NodeStats } from '../types'
+
+const TRAILING_ZEROS_BEYOND_CENTS = /0{1,2}$/
+
+export function formatCostUsd(costUsd: number): string {
+ if (costUsd === 0) {
+ return '$0'
+ }
+ if (costUsd < 0.001) {
+ return '<$0.001'
+ }
+ if (costUsd < 1) {
+ return `$${costUsd.toFixed(4).replace(TRAILING_ZEROS_BEYOND_CENTS, '')}`
+ }
+ return `$${humanFriendlyNumber(costUsd, 2, 2)}`
+}
+
+export function formatLatencyMs(latencyMs: number): string {
+ const roundedMs = Math.round(latencyMs)
+ if (roundedMs < 1000) {
+ return `${roundedMs}ms`
+ }
+ // Rounds before picking a unit, so 59_996ms (~60s) renders as "1m", not "60s".
+ const roundedSeconds = Math.round((roundedMs / 1000) * 100) / 100
+ if (roundedSeconds < 60) {
+ return `${humanFriendlyNumber(roundedSeconds, 2)}s`
+ }
+ return humanFriendlyDuration(roundedSeconds, { maxUnits: 2 })
+}
+
+export function formatTokenCounts(inputTokens: number | null, outputTokens: number | null): string | null {
+ const sides = [
+ inputTokens !== null ? `${humanFriendlyNumber(inputTokens, 0)} in` : null,
+ outputTokens !== null ? `${humanFriendlyNumber(outputTokens, 0)} out` : null,
+ ].filter((side): side is string => side !== null)
+ return sides.length > 0 ? sides.join(' · ') : null
+}
+
+export function formatCacheTokens(readTokens: number | null, writeTokens: number | null): string | null {
+ const sides = [
+ readTokens ? `${humanFriendlyNumber(readTokens, 0)} read` : null,
+ writeTokens ? `${humanFriendlyNumber(writeTokens, 0)} write` : null,
+ ].filter((side): side is string => side !== null)
+ return sides.length > 0 ? sides.join(' · ') : null
+}
+
+export function statParts(stats: NodeStats): string[] {
+ const tokens = formatTokenCounts(stats.inputTokens, stats.outputTokens)
+ return [
+ stats.costUsd !== null ? formatCostUsd(stats.costUsd) : null,
+ tokens,
+ stats.latencyMs !== null ? formatLatencyMs(stats.latencyMs) : null,
+ stats.cacheReadTokens ? `${humanFriendlyNumber(stats.cacheReadTokens, 0)} cache read` : null,
+ stats.cacheWriteTokens ? `${humanFriendlyNumber(stats.cacheWriteTokens, 0)} cache write` : null,
+ ].filter((part): part is string => part !== null)
+}
+
+export function compactStatParts(stats: NodeStats): string[] {
+ const knownTokens = [stats.inputTokens, stats.outputTokens].filter((count): count is number => count !== null)
+ return [
+ stats.latencyMs !== null ? formatLatencyMs(stats.latencyMs) : null,
+ knownTokens.length > 0
+ ? `${humanFriendlyNumber(
+ knownTokens.reduce((a, b) => a + b, 0),
+ 0
+ )} tok`
+ : null,
+ ].filter((part): part is string => part !== null)
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/jsonText.ts b/products/ai_observability/frontend/redesign/trace/components/jsonText.ts
new file mode 100644
index 000000000000..c5584f18d952
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/jsonText.ts
@@ -0,0 +1,14 @@
+export function isPlainObject(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
+}
+
+export function toDisplayText(value: unknown): string {
+ if (typeof value === 'string') {
+ return value
+ }
+ try {
+ return JSON.stringify(value, null, 2) ?? String(value)
+ } catch {
+ return String(value)
+ }
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/nodeKindColors.ts b/products/ai_observability/frontend/redesign/trace/components/nodeKindColors.ts
new file mode 100644
index 000000000000..2c7787703115
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/nodeKindColors.ts
@@ -0,0 +1,32 @@
+import { TraceNodeKind } from '../types'
+
+export interface NodeKindColorClasses {
+ glyphBg: string
+ barBg: string
+ barBorder: string
+}
+
+// Tailwind needs literal class strings, so every kind's classes are spelled out here rather
+// than built from the data-color number at runtime.
+export const NODE_KIND_COLORS: Record<TraceNodeKind, NodeKindColorClasses> = {
+ trace: {
+ glyphBg: 'bg-[var(--data-color-1)]',
+ barBg: 'bg-[var(--data-color-1)]/20',
+ barBorder: 'border-[var(--data-color-1)]/60',
+ },
+ span: {
+ glyphBg: 'bg-[var(--data-color-8)]',
+ barBg: 'bg-[var(--data-color-8)]/20',
+ barBorder: 'border-[var(--data-color-8)]/60',
+ },
+ generation: {
+ glyphBg: 'bg-[var(--data-color-14)]',
+ barBg: 'bg-[var(--data-color-14)]/25',
+ barBorder: 'border-[var(--data-color-14)]/60',
+ },
+ embedding: {
+ glyphBg: 'bg-[var(--data-color-11)]',
+ barBg: 'bg-[var(--data-color-11)]/25',
+ barBorder: 'border-[var(--data-color-11)]/60',
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.test.ts b/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.test.ts
new file mode 100644
index 000000000000..a8130aafed8d
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.test.ts
@@ -0,0 +1,13 @@
+import { timelineBarGeometry } from './timelineBarGeometry'
+
+describe('timelineBarGeometry', () => {
+ it.each([
+ ['a normal bar', 100, 200, 1000, { leftPercent: 10, widthPercent: 20 }],
+ ['a trace with no total duration', 0, 0, 0, { leftPercent: 0, widthPercent: 1.5 }],
+ ['a bar starting near the end of the trace', 990, 50, 1000, { leftPercent: 98.5, widthPercent: 1.5 }],
+ ['a tiny duration', 0, 1, 1000, { leftPercent: 0, widthPercent: 1.5 }],
+ ['a duration longer than the total', 0, 1500, 1000, { leftPercent: 0, widthPercent: 100 }],
+ ] as const)('gives %s the geometry %p', (_label, startMs, durationMs, totalMs, expected) => {
+ expect(timelineBarGeometry(startMs, durationMs, totalMs)).toEqual(expected)
+ })
+})
diff --git a/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.ts b/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.ts
new file mode 100644
index 000000000000..feddbd93ccd9
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/timelineBarGeometry.ts
@@ -0,0 +1,14 @@
+// Keeps instant events visible as a sliver instead of a zero-width bar.
+export const MIN_BAR_PERCENT = 1.5
+
+export interface TimelineBarGeometry {
+ leftPercent: number
+ widthPercent: number
+}
+
+export function timelineBarGeometry(startMs: number, durationMs: number, totalMs: number): TimelineBarGeometry {
+ const safeTotal = totalMs > 0 ? totalMs : 1
+ const leftPercent = Math.min((startMs / safeTotal) * 100, 100 - MIN_BAR_PERCENT)
+ const widthPercent = Math.min(Math.max((durationMs / safeTotal) * 100, MIN_BAR_PERCENT), 100 - leftPercent)
+ return { leftPercent, widthPercent }
+}
diff --git a/products/ai_observability/frontend/redesign/trace/components/timelineTicks.test.ts b/products/ai_observability/frontend/redesign/trace/components/timelineTicks.test.ts
new file mode 100644
index 000000000000..32c0c52fc4ab
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/timelineTicks.test.ts
@@ -0,0 +1,19 @@
+import { timelineTicks } from './timelineTicks'
+
+describe('timelineTicks', () => {
+ it.each([
+ ['a trace with no duration', 0, [0]],
+ ['a short trace', 3539, [0, 1000, 2000, 3000]],
+ ['a last tick too close to the end label', 2310, [0, 500, 1000, 1500]],
+ ['an agent run', 8374, [0, 2000, 4000, 6000]],
+ ['a multi-minute session', 223935, [0, 50000, 100000, 150000]],
+ ['a sub-5ms trace', 3, [0, 1, 2]],
+ ['a total that is an exact step', 1000, [0, 200, 400, 600, 800]],
+ ])('picks rounded ticks for %s', (_label, totalMs, expected) => {
+ expect(timelineTicks(totalMs).map((tick) => tick.valueMs)).toEqual(expected)
+ })
+
+ it('positions each tick by its share of the total', () => {
+ expect(timelineTicks(2000).map((tick) => tick.fraction)).toEqual([0, 0.25, 0.5, 0.75])
+ })
+})
diff --git a/products/ai_observability/frontend/redesign/trace/components/timelineTicks.ts b/products/ai_observability/frontend/redesign/trace/components/timelineTicks.ts
new file mode 100644
index 000000000000..1af6cb36ac1f
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/components/timelineTicks.ts
@@ -0,0 +1,34 @@
+const MAX_INTERVALS = 5
+const NICE_MANTISSAS = [1, 2, 5]
+// The end label sits right-aligned at 100%, so a tick this close to the end would overlap it.
+const END_LABEL_CLEARANCE = 0.15
+
+export interface TimelineTick {
+ valueMs: number
+ fraction: number
+}
+
+function niceStepMs(totalMs: number): number {
+ const minimumStep = Math.max(totalMs / MAX_INTERVALS, 1)
+ let magnitude = 10 ** Math.floor(Math.log10(minimumStep))
+ for (;;) {
+ for (const mantissa of NICE_MANTISSAS) {
+ if (mantissa * magnitude >= minimumStep) {
+ return mantissa * magnitude
+ }
+ }
+ magnitude *= 10
+ }
+}
+
+export function timelineTicks(totalMs: number): TimelineTick[] {
+ if (totalMs <= 0) {
+ return [{ valueMs: 0, fraction: 0 }]
+ }
+ const stepMs = niceStepMs(totalMs)
+ const ticks: TimelineTick[] = []
+ for (let valueMs = 0; valueMs / totalMs <= 1 - END_LABEL_CLEARANCE; valueMs += stepMs) {
+ ticks.push({ valueMs, fraction: valueMs / totalMs })
+ }
+ return ticks
+}
diff --git a/products/ai_observability/frontend/redesign/trace/sampleFixtures/anthropicMessagesThinkingToolUse.ts b/products/ai_observability/frontend/redesign/trace/sampleFixtures/anthropicMessagesThinkingToolUse.ts
new file mode 100644
index 000000000000..b28f6c8ae139
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/sampleFixtures/anthropicMessagesThinkingToolUse.ts
@@ -0,0 +1,217 @@
+import { NodeProperties, ThreadMessage, TraceTreeNode } from '../types'
+import { SampleTraceFixture, sampleStats } from './sampleTraceFixture'
+
+const TRACE_ID = '2fa60c6497874ba3c4633d94fdfae64f'
+const GENERATION_ID = 'd6263394121a6a51'
+const TIMESTAMP = '2026-09-01T12:15:02.000Z'
+
+const DRAFT_ROLLUP_CODE = `function rollupMonthly(card, history, vars) {
+ // Sum recurring spend per category, ignore anything under the noise
+ // floor, and flag categories that grew more than 20% month over month.
+ const NOISE_FLOOR = 50;
+ const GROWTH_ALERT = 0.2;
+ const buckets = {};
+
+ for (const txn of card.txns) {
+ // NOTE: coding is sometimes an empty array for uncategorized imports
+ const cat = txn.coding[0].code;
+ const amount = txn.n;
+ if (amount < NOISE_FLOOR) continue;
+ buckets[cat] = (buckets[cat] || 0) + amount;
+ }
+
+ const flagged = [];
+ for (const cat in buckets) {
+ const prior = history.find((h) => h.txt.includes(cat));
+ if (!prior) continue;
+ const delta = (buckets[cat] - prior.n) / prior.n;
+ if (delta > GROWTH_ALERT) {
+ flagged.push({ category: cat, delta, current: buckets[cat] });
+ }
+ }
+
+ return { buckets, flagged, asOf: card.due };
+}
+`
+
+const FIXED_ROLLUP_CODE = `function rollupMonthly(card, history, vars) {
+ const buckets = {};
+ for (const txn of card.txns) {
+ const cat = txn.coding?.[0]?.code ?? "uncategorized";
+ if (txn.n < 50) continue;
+ buckets[cat] = (buckets[cat] || 0) + txn.n;
+ }
+ return { buckets, asOf: card.due };
+}
+`
+
+const LINKED_CARDS_RESULT =
+ '{"profile": {"name": [{"family": "Warner", "given": ["Sophia"]}], "birthDate": "1986-09-23", "gender": "female", "address": [{"state": "CA"}], "identifier": ["cust-warner-sophia-88213045-w2"], "aliases": []}, "txns": [{"txt": "Recurring grocery charge flagged for manual review", "code": {"coding": [{"code": "grocery-recurring-monthly-04", "display": "Grocery, recurring", "version": "1"}]}, "issued": "2026-07-30T17:32:32.010Z", "due": "2026-07-27T14:27:19.000Z", "n": 89, "status": "fresh", "tags": ["needs-review-flag"]}], "notes": [], "history": [{"txt": "Matched recurring grocery debit to budget category rule", "recorded": "2026-07-13T22:42:45.723Z", "status": "completed", "attempts": 11}, {"txt": "Matched recurring rent debit to budget category rule set", "recorded": "2026-07-13T22:41:36.164Z", "status": "completed", "attempts": 6}], "flags": [], "vars": [{"k": "rent-0F5c1cd", "dep": [], "n": 1}, {"k": "grocery-754a6", "dep": [], "n": 14}, {"k": "savings-2D218597", "dep": ["budget-total-aE164", "category-e2349f"], "n": 20}], "revisions": []}'
+
+const input: ThreadMessage[] = [
+ {
+ id: `${GENERATION_ID}-in-0`,
+ role: 'user',
+ parts: [
+ {
+ kind: 'text',
+ text: "Hey, can you take another look at the Monthly Rollup card? It's supposed to sum\nrecurring transactions per category, skip anything under $50, and flag categories\nthat jumped more than 20% versus last month. Right now it's throwing an error on\nthe grocery bucket and I can't tell why. Pull the linked cards if you need context.",
+ },
+ ],
+ isInternal: false,
+ sourceNodeId: GENERATION_ID,
+ },
+ {
+ id: `${GENERATION_ID}-in-1`,
+ role: 'assistant',
+ parts: [
+ {
+ kind: 'thinking',
+ text: "I should pull the linked cards\nand variable history first to see\nwhat's actually stored here.",
+ },
+ {
+ kind: 'toolCall',
+ name: 'calc',
+ args: { code: DRAFT_ROLLUP_CODE, v: 'card_6PbgqloIxg@rollup-draft' },
+ result: LINKED_CARDS_RESULT,
+ },
+ ],
+ isInternal: true,
+ sourceNodeId: GENERATION_ID,
+ },
+]
+
+const output: ThreadMessage[] = [
+ {
+ id: `${GENERATION_ID}-out-0`,
+ role: 'assistant',
+ parts: [
+ {
+ kind: 'toolCall',
+ name: 'calc',
+ args: { v: 'card_6PbgqloIxg@rollup-fixed-guarded-v2', code: FIXED_ROLLUP_CODE },
+ },
+ ],
+ isInternal: true,
+ sourceNodeId: GENERATION_ID,
+ },
+]
+
+export const anthropicThinkingMessages: ThreadMessage[] = [...input, ...output]
+
+const generationStats = sampleStats({
+ costUsd: 0.0435,
+ inputTokens: 2,
+ outputTokens: 218,
+ cacheReadTokens: 56210,
+ cacheWriteTokens: 1585,
+ latencyMs: 3539,
+})
+
+const tree: TraceTreeNode[] = [
+ {
+ id: TRACE_ID,
+ kind: 'trace',
+ name: 'run-budget-rollup',
+ model: null,
+ stats: sampleStats({ costUsd: 0.0435, inputTokens: 2, outputTokens: 218, latencyMs: 3539 }),
+ hasError: false,
+ children: [
+ {
+ id: GENERATION_ID,
+ kind: 'generation',
+ name: 'run-budget-rollup',
+ model: 'claude-opus-5-5',
+ stats: generationStats,
+ hasError: false,
+ children: [],
+ },
+ ],
+ },
+]
+
+const traceProperties: NodeProperties = {
+ timestamp: TIMESTAMP,
+ provider: null,
+ temperature: null,
+ sessionId: null,
+ promptName: null,
+ promptVersion: null,
+ person: 'user-1',
+}
+
+export const anthropicMessagesThinkingToolUse: SampleTraceFixture = {
+ header: {
+ name: 'run-budget-rollup',
+ hasError: false,
+ olderHref: '/older',
+ newerHref: '/newer',
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+ summary: {
+ traceId: TRACE_ID,
+ timestamp: TIMESTAMP,
+ person: { label: 'user-1', href: '/person/user-1' },
+ totals: tree[0].stats,
+ },
+ tree,
+ initialNodeId: GENERATION_ID,
+ details: {
+ [TRACE_ID]: {
+ content: { kind: 'io', input: null, output: null },
+ error: null,
+ properties: traceProperties,
+ evals: { status: 'ready', results: [] },
+ raw: { id: TRACE_ID, createdAt: TIMESTAMP, traceName: 'run-budget-rollup' },
+ },
+ [GENERATION_ID]: {
+ content: { kind: 'messages', input, output },
+ error: null,
+ properties: { ...traceProperties, provider: 'anthropic.messages' },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_generation',
+ id: GENERATION_ID,
+ createdAt: TIMESTAMP,
+ properties: {
+ $ai_provider: 'anthropic.messages',
+ $ai_model: 'claude-opus-5-5',
+ $ai_span_name: 'run-budget-rollup',
+ $ai_trace_id: TRACE_ID,
+ $ai_span_id: GENERATION_ID,
+ $ai_lib: 'posthog-ai',
+ $ai_lib_version: '7.21.0',
+ $ai_latency: 3.539117633998394,
+ $ai_input_tokens: 2,
+ $ai_output_tokens: 218,
+ $ai_cache_read_input_tokens: 56210,
+ $ai_cache_creation_input_tokens: 1585,
+ $ai_stop_reason: 'tool_use',
+ $ai_http_status: 200,
+ $ai_tools_called: 'calc',
+ $ai_tool_call_count: 1,
+ resource_locator: 'personal-finance/workbooks/monthly-budget/cards/rollup-final',
+ },
+ },
+ },
+ },
+ thread: {
+ status: 'ready',
+ turns: [{ id: TRACE_ID, timestamp: TIMESTAMP, messages: anthropicThinkingMessages, error: null }],
+ activeTurnId: TRACE_ID,
+ },
+ timeline: {
+ rows: [
+ {
+ id: GENERATION_ID,
+ kind: 'generation',
+ name: 'run-budget-rollup',
+ depth: 0,
+ startMs: 0,
+ durationMs: 3539,
+ hasError: false,
+ },
+ ],
+ totalMs: 3539,
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/sampleFixtures/claudeCodePluginSession.ts b/products/ai_observability/frontend/redesign/trace/sampleFixtures/claudeCodePluginSession.ts
new file mode 100644
index 000000000000..84a0558baff5
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/sampleFixtures/claudeCodePluginSession.ts
@@ -0,0 +1,370 @@
+import { MessagePart, NodeProperties, ThreadMessage, TimelineRowData, TraceTreeNode } from '../types'
+import { SampleNodeDetail, SampleTraceFixture, sampleStats } from './sampleTraceFixture'
+
+const TRACE_ID = '88cfdcc8-1757-7012-663c-599c6649c0e6'
+const SESSION_ID = 'd716a155-3363-7994-8a77-47313258e4d4'
+const TRACE_TIMESTAMP = '2026-09-02T09:41:07.000Z'
+const GENERATION_NAME = 'claude-opus-5-5 (anthropic)'
+const MODEL = 'claude-opus-5-5'
+
+interface BashCall {
+ spanId: string
+ input: Record<string, unknown>
+ output: string
+}
+
+interface AgentStep {
+ generationId: string
+ offsetMs: number
+ outputTokens: number
+ cacheReadTokens: number
+ cacheCreationTokens: number
+ costUsd: number
+ text: string | null
+ bash: BashCall | null
+}
+
+const STEPS: AgentStep[] = [
+ {
+ generationId: '111046f5-1df3-7b7e-8bd5-2f1558c59ff3',
+ offsetMs: 0,
+ outputTokens: 138,
+ cacheReadTokens: 528409,
+ cacheCreationTokens: 29,
+ costUsd: 0.2678,
+ text: null,
+ bash: {
+ spanId: 'ece301eb-d515-777b-1bfb-b85a470af9c8',
+ input: {
+ command:
+ 'grep -rn \'name="description"\' src/pages --include="*.tsx" -A1 | head -40 && wc -l src/pages/*.tsx',
+ description: 'Search existing meta description tags',
+ },
+ output: 'src/pages/pricing.tsx:12: content="See plans and pricing."\nsrc/pages/index.tsx:9: content="Grow faster with less busywork."\nsrc/pages/blog/index.tsx:15: (no description tag found)\n3 files checked, 1 missing a description tag',
+ },
+ },
+ {
+ generationId: 'd2929d99-1ac8-7656-5531-0db60372e266',
+ offsetMs: 14478,
+ outputTokens: 583,
+ cacheReadTokens: 528438,
+ cacheCreationTokens: 247,
+ costUsd: 0.2803,
+ text: 'Found three landing pages. The blog index has no meta description at all, and the other two are under 60 characters, which Google usually truncates or rewrites.\nNext I will check title tag lengths and the sitemap before touching any copy.',
+ bash: {
+ spanId: '7b2f934f-7507-76b8-a7f8-1238cd354069',
+ input: {
+ command:
+ 'for f in src/pages/index.tsx src/pages/pricing.tsx src/pages/blog/index.tsx; do\n echo "== $f =="\n title=$(grep -o "<title>.*</title>" "$f" | head -1)\n desc=$(grep -o \'content="[^"]*"\' "$f" | head -1)\n title_len=${#title}\n desc_len=${#desc}\n echo "title: ${title:-none} (${title_len} chars)"\n echo "description: ${desc:-none} (${desc_len} chars)"\n if [ "$desc_len" -eq 0 ]; then\n echo "WARNING: no meta description found"\n fi\n echo\ndone\necho "scan complete"',
+ description: 'Check title and description length per landing page',
+ },
+ output: '== src/pages/index.tsx ==\ntitle: none (0 chars)',
+ },
+ },
+ {
+ generationId: '41cc056a-ca02-7a15-2b9a-3260cbafa9ed',
+ offsetMs: 25833,
+ outputTokens: 365,
+ cacheReadTokens: 528685,
+ cacheCreationTokens: 640,
+ costUsd: 0.2775,
+ text: null,
+ bash: {
+ spanId: '9c948663-84b3-76d4-4198-98ce2393afe2',
+ input: {
+ command:
+ 'npm run build --silent && npx --yes lighthouse-ci autorun --collect.url=https://growth-site.example.com/ --collect.url=https://growth-site.example.com/pricing --collect.url=https://growth-site.example.com/blog --collect.numberOfRuns=3 --assert.assertions.categories:seo=error --assert.assertions.categories:performance=warn --upload.target=filesystem --upload.outputDir=.lighthouseci --settings.onlyCategories=seo,performance',
+ description: 'Build the site and run a Lighthouse SEO audit',
+ timeout: 180000,
+ },
+ output: '> [email protected] build\n> next build\n\nRoute (app) Size First Load JS\n/ 4.1 kB 92.3 kB\n/pricing 3.2 kB 91.5 kB\n/blog 2.8 kB 90.9 kB\n\nLighthouse SEO score: 78/100 (missing meta description on /blog, sitemap references a 404)',
+ },
+ },
+ {
+ generationId: '555417a2-21e6-70f5-6e7b-e35ead284f26',
+ offsetMs: 199761,
+ outputTokens: 532,
+ cacheReadTokens: 529325,
+ cacheCreationTokens: 583,
+ costUsd: 0.2816,
+ text: 'The audit confirms the blog index is dragging the SEO score down, mostly because of the missing meta description and a stale sitemap that still lists a page that now returns a 404.\nI will add the missing tag on the blog index, regenerate the sitemap and robots.txt from the current route list, then rerun the audit to confirm the score moved.',
+ bash: {
+ spanId: '09a4fba1-028f-7d98-5980-8a7847d1e5ca',
+ input: {
+ command:
+ 'node scripts/generate-sitemap.mjs --base-url=https://growth-site.example.com --pages-dir=src/pages --out=public/sitemap.xml --exclude=/internal,/drafts,/archive --changefreq=weekly --priority-home=1.0 --priority-default=0.6 --lastmod=git && node scripts/generate-robots.mjs --sitemap=https://growth-site.example.com/sitemap.xml --out=public/robots.txt --disallow=/internal,/drafts,/archive --allow-crawlers=googlebot,bingbot && echo done generating sitemap and robots files for the growth site with the updated route list',
+ description: 'Regenerate sitemap.xml and robots.txt',
+ },
+ output: 'Wrote public/sitemap.xml (14 urls, excluded internal and draft pages)\nWrote public/robots.txt with the updated disallow list',
+ },
+ },
+ {
+ generationId: 'dd0d2963-cca2-78dc-70aa-0f7859ba5f98',
+ offsetMs: 211740,
+ outputTokens: 636,
+ cacheReadTokens: 529908,
+ cacheCreationTokens: 608,
+ costUsd: 0.2847,
+ text: null,
+ bash: {
+ spanId: '7f5c71be-e757-7896-3514-615e2e63a7ac',
+ input: {
+ command:
+ 'git add src/pages/blog/index.tsx public/sitemap.xml public/robots.txt && git commit -m "fix(seo): add missing blog meta description and refresh sitemap and robots file" && git push origin main --verbose && echo pushed seo fixes to main successfully with no conflicts detected in the working tree and no other pending changes left uncommitted',
+ description: 'Commit and push the SEO fixes',
+ },
+ output: '1',
+ },
+ },
+ {
+ generationId: '8070d7db-b53b-7af7-c82b-e43dc062c7e9',
+ offsetMs: 223935,
+ outputTokens: 446,
+ cacheReadTokens: 530516,
+ cacheCreationTokens: 1261,
+ costUsd: 0.2843,
+ text: "## SEO cleanup summary\n\nI looked at the three main landing pages for missing SEO basics and fixed what I found.\n\n**What was wrong**\n- `src/pages/index.tsx` and `src/pages/pricing.tsx` already had meta descriptions, both under 60 characters, which is fine.\n- `src/pages/blog/index.tsx` had no meta description at all.\n- The sitemap still referenced a page that now returns a 404, which Lighthouse flagged.\n\n**What I changed**\n- Added a meta description to the blog index page.\n- Regenerated `sitemap.xml` and `robots.txt` from the current route list, excluding internal and draft pages.\n- Ran a production build plus a Lighthouse SEO pass to confirm the fix, which moved the score up from the 78/100 it started at.\n\n**One thing to check**\nI committed and pushed to `main`, but the push exited with status 1: the pre-commit hook flagged the new meta description as one character over the usual 160-character guideline. The commit still went through since it's a warning, not a hard failure, but you may want to trim that line by a character or two next time you touch it.",
+ bash: null,
+ },
+]
+
+function timestampAt(offsetMs: number): string {
+ return new Date(Date.parse(TRACE_TIMESTAMP) + offsetMs).toISOString()
+}
+
+const baseProperties: NodeProperties = {
+ timestamp: TRACE_TIMESTAMP,
+ provider: null,
+ temperature: null,
+ sessionId: SESSION_ID,
+ promptName: null,
+ promptVersion: null,
+ person: 'user-1',
+}
+
+function stepInput(step: AgentStep): ThreadMessage[] {
+ return [
+ {
+ id: `${step.generationId}-in-0`,
+ role: 'user',
+ parts: [{ kind: 'text', text: 'seo fixes' }],
+ isInternal: false,
+ sourceNodeId: step.generationId,
+ },
+ ]
+}
+
+function stepOutput(step: AgentStep): ThreadMessage[] {
+ const parts: MessagePart[] = []
+ if (step.text) {
+ parts.push({ kind: 'text', text: step.text })
+ }
+ if (step.bash) {
+ parts.push({ kind: 'toolCall', name: 'Bash', args: step.bash.input })
+ }
+ return [
+ {
+ id: `${step.generationId}-out-0`,
+ role: 'assistant',
+ parts,
+ isInternal: parts.every((part) => part.kind === 'toolCall'),
+ sourceNodeId: step.generationId,
+ },
+ ]
+}
+
+function bashNode(bash: BashCall): TraceTreeNode {
+ return {
+ id: bash.spanId,
+ kind: 'span',
+ name: 'Bash',
+ model: null,
+ stats: sampleStats({}),
+ hasError: false,
+ children: [],
+ }
+}
+
+function stepNode(step: AgentStep): TraceTreeNode {
+ return {
+ id: step.generationId,
+ kind: 'generation',
+ name: GENERATION_NAME,
+ model: MODEL,
+ stats: sampleStats({
+ costUsd: step.costUsd,
+ inputTokens: 2,
+ outputTokens: step.outputTokens,
+ cacheReadTokens: step.cacheReadTokens,
+ cacheWriteTokens: step.cacheCreationTokens,
+ }),
+ hasError: false,
+ children: step.bash ? [bashNode(step.bash)] : [],
+ }
+}
+
+function sharedRawProperties(): Record<string, unknown> {
+ return {
+ $ai_trace_id: TRACE_ID,
+ $ai_session_id: SESSION_ID,
+ $ai_parent_id: TRACE_ID,
+ $ai_framework: 'claude-code',
+ $ai_lib: 'custom-agent-plugin',
+ $ai_project_name: 'growth-site',
+ $ai_git_branch: 'main',
+ $ai_purpose: 'seo-agent',
+ $ai_latency: null,
+ $ai_is_error: false,
+ }
+}
+
+function stepDetails(step: AgentStep): [string, SampleNodeDetail][] {
+ const timestamp = timestampAt(step.offsetMs)
+ const generation: [string, SampleNodeDetail] = [
+ step.generationId,
+ {
+ content: { kind: 'messages', input: stepInput(step), output: stepOutput(step) },
+ error: null,
+ properties: { ...baseProperties, timestamp, provider: 'anthropic' },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_generation',
+ id: step.generationId,
+ createdAt: timestamp,
+ properties: {
+ ...sharedRawProperties(),
+ $ai_span_id: step.generationId,
+ $ai_model: MODEL,
+ $ai_provider: 'anthropic',
+ $ai_input_tokens: 2,
+ $ai_output_tokens: step.outputTokens,
+ $ai_cache_read_input_tokens: step.cacheReadTokens,
+ $ai_cache_creation_input_tokens: step.cacheCreationTokens,
+ $ai_stop_reason: step.bash ? 'tool_calls' : 'stop',
+ $ai_user_prompt: 'seo fixes',
+ },
+ },
+ },
+ ]
+ if (!step.bash) {
+ return [generation]
+ }
+ const { spanId, input, output } = step.bash
+ const inputState = JSON.stringify(input)
+ return [
+ generation,
+ [
+ spanId,
+ {
+ content: { kind: 'io', input: inputState, output },
+ error: null,
+ properties: { ...baseProperties, timestamp },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_span',
+ id: spanId,
+ createdAt: timestamp,
+ properties: {
+ ...sharedRawProperties(),
+ $ai_span_id: spanId,
+ $ai_parent_id: step.generationId,
+ $ai_span_name: 'Bash',
+ $ai_input_state: inputState,
+ $ai_output_state: output,
+ },
+ },
+ },
+ ],
+ ]
+}
+
+function stepTimelineRows(step: AgentStep): TimelineRowData[] {
+ const generation: TimelineRowData = {
+ id: step.generationId,
+ kind: 'generation',
+ name: MODEL,
+ depth: 0,
+ startMs: step.offsetMs,
+ durationMs: null,
+ hasError: false,
+ }
+ if (!step.bash) {
+ return [generation]
+ }
+ return [
+ generation,
+ {
+ id: step.bash.spanId,
+ kind: 'span',
+ name: 'Bash',
+ depth: 1,
+ startMs: step.offsetMs,
+ durationMs: null,
+ hasError: false,
+ },
+ ]
+}
+
+const lastStep = STEPS[STEPS.length - 1]
+
+const traceNode: TraceTreeNode = {
+ id: TRACE_ID,
+ kind: 'trace',
+ name: 'seo fixes',
+ model: null,
+ stats: sampleStats({ costUsd: 1.6763, inputTokens: 12, outputTokens: 2700, latencyMs: 223935 }),
+ hasError: false,
+ children: STEPS.map(stepNode),
+}
+
+export const claudeCodePluginSession: SampleTraceFixture = {
+ header: {
+ name: 'seo fixes',
+ hasError: false,
+ olderHref: '/older',
+ newerHref: null,
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+ summary: {
+ traceId: TRACE_ID,
+ timestamp: TRACE_TIMESTAMP,
+ person: { label: 'user-1', href: '/person/user-1' },
+ totals: traceNode.stats,
+ },
+ tree: [traceNode],
+ initialNodeId: lastStep.generationId,
+ details: Object.fromEntries([
+ [
+ TRACE_ID,
+ {
+ content: { kind: 'io', input: null, output: null },
+ error: null,
+ properties: baseProperties,
+ evals: { status: 'ready', results: [] },
+ raw: {
+ id: TRACE_ID,
+ createdAt: TRACE_TIMESTAMP,
+ traceName: 'seo fixes',
+ aiSessionId: SESSION_ID,
+ totalLatency: 223.935,
+ inputTokens: 12,
+ outputTokens: 2700,
+ },
+ },
+ ],
+ ...STEPS.flatMap(stepDetails),
+ ]),
+ thread: {
+ status: 'ready',
+ turns: [
+ {
+ id: TRACE_ID,
+ timestamp: TRACE_TIMESTAMP,
+ messages: [...stepInput(lastStep), ...stepOutput(lastStep)],
+ error: null,
+ },
+ ],
+ activeTurnId: TRACE_ID,
+ },
+ timeline: { rows: STEPS.flatMap(stepTimelineRows), totalMs: 223935 },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/sampleFixtures/langchainCerebrasImageError.ts b/products/ai_observability/frontend/redesign/trace/sampleFixtures/langchainCerebrasImageError.ts
new file mode 100644
index 000000000000..d1a50be9ca4c
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/sampleFixtures/langchainCerebrasImageError.ts
@@ -0,0 +1,212 @@
+import { MessagePart, NodeProperties, ThreadMessage, TraceTreeNode } from '../types'
+import { SampleTraceFixture, sampleStats } from './sampleTraceFixture'
+
+const TRACE_ID = '3030b60b-110e-7653-675c-235b05cc9a77'
+const SPAN_ID = '03aaa1fa-517a-779b-ae4d-3bc682a08ab2'
+const GENERATION_ID = 'a18285a8-8cef-7877-ec78-ad8c9a72eb0a'
+const TIMESTAMP = '2026-09-03T14:02:11.000Z'
+const SPAN_TIMESTAMP = '2026-09-03T14:02:11.001Z'
+
+const ERROR_MESSAGE =
+ "Error code: 400 - {'message': \"The model 'llama3.1-70b' does not support image inputs. Remove the image_url content block from the message and resend the request, or switch to a model that supports vision.\", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'unsupported_content_type'}"
+
+const SYSTEM_PROMPT = `You are a warehouse intake assistant that extracts structured information from photographs of shipping labels and package markings.
+
+Your job is to look at the attached image and call the extract_package_label_details function with every field you can confidently read from the label. Never guess a value you cannot see clearly; leave it null instead of inventing one.
+
+## Fields
+
+- brand: the printed brand or manufacturer wordmark on the label, if visible.
+- name: the product or item name as printed on the label.
+- quantity: the unit count in the shipment, as an integer if printed.
+- estimated_weight_kg: the package weight in kilograms. Convert from pounds if the label prints lbs instead.
+- package_size_tier_code: one of the enumerated size tiers printed or implied by the carton dimensions.
+- metadata: any other key-value pairs printed on the label, such as barcodes, lot codes, or hazard symbols, that don't fit another field.
+- manufacturer: the manufacturing company name, which may differ from the brand on the front of the box.
+- country_of_manufacture: the country printed after "Made in" or an equivalent phrase.
+- expiration_date: the expiry or best-before date, normalized to ISO 8601.
+
+## Rules
+
+1. Read every visible line of text on the label before answering, including small print near the barcode.
+2. When two candidate values conflict, prefer the clearest and most complete printed value.
+3. Do not translate text; keep the original spelling and capitalization from the label.
+4. If the image is too blurry or the label is torn in a way that hides a field, leave that field null rather than guessing.`
+
+const LABEL_PHOTO: MessagePart = {
+ kind: 'attachment',
+ mediaType: 'image',
+ name: null,
+ mimeType: 'image/jpeg',
+ url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBMRXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAoKADAAQAAAABAAAAZAAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAZACgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/bAEMABwcHBwcHDAcHDBEMDAwRFxEREREXHhcXFxcXHiQeHh4eHh4kJCQkJCQkJCsrKysrKzIyMjIyODg4ODg4ODg4OP/bAEMBCQkJDg0OGQ0NGTsoISg7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O//dAAQACv/aAAwDAQACEQMRAD8Axdq+lG1fSlpD0rgNS0NPvGAZbeQgjIIQ8g/hR/Z94OtvJ/3w3+Fer6fDcf2fDJa2kdyzsVcuudoVEA5/OpY5JwP3+jqSCckRsMjrgfL1X16N25ro9j5k8x5CbK6HBgkH/AD/AIUw20ynDRMPqpr2OQMSMaOqiQgIxVjgZA+YBcgkHI+nNOu0t7N5m+w+YEfaIo0kUgZwG3glTuHPT2o9h5hzHjBhcdUP5U0xkdVx+FexiQLN5L6Y4ZyuwLJIvDAcnjHyn7x7cda1bm0tY9LN6ltKknlq+1pZAoLHBBO4dOpzj6ij2HmHMeDbQOopML7V659tt4YVlurSQK5AVjLIqkELkncTt+ZvfIpyX+mzEiKymbG7gSkkbeSDngHg8fSl7DzDmPIfk9qPk9q9qt20S6VJGjaJDOYSXk6fIXBPXB4xj1NZY1Hw84LNbzbBjGCrMWJIA29cY5z0Hej2D7hzHlOF9qML6Cve7HQtJ1O0W5EborMwAbbn5WI5+X2qw3g/SGGCG/JD/NaPYvuHMfPu1fSjavpXvx8GaRjgH/viP/4imHwVpRGP/acf/wARS9i+4cx4JtX0o2r6V7v/AMIPpfr/AOOR/wDxNVL3wbpdrZzXS4YxRs4BRcHaM84ANHsWHMjxPavpRtX0qxdqi3UyRjCrIwA9ACcVBWJR/9DGpD0paQ9DXAan0P4WXZpSgnq7D/vnj+ldJXB2n2CPToY72SSNmaUK0eQceYM8jkdunbNTuNBln3pfTI+3GFc9BjPOPxPNdyMjtaK5i2XTjmaG7nm+zEyuGYngluCCBx1xUDT6W8soOoysCHXywxHPzE7cAEkf0FMDrqK57FvYSMLjUHBlQgB2+7nOGHp061EGszZGA6mW3sCJS/I4AxkH9M0AdIyqwwwBHXn2oCqowoA78e9YCmO3t2jfUhulKvG8hXIXIGByMg4x+NVmU7kEerkBiW52tnbjv0A/nmgDpI7e3iUrFGqBmLEKAMk9T9ad5URGNo9OlYpMptlij1FTJHnfIQvOeRx0GBTRDqbj/RdRSRlGSCinPUc46DOPyoA3wAOBS1l2bSxF/td2k2OwCrjk8nFXkngkOI5FY89CD04NAE1FR+bH5nlbhvwTtzzgdTipKACs3WDjSbv3hcfmpFaCujKGUgg9x0rN1o40m594yPz4oA+cLvm7mP8A00f+ZqCprk5uZSO7t/M1DXAan//RxqQ9DS0deK4DU+gNLN9HYxfZo1kXdLuzjIPmdskds1cjjvXjlkls4VlGNmcHdnG7PJx09e1T6GCNOXP9+T/0M1r13mRjWoumuX82yjiVwFZ9wyyjOBgZ9fXuaqxC7aZFbTIo1L4L7lOF554Hcfzro6KAOclublpGQ6V5m0lASVwUHTr29qjcbVIfTF/iyFAwFOO4HU109FAHOtHaube2OnGQCJSCwBCDPCknuOTVVnhaM79IYrJgkBRknKnkHHfnn0rrKKAOYdrZIYLltNct1CqMlMHAznHb8qms2t47drm2sZIBFkhANpY5Pbv1zz610NFAHJmPTZlmll06VWhXeQR97JPC88/ypVl0w4mW0uEET5BKYyV3ccnOM5NdXRQBzmnyabdXMyQ2ssbSqxd5FIBDEZGT6ntU8XhzSYeYYip45DN27delblFAGMugaapJRCu7HGTgbcYwOg6CqGraTaQae8yFy6DALMT94gc5611FZOuf8guX6p/6EKAPm+Y5mcjux/nUdOfl2PuabXAan//SxqUDJApKdGMyKB3IrgNT6T0X/kHJ/vP/AOhmtWsrRf8AkGx/V/8A0I1q13mQUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAVk65/wAgyX6p/wChCtasfXiBpcufVP8A0IUAfNp60UUVwGp//9PGqWAEzxgd2H86iqe1/wCPqH/rov8AMVwGp9HaJ/yDIvfcfzY1q18p/EfV9UsdRs4bG7mgQ2yttjkZRzvOcA/SqcHiHxB5k0Y1C5wGjCjzX7wscDn15+td5kfXFFfH114s8SxyMsep3IBlwv7xumW46+mKsxeL/FIkZRqVxtCMfv552+/vQB9cUV8sDxh4nFwsa6jNgg8ZB5wvt71ZPjLxSskypfykB5QPun7qpjt2JNAH09RXyxJ478WR2UUi6g+5iSSQvTeAO3pRZ+P/ABe0kKyXzEOyBsqnou7t9aAPqeivkOz+J3jYxbnvt2Y92TGnXL+3sK0Zfid4zhjZlu1J3kDMSHgZ9qAPquivmy2+JHixoDI88bHyVfmNep3emPQVTPxV8XJeND5kDKB3jHGI2bsfUCgD6for5rt/ir4qZ1D/AGcgmMf6s/xE5/ip9r8WPE8krq6WxCtIPuN/DHuH8XrQB9I1ieIv+QVJ/vJ/6EK8Nu/i34kt5IlWG2IeN3OVbqvT+Ku507xHe+JPDV5dXyRo0Nyka+WCBjCNzknuaGB5QOgpaQdBS1wGp//Uxqs2YJvIAP8Anon/AKEKrU+KR4ZVmjOGRgw+o5FcBqU/iTp2oXep2UlrbSyr9jjGURmH3T3Aqhb6ffi7cG3lGZYv4G7QsPT1rtk8SarGoRJCqgYADOAB7ANgVKPFWsAY81v++5P/AIqur20SOVnlN3Z3nnRjyJP9eD9w9MH2qaK3uBI+Y3H7tv4T6rXqY8W60BjzW/77f/4qnjxhrY480/8AfT//ABVHtohys83SOQX8QKMPmPY/7FWEBEsmQR885/RBXoY8ZawBy+T67m/xpw8Z6p/Fz+P+INHtohys8iueLCAHg+Wv/oYpbVl82Hkf6xv/AEGvXP8AhMdQP3kU/XB/mppP+EtuWOXgQkdOE/rGaftYhys8CtP+PQf9cV/nLWheEeUP99/5mvaD4lVsB7SPjp8kX9Yqa2v2zjEllCwHTdHCf/aQo9rEOVnm1t/x6v8A9cI/51hf8xGb/gf/AKJNe0f8JBbEFTYwEEYwYoj/ACQVGdZ00sWbTLQlskkwR8569AKPax7i5WeUQ9V+o/8AQWpLL/XXH+9N/wCiq9ZXWNKzltLtOMEYgUcjp3HqaRdS0AE/8Sq2Gck4hA5Ix2b04o9rHuHKzyfU/wDj7h/3Zf5SV7V4T/5EnUP+v1f/AECKs6S/8NTvvn0mBjgjPl4POSej+pNXD4h06PT302ytRbxO5kKxrjLkYycufah1I23Hys40dKWiiuQs/9XA8xqPMamUVwmo/wAxqPMamUUAP8xqPMamUUAP8xqPMamUUAP8xqPMamUUAP8AMajzGplFAD/MajzGplFAD/MajzGplFAD/MajzGplFAD/ADGo8xqZRQB//9k=',
+}
+
+function labelMessages(sourceNodeId: string): ThreadMessage[] {
+ return [
+ {
+ id: `${sourceNodeId}-in-0`,
+ role: 'system',
+ parts: [{ kind: 'text', text: SYSTEM_PROMPT }],
+ isInternal: false,
+ sourceNodeId,
+ },
+ {
+ id: `${sourceNodeId}-in-1`,
+ role: 'user',
+ parts: [LABEL_PHOTO],
+ isInternal: false,
+ sourceNodeId,
+ },
+ ]
+}
+
+export const cerebrasLabelMessages: ThreadMessage[] = labelMessages(GENERATION_ID)
+
+const tree: TraceTreeNode[] = [
+ {
+ id: TRACE_ID,
+ kind: 'trace',
+ name: 'scan_package',
+ model: null,
+ stats: sampleStats({ latencyMs: 2133 }),
+ hasError: true,
+ children: [
+ {
+ id: SPAN_ID,
+ kind: 'span',
+ name: 'RunnableSequence',
+ model: null,
+ stats: sampleStats({ latencyMs: 2008 }),
+ hasError: true,
+ children: [
+ {
+ id: GENERATION_ID,
+ kind: 'generation',
+ name: 'extract_shipping_label_fields_llm',
+ model: 'qwen-3.8-27b',
+ stats: sampleStats({ latencyMs: 2004 }),
+ hasError: true,
+ children: [],
+ },
+ ],
+ },
+ ],
+ },
+]
+
+const traceProperties: NodeProperties = {
+ timestamp: TIMESTAMP,
+ provider: null,
+ temperature: null,
+ sessionId: TRACE_ID,
+ promptName: null,
+ promptVersion: null,
+ person: 'user-1',
+}
+
+const sharedRawProperties: Record<string, unknown> = {
+ $ai_trace_id: TRACE_ID,
+ $ai_session_id: TRACE_ID,
+ $ai_framework: 'langchain',
+ $ai_is_error: true,
+ $ai_error: ERROR_MESSAGE,
+ $lib: 'posthog-python',
+ $lib_version: '7.44.2',
+ $python_version: '3.12.14',
+ $os: 'Linux',
+}
+
+export const langchainCerebrasImageError: SampleTraceFixture = {
+ header: {
+ name: 'scan_package',
+ hasError: true,
+ olderHref: '/older',
+ newerHref: '/newer',
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+ summary: {
+ traceId: TRACE_ID,
+ timestamp: TIMESTAMP,
+ person: { label: 'user-1', href: '/person/user-1' },
+ totals: tree[0].stats,
+ },
+ tree,
+ initialNodeId: GENERATION_ID,
+ details: {
+ [TRACE_ID]: {
+ content: { kind: 'io', input: null, output: null },
+ error: null,
+ properties: traceProperties,
+ evals: { status: 'ready', results: [] },
+ raw: { id: TRACE_ID, createdAt: TIMESTAMP, traceName: 'scan_package', totalLatency: 2.133077383041382 },
+ },
+ [SPAN_ID]: {
+ content: { kind: 'messages', input: labelMessages(SPAN_ID), output: [] },
+ error: ERROR_MESSAGE,
+ properties: { ...traceProperties, timestamp: SPAN_TIMESTAMP },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_span',
+ id: SPAN_ID,
+ createdAt: SPAN_TIMESTAMP,
+ properties: {
+ ...sharedRawProperties,
+ $ai_span_id: SPAN_ID,
+ $ai_parent_id: TRACE_ID,
+ $ai_span_name: 'RunnableSequence',
+ $ai_latency: 2.0081095695495605,
+ },
+ },
+ },
+ [GENERATION_ID]: {
+ content: { kind: 'messages', input: cerebrasLabelMessages, output: [] },
+ error: ERROR_MESSAGE,
+ properties: { ...traceProperties, provider: 'cerebras', temperature: 0 },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_generation',
+ id: GENERATION_ID,
+ createdAt: TIMESTAMP,
+ properties: {
+ ...sharedRawProperties,
+ $ai_span_id: GENERATION_ID,
+ $ai_parent_id: SPAN_ID,
+ $ai_span_name: 'extract_shipping_label_fields_llm',
+ $ai_provider: 'cerebras',
+ $ai_model: 'qwen-3.8-27b',
+ $ai_model_parameters: { max_tokens: 2048, stream: false, temperature: 0 },
+ $ai_http_status: 400,
+ $ai_latency: 2.0036303997039795,
+ },
+ },
+ },
+ },
+ thread: {
+ status: 'ready',
+ turns: [{ id: TRACE_ID, timestamp: TIMESTAMP, messages: cerebrasLabelMessages, error: ERROR_MESSAGE }],
+ activeTurnId: TRACE_ID,
+ },
+ timeline: {
+ rows: [
+ {
+ id: SPAN_ID,
+ kind: 'span',
+ name: 'RunnableSequence',
+ depth: 0,
+ startMs: 0,
+ durationMs: 2008,
+ hasError: true,
+ },
+ {
+ id: GENERATION_ID,
+ kind: 'generation',
+ name: 'extract_shipping_label_fields_llm',
+ depth: 1,
+ startMs: 3,
+ durationMs: 2004,
+ hasError: true,
+ },
+ ],
+ totalMs: 2008,
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/sampleFixtures/openaiAgentsWithEvals.ts b/products/ai_observability/frontend/redesign/trace/sampleFixtures/openaiAgentsWithEvals.ts
new file mode 100644
index 000000000000..6b9ae19736a2
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/sampleFixtures/openaiAgentsWithEvals.ts
@@ -0,0 +1,394 @@
+import { EvalResult, NodeProperties, ThreadMessage, TraceTreeNode } from '../types'
+import { SampleNodeDetail, SampleTraceFixture, sampleStats } from './sampleTraceFixture'
+
+const TRACE_ID = 'trace_5gL08JNGqLvX2XcwWRWBmJgj6s6VwJcE'
+const AGENT_SPAN_ID = 'span_xCcAWaoMGK3OoppmlOJIXhhd'
+const PLAN_GENERATION_ID = 'span_FYJ2pRLptL4UCIwPXGLln0GK'
+const TOOL_SPAN_ID = 'span_CULdQjgMziv9EbJnburSgu3D'
+const ANSWER_GENERATION_ID = 'span_ctqufTsp1mJkbrbkhXzicEWV'
+const EVALUATION_ID = 'cbf8ebc8-3e71-746e-5386-1e791507a148'
+
+const TRACE_TIMESTAMP = '2026-09-24T10:18:24.262Z'
+const ANSWER_TIMESTAMP = '2026-09-24T10:18:30.258Z'
+const AGENT_TIMESTAMP = '2026-09-24T10:18:30.259Z'
+
+const MODEL = 'gpt-5.6-luna'
+const GENERATION_NAME = `${MODEL} (openai)`
+
+const USER_REQUEST =
+ "Can you check if there are family rooms available in Lisbon for the last week of October, and let me know if I'll need a visa?\nWe're a family of 4, flying from Toronto."
+
+const SEARCH_RESULTS = `Search results for: Lisbon, check-in 2026-10-24, check-out 2026-10-31, guests: 2 adults + 2 children
+Filters applied: family room required, free cancellation, max distance 6 km from center
+
+1. Hotel Alfama Vista
+ Rating: 4.6/5 (1204 reviews)
+ Family room: Yes, sleeps 4, 32 sqm
+ Price: EUR 189/night (7 nights: EUR 1323)
+ Cancellation: Free until 48h before check-in
+ Distance to center: 0.8 km
+ Amenities: Rooftop pool, breakfast included, pet friendly
+
+2. Baixa Riverside Suites
+ Rating: 4.4/5 (876 reviews)
+ Family room: Yes, sleeps 4, 28 sqm
+ Price: EUR 165/night (7 nights: EUR 1155)
+ Cancellation: Free until 48h before check-in
+ Distance to center: 0.4 km
+ Amenities: River view, kitchenette, no breakfast
+
+3. Belem Garden Hotel
+ Rating: 4.7/5 (592 reviews)
+ Family room: Yes, sleeps 4, 35 sqm
+ Price: EUR 210/night (7 nights: EUR 1470)
+ Cancellation: Free until 48h before check-in
+ Distance to center: 3.1 km
+ Amenities: Garden courtyard, spa, breakfast included
+
+Visa note: Canadian passport holders do not require a visa for stays under 90 days in Portugal (Schengen area).
+Currency: EUR. Card payment accepted at all listed properties.
+Availability last checked: 2026-09-24 10:18 UTC. Prices may change if booked more than 48 hours from now.`
+
+const FINAL_ANSWER =
+ '{"summary": "Found three family-friendly hotels in Lisbon with rooms for late October, and Canadian passport holders don\'t need a visa for this trip.", "details": {"type": "text", "content": "# Lisbon Family Trip, Oct 24-31\\n\\n## Visa\\nCanadian passport holders do not need a visa for stays under 90 days in Portugal, since it\'s in the Schengen area. Just make sure your passport is valid at least 3 months past your return date. Bring a printed copy of your return flight in case border control asks.\\n\\n## Recommended hotels (family room, sleeps 4)\\n\\n**1. Hotel Alfama Vista** - EUR 189/night, EUR 1,323 total\\n- Rooftop pool, breakfast included, pet friendly\\n- 0.8 km from the center, rated 4.6/5, 1,204 reviews\\n\\n**2. Baixa Riverside Suites** - EUR 165/night, EUR 1,155 total\\n- River view, kitchenette, no breakfast\\n- 0.4 km from the center, rated 4.4/5, 876 reviews\\n\\n**3. Belem Garden Hotel** - EUR 210/night, EUR 1,470 total\\n- Garden courtyard, spa, breakfast included\\n- 3.1 km from the center, rated 4.7/5, 592 reviews\\n\\nAll three have free cancellation until 48 hours before check-in, so you can book now and adjust later if plans shift."}}'
+
+function userRequest(sourceNodeId: string): ThreadMessage {
+ return {
+ id: `${sourceNodeId}-in-0`,
+ role: 'user',
+ parts: [{ kind: 'text', text: USER_REQUEST }],
+ isInternal: false,
+ sourceNodeId,
+ }
+}
+
+const planInput: ThreadMessage[] = [userRequest(PLAN_GENERATION_ID)]
+
+const planOutput: ThreadMessage[] = [
+ {
+ id: `${PLAN_GENERATION_ID}-out-1`,
+ role: 'assistant',
+ parts: [{ kind: 'toolCall', name: 'search_hotels', args: {} }],
+ isInternal: true,
+ sourceNodeId: PLAN_GENERATION_ID,
+ },
+]
+
+const answerInput: ThreadMessage[] = [
+ userRequest(ANSWER_GENERATION_ID),
+ {
+ id: `${ANSWER_GENERATION_ID}-in-2`,
+ role: 'assistant',
+ parts: [{ kind: 'toolCall', name: 'search_hotels', args: {}, result: SEARCH_RESULTS }],
+ isInternal: true,
+ sourceNodeId: ANSWER_GENERATION_ID,
+ },
+]
+
+const answerOutput: ThreadMessage[] = [
+ {
+ id: `${ANSWER_GENERATION_ID}-out-1`,
+ role: 'assistant',
+ parts: [{ kind: 'text', text: FINAL_ANSWER }],
+ isInternal: false,
+ sourceNodeId: ANSWER_GENERATION_ID,
+ },
+]
+
+const EVALUATION_HREF = `/evaluations/${EVALUATION_ID}`
+
+function evalRun(runId: string, timestamp: string, reasoning: string): EvalResult {
+ return {
+ id: `${EVALUATION_ID}-${runId}`,
+ name: 'no_fabrication',
+ href: EVALUATION_HREF,
+ outcome: 'pass',
+ label: 'True',
+ reasoning,
+ timestamp,
+ isBackfill: false,
+ target: null,
+ }
+}
+
+const planEval = evalRun(
+ '2864bb23-1838-757a-f65e-83f2826cbbc2',
+ '2026-09-24T10:18:41.508Z',
+ 'The tool call result matches the cited hotel data exactly.'
+)
+
+const answerEval = evalRun(
+ '65ed9ea6-398b-7c59-32bc-a32577820244',
+ '2026-09-24T10:18:44.917Z',
+ 'The final answer only cites facts present in the tool output.'
+)
+
+const answerHelpfulness: EvalResult = {
+ id: 'b7d31f02-6a4e-4c19-9e58-0f2c7a91d3e6',
+ name: 'helpfulness',
+ href: '/evaluations/b7d31f02-6a4e-4c19-9e58-0f2c7a91d3e6',
+ outcome: 'unrated',
+ label: '0.9',
+ reasoning: 'Covers both hotels and the visa question, with prices and cancellation terms.',
+ timestamp: '2026-09-20T03:02:11.000Z',
+ isBackfill: true,
+ target: null,
+}
+
+export const openaiAgentsEvals: EvalResult[] = [planEval, answerEval, answerHelpfulness]
+
+const traceEvals: EvalResult[] = [
+ { ...planEval, target: { label: GENERATION_NAME, nodeId: PLAN_GENERATION_ID } },
+ { ...answerEval, target: { label: GENERATION_NAME, nodeId: ANSWER_GENERATION_ID } },
+ { ...answerHelpfulness, target: { label: GENERATION_NAME, nodeId: ANSWER_GENERATION_ID } },
+]
+
+const planStats = sampleStats({ costUsd: 0.0016, inputTokens: 853, outputTokens: 49, latencyMs: 2376 })
+const answerStats = sampleStats({ costUsd: 0.0079, inputTokens: 1616, outputTokens: 586, latencyMs: 5995 })
+const runTotals = { costUsd: 0.0094, inputTokens: 2469, outputTokens: 635 }
+
+const tree: TraceTreeNode[] = [
+ {
+ id: TRACE_ID,
+ kind: 'trace',
+ name: 'Trip Planning',
+ model: null,
+ stats: sampleStats({ ...runTotals, latencyMs: 8377 }),
+ hasError: false,
+ children: [
+ {
+ id: AGENT_SPAN_ID,
+ kind: 'span',
+ name: 'trip-concierge-agent-run',
+ model: null,
+ stats: sampleStats({ ...runTotals, latencyMs: 8374 }),
+ hasError: false,
+ children: [
+ {
+ id: PLAN_GENERATION_ID,
+ kind: 'generation',
+ name: GENERATION_NAME,
+ model: MODEL,
+ stats: planStats,
+ hasError: false,
+ children: [],
+ },
+ {
+ id: TOOL_SPAN_ID,
+ kind: 'span',
+ name: 'search_hotels',
+ model: null,
+ stats: sampleStats({}),
+ hasError: false,
+ children: [],
+ },
+ {
+ id: ANSWER_GENERATION_ID,
+ kind: 'generation',
+ name: GENERATION_NAME,
+ model: MODEL,
+ stats: answerStats,
+ hasError: false,
+ children: [],
+ },
+ ],
+ },
+ ],
+ },
+]
+
+const traceProperties: NodeProperties = {
+ timestamp: TRACE_TIMESTAMP,
+ provider: null,
+ temperature: null,
+ sessionId: null,
+ promptName: null,
+ promptVersion: null,
+ person: 'user-1',
+}
+
+const sharedRawProperties: Record<string, unknown> = {
+ $ai_trace_id: TRACE_ID,
+ $ai_parent_id: AGENT_SPAN_ID,
+ $ai_framework: 'openai-agents',
+ $ai_provider: 'openai',
+ $ai_lib: 'posthog-ai',
+ $ai_lib_version: '8.3.0',
+ feature: 'trip_concierge_agent',
+}
+
+function generationDetail(
+ id: string,
+ timestamp: string,
+ input: ThreadMessage[],
+ output: ThreadMessage[],
+ evalResults: EvalResult[],
+ rawProperties: Record<string, unknown>
+): SampleNodeDetail {
+ return {
+ content: { kind: 'messages', input, output },
+ error: null,
+ properties: { ...traceProperties, timestamp, provider: 'openai' },
+ evals: { status: 'ready', results: evalResults },
+ raw: {
+ event: '$ai_generation',
+ id,
+ createdAt: timestamp,
+ properties: { ...sharedRawProperties, $ai_span_id: id, $ai_model: MODEL, ...rawProperties },
+ },
+ }
+}
+
+export const openaiAgentsWithEvals: SampleTraceFixture = {
+ header: {
+ name: 'Trip Planning',
+ hasError: false,
+ olderHref: '/older',
+ newerHref: '/newer',
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+ summary: {
+ traceId: TRACE_ID,
+ timestamp: TRACE_TIMESTAMP,
+ person: { label: 'user-1', href: '/person/user-1' },
+ totals: tree[0].stats,
+ },
+ tree,
+ initialNodeId: ANSWER_GENERATION_ID,
+ details: {
+ [TRACE_ID]: {
+ content: { kind: 'io', input: null, output: null },
+ error: null,
+ properties: traceProperties,
+ evals: { status: 'ready', results: traceEvals },
+ raw: {
+ id: TRACE_ID,
+ createdAt: TRACE_TIMESTAMP,
+ traceName: 'Trip Planning',
+ totalLatency: 8.377000093460083,
+ traceMetadata: { userId: '9432f4d0-1a38-7c4a-a840-a22446331b7d' },
+ },
+ },
+ [AGENT_SPAN_ID]: {
+ content: { kind: 'io', input: null, output: null },
+ error: null,
+ properties: { ...traceProperties, timestamp: AGENT_TIMESTAMP },
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_span',
+ id: AGENT_SPAN_ID,
+ createdAt: AGENT_TIMESTAMP,
+ properties: {
+ ...sharedRawProperties,
+ $ai_span_id: AGENT_SPAN_ID,
+ $ai_parent_id: null,
+ $ai_span_name: 'trip-concierge-agent-run',
+ $ai_span_type: 'agent',
+ $ai_latency: 8.374000072479248,
+ $ai_agent_output_type: 'ZodOutput',
+ $ai_agent_handoffs: ['ItineraryAgent'],
+ $ai_agent_tools: [
+ 'search_flights',
+ 'check_visa_requirements',
+ 'get_weather_forecast',
+ 'search_hotels',
+ 'convert_currency',
+ ],
+ },
+ },
+ },
+ [PLAN_GENERATION_ID]: generationDetail(PLAN_GENERATION_ID, TRACE_TIMESTAMP, planInput, planOutput, [planEval], {
+ $ai_response_id: 'resp_t6UzdDRX3JALmEQgkpmbjNstpSizyPOtAY3iwM7txHDAbsznsI',
+ $ai_input_tokens: 853,
+ $ai_output_tokens: 49,
+ $ai_latency: 2.376000165939331,
+ $ai_tools_called: 'search_hotels',
+ $ai_tool_call_count: 1,
+ }),
+ [TOOL_SPAN_ID]: {
+ content: { kind: 'io', input: '{}', output: SEARCH_RESULTS },
+ error: null,
+ properties: traceProperties,
+ evals: { status: 'ready', results: [] },
+ raw: {
+ event: '$ai_span',
+ id: TOOL_SPAN_ID,
+ createdAt: TRACE_TIMESTAMP,
+ properties: {
+ ...sharedRawProperties,
+ $ai_span_id: TOOL_SPAN_ID,
+ $ai_span_name: 'search_hotels',
+ $ai_span_type: 'tool',
+ $ai_latency: 0,
+ $ai_input_state: '{}',
+ },
+ },
+ },
+ [ANSWER_GENERATION_ID]: generationDetail(
+ ANSWER_GENERATION_ID,
+ ANSWER_TIMESTAMP,
+ answerInput,
+ answerOutput,
+ [answerEval, answerHelpfulness],
+ {
+ $ai_response_id: 'resp_klx2gvAQZnLtNaXUgbFxg2L7Az15GoJGFMNBt6s847mQpP4v54',
+ $ai_input_tokens: 1616,
+ $ai_output_tokens: 586,
+ $ai_latency: 5.995000123977661,
+ }
+ ),
+ },
+ thread: {
+ status: 'ready',
+ turns: [
+ {
+ id: TRACE_ID,
+ timestamp: TRACE_TIMESTAMP,
+ messages: [...answerInput, ...answerOutput],
+ error: null,
+ },
+ ],
+ activeTurnId: TRACE_ID,
+ },
+ timeline: {
+ rows: [
+ {
+ id: AGENT_SPAN_ID,
+ kind: 'span',
+ name: 'trip-concierge-agent-run',
+ depth: 0,
+ startMs: 0,
+ durationMs: 8374,
+ hasError: false,
+ },
+ {
+ id: PLAN_GENERATION_ID,
+ kind: 'generation',
+ name: MODEL,
+ depth: 1,
+ startMs: 1,
+ durationMs: 2376,
+ hasError: false,
+ },
+ {
+ id: TOOL_SPAN_ID,
+ kind: 'span',
+ name: 'search_hotels',
+ depth: 1,
+ startMs: 2377,
+ durationMs: null,
+ hasError: false,
+ },
+ {
+ id: ANSWER_GENERATION_ID,
+ kind: 'generation',
+ name: MODEL,
+ depth: 1,
+ startMs: 2378,
+ durationMs: 5995,
+ hasError: false,
+ },
+ ],
+ totalMs: 8374,
+ },
+}
diff --git a/products/ai_observability/frontend/redesign/trace/sampleFixtures/sampleTraceFixture.ts b/products/ai_observability/frontend/redesign/trace/sampleFixtures/sampleTraceFixture.ts
new file mode 100644
index 000000000000..8739a3b32933
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/sampleFixtures/sampleTraceFixture.ts
@@ -0,0 +1,22 @@
+import { NodeDetailProps } from '../components/NodeDetail'
+import { TraceViewReadyProps } from '../components/TraceView'
+import { NodeStats } from '../types'
+
+export type SampleNodeDetail = Omit<NodeDetailProps, 'node' | 'tab' | 'onTabChange' | 'onViewInThread' | 'onSelectNode'>
+
+export type SampleTraceFixture = Pick<TraceViewReadyProps, 'header' | 'summary' | 'tree' | 'thread' | 'timeline'> & {
+ initialNodeId: string
+ details: Record<string, SampleNodeDetail>
+}
+
+export function sampleStats(stats: Partial<NodeStats>): NodeStats {
+ return {
+ costUsd: null,
+ inputTokens: null,
+ outputTokens: null,
+ cacheReadTokens: null,
+ cacheWriteTokens: null,
+ latencyMs: null,
+ ...stats,
+ }
+}
diff --git a/products/ai_observability/frontend/redesign/trace/storyFixtures.tsx b/products/ai_observability/frontend/redesign/trace/storyFixtures.tsx
new file mode 100644
index 000000000000..75be2e11b317
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/storyFixtures.tsx
@@ -0,0 +1,426 @@
+import type { Decorator } from '@storybook/react'
+
+import { SampleNodeDetail, SampleTraceFixture } from './sampleFixtures/sampleTraceFixture'
+import {
+ ConversationTurn,
+ EvalResult,
+ MessagePart,
+ NodeProperties,
+ NodeStats,
+ ThreadMessage,
+ TimelineRowData,
+ TraceTreeNode,
+} from './types'
+
+export const FIXTURE_STATS: NodeStats = {
+ costUsd: 0.0021,
+ inputTokens: 1840,
+ outputTokens: 212,
+ cacheReadTokens: 1024,
+ cacheWriteTokens: 312,
+ latencyMs: 2310,
+}
+
+const noStats: NodeStats = {
+ costUsd: null,
+ inputTokens: null,
+ outputTokens: null,
+ cacheReadTokens: null,
+ cacheWriteTokens: null,
+ latencyMs: null,
+}
+
+export const FIXTURE_TREE: TraceTreeNode[] = [
+ {
+ id: 'trace-1',
+ kind: 'trace',
+ name: 'answer-billing-question',
+ model: null,
+ stats: FIXTURE_STATS,
+ hasError: false,
+ children: [
+ {
+ id: 'span-retrieve',
+ kind: 'span',
+ name: 'retrieve-context',
+ model: null,
+ stats: { ...noStats, latencyMs: 410 },
+ hasError: false,
+ children: [
+ {
+ id: 'embed-question',
+ kind: 'embedding',
+ name: 'embed-question',
+ model: 'text-embedding-3-small',
+ stats: { ...noStats, inputTokens: 18, latencyMs: 120, costUsd: 0 },
+ hasError: false,
+ children: [],
+ },
+ {
+ id: 'span-search',
+ kind: 'span',
+ name: 'search-help-center',
+ model: null,
+ stats: { ...noStats, latencyMs: 260 },
+ hasError: false,
+ children: [],
+ },
+ ],
+ },
+ {
+ id: 'gen-answer',
+ kind: 'generation',
+ name: 'draft-answer',
+ model: 'gpt-4.1-mini',
+ stats: {
+ costUsd: 0.0021,
+ inputTokens: 1822,
+ outputTokens: 212,
+ cacheReadTokens: 1024,
+ cacheWriteTokens: 312,
+ latencyMs: 1880,
+ },
+ hasError: false,
+ children: [],
+ },
+ ],
+ },
+]
+
+export const FIXTURE_GENERATION_PROPERTIES: NodeProperties = {
+ timestamp: '2026-09-01T10:15:02Z',
+ provider: 'openai',
+ temperature: 0.2,
+ sessionId: 'sess-7f3a',
+ promptName: 'billing-answer',
+ promptVersion: 6,
+ person: '[email protected]',
+}
+
+export const FIXTURE_SPAN_PROPERTIES: NodeProperties = {
+ timestamp: '2026-09-01T10:15:00Z',
+ provider: null,
+ temperature: null,
+ sessionId: 'sess-7f3a',
+ promptName: null,
+ promptVersion: null,
+ person: '[email protected]',
+}
+
+export const FIXTURE_GENERATION_INPUT: ThreadMessage[] = [
+ {
+ id: 'm-system',
+ role: 'system',
+ parts: [
+ {
+ kind: 'text',
+ text: 'You answer billing questions for Hedgebox.\n\n## Rules\n- Use only the provided articles.\n- Keep answers **short**.',
+ },
+ ],
+ isInternal: true,
+ sourceNodeId: 'gen-answer',
+ },
+ {
+ id: 'm-user',
+ role: 'user',
+ parts: [{ kind: 'text', text: 'Why did my invoice go up this month?' }],
+ isInternal: false,
+ sourceNodeId: 'gen-answer',
+ },
+ {
+ id: 'm-tool',
+ role: 'assistant',
+ parts: [
+ {
+ kind: 'toolCall',
+ name: 'lookup_invoice',
+ args: { month: '2026-08' },
+ result: { seats: { before: 4, after: 6 }, total_usd: 180 },
+ },
+ ],
+ isInternal: true,
+ sourceNodeId: 'gen-answer',
+ },
+]
+
+export const FIXTURE_GENERATION_OUTPUT: ThreadMessage[] = [
+ {
+ id: 'm-answer',
+ role: 'assistant',
+ parts: [
+ {
+ kind: 'text',
+ text: 'Your team went from **4 to 6 seats** on August 12, so the invoice includes two extra seats for the rest of the month.',
+ },
+ ],
+ isInternal: false,
+ sourceNodeId: 'gen-answer',
+ },
+]
+
+export const FIXTURE_GENERATION_MESSAGES: ThreadMessage[] = [...FIXTURE_GENERATION_INPUT, ...FIXTURE_GENERATION_OUTPUT]
+
+export const FIXTURE_TURN: ConversationTurn = {
+ id: 'trace-1',
+ timestamp: '2026-09-01T10:15:00Z',
+ messages: FIXTURE_GENERATION_MESSAGES,
+ error: null,
+}
+
+export const FIXTURE_TIMELINE_ROWS: TimelineRowData[] = [
+ {
+ id: 'trace-1',
+ kind: 'trace',
+ name: 'answer-billing-question',
+ depth: 0,
+ startMs: 0,
+ durationMs: 2310,
+ hasError: false,
+ },
+ {
+ id: 'span-retrieve',
+ kind: 'span',
+ name: 'retrieve-context',
+ depth: 1,
+ startMs: 10,
+ durationMs: 410,
+ hasError: false,
+ },
+ {
+ id: 'embed-question',
+ kind: 'embedding',
+ name: 'embed-question',
+ depth: 2,
+ startMs: 20,
+ durationMs: 120,
+ hasError: false,
+ },
+ {
+ id: 'span-search',
+ kind: 'span',
+ name: 'search-help-center',
+ depth: 2,
+ startMs: 150,
+ durationMs: 260,
+ hasError: false,
+ },
+ {
+ id: 'gen-answer',
+ kind: 'generation',
+ name: 'draft-answer',
+ depth: 1,
+ startMs: 430,
+ durationMs: 1880,
+ hasError: false,
+ },
+]
+
+const INLINE_CHART_SVG =
+ "<svg xmlns='http://www.w3.org/2000/svg' width='160' height='96'><rect width='160' height='96' fill='lavender'/><rect x='16' y='56' width='24' height='28' fill='slateblue'/><rect x='56' y='36' width='24' height='48' fill='slateblue'/><rect x='96' y='16' width='24' height='68' fill='slateblue'/></svg>"
+
+export const FIXTURE_ATTACHMENT_EXTERNAL_AUDIO: MessagePart = {
+ kind: 'attachment',
+ mediaType: 'audio',
+ name: null,
+ mimeType: 'audio/wav',
+ url: 'https://media.example.com/voice-note.wav',
+}
+
+export const FIXTURE_ATTACHMENT_SAME_ORIGIN_AUDIO: MessagePart = {
+ kind: 'attachment',
+ mediaType: 'audio',
+ name: 'clip.wav',
+ mimeType: 'audio/wav',
+ url: '/api/projects/1/ai_blob/v1/sha256/4f6e9c2a1b3d5e7f8091a2b3c4d5e6f7089a1b2c3d4e5f60718293a4b5c6d7e',
+}
+
+export const FIXTURE_ATTACHMENT_REJECTED_IMAGE_URL: MessagePart = {
+ kind: 'attachment',
+ mediaType: 'image',
+ name: 'suspicious-chart.png',
+ mimeType: 'image/png',
+ url: '//evil.example.com/x',
+}
+
+export const FIXTURE_ATTACHMENT_DATA_FILE: MessagePart = {
+ kind: 'attachment',
+ mediaType: 'file',
+ name: 'notes.txt',
+ mimeType: 'text/plain',
+ url: 'data:text/plain;base64,SGVsbG8gZnJvbSBQb3N0SG9nIQ==',
+}
+
+export const FIXTURE_ATTACHMENT_PARTS: MessagePart[] = [
+ {
+ kind: 'attachment',
+ mediaType: 'image',
+ name: 'seat-usage.svg',
+ mimeType: 'image/svg+xml',
+ url: `data:image/svg+xml,${encodeURIComponent(INLINE_CHART_SVG)}`,
+ },
+ FIXTURE_ATTACHMENT_EXTERNAL_AUDIO,
+ {
+ kind: 'attachment',
+ mediaType: 'video',
+ name: 'screen-recording.mp4',
+ mimeType: 'video/mp4',
+ url: 'https://media.example.com/screen-recording.mp4',
+ },
+ {
+ kind: 'attachment',
+ mediaType: 'file',
+ name: 'invoice-august.pdf',
+ mimeType: 'application/pdf',
+ url: 'https://media.example.com/invoice-august.pdf',
+ },
+ { kind: 'attachment', mediaType: 'file', name: null, mimeType: 'text/csv', url: null },
+ FIXTURE_ATTACHMENT_SAME_ORIGIN_AUDIO,
+ FIXTURE_ATTACHMENT_DATA_FILE,
+]
+
+const EVAL_TIMESTAMP = '2026-09-01T10:16:40Z'
+
+export const FIXTURE_EVALS: EvalResult[] = [
+ {
+ id: 'e-answers',
+ name: 'Answers the question',
+ href: '/evaluations/answers-the-question',
+ outcome: 'pass',
+ label: 'True',
+ reasoning: 'Explains the seat change directly.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-grounded',
+ name: 'Grounded in articles',
+ href: '/evaluations/grounded-in-articles',
+ outcome: 'fail',
+ label: 'False',
+ reasoning: 'Mentions a date not present in the context.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-competitor',
+ name: 'Mentions a competitor',
+ href: '/evaluations/mentions-a-competitor',
+ outcome: 'pass',
+ label: 'False',
+ reasoning: 'No other product is named.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: true,
+ target: null,
+ },
+ {
+ id: 'e-helpfulness',
+ name: 'Helpfulness',
+ href: '/evaluations/helpfulness',
+ outcome: 'unrated',
+ label: '0.82',
+ reasoning: 'Clear and specific, but does not say how to reduce seats.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-sentiment',
+ name: 'User sentiment',
+ href: null,
+ outcome: 'pass',
+ label: 'Positive',
+ reasoning: null,
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-refund',
+ name: 'Refund policy',
+ href: '/evaluations/refund-policy',
+ outcome: 'inconclusive',
+ label: 'Skipped',
+ reasoning: 'The question is not about refunds.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-tone',
+ name: 'Tone',
+ href: '/evaluations/tone',
+ outcome: 'error',
+ label: 'Error',
+ reasoning: 'The judge model returned an empty response.',
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+ {
+ id: 'e-policy',
+ name: 'Follows billing policy',
+ href: '/evaluations/follows-billing-policy',
+ outcome: 'pending',
+ label: 'Running',
+ reasoning: null,
+ timestamp: EVAL_TIMESTAMP,
+ isBackfill: false,
+ target: null,
+ },
+]
+
+export const FIXTURE_TRACE_EVALS: EvalResult[] = FIXTURE_EVALS.map((result) => ({
+ ...result,
+ target: { label: 'draft-answer', nodeId: 'gen-answer' },
+}))
+
+const FIXTURE_SPAN_DETAIL: SampleNodeDetail = {
+ content: { kind: 'io', input: { question: 'Why did my invoice go up?' }, output: { hits: 3 } },
+ error: null,
+ properties: FIXTURE_SPAN_PROPERTIES,
+ evals: { status: 'ready', results: [] },
+ raw: { event: '$ai_span' },
+}
+
+export const FIXTURE_TRACE: SampleTraceFixture = {
+ header: {
+ name: 'answer-billing-question',
+ hasError: false,
+ olderHref: '/older',
+ newerHref: '/newer',
+ backLink: { label: 'Back to traces', href: '/traces' },
+ },
+ summary: {
+ traceId: '3f9c2a71-5b8e-4d0f-a1c2-7e6d5b4a3c21',
+ timestamp: '2026-09-01T10:15:00Z',
+ person: { label: '[email protected]', href: '/person/ana' },
+ totals: FIXTURE_STATS,
+ },
+ tree: FIXTURE_TREE,
+ initialNodeId: 'gen-answer',
+ details: {
+ 'trace-1': { ...FIXTURE_SPAN_DETAIL, evals: { status: 'ready', results: FIXTURE_TRACE_EVALS } },
+ 'span-retrieve': FIXTURE_SPAN_DETAIL,
+ 'embed-question': FIXTURE_SPAN_DETAIL,
+ 'span-search': FIXTURE_SPAN_DETAIL,
+ 'gen-answer': {
+ content: { kind: 'messages', input: FIXTURE_GENERATION_INPUT, output: FIXTURE_GENERATION_OUTPUT },
+ error: null,
+ properties: FIXTURE_GENERATION_PROPERTIES,
+ evals: { status: 'ready', results: FIXTURE_EVALS },
+ raw: { event: '$ai_generation', id: 'gen-answer' },
+ },
+ },
+ thread: { status: 'ready', turns: [FIXTURE_TURN], activeTurnId: FIXTURE_TURN.id },
+ timeline: { rows: FIXTURE_TIMELINE_ROWS, totalMs: 2310 },
+}
+
+export function withWidth(px: number): Decorator {
+ return (Story) => (
+ <div className="border border-dashed border-primary" style={{ width: px }}>
+ <Story />
+ </div>
+ )
+}
diff --git a/products/ai_observability/frontend/redesign/trace/types.ts b/products/ai_observability/frontend/redesign/trace/types.ts
new file mode 100644
index 000000000000..6cecc9078f84
--- /dev/null
+++ b/products/ai_observability/frontend/redesign/trace/types.ts
@@ -0,0 +1,120 @@
+export type TraceNodeKind = 'trace' | 'span' | 'generation' | 'embedding'
+
+export type TraceMode = 'spans' | 'thread' | 'timeline'
+
+export type NodeDetailTab = 'messages' | 'details' | 'evals' | 'raw'
+
+export interface NodeStats {
+ costUsd: number | null
+ inputTokens: number | null
+ outputTokens: number | null
+ cacheReadTokens: number | null
+ cacheWriteTokens: number | null
+ latencyMs: number | null
+}
+
+export interface TraceTreeNode {
+ id: string
+ kind: TraceNodeKind
+ name: string
+ model: string | null
+ stats: NodeStats
+ hasError: boolean
+ children: TraceTreeNode[]
+}
+
+export type MessageRole = 'system' | 'user' | 'assistant' | 'tool'
+
+export type AttachmentMediaType = 'image' | 'audio' | 'video' | 'file'
+
+export type MessagePart =
+ | { kind: 'text'; text: string }
+ | { kind: 'thinking'; text: string }
+ | { kind: 'toolCall'; name: string; args: unknown; result?: unknown; isError?: boolean }
+ | {
+ kind: 'attachment'
+ mediaType: AttachmentMediaType
+ name: string | null
+ mimeType: string | null
+ url: string | null
+ }
+
+export interface ThreadMessage {
+ id: string
+ role: MessageRole
+ parts: MessagePart[]
+ isInternal: boolean
+ sourceNodeId: string | null
+}
+
+export interface ConversationTurn {
+ id: string
+ timestamp: string
+ messages: ThreadMessage[]
+ error: string | null
+}
+
+export type ConversationState =
+ | { status: 'loading' }
+ | { status: 'ready'; turns: ConversationTurn[]; activeTurnId: string | null }
+
+export type NodeContent =
+ | { kind: 'messages'; input: ThreadMessage[]; output: ThreadMessage[] }
+ | { kind: 'io'; input: unknown; output: unknown }
+ | { kind: 'loading' }
+ | { kind: 'error'; message: string }
+
+export interface NodeProperties {
+ timestamp: string
+ provider: string | null
+ temperature: number | null
+ sessionId: string | null
+ promptName: string | null
+ promptVersion: number | null
+ person: string | null
+}
+
+/**
+ * `unrated` is a result with a value but no verdict, such as a numeric score without a passing rule.
+ * `inconclusive` is a run that produced no usable value: skipped, not applicable, no score, unknown sentiment.
+ */
+export type EvalOutcome = 'pass' | 'fail' | 'error' | 'pending' | 'inconclusive' | 'unrated'
+
+export interface EvalTarget {
+ label: string
+ nodeId: string
+}
+
+export interface EvalResult {
+ id: string
+ name: string
+ href: string | null
+ outcome: EvalOutcome
+ /** What the result says, such as "True", "0.82", "Positive" or "Skipped". */
+ label: string
+ reasoning: string | null
+ timestamp: string
+ isBackfill: boolean
+ /** Null when the result targets the node being viewed. */
+ target: EvalTarget | null
+}
+
+export type EvalsState =
+ | { status: 'loading' }
+ | { status: 'ready'; results: EvalResult[] }
+ | { status: 'error'; errorMessage: string }
+
+export interface LabeledLink {
+ label: string
+ href: string
+}
+
+export interface TimelineRowData {
+ id: string
+ kind: TraceNodeKind
+ name: string
+ depth: number
+ startMs: number
+ durationMs: number | null
+ hasError: boolean
+}