Add regex cheat-sheet icon next to regex inputs

Adds RegexHelpIcon, a hover/click popover (modeled on HelpIcon) showing
a compact cheat sheet for the Rust `regex` crate's actual syntax, and
places it next to every user-facing regex field: Params/Metrics message
match regex, Alerts field regex, and FilterBar's regex(...) helper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
Hugh Kaznowski
2026-09-05 19:32:36 +01:00
co-authored by Claude Sonnet 5
parent e6e5bc8f50
commit 83cc7105d6
5 changed files with 84 additions and 3 deletions
+5 -1
View File
@@ -12,6 +12,7 @@ import {
} from '../lib/api'
import { CollapseToggle, PopOutButton, sectionHeaderClassName, sectionHeaderLeftClassName, useSectionCollapsed } from './CollapsibleSection'
import { HelpIcon } from './HelpIcon'
import { RegexHelpIcon } from './RegexHelpIcon'
const EMPTY_MATCHER: MetricParamMatcher = { param_name: '', capture_group: '', kind: 'string' }
@@ -174,7 +175,10 @@ export function Metrics({ range }: { range: TimeRange | null }) {
/>
</div>
<div>
<label className="mb-1 block text-xs text-text-subtle">Message match regex</label>
<label className="mb-1 flex items-center gap-1 text-xs text-text-subtle">
Message match regex
<RegexHelpIcon label="Help: Message match regex syntax" />
</label>
<input
className="w-full rounded border border-border-soft bg-surface-1 px-2 py-1 font-mono text-sm text-text placeholder:text-text-subtle focus:border-border-strong focus:outline-none"
value={regex}