Skip to content

Comments

Facet range inputs & formalValue for filters#157

Merged
korgon merged 6 commits intodevelopfrom
price-facet-inputs
Jan 14, 2026
Merged

Facet range inputs & formalValue for filters#157
korgon merged 6 commits intodevelopfrom
price-facet-inputs

Conversation

@chrisFrazier77
Copy link

adding range facet inputs and the ability to use filterFormatValue for filters

Copilot AI review requested due to automatic review settings December 30, 2025 19:40
@chrisFrazier77 chrisFrazier77 linked an issue Dec 30, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds range facet input controls and the ability to format filter values using a configurable format string. The changes enable users to manually input range values for facets like price ranges and customize how range filter labels are displayed.

Key Changes:

  • Added sprintf formatting utility for filter value formatting
  • Introduced range input UI components with validation and submit functionality
  • Added filterFormatValue configuration option to facet settings

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/snap-toolbox/src/sprintf/sprintf.ts Adds sprintf formatting utility for filter value formatting
packages/snap-toolbox/src/index.ts Exports the new sprintf module
packages/snap-store-mobx/src/types.ts Adds filterFormatValue config option to FacetStoreConfig
packages/snap-store-mobx/src/Search/Stores/SearchFilterStore.ts Implements filter label formatting using sprintf and filterFormatValue config
packages/snap-store-mobx/src/Search/Stores/SearchFacetStore.ts Updates facet type definition to use string literal union instead of generic string
packages/snap-store-mobx/src/Search/SearchStore.ts Passes config to SearchFilterStore constructor
packages/snap-store-mobx/src/Autocomplete/AutocompleteStore.ts Passes config to SearchFilterStore constructor
packages/snap-preact/src/Templates/Stores/library/languages/fr.ts Adds French translation for range input submit button
packages/snap-preact/src/Templates/Stores/library/languages/es.ts Adds Spanish translation for range input submit button
packages/snap-preact/components/src/types.ts Removes deprecated FacetType enum
packages/snap-preact/components/src/components/Organisms/Facet/readme.md Documents new range input props
packages/snap-preact/components/src/components/Organisms/Facet/Facet.tsx Implements range input UI with validation and submit functionality
packages/snap-preact/components/src/components/Organisms/Facet/Facet.test.tsx Adds tests for range input props and updates test class name
packages/snap-preact/components/src/components/Organisms/Facet/Facet.stories.tsx Updates stories with range input controls and fixes site ID references
packages/snap-preact/components/src/components/Molecules/Filter/Filter.stories.tsx Updates to use string literals instead of deprecated FacetType enum
packages/snap-preact-demo/templates/src/index.ts Adds commented configuration examples for range inputs and filterFormatValue

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

@korgon korgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial feedback. Still need to manual test.

@chrisFrazier77 chrisFrazier77 requested a review from korgon January 12, 2026 17:00
Copy link

@korgon korgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings suggestions for better nested configuration (to support future filter settings).

Also, should this support 'enter' key to submit?

Copy link

@korgon korgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config does not work as I would expect it to (affecting all applicable fields):

settings: {
	filters: {
		filterFormatValue: '$%01.2f - $%01.2f',
	}
},

@korgon
Copy link

korgon commented Jan 13, 2026

There is an issue related to the format config here:
searchspring#364

^ that task specifically is about the limitations of sprintf - which I don't think we have addressed here. We might be able to add to this in the future, but maybe we could address this limitation now?

Copy link

@korgon korgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more thoughts - sorry my comments here are so spread out.

@korgon korgon merged commit 719a540 into develop Jan 14, 2026
1 check passed
@korgon korgon deleted the price-facet-inputs branch January 14, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Price Facet Inputs

2 participants