Add category navigation to search results#327
Closed
tracygardner wants to merge 2 commits intomainfrom
Closed
Conversation
When searching, matching categories and subcategories now appear at the top of the flyout as clickable buttons above the matching blocks. Clicking a category button navigates to that category in the toolbox sidebar and opens its flyout (including expanding the parent first for subcategories). - buildCategoryIndex() traverses the toolbox definition to collect all categories and subcategories with their display names and paths - navigateToCategory() resolves the raw-name path to live toolbox items, expanding parents and selecting the target via ensurePointerFocusedSelection_ - matchBlocks now also filters the category index and passes matches to showMatchingBlocks - showMatchingBlocks renders a "Categories" label + per-category buttons (with categorystyle-based CSS classes) before the block list - CSS added for the category header label and per-categorystyle button colours https://claude.ai/code/session_012QbU2xUemokbaybUrz5VG3
Blockly v12 places replaceMessageReferences under utils.parsing, not directly on utils. Fix both the new buildCategoryIndex resolveDisplayName helper and the pre-existing getBlockMessage helper which had the same bug (it rarely fired because most blocks have a toString() result). https://claude.ai/code/session_012QbU2xUemokbaybUrz5VG3
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.
Summary
Enhanced the search plugin to display matching categories alongside matching blocks in search results, allowing users to quickly navigate to relevant toolbox categories.
Key Changes
buildCategoryIndex()function that recursively traverses the toolbox schema to build a searchable index of all categories with their display names, paths, and styling informationnavigateToCategory()function that programmatically expands nested categories and selects the target category in the toolboxshowMatchingBlocks()to accept and display category matches alongside block matches, with categories appearing in a separate section above blocksImplementation Details
workspace.flockCategoryIndexhttps://claude.ai/code/session_012QbU2xUemokbaybUrz5VG3