From 73e3109198c80c9020d70169e4957a3396813e6b Mon Sep 17 00:00:00 2001 From: Luke Hsiao Date: Mon, 10 Aug 2026 23:26:54 -0600 Subject: [PATCH] queries/jjdescription: highlight the body as text, not as a string The query captures the entire message body as `@string`. `jjdescription` was added by copying git-commit's language rules, but the two queries disagree about the part you actually type: git-commit leaves the body uncaptured so it renders as `ui.text`, and marks only the subject line as a heading. Scoping prose as a string gives it a color chosen for string literals, which many themes deliberately keep close to comment, so the description is hard to separate from the `JJ:` boilerplate. String colors are also tuned to sit against code rather than to carry a paragraph, so the body can land below a readable contrast against the background. One real-world example are the 22 stock Omarchy themes, which generate their Helix theme from one shared template, the body as `@string` fails WCAG AA against the background in four of them (catppuccin-latte, flexoki-light, miasma, retro-82), and on retro-82 it sits at 1.34:1 against the JJ: comments. Left to `ui.text` it passes in all 22, and retro-82 becomes 4.54:1 against the comments and 13.39:1 against the background. Of the 279 languages with highlight queries, `jjdescription` is the only one that captures a bare prose node as @string. The grammar has no subject node, so the subject line is matched as the first named child of the document. Signed-off-by: Luke Hsiao --- runtime/queries/jjdescription/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/jjdescription/highlights.scm b/runtime/queries/jjdescription/highlights.scm index 227c4f630b04..c11d7f9fbee6 100644 --- a/runtime/queries/jjdescription/highlights.scm +++ b/runtime/queries/jjdescription/highlights.scm @@ -1,4 +1,4 @@ -(text) @string +(document . (text) @markup.heading) (filepath) @string.special.path (change type: "A" @diff.plus)