Skip to content

Comments

feat(runtime): add ais.index block support#25

Open
sarahdayan wants to merge 2 commits intomainfrom
feat/ais-index-block-support
Open

feat(runtime): add ais.index block support#25
sarahdayan wants to merge 2 commits intomainfrom
feat/ais-index-block-support

Conversation

@sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Feb 21, 2026

Summary

  • Adds recursive block support to the runtime so ais.index blocks can wrap index-dependent widgets (searchBox, configure, hits, etc.)
  • Extracts block processing into a processBlocks() function that recurses into nested blocks
  • Handles ais.index directly in the middleware (not via $$supportedWidgets) since it's structural, not a leaf widget
  • Validates indexName presence and warns on missing
  • Registers cleanup for index widgets and injected style elements on unsubscribe

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for algolia-experiences-react ready!

Name Link
🔨 Latest commit 2b891de
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-react/deploys/6999d70d2fc8f800087130e7
😎 Deploy Preview https://deploy-preview-25--algolia-experiences-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for algolia-experiences-js ready!

Name Link
🔨 Latest commit 2b891de
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-js/deploys/6999d70d0b2f77000818193f
😎 Deploy Preview https://deploy-preview-25--algolia-experiences-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sarahdayan sarahdayan changed the title feat(runtime): add ais.index block support feat(runtime): add ais.index block support Feb 21, 2026
@sarahdayan sarahdayan requested a review from dhayab February 21, 2026 09:01
@sarahdayan sarahdayan added the Priority PR PRs that should be reviewed early because other work depends on them label Feb 21, 2026
@sarahdayan sarahdayan force-pushed the feat/ais-index-block-support branch 2 times, most recently from 2e4cd56 to d12d03c Compare February 21, 2026 14:21
Index-dependent widgets (searchBox, configure, hits, etc.) need to be
scoped to a search index. Rather than setting indexName on the
InstantSearch instance, ais.index blocks wrap child widgets uniformly
for both single-index and multi-index (federated search) scenarios.

- Make block types recursive (blocks can contain nested blocks)
- Extract processBlocks() for recursive block processing
- Handle ais.index by creating an index widget and recursing into children
- Validate indexName presence with warning on missing
- Register cleanup for index widgets and injected style elements
- Add indexId to ExperienceApiBlockParameters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sarahdayan sarahdayan force-pushed the feat/ais-index-block-support branch from d12d03c to ac3a2eb Compare February 21, 2026 15:49
Document how the AI tools layer handles ais.index blocks: they render
with fallback labels (not in WIDGET_TYPES), and nested blocks are not
described. This makes the current gap visible for future work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority PR PRs that should be reviewed early because other work depends on them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant