Add "View patterns" context menu to log explorer#321
Conversation
Add a "View patterns" option to the field context menus in the log detail tree and facets sidebar. Navigates to the patterns visualization for the selected field.
Code ReviewSmall, focused PR — easy to follow. A few observations: 1. Inconsistency in Log.hs: inline JS string vs. data-attribute patternThe new facets dropdown item (line 434) passes the field path as an inline JS string literal: onclick_ $ "viewFieldPatterns('" <> T.replace "___" "." key <> "')"The sibling items (lines 393–426) already store the field via li_ $ a_ [class_ "flex gap-2 items-center", term "data-field" (T.replace "___" "." key),
[__|on click call viewFieldPatterns(@data-field) end|]] doEmbedding a field name directly into a JS string literal (via Haskell string concatenation) is also a latent XSS vector — if a field name ever contains a single-quote, it would break out of the string. The data-attribute pattern avoids this entirely and is the established idiom in this file. 2. Utils.hs:
|
Summary
viz_type=patterns) for the selected fieldviewFieldPatternsJS helper functionExtracted from #300 to reduce PR size.
Test plan