Repository navigation
feat(list): move filters to a list toolbar with a sort selector - #77
Merged
Merged
Conversation
Sort/label keys for the upcoming list toolbar sort menu (Recommended / Closest / Soonest), added to every locale so they don't ship en-only. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add the `?sort=` codec (SortOrder + sortFromParams/sortToParams, kept separate from the filter codec so sort never keys the events query or lights the filter badge), the useSortOrder/useSetSortOrder hook pair (mirrors useSetFilters — replace nav, preserves other params, omits the default), and a `byDistance` comparator for the "Closest" ordering. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ListToolbar is a thin justify-between controls row above a results list; SortMenu is the ghost `Sort: <current>` trigger + Radix DropdownMenu radio group (Recommended / Closest / Soonest), mirroring the SettingsMenu selectable-menu pattern and reading/writing `?sort=`. Both get Ladle stories and tier-barrel exports. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Move the results sort out of the cached queryFn into a memo keyed on the fetched list + `useSortOrder()`, so picking Recommended / Closest / Soonest re-sorts client-side with no refetch (sort stays out of the query key). Recommended keeps the existing relevance score; Closest uses byDistance; Soonest uses byNextOccurrence. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the icon-only funnel from the Search and Countries drawer headers and render a labeled list toolbar above the results instead: a ghost Filters button (count in the label) on both views, plus a Sort menu (Recommended / Closest / Soonest) on Search only. FilterButton becomes a labeled ghost control, and searching a place / accepting the nearby prompt now carries the current `?sort=` through the URL rebuild. Closes #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Extract the duplicated "carry the URL-only filters + sort across a re-search" round-trip in SearchField + NearbySuggestion into a single named preserveSearchState helper. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address /code-review findings: open the sort DropdownMenu with
modal={false} so Radix's scroll-lock / pointer-events trap doesn't fight
the draggable vaul drawer, and drop the non-functional `truncate` on the
trigger label (it had no width bound, so it never ellipsized).
Refs #75
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deploying sahajatlas with
|
| Latest commit: |
a8599c1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fa89b427.sahajatlas.pages.dev |
| Branch Preview URL: | https://feat-list-toolbar-sort.sahajatlas.pages.dev |
- i18n-and-state rule: sort is a third URL-derived slice (useSortOrder/ useSetSortOrder, ?sort=), kept separate from filters (presentation, not a predicate — never refetches, never lights the badge). - DESIGN_SYSTEM: add the ListToolbar + SortMenu molecule rows. - CLAUDE.md: note the list sort order lives in the URL alongside filters. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Ardnived
force-pushed
the
feat/list-toolbar-sort
branch
from
July 24, 2026 16:29
a1cd57a to
4ad0315
Compare
Deploying sahajatlas-design with
|
| Latest commit: |
a8599c1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://452e7fde.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://feat-list-toolbar-sort.sahajatlas-design.pages.dev |
Resolve conflicts against main's refactors: - EventsList split: re-apply the sort feature (sortEvents / useSortOrder, no-refetch memo, byDistance/byNextOccurrence) onto main's new DynamicEventsList.tsx; EventsList.tsx keeps main's presentational-only form. - SearchView / CountriesView: combine main's GeolocationSuggestion rename (was NearbySuggestion) with the new ListToolbar (+ SortMenu on search). - locales: keep BOTH the sort.* block and main's search/back/close/explore/ settings label keys across all 9 non-en common.json files. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- ListToolbar: drop the vertical padding and bump horizontal to px-3 so the ghost buttons' content lands on the px-6 (listRow) gutter — aligning the Filters button with EventListItem (search) and ListItem (countries) content. - CountriesView: add the SearchButton (jump to /search) to the header between the search field and the collapse/close control, matching RegionView. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The country browse index gets its filter access back in the header as an icon-only funnel (with the active-count badge), matching the close/collapse controls, and drops the single-button ListToolbar. Add an `iconOnly` variant to FilterButton so the header (icon) and SearchView's toolbar (labeled) share one nav + count. SearchView's Filters + Sort toolbar is unchanged. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ListToolbar is now the SearchView results toolbar only; CountriesView (a browse index) filters via a header icon and has no sort. Refs #75 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Jul 26, 2026
Reconcile with #77 (filters → list toolbar + sort selector), which landed on main after the previous merge. Source files (shared.tsx FilterButton toolbar refactor, the new sort module) auto-merged cleanly; only the 10 locale files conflicted (both append a top-level object — my `calendar` vs #77's `sort`), resolved to keep both. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
14 tasks
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
Surfaces sorting (previously a hardcoded relevance score with no UI) and makes filter access legible, via a labeled toolbar on the search results.
?sort=.filtersToParams/filtersKey/matchesFilters, and never lights the filter badge.Changes
src/lib/shape/sort.ts—?sort=codec (SortOrder,sortFromParams/sortToParams), separate from the filter codec;byDistancecomparator added toevent.ts.src/hooks/use-sort.ts—useSortOrder/useSetSortOrder, mirroringuseSetFilters.src/components/organisms/EventsList/DynamicEventsList.tsx— the sort runs inuseMemo(() => sortEvents(events, order), [events, order])on the fetched list, so changing sort re-sorts without a refetch.src/components/molecules/{SortMenu,ListToolbar}/— new molecules (+ stories + barrel). SortMenu is a RadixDropdownMenuradio group openedmodal={false}so it doesn't fight the vaul drawer.src/views/shared.tsx—FilterButtongained aniconOnlyvariant (icon + count badge for the CountriesView header) alongside the labeled ghost button (SearchView toolbar), sharing one nav + count;preserveSearchStatecarries filters + sort through the place-search / nearby-prompt URL rebuilds.src/views/{SearchView,CountriesView}— toolbar on Search; header icon filter on Countries.public/locales/*/common.json—sort.*labels across all 10 locales.Merged with
mainMerged
main(#74 UI bug-sweep) into the branch and resolved the conflicts: re-applied the sort feature onto main's split-outDynamicEventsList.tsx, combined theNearbySuggestion→GeolocationSuggestionrename with the toolbar, and kept both mysort.*keys and main's newsearch/back/close/explore/settingslabel keys across the 9 non-en locales.Verification
sort.test.ts) ·pnpm build✓ ·ladle:build✓ (all re-run post-merge).?sort=+ Filters round-trip preserve the sort; no refetch.Notes for reviewer
.claude/rules/i18n-and-state.md.modal={false}), and of main's updatedAlert/drawer styling under the new toolbar.Closes #75
🤖 Generated with Claude Code