Skip to content

chore(metaparams): add search extensions/workflowSelector support#69

Draft
chris-algolia wants to merge 1 commit into
masterfrom
feat/search-extensions-ui
Draft

chore(metaparams): add search extensions/workflowSelector support#69
chris-algolia wants to merge 1 commit into
masterfrom
feat/search-extensions-ui

Conversation

@chris-algolia
Copy link
Copy Markdown

@chris-algolia chris-algolia commented Jun 2, 2026

Note for reviewers: this PR is AI-coded, I'm not familiar with this repo

Summary

This PR allows to setup "extensions" workflowSelector.name params in metaparams.
It also adds this params in the CURL url view.

Screenshot 2026-06-02 at 12 33 00 Screenshot 2026-06-02 at 12 32 51 Screenshot 2026-06-02 at 14 47 43
  • Add extensions as a search-scoped metaparam with object editing support.
  • Add local param autocomplete fallback so newly declared params are available even before the remote metaparams index is updated.
  • Serialize extensions at the REST request boundary for search and disjunctive search, while keeping it as a normal Search Param in the UI.
  • Import/export curl snippets with top-level extensions so generated REST calls match Algolia's query body shape.

Validation

  • yarn run lint --no-fix passes with 0 errors and the existing 37 warnings.
  • Dev server compiled successfully at http://localhost:8080/ with existing warnings only.

@chris-algolia chris-algolia force-pushed the feat/search-extensions-ui branch from dd12ff4 to 98c5431 Compare June 2, 2026 10:31
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes.

@chris-algolia chris-algolia changed the title Add search extensions UI support chore(metaparams): add search extensions UI support Jun 2, 2026
@chris-algolia chris-algolia requested a review from Copilot June 2, 2026 12:51
Copy link
Copy Markdown
Contributor

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 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 extensions to the metaparams specs as a search-scoped object param with dedicated editing UI.
  • Ensure extensions is sent as a top-level field in search/disjunctive search requests (instead of being serialized into the params querystring).
  • 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;
};
@chris-algolia chris-algolia changed the title chore(metaparams): add search extensions UI support chore(metaparams): add search extensions/workflowSelector support Jun 2, 2026
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.

2 participants