feat: add bounty amount range filter UI on bounties page#269
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
algora-io#157 asked for a min/max bounty-amount filter on the public bounties list. Adds the form inputs, threads the amount range through the query opts and into the bounties query, and unifies the existing tech-filter param handling with the new amount-range params so the URL stays bookmarkable. The change to handle_params is broader than strictly necessary - collapsing the two existing clauses into one parameterized implementation made the new min/max params drop in cleanly. Happy to split into separate PRs if you'd prefer a tighter diff. Fixes algora-io#157
|
|
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.
Summary
Adds a min/max bounty-amount filter to the public bounties LiveView, including the form controls, URL-param parsing, and the query-opts wiring through
Algora.Bountiesso the result set narrows server-side. The tech-filter param handling was unified with the new amount-range handling so the URL stays bookmarkable for any combination.Why this matters
#157 asked for an amount filter so bounty hunters can scope to their interest band. The existing UI already supported tech filters but not amount, and the workaround was to scroll the full list.
Scope note
The diff is larger than the smallest possible "just add two inputs" because I collapsed two
handle_paramsclauses into one parameterized implementation to make the new min/max params drop in cleanly. Happy to split into a smaller follow-up PR if you'd prefer a tighter surface area for the initial review.Changes
lib/algora_web/live/bounties_live.ex- new filter UI, unified param handling, query-opts plumbing.lib/algora/bounties/bounties.ex- accept:amount_min/:amount_maxin the query and emit the SQL clause.test/algora/bounties_test.exs- tests covering amount-range filtering with each end of the range and the combined case.Testing
New bounty-query tests pass locally. Existing tests still pass.
Fixes #157