Backlog/b 33 search input - #159
Merged
Merged
Conversation
The search form bound submit to onFormSubmit, which called preventDefault for anything that was not a coordinate pair and then did nothing at all once suggestions were on screen. The button was dead for text, so the name fallback in SearchesController — LOWER(name) LIKE — was unreachable even though it works. That handler existed only to block the submit, so it is gone together with its binding. The same dropdown could also kill the controller. renderResults kept every rendered row in lastSearchResults, placeholders included, so Enter while "Searching…" or "Nothing found" was on screen ran selectResultByIndex(0), reached setCoordinates(undefined, undefined) and threw on undefined.toFixed. Stimulus stayed dead until a reload. The array now holds only rows that can actually be picked — a label with finite coordinates — and data-idx numbers those instead of the rendered list, so both placeholder states are unselectable by construction rather than by a check someone has to remember. Junk coordinates from the geocoder fall out under the same rule. Suggestions still come from Nominatim in the browser; moving them onto the local city table is a separate change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The form under /courts/:id/suggestions/new carried a free-text comment, and its placeholder was the game form's example about looking for one more player — copied together with the key when the form was added. The field does not belong there at all: a correction is a set of changed court fields, and the moderator reviews those, not a note beside them. With the field gone a suggestion has to change something, so the model now requires a payload instead of "a payload or a comment", and the error says so in all three locales. The check runs on create only: rows saved before this change may hold a comment and no payload, and a moderator must still be able to approve or reject them. Their comment keeps showing on the review page, and the column stays as it is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
No description provided.