Skip to content

feat(dropdown): Persist filter dropdown value between pages#288

Open
ethan-id wants to merge 1 commit into
exa-studio:mainfrom
ethan-id:keep-filter
Open

feat(dropdown): Persist filter dropdown value between pages#288
ethan-id wants to merge 1 commit into
exa-studio:mainfrom
ethan-id:keep-filter

Conversation

@ethan-id
Copy link
Copy Markdown

Description

Adds a composable useApiFilter() to persist the user’s selected filter across page navigations and reloads. Wires it into FilterDropdown.vue and the categories page so the persisted value is used on initial load and when switching categories.

Proposed Changes

  • New frontend/composables/useApiFilter.ts: stores the current filter in useState('apiFilter') and syncs to localStorage on the client.
  • Update frontend/components/FilterDropdown.vue:
    • Bind v-model to the shared filter from the composable.
    • Emit the current value on mount so parent views initialize correctly.
  • Update frontend/pages/categories/[category].vue:
    • Use the shared filter and refetch when route.params.category changes (watch(..., { immediate: true })).
    • Remove redundant local filter state and the extra onMounted fetch.

Checklist

  • My submission is formatted according to the guidelines in the contributing guide
  • My submission has a useful description
  • Code follows the established CODE_OF_CONDUCT guidelines.
  • Code has been tested thoroughly.
  • All commit messages are descriptive and follow the established commit message format.
  • Pull request description clearly describes the changes included in the pull request.
  • I have searched the repository for any relevant issues or pull requests
  • Any category I am creating has the minimum requirement of 3 items

@imggion
Copy link
Copy Markdown
Member

imggion commented Aug 25, 2025

Thanks for your contribution. We'll review this pr soon! 😄

@imggion imggion added enhancement New feature or request frontend labels Aug 25, 2025
@imggion imggion self-requested a review August 25, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants