Skip to content

feat(grouping): Add syntax highlighting to the fingerprint rules editor - #128486

Draft
scttcper wants to merge 1 commit into
masterfrom
scttcper/fingerprint-rules-editor
Draft

scttcper wants to merge 1 commit into
masterfrom
scttcper/fingerprint-rules-editor

Conversation

@scttcper

Copy link
Copy Markdown
Member

Fingerprint rules were a plain textarea, so a typo'd matcher, a missing space before ->, or an arrow from another language only showed up as a generic syntax error after hitting save.

The editor now highlights each part of a rule and underlines mistakes once typing pauses. Hovering an underline explains it, and a collapsed summary under the field counts the errors and warnings. Warnings are for rules that save but probably don't do what was meant, like an unknown {{ variable }}, an unquoted title=, or a trailing # comment that ends up in the fingerprint.

The tokenizer follows the backend grammar in parser.py. I fuzzed it against the backend with a couple hundred thousand random configs and it never flags one the backend accepts.

Depends on #128461, which saves a → as ->, so the editor treats a → as an arrow.

Fingerprint rules editor

Fingerprint rules were a plain textarea, so a typo'd matcher, a missing
space before ->, or an arrow pasted from somewhere else only showed up
as a generic syntax error after saving.

The editor now highlights each part of a rule and underlines mistakes
once typing pauses. Hovering an underline explains it, and a collapsed
summary under the field counts the errors and warnings. The tokenizer
follows the backend grammar, so errors line up with what the backend
rejects on save. The example rules above the field are highlighted too.

Assumes #128461 lands first, which saves a → as ->.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.78% 95.78% ±0%
Typed 141,510 141,747 🟢 +237
Untyped 6,237 6,249 🔴 +12
🔍 12 new type safety issues introduced

Non-null assertions (!) (12 new)

File Line Detail
static/app/views/settings/projectIssueGrouping/fingerprintRulesEditor.tsx 70 points[i + 1]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesEditor.tsx 71 tokens[tokenIndex]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 165 matchAt(NON_NEWLINE_WHITESPACE, text, pos)!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 194 match[1]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 223 matchAt(UNQUOTED, text, pos)!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 233 quotedKey[1]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 289 quoted[1]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 317 text[pos]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 333 matchAt(INVALID_FINGERPRINT_TEXT, text, pos)!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 376 text[pos]!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 394 matcher.arrowStart!
static/app/views/settings/projectIssueGrouping/fingerprintRulesSyntax.ts 414 text[pos]!

This is informational only and does not block the PR.

This branch was successfully deployed

1 active deployment
Preview — 4cc6e712 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant