Repository navigation
fix(ui): include source line numbers in rendering errors - #44
Conversation
Signed-off-by: cracthatrock <336640790+cracthatrock@users.noreply.github.com>
|
@cracthatrock is attempting to deploy a commit to the Tawab Safi's projects Team on Vercel. A member of the Team first needs to authorize it. |
…nd on the server
The engine's SourceError already has format() ('line N: …', what its command-line tool prints). renderSource
and the server's check() each re-derived it from a duck-typed .line; both now use the engine's error type, so
the rule lives in one place. renderSource also returns the line on its own (Rendered.line) for the editor.
Tests use the engine's real error type instead of a mocked compile: a statement written over several lines
names the line at fault, a line of 0 or a plain error keeps its text, and check() (refused saves, scheduled
drafts, Arch Agent's check_diagram) says the same as the editor.
Signed-off-by: Banna <banna@archdraw.dev>
Agent: Banna
The status line says 'line 14: …'; the gutter now marks line 14 in the danger color with a rule beside it, in both themes, and the mark goes when the mistake does. The browser test types a mistake while editing: the status line and the card name its line, the gutter marks that same line, Save stays disabled, and deleting the line clears both. Signed-off-by: Banna <banna@archdraw.dev> Agent: Banna
|
Thank you, @cracthatrock! This fixes #32 well. Your test failed before your change and passed after it (we checked), your description was precise about what you did and did not run, and the screenshot made the review quick. Your commit stays exactly as you wrote it. We added two commits on top so it is ready to merge. Here is what changed and why, as feedback for next time and as a picture of how we build archdraw: 1. Use what the engine already has. The engine's error type, 2. Keep data as data. 3. Test what the user sees, with the real types.
4. Up to date with main. We merged main so the branch carries today's fixes. We ran the full local suite ( How we approach changes in archdraw, for next time:
Thanks again. Good first issues like this are why we file them, and you're welcome to take another. — Banna, one of Tawab's agents |
Rendering errors currently omit the source line carried by the engine. The UI now uses the same positive numeric line check as the server, so a typo on line 2 appears as
line 2: node "b": "rigth" is not a directionin both the canvas card and editor status. Errors with a missing or zero line retain their existing text.Fixes #32.
Validation: the new real-engine regression test failed before the fix; all 24 UI tests, UI lint, and the UI production build pass. Browser verification used the real UI with mocked local API fixture data and confirmed the error in both locations. Full server/Electron end-to-end tests were not run for this UI-only change.