Skip to content

Global search: Indexer#370

Merged
elmarburke merged 3 commits intomainfrom
global-search/init-indexer
Aug 11, 2025
Merged

Global search: Indexer#370
elmarburke merged 3 commits intomainfrom
global-search/init-indexer

Conversation

@elmarburke
Copy link
Copy Markdown
Contributor

@elmarburke elmarburke commented Aug 7, 2025

Description

This introduces the indexer. In order for the search to function, a filterer will follow after this. This is the good old Map/Reduce.

  • Adding the indexer for nodes on WebPageNodes and ComponentNodes. For the nodes it indexes, see the IndexedNode type.
  • Introduces a DevTool to see what's in the index
  • Sets React to 18 again, to only have one react version mounted (in test)

Testing

  • Indexes canvas nodes
  • Indexes collection items
  • Indexes managed collection items (As CollectionItem and the fields as TextNode when they exist on a page)

@elmarburke elmarburke force-pushed the global-search/init-indexer branch from 97384aa to b9318e2 Compare August 7, 2025 13:54
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is just a DevTool that will get removed again once we have filters and the result list in place.

@elmarburke elmarburke force-pushed the global-search/init-indexer branch from cbdef65 to b336c7f Compare August 7, 2025 14:04
@elmarburke elmarburke requested a review from Copilot August 7, 2025 14:06

This comment was marked as outdated.

@elmarburke elmarburke force-pushed the global-search/init-indexer branch from b336c7f to 0544ff9 Compare August 7, 2025 14:23
@elmarburke elmarburke requested a review from Copilot August 7, 2025 14:24
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 introduces a global search indexer for a Framer plugin that builds a searchable index of WebPageNodes, ComponentNodes, and Collection items. The indexer crawls through nodes, extracts relevant content (text, names, fields), and provides a foundation for search functionality.

  • Implements GlobalSearchIndexer class with event-driven architecture for indexing Framer nodes and collections
  • Creates React context and provider components to manage indexer state and integration
  • Adds developer tools interface to inspect indexed entries and debug the indexing process

Reviewed Changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
plugins/global-search/src/utils/indexer/indexer.ts Core indexer implementation with node crawling and batch processing
plugins/global-search/src/utils/indexer/IndexerProvider.tsx React provider for indexer state management
plugins/global-search/src/utils/indexer/types.ts Type definitions for index entries and node filtering
plugins/global-search/src/components/DevToolsScene.tsx Developer tools interface for inspecting indexed data
plugins/global-search/src/utils/indexer/strip-markup.ts Utility function to remove HTML markup from text
plugins/global-search/src/App.tsx Main app component updated to use indexer and dev tools
plugins/global-search/package.json Dependencies updated to React 18 and added error boundary support

Comment thread plugins/global-search/src/utils/indexer/IndexerProvider.tsx Outdated
Comment thread plugins/global-search/src/utils/indexer/IndexerProvider.tsx Outdated
Comment thread plugins/global-search/src/utils/indexer/strip-markup.ts Outdated
Comment thread plugins/global-search/src/components/DevToolsScene.tsx
Comment thread plugins/global-search/src/utils/indexer/indexer.ts
@elmarburke elmarburke force-pushed the global-search/init-indexer branch from 0544ff9 to dfc1427 Compare August 7, 2025 14:42
@elmarburke elmarburke marked this pull request as ready for review August 7, 2025 14:45
Copy link
Copy Markdown
Member

@niekert niekert left a comment

Choose a reason for hiding this comment

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

Overall LGTM just a few nits and questions

)

return (
<div className="flex flex-col h-full">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know its just temporary / for debugging but its a lil completely broken on dark mode :D

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not investing time into this for now, as it stays only for a matter of days...

Comment thread plugins/global-search/src/utils/indexer/indexer.ts Outdated
Comment thread plugins/global-search/src/utils/indexer/IndexerProvider.tsx Outdated
Comment thread plugins/global-search/src/utils/indexer/indexer.ts
Comment thread plugins/global-search/src/utils/indexer/indexer.ts
Comment thread plugins/global-search/src/utils/indexer/strip-markup.test.ts Outdated
if (isWebPageNode(value)) return true
if (isComponentNode(value)) return true

return false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: kinda feel like it would be nice to somehow make this exhaustive so we get notified when we add support for new node types while upgrading the plugin version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will do that and make the types as narrow as they need to be once the results are visible and it's easier to rule out additional, no needed data as well

@elmarburke elmarburke requested a review from niekert August 8, 2025 11:22
Copy link
Copy Markdown
Member

@niekert niekert left a comment

Choose a reason for hiding this comment

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

Nice one 👏

Comment thread plugins/global-search/src/utils/indexer/IndexerProvider.tsx Outdated
@elmarburke elmarburke force-pushed the global-search/init-indexer branch from f029f04 to 12cc32c Compare August 11, 2025 08:44
@elmarburke elmarburke force-pushed the global-search/init-indexer branch from 12cc32c to 815e0ea Compare August 11, 2025 09:23
@elmarburke elmarburke added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 40ec284 Aug 11, 2025
6 checks passed
@elmarburke elmarburke deleted the global-search/init-indexer branch August 11, 2025 09:28
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.

3 participants