Restore context-aware error footer (cursor-line error)#34
Merged
Conversation
Fixes #33 — a Compose-migration regression. Pre-migration, putting the cursor on a line with a compile error showed that error in the bottom footer; that link was lost (the footer only showed a generic "N message(s)" count, and the editor never tracked cursor position). Fix: register the kodemirror session updateListener to report the primary cursor's 1-based line to the view model on every transaction; the view model maps that line onto the current diagnostics and the footer shows the matching error (falling back to the count when the cursor isn't on an error line). Lint squiggles/gutter unchanged. Tests (e2e, TDD): new ErrorFooterTest asserts (1) diagnostics land on the right lines, (2) cursor on an error line shows its error in the footer, (3) moving the cursor updates/clears the footer. Reproduced the regression first — before the fix, (2) and (3) FAILED (Playwright timeouts) while (1) passed (diagnostic line-offset was already correct). Required new TestBridge hooks (error lines, cursor line, footer text + a deterministic cursor-mover action), since the bridge exposed none of that. Verified: full clean :e2e:test green incl. ErrorFooterTest; spotless clean.
monkopedia-reviewer
approved these changes
Jun 3, 2026
Collaborator
monkopedia-reviewer
left a comment
There was a problem hiding this comment.
Tier-2 signoff by Monkopedia (eyeballed live on adolin — restored cursor-line error footer, diagnostic lines confirmed correct). Reviewed to merge standard: correct cursor→line→diagnostic mapping, meaningful e2e ErrorFooterTest, CI green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #33 — a Compose-migration regression. Pre-migration, putting the cursor on a line with a compile error showed that error in the bottom footer; moving on/off lines updated it. That regressed: the footer only showed a generic
"N message(s)"count and the editor never tracked cursor position. Error squiggles/gutter still worked — only the cursor→footer link was lost.Fix
Wire the kodemirror session's
onUpdatecallback (fired on every dispatched transaction) to report the primary cursor's 1-based line to the view model. (TheupdateListenerfacet looked like the natural hook but is never dispatched in kodemirror 0.3.2, soonUpdateis the working path.) The view model maps that line onto the current diagnostics, and the footer shows the matching error (falling back to the count when the cursor isn't on an error line). Lint squiggles/gutter unchanged.Tests (TDD — reproduced the regression first)
New
ErrorFooterTest(e2e) asserts the three behaviors from #33:Before the fix, (2) and (3) FAILED (Playwright timeouts), while (1) passed — i.e. the diagnostic line-offset was already correct; only the cursor→footer link regressed:
Required new TestBridge hooks (error lines, cursor line, footer text + a deterministic cursor-mover action), since the bridge exposed none of that.
Validation
:e2e:testgreen incl.ErrorFooterTest; existing suite stays green.:frontend:spotlessKotlinCheckclean.Review note
@Monkopedia — touches editor UX (the restored footer behavior); please eyeball the final footer. Relates to #32 (broader error-surfacing UX).
Fixes #33