Skip to content

Add "View patterns" context menu to log explorer#321

Merged
tonyalaribe merged 1 commit intomasterfrom
view-patterns-context-menu
Feb 18, 2026
Merged

Add "View patterns" context menu to log explorer#321
tonyalaribe merged 1 commit intomasterfrom
view-patterns-context-menu

Conversation

@tonyalaribe
Copy link
Contributor

Summary

  • Adds a "View patterns" option to field context menus in the log detail JSON tree and facets sidebar
  • Navigates to the patterns visualization (viz_type=patterns) for the selected field
  • Adds viewFieldPatterns JS helper function

Extracted from #300 to reduce PR size.

Test plan

  • Open log explorer, expand a log entry, right-click a field → "View patterns" should navigate to patterns view for that field
  • In facets sidebar, click field dropdown → "View patterns" should work similarly

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.
@tonyalaribe tonyalaribe merged commit 57423b8 into master Feb 18, 2026
7 checks passed
@tonyalaribe tonyalaribe deleted the view-patterns-context-menu branch February 18, 2026 00:38
@claude
Copy link

claude bot commented Feb 18, 2026

Code Review

Small, focused PR — easy to follow. A few observations:

1. Inconsistency in Log.hs: inline JS string vs. data-attribute pattern

The 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 term "data-field" and access it via @data-field in Hyperscript. This item should follow the same convention, e.g.:

li_ $ a_ [class_ "flex gap-2 items-center", term "data-field" (T.replace "___" "." key),
           [__|on click call viewFieldPatterns(@data-field) end|]] do

Embedding 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: onpointerdown_ vs Hyperscript on click

The new entry (Utils.hs:379) uses onpointerdown_ with a raw JS call. The non-filter context-menu actions ("Add as table column", "Group by") use Hyperscript on click. The filter items use onpointerdown_, so this pattern is not unique, but navigation triggered on pointerdown (before click fires) is an unusual UX choice worth confirming intentionally.

3. Minor: implicit pattern_skip deletion

url.searchParams.delete('pattern_skip');

A brief comment explaining why this param is reset on navigation would help future readers.

No structural issues

HTML structure, faSprite_ usage, and class lists are consistent with surrounding code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments