docs: handoff 19 — ADR-0027 highlight/hint wiring finished
ADR-0027 gains a "Follow-up" section recording the completed §2 highlight + hint wiring and precise per-literal WARNING spans; the three stale As-built bullets point at it. requirements.md test baseline → 1125 and the S6 entry notes the completion + Amendment 1. handoff-19 records the run and queues the two deferred manual-testing bugs (add 1:n relationship completion/usage hint; --resume / last_project) as the next session's first work.
This commit is contained in:
@@ -273,23 +273,72 @@ choices and deviations from the sketch above:
|
||||
still blocks plainly. Any event resets the window (not
|
||||
only keystrokes) — a slight over-reset, harmless in
|
||||
practice.
|
||||
- **WARNING spans are coarse** — the whole WHERE clause. The
|
||||
`Expr` AST carries no source spans, and the indicator
|
||||
reads only severity. Precise per-literal spans (for a
|
||||
future warning-highlight overlay) are a refinement.
|
||||
- **Highlight / hint integration beyond the indicator** —
|
||||
§2 notes highlighting and the hint panel "read the
|
||||
individual diagnostics". The indicator and the model
|
||||
ship; routing diagnostic spans into the per-byte highlight
|
||||
overlay, and diagnostic messages into the hint panel
|
||||
beyond the existing parse-error path, is a follow-up (the
|
||||
build order did not enumerate it as a step).
|
||||
- **Debounce timing is not unit-tested** — it is async
|
||||
event-loop glue. `App::input_validity_verdict` (the pure
|
||||
verdict) and the indicator rendering are covered;
|
||||
- **WARNING spans are per-literal.** Each `Operand` AST node
|
||||
carries the byte span of the terminal it was built from, so
|
||||
an expression WARNING is anchored to exactly the offending
|
||||
literal. *(The initial ship used a coarse whole-WHERE-clause
|
||||
span; made precise in the Follow-up section below.)*
|
||||
- **Highlight & hint wiring — complete.** §2's "highlighting
|
||||
and the hint panel read the individual diagnostics" is
|
||||
wired — see the Follow-up section below. *(The initial ship
|
||||
had the indicator and the model only; the build order did
|
||||
not enumerate the wiring as a step.)*
|
||||
- **Debounce decision logic is unit-tested** — it is the
|
||||
`IndicatorDebounce` state machine in `runtime` (Follow-up
|
||||
section). The `tokio::time::timeout` interaction itself
|
||||
stays integration-level. The pure verdict
|
||||
(`input_verdict` / `input_validity_verdict`) and the
|
||||
indicator rendering were covered from the initial ship;
|
||||
`input_verdict` has a parse-outcome / schema-existence /
|
||||
expression-warning / existing-cases-sweep test set.
|
||||
|
||||
## Follow-up — highlight & hint wiring, precise spans (2026-05-19)
|
||||
|
||||
The As-built notes above left three items open; this pass
|
||||
closes them. §2's design — "the indicator is the summary;
|
||||
highlighting and the hint panel read the individual
|
||||
diagnostics for *where* and *why*" — is now fully realised.
|
||||
|
||||
- **`Operand` carries a source span.** Each WHERE-expression
|
||||
operand records the byte range of the terminal it was built
|
||||
from. `Operand`'s `PartialEq` is hand-written to *ignore*
|
||||
the span — it is editor metadata — so `Command` equality,
|
||||
and the large `Expr` test corpus, stay whitespace- and
|
||||
position-independent. Expression WARNINGs are now anchored
|
||||
to exactly the offending literal, not the whole clause.
|
||||
- **`walker::input_diagnostics`** is the shared entry point
|
||||
both UI layers read — the sibling of `input_verdict` that
|
||||
returns the diagnostic set rather than its severity summary.
|
||||
- **Highlight overlay.** `render_input_runs` overlays the
|
||||
schema-aware diagnostics on the input field: an unknown
|
||||
table / column ERROR in the error colour, an expression
|
||||
WARNING in `theme.warning`. The overlay is *global* — every
|
||||
flagged token is coloured wherever it sits, not only under
|
||||
the cursor, which is precisely the problem §Context
|
||||
describes. The pre-existing cursor-local invalid-identifier
|
||||
overlay is kept (it covers in-progress identifiers, which
|
||||
produce no diagnostics); the two are additive and
|
||||
idempotent. `overlay_span` recolours a token's whole byte
|
||||
range (the older `overlay_error` hit only a single byte).
|
||||
- **Hint panel.** `ambient_hint` surfaces a diagnostic's
|
||||
message. `input_diagnostics` is non-empty only for a
|
||||
command that structurally parses — so a non-empty result
|
||||
means "complete and submittable, but wrong or dubious". It
|
||||
is checked early, ahead of slot hints and completions, so a
|
||||
flawed-but-parsing command no longer gets the misleading
|
||||
"Submit with Enter" prose. The diagnostic under the cursor
|
||||
wins (the panel explains where the user is looking);
|
||||
otherwise the most severe.
|
||||
- **Debounce.** The indicator-debounce decision logic moved
|
||||
out of the event loop into the `IndicatorDebounce` state
|
||||
machine, unit-tested for the keystroke / settle cycle.
|
||||
|
||||
The one piece still integration-level: a PTY-tier test of the
|
||||
actual `tokio` debounce *timing* (as distinct from the
|
||||
now-tested decision logic) — consistent with the four-tier
|
||||
strategy (ADR-0008), where Tier 4 is wired only for the
|
||||
critical flows.
|
||||
|
||||
## Amendment 1 — `LIKE` on a numeric column (2026-05-19)
|
||||
|
||||
§1 defined the WARNING set as exactly a type-mismatched
|
||||
|
||||
Reference in New Issue
Block a user