Skip to content

feat: prevent empty messages and optimistic posting - #4

Merged
benfoxall merged 3 commits into
mainfrom
copilot/prevent-empty-messages
Aug 9, 2026
Merged

feat: prevent empty messages and optimistic posting#4
benfoxall merged 3 commits into
mainfrom
copilot/prevent-empty-messages

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes two UX issues with message posting:

Prevent blank messages — trims the message text and returns early if it's empty or whitespace-only, so accidental blank posts can't happen.

Optimistic posting — the note is saved to the DB immediately (with placeholder lat: 0, lon: 0) so it appears in the list right away and the form resets instantly. Geolocation then runs in the background and updates the record with real coordinates on success; on failure the note stays at 0, 0.

Map bounds fix — notes with lat: 0, lon: 0 (i.e. still awaiting geolocation) are filtered out of noteLocations so the map doesn't try to fit the Gulf of Guinea into the viewport. Once real coordinates arrive the note appears on the map automatically.

All 12 tests pass.

Copilot AI and others added 3 commits August 8, 2026 19:39
Co-authored-by: benfoxall <51385+benfoxall@users.noreply.github.com>
Co-authored-by: benfoxall <51385+benfoxall@users.noreply.github.com>
Co-authored-by: benfoxall <51385+benfoxall@users.noreply.github.com>
@benfoxall
benfoxall marked this pull request as ready for review August 9, 2026 05:26
@benfoxall
benfoxall merged commit d553f29 into main Aug 9, 2026
1 check passed
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.

2 participants