From ed799a0c0bddb4cc9749f2721e15d2b9bf019adc Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sun, 23 Aug 2026 16:54:58 -0400 Subject: [PATCH] feat(web): use the Ace editor for the request-metadata JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A textarea is a poor place to hand-write a nested `_meta` payload. Ace closes a brace when you open one, folds nested objects, and — through its JSON worker — marks the offending line in the gutter instead of reporting one message for the whole document. Three things the swap turned up: - Ace fires *two* change events for a replace (a remove, then an insert), so select-all-and-retype briefly leaves an empty document. Acting on the first emitted `{}` and wiped the user's saved metadata the instant they selected it. `handleChange` now coalesces the pair in a microtask, and the component tracks what it last emitted so the parent echoing that value back is not mistaken for an external reset. - Ace's own `github` themes fail WCAG AA on the gutter — `#AAA` on `#e8e8e8` is 1.89:1, and the dark theme is 4.13:1. Folding needs the gutter, so the colors are overridden with palette tokens (5.82:1 and 4.88:1) rather than hiding it. - `textInputAriaLabel` alone never reaches the DOM: Ace composes the label as "