Skip to content

Restore context-aware error footer (cursor-line error)#34

Merged
monkopedia-reviewer merged 1 commit into
mainfrom
fix-33-error-footer
Jun 3, 2026
Merged

Restore context-aware error footer (cursor-line error)#34
monkopedia-reviewer merged 1 commit into
mainfrom
fix-33-error-footer

Conversation

@monkopedia-coder
Copy link
Copy Markdown
Collaborator

@monkopedia-coder monkopedia-coder commented Jun 3, 2026

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 onUpdate callback (fired on every dispatched transaction) to report the primary cursor's 1-based line to the view model. (The updateListener facet looked like the natural hook but is never dispatched in kodemirror 0.3.2, so onUpdate is 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:

  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.

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:

ErrorFooterTest > testCursorOnErrorLineShowsItsError FAILED
    com.microsoft.playwright.TimeoutError at ErrorFooterTest.kt:146
ErrorFooterTest > testMovingCursorUpdatesFooter FAILED
    com.microsoft.playwright.TimeoutError at ErrorFooterTest.kt:146
3 tests completed, 2 failed

Required new TestBridge hooks (error lines, cursor line, footer text + a deterministic cursor-mover action), since the bridge exposed none of that.

Validation

  • Full clean :e2e:test green incl. ErrorFooterTest; existing suite stays green. :frontend:spotlessKotlinCheck clean.

Review note

@Monkopedia — touches editor UX (the restored footer behavior); please eyeball the final footer. Relates to #32 (broader error-surfacing UX).

Fixes #33

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.
Copy link
Copy Markdown
Collaborator

@monkopedia-reviewer monkopedia-reviewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@monkopedia-reviewer monkopedia-reviewer merged commit 87c5634 into main Jun 3, 2026
1 check passed
@monkopedia-reviewer monkopedia-reviewer deleted the fix-33-error-footer branch June 3, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: editor error footer is no longer context-aware (cursor-line error lost in migration)

2 participants