Fix polygon footprint preview (#133)#135
Merged
Merged
Conversation
…e for non-logged in users.
sfoale
requested review from
cmccully,
Copilot,
kwynn03,
moira-andrews and
swyatt7
July 2, 2026 06:11
There was a problem hiding this comment.
Pull request overview
This PR fixes polygon footprint preview rendering in the UI by aligning polygon parsing with the backend’s footprint parser, improving error surfacing to the frontend, and adding FastAPI tests for polygon preview behavior.
Changes:
- Update
/ajax_preview_footprintto parse polygon input viaparse_multi_polygon(supporting[(x,y)...]#[...]and newline-separated formats) and return parse errors to the client. - Improve Plotly polygon rendering semantics (
mode="lines",fill="toself") for footprint previews. - Frontend: surface backend
{ error }preview responses as exceptions, and show a login-specific message on 401/403 instrument submit failures; add UI preview tests for polygon cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/fastapi/test_ui.py | Adds test coverage for single/multi/invalid polygon preview responses. |
| server/routes/ui/preview_footprint.py | Switches polygon preview parsing to parse_multi_polygon, returns parsing errors, and adjusts Plotly trace fill behavior. |
| frontend/src/lib/services/instrumentService.ts | Improves error handling for preview responses and adds clearer 401/403 messaging for instrument submission. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
swyatt7
approved these changes
Jul 2, 2026
swyatt7
left a comment
Collaborator
There was a problem hiding this comment.
Moira and I tested this. Works as expected :)
thanks
moira-andrews
approved these changes
Jul 2, 2026
moira-andrews
left a comment
Contributor
There was a problem hiding this comment.
Tested and was able to preview footprint successfully
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.
Fixes #133