|
75 | 75 | "Matches the dark theme", |
76 | 76 | "Does not guess ais-* class names" |
77 | 77 | ] |
| 78 | + }, |
| 79 | + { |
| 80 | + "id": 6, |
| 81 | + "prompt": "Add a search results page at /search for my Next.js App Router site. Users should be able to filter by brand and category, sort by price ascending or descending, and paginate. The index has replicas products_price_asc and products_price_desc.", |
| 82 | + "expected_output": "A results page using InstantSearchNext with the canonical widget tree, refinements, sort, pagination, routing, insights, and a no-results boundary, with all non-trivial props sourced from installed types", |
| 83 | + "files": [], |
| 84 | + "expectations": [ |
| 85 | + "Uses InstantSearchNext from react-instantsearch-nextjs at the layout level, not wrapping a single page", |
| 86 | + "Sets routing={true} and insights={true} on the provider", |
| 87 | + "Uses Configure to set hitsPerPage, attributesToHighlight, and attributesToSnippet", |
| 88 | + "Uses RefinementList for brand and HierarchicalMenu (or RefinementList/Menu, justified) for category", |
| 89 | + "Uses SortBy with the provided replica index names (products, products_price_asc, products_price_desc)", |
| 90 | + "Uses Pagination, not InfiniteHits, since the user did not ask for infinite scroll", |
| 91 | + "Renders a NoResultsBoundary using useInstantSearch().results.nbHits", |
| 92 | + "Uses Highlight on hit text attributes; does not render raw strings", |
| 93 | + "Reads RefinementList and SortBy props from node_modules/react-instantsearch/dist/es/widgets before writing prop values it has not used before", |
| 94 | + "Does NOT add getServerState (App Router handles SSR via InstantSearchNext)", |
| 95 | + "Does NOT combine Pagination with InfiniteHits" |
| 96 | + ] |
| 97 | + }, |
| 98 | + { |
| 99 | + "id": 7, |
| 100 | + "prompt": "I want a searchable refinement list for brand (so the user can type to filter brands) and active filter chips that show as removable pills at the top of the results.", |
| 101 | + "expected_output": "RefinementList with searchable + searchablePlaceholder configured from the type, plus CurrentRefinements wired with widget-aware classNames for the chip layout", |
| 102 | + "files": [], |
| 103 | + "expectations": [ |
| 104 | + "Reads RefinementList .d.ts to confirm the searchable, searchablePlaceholder, limit, and showMore props before using them", |
| 105 | + "Adds searchable={true} and a searchablePlaceholder on RefinementList", |
| 106 | + "Uses CurrentRefinements (not a custom hook) for the active-filter chips", |
| 107 | + "Pairs CurrentRefinements with ClearRefinements where appropriate, with excludedAttributes considered when needed", |
| 108 | + "Greps installed source for ais-CurrentRefinements-* class names before writing chip CSS", |
| 109 | + "Does not rebuild a refinement list with useRefinementList when RefinementList suffices" |
| 110 | + ] |
| 111 | + }, |
| 112 | + { |
| 113 | + "id": 8, |
| 114 | + "prompt": "Add SSR to my React InstantSearch results page. I'm using Next.js Pages Router (not App Router).", |
| 115 | + "expected_output": "Pages Router SSR using getServerState plus InstantSearchSSRProvider, with the same widget tree on server and client", |
| 116 | + "files": [], |
| 117 | + "expectations": [ |
| 118 | + "Uses getServerState from react-instantsearch/server inside getServerSideProps", |
| 119 | + "Wraps the widget tree in InstantSearchSSRProvider with serverState", |
| 120 | + "Passes renderToString from react-dom/server into getServerState", |
| 121 | + "Configures routing with a serverUrl (or framework equivalent) so the server-side router can resolve URL state", |
| 122 | + "Declares the searchClient at module scope, not inside getServerSideProps", |
| 123 | + "Renders the same widget tree on server and client", |
| 124 | + "Does NOT use InstantSearchNext (that's App Router only)", |
| 125 | + "Reads getServerState.d.ts and InstantSearchSSRProvider.d.ts from node_modules before wiring props" |
| 126 | + ] |
| 127 | + }, |
| 128 | + { |
| 129 | + "id": 9, |
| 130 | + "prompt": "I need a custom widget that renders the available brands as round colored chips with each brand's logo, instead of the default checkbox list. Selecting a chip refines the results.", |
| 131 | + "expected_output": "A custom widget built with useRefinementList that renders chips, with renderState fields read from the hook's installed type", |
| 132 | + "files": [], |
| 133 | + "expectations": [ |
| 134 | + "Uses useRefinementList from react-instantsearch (not useConnector with a raw connector, since a hook exists)", |
| 135 | + "Reads node_modules/react-instantsearch/dist/es/connectors/useRefinementList.d.ts to learn the return type before destructuring", |
| 136 | + "Calls refine(item.value) on chip click", |
| 137 | + "Renders accessibility attributes (role, aria-pressed) explicitly since the built-in widget's accessibility is lost", |
| 138 | + "Considers transformItems on RefinementList as a lighter-weight alternative before going custom", |
| 139 | + "Does NOT rebuild refinement state from useHits + useState" |
| 140 | + ] |
| 141 | + }, |
| 142 | + { |
| 143 | + "id": 10, |
| 144 | + "prompt": "Set up my React InstantSearch project with the correct future flags so it's ready for the next major release.", |
| 145 | + "expected_output": "Future flags applied based on installed types and the live Upgrade guides, not training-data recall", |
| 146 | + "files": [], |
| 147 | + "expectations": [ |
| 148 | + "Reads InstantSearchProps['future'] from node_modules/react-instantsearch types to enumerate available flags", |
| 149 | + "Fetches https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/react to confirm current recommended flags and defaults", |
| 150 | + "Applies flags on the InstantSearch (or InstantSearchNext) provider with values matching the installed package version", |
| 151 | + "Does NOT enable a flag that does not appear in the installed type", |
| 152 | + "Asks the user before enabling any flag whose default cannot be determined from types or docs" |
| 153 | + ] |
| 154 | + }, |
| 155 | + { |
| 156 | + "id": 11, |
| 157 | + "prompt": "Add an autocomplete search bar to my Vue 3 app. I'm using vue-instantsearch elsewhere on the site for a results page. The autocomplete should query my products index and clicking a result should navigate to /products/[objectID].", |
| 158 | + "expected_output": "Autocomplete built with @algolia/autocomplete-js mounted from a Vue component (onMounted/onBeforeUnmount), reusing the module-level searchClient", |
| 159 | + "files": [], |
| 160 | + "expectations": [ |
| 161 | + "Picks @algolia/autocomplete-js as the autocomplete library, NOT a vue-instantsearch widget such as <ais-search-box> or <ais-autocomplete>", |
| 162 | + "Does NOT treat @algolia/autocomplete-js as an anti-pattern (it is the recommended path for Vue, unlike React)", |
| 163 | + "Mounts autocomplete inside a Vue component via onMounted with a ref to the host element, and calls instance.destroy() in onBeforeUnmount", |
| 164 | + "Declares the searchClient at module scope (outside the component), reusing the same one used by vue-instantsearch where applicable", |
| 165 | + "Configures getSources with an Algolia source that uses algoliasearch v5's search method shape", |
| 166 | + "Wires getItemUrl and a templates.item that links to /products/[objectID]", |
| 167 | + "Confirms the autocomplete options shape (getSources, templates) against the live Algolia docs or installed types before scaffolding" |
| 168 | + ] |
| 169 | + }, |
| 170 | + { |
| 171 | + "id": 12, |
| 172 | + "prompt": "Add autocomplete search to a vanilla JS site. The page already mounts an InstantSearch.js results page. The autocomplete should sit in the header and link to product detail pages.", |
| 173 | + "expected_output": "Autocomplete built with @algolia/autocomplete-js, separate from the instantsearch.js widget tree, sharing the same module-level searchClient", |
| 174 | + "files": [], |
| 175 | + "expectations": [ |
| 176 | + "Picks @algolia/autocomplete-js as the autocomplete library, NOT the instantsearch.js searchBox widget for autocomplete behavior", |
| 177 | + "Does NOT treat @algolia/autocomplete-js as an anti-pattern (it is the recommended path for vanilla JS, unlike React)", |
| 178 | + "Calls autocomplete({ container, getSources, ... }) once and saves the returned instance for later destroy() on teardown", |
| 179 | + "Reuses the module-level searchClient already used by instantsearch.js, declared outside any function", |
| 180 | + "Uses algoliasearch v5's search method shape inside getSources", |
| 181 | + "Imports @algolia/autocomplete-theme-classic (or documents the chosen theme) so the dropdown is styled", |
| 182 | + "Confirms the autocomplete options shape against the live Algolia docs or installed types before scaffolding" |
| 183 | + ] |
78 | 184 | } |
79 | 185 | ] |
80 | 186 | } |
0 commit comments