Skip to content

Added search and checkbox functionality #6

Merged
sampsyo merged 7 commits intomainfrom
search
Dec 22, 2025
Merged

Added search and checkbox functionality #6
sampsyo merged 7 commits intomainfrom
search

Conversation

@sq86-qazi
Copy link
Contributor

Allows users to filter instructions based on extension

@sq86-qazi sq86-qazi requested a review from sampsyo November 11, 2025 02:33
Copy link
Contributor

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

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

Neat! I'm glad this worked out so quickly. Good work getting this going!

The main theme among my comments here is that I have identified some (hopefully easy) cleanup tasks to do in future PRs. When you merge this PR, can you please create issues to track those tasks? Then we can do those next.


label.appendChild(checkbox);
label.appendChild(text);
filtersContainer.appendChild(label);
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall, it looks like the strategy here is to populate the list of extension in the client, rather than when generating the HTML. Rather like the situation where we were generating SVG in the browser before, I think this could be a lot simpler if we simply generate the HTML for the checkboxes up front. This would avoid all the createElement and stuff, and it could be much easier to read.

I strongly suggest that we leave that change to a future PR as well! In the interest of getting this one merged, so the next step will be clear.

Copy link
Contributor

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

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

I found one unaddressed comment from my previous review, which I've marked within. And one more comment about some newly-changed code… it looks like this switched from using a JavaScript Map to a Set, but I'm not sure why we need either one.

const items = Array.from(list.querySelectorAll('li'));
const activeExtensions = new Set();

const extensionSet = new Set();
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't really understand why we are using a Set here. It was previously a Map. Can we just construct an array and then sort it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because this is essentially creating a list of extensions based on the list of instructions. Since a lot of the instructions have the same extension this automatically gets rid of the duplicate extensions. If I did an array I would have to take out the duplicates.

Copy link
Contributor

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

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

Cool; seems like we're in business!

@sampsyo sampsyo merged commit 8e8a74b into main Dec 22, 2025
4 checks passed
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