Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toolbox-search to search dropdown field options #1940

Open
1 task done
gonfunko opened this issue Sep 20, 2023 · 5 comments · Fixed by #1971
Open
1 task done

Update toolbox-search to search dropdown field options #1940

gonfunko opened this issue Sep 20, 2023 · 5 comments · Fixed by #1971
Labels
category: plugin Anything in the plugins folder help wanted Open for contributions type: feature request New feature or request

Comments

@gonfunko
Copy link
Contributor

Check for duplicates

  • I have searched for similar issues before opening a new one.

Component

toolbox-search

Problem

No response

Request

The toolbox-search plugin should include the text of options in dropdown fields when filtering blocks. Right now, only the label text on the block (or the contents of text fields) are included in the index. Ideally, the matching option would also be shown pre-selected on the block in the toolbox.

Alternatives considered

No response

Additional context

No response

@gonfunko gonfunko added type: feature request New feature or request triage labels Sep 20, 2023
@BeksOmega BeksOmega added help wanted Open for contributions category: plugin Anything in the plugins folder and removed triage labels Sep 21, 2023
@rachel-fenichel
Copy link
Collaborator

To work on this bug:

  • Run npm install at the root of the repository to install all parts of blockly-samples
  • cd to plugins/toolbox-search
  • Run npm run start to open a playground and verify that the toolbox search plugin works for you
  • Make code changes (see below)
  • Verify that the changes work in the playground as expected

The code that searches block text is in indexBlocks in src/block_searcher.ts. Lines 31-32 loop over every filed and call indexBlockText(field.getText()).

  • Update this call to check if the field is a dropdown, and call indexBlockText for every option in the dropdown menu.
  • Update matchBlocks in src/toolbox_search.ts to set the value of the dropdown based on the query, if it doesn't match the default text on the block.

To verify, find a block with a dropdown (such as one of the math blocks) and do a search for a non-default value that is contained in the dropdown.

@BeksOmega BeksOmega added ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ and removed rrf-internal labels Sep 22, 2023
@ludizhan
Copy link

https://github.com/sammitako and I have been working on this during the GHC OSD and would like to continue on finishing it. Can we both get assigned to this issue? Thanks!

@rachel-fenichel
Copy link
Collaborator

I think I have to tag @sammitako in order to assign to her. Let's see if this works.

@sammitako
Copy link
Contributor

sammitako commented Sep 22, 2023

Thank you!

@BeksOmega BeksOmega linked a pull request Sep 29, 2023 that will close this issue
1 task
@BeksOmega
Copy link
Contributor

Work still to be done: Select the proper option in the dropdown when searching.

@BeksOmega BeksOmega removed the ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ label Oct 23, 2023
ictin added a commit to ictin/blockly-samples that referenced this issue Jan 3, 2024
constantinIliescu added a commit to constantinIliescu/blockly-samples that referenced this issue Feb 26, 2024
Fixes: google#1940

Uses the Block State as suggested here:
google#2004 (comment)
Fixes: bug that didn't indexed the last trigram from a word
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: plugin Anything in the plugins folder help wanted Open for contributions type: feature request New feature or request
Projects
No open projects
Status: Done Testing
5 participants