Repository navigation
feat(huddlz): personal sections + URL-driven filters on /huddlz - #163
Merged
Merged
Conversation
Adds an optional :relationship argument to Huddl :search action that restricts results to huddlz the actor hosts (creator) or is attending (RSVPed but not creator). Anonymous actors with the filter set get an empty result rather than a silent broadening of scope. The filter is applied in the existing ApplySearchFilters preparation so it composes with all other search filters (text, date, event type, location/distance) in a single query.
Mirrors the /groups treatment on the huddlz discovery page. - Two personal sections at the top: "// Hosting" and "// Attending" that appear when the authenticated actor has matching huddlz - Each section caps at 6 cards and shows "View all →" when count exceeds the cap, deep-linking to /?yours=hosting|attending while preserving every active filter (search, type, date, location) - Sections inherit ALL filters: search, event type, date filter, and location/distance scope sections together with the main grid - ?yours= scoped views render a single full grid scoped to that relationship with a back link - Filters are now URL-driven so deep links reproduce state and back button works as expected - Anonymous users hitting ?yours= are redirected to /sign-in with a flash explaining what they were after Tests: LiveView (sections, scope routing, anon redirect, search-aware empty copy, View-all href), GraphQL (relationship arg on searchHuddlz), cucumber feature for the headline flow.
- View-all link now threads cleared=1 when the user has a default location pre-fill that they explicitly cleared, so navigating into a scoped section doesn't resurrect the home_location filter. - Drop distance from the URL when the location is cleared. Previously, clicking the Clear button while a default location was active could emit URLs like /?distance=25&cleared=1 because form_params_from_assigns read stale assigns; distance is meaningless without a location. - Refactor current_filter_params into smaller helpers (location_params, non_location_params, drop_param?) to drop credo complexity warning.
This was referenced May 2, 2026
The location autocomplete only renders a hidden `location` text input; lat/lng live in component state and reach the parent only via the :location_selected message. Plain form events (typing search, changing event type or date) therefore submitted without lat/lng, and current_filter_params dropped the location filter from the URL — the location chip and distance filter silently disappeared. Merge the active socket location into form params before serializing the path, so URL state stays in sync when unrelated filters change.8000
The link out of a scoped view (?yours=hosting|attending) was hardcoded to ~p"/" and dropped every active filter, even though the inbound "View all →" link intentionally preserves them. Build the back-link URL from current filter assigns with scope=:all so the round trip is symmetric.
The :relationship arg lived on the action but not on the Communities.search_huddlz code interface, so external callers (and the LiveView) had to bypass the helper and build an Ash query by hand. Add it as the trailing optional positional and switch the LiveView's run_search/3 back to the helper for consistency with the rest of the codebase. Existing 6-arg call sites need an explicit nil before opts so the keyword list isn't picked up as the 7th positional.
CLAUDE.md mandates lowercase "huddlz" in all branding, UI copy, and
documentation. The flash messages already followed this; the scoped
page titles ("Huddlz You're Hosting", "Huddlz You're Attending",
"Huddlz") didn't.
The previous comment claimed the autocomplete fires :location_cleared on its own initial mount with a nil value; it doesn't — the only emit site is the "clear" event handler. The guard's real purpose is idempotence: avoid polluting the URL with cleared=1 when there was nothing to clear. Update the comment to match.
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
Mirrors the /groups personal-sections treatment on the huddlz discovery page (#157 was the precedent), and migrates the page's filter state into the URL so deep links and back/forward navigation work properly.
What's new
URL-driven filter state
The page previously kept search/type/date/location in socket assigns only. Now it's URL-driven (via `handle_params` + `push_patch`), so:
Resource & API surface
Per the API-first principle:
Trade-offs worth flagging
Out of scope
Test plan