Repository navigation
fix: sync user query with collection link - #6
Merged
Merged
Conversation
Bornholm
approved these changes
Apr 1, 2026
Bornholm
self-requested a review
April 1, 2026 20:09
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.
Ref #3
Close #3
This pull request updates the Ask page to improve how the query state is managed and synchronized between the UI and backend. The changes ensure that the results area is only shown after a query is submitted, and they add support for synchronizing the query field across navigation and reloads. The update also injects a JavaScript file for query synchronization and marks up relevant HTML elements for this purpose.
Query state management and UI synchronization:
Submittedfield to theAskPageVModelstruct and updated the logic so the results area is only displayed after a query is submitted, not just when the query string is non-empty. (ask_page.templ,ask_page_templ.go,ask_page.go) [1] [2] [3] [4] [5]Submittedwhen a query is posted and to synchronize the query field from the URL on GET requests. (ask_page.go) [1] [2]Frontend enhancements for query synchronization:
<script>tag to load/assets/js/query-sync.jswith a nonce for CSP compliance, and addeddata-sync-queryanddata-sync-query-linkattributes to relevant elements for JavaScript handling. (ask_page.templ,ask_page_templ.go) [1] [2] [3] [4] [5] [6]Other minor updates:
ask_page_templ.go) [1] [2] [3] [4] [5]ask_page_templ.go) [1] [2]These changes together make the Ask page more robust and user-friendly by ensuring consistent query state and a more predictable UI.