chore(metaparams): add search extensions/workflowSelector support#69
Draft
chris-algolia wants to merge 1 commit into
Draft
chore(metaparams): add search extensions/workflowSelector support#69chris-algolia wants to merge 1 commit into
chris-algolia wants to merge 1 commit into
Conversation
dd12ff4 to
98c5431
Compare
Up to standards ✅🟢 Issues
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds UI and request/export support for Algolia’s extensions search parameter (notably workflowSelector.name) so it can be edited in metaparams and correctly represented at the REST boundary (including generated/imported curl snippets).
Changes:
- Add
extensionsto the metaparams specs as a search-scoped object param with dedicated editing UI. - Ensure
extensionsis sent as a top-level field in search/disjunctive search requests (instead of being serialized into theparamsquerystring). - Update curl snippet generation and curl parsing to include top-level
extensions, plus add a local autocomplete fallback for param names.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/common/utils/customIndexMethods.js | Splits extensions out of search params and serializes it at the transport boundary (single + disjunctive search). |
| packages/common/utils/curlCommandExtractor.js | Adds support for reading extensions from curl JSON bodies and normalizes header matching. |
| packages/common/params-specs/data.yml | Declares extensions as a search-scoped object metaparam with defaults. |
| packages/common/components/params/input/InputValue.vue | Wires new object editors (extensions, generic JSON object) into the param input system. |
| packages/common/components/params/input/InputParamName.vue | Adds local param-name suggestions and default initialization for newly declared params. |
| packages/common/components/params/input/InputJsonObject.vue | Introduces a generic JSON-object editor textarea. |
| packages/common/components/params/input/InputExtensions.vue | Adds a dedicated extensions editor with workflow selector support + JSON mode. |
| packages/common/components/explorer/export-params/templates.js | Updates curl template to accept a generated full JSON request body. |
| packages/common/components/explorer/export-params/snippet-generator.js | Generates curl search bodies with top-level extensions and expands value serialization behavior. |
| packages/common/components/autocomplete/AlgoliaAutocomplete.vue | Adds local-items fallback and safer highlight rendering in autocomplete results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
72
to
+80
| refine: async function (query) { | ||
| const data = await this.algoliaIndex.search(query, this.searchParams || {}); | ||
| this.items = data.hits; | ||
| const localItems = this.localRefine(query); | ||
| this.items = localItems; | ||
| try { | ||
| const data = await this.algoliaIndex.search(query, this.searchParams || {}); | ||
| this.items = this.mergeItems(localItems, data.hits); | ||
| } catch (e) { | ||
| this.items = localItems; | ||
| } |
Comment on lines
91
to
112
| @@ -75,6 +105,10 @@ const SnippetGenerator = function () { | |||
| if (Array.isArray(value)) { | |||
| return `[\n ${value.map((v) => this.getStringValue(v, language)).join(',\n ')}\n ]`; | |||
| } | |||
|
|
|||
| if (value && typeof value === 'object') { | |||
| return JSON.stringify(value, null, 2); | |||
| } | |||
| }; | |||
Comment on lines
+30
to
+36
| watch: { | ||
| value: function (value) { | ||
| const serialized = JSON.stringify(value || {}, null, 2); | ||
| if (serialized !== this.draft) { | ||
| this.draft = serialized; | ||
| } | ||
| }, |
Comment on lines
+84
to
+89
| value: function (value) { | ||
| const serialized = JSON.stringify(extensionsValue(value), null, 2); | ||
| if (serialized !== this.draft) { | ||
| this.draft = serialized; | ||
| } | ||
| }, |
Comment on lines
+65
to
+70
| this.curlParamValue = function (value) { | ||
| if (Array.isArray(value) || (value && typeof value === 'object')) { | ||
| return JSON.stringify(value); | ||
| } | ||
| return value; | ||
| }; |
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.
Note for reviewers: this PR is AI-coded, I'm not familiar with this repo
Summary
This PR allows to setup "extensions"
workflowSelector.nameparams in metaparams.It also adds this params in the CURL url view.
extensionsas a search-scoped metaparam with object editing support.extensionsat the REST request boundary for search and disjunctive search, while keeping it as a normal Search Param in the UI.extensionsso generated REST calls match Algolia's query body shape.Validation
yarn run lint --no-fixpasses with 0 errors and the existing 37 warnings.http://localhost:8080/with existing warnings only.