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

feat: Select all projects iconbutton #574

Merged
merged 9 commits into from
Dec 20, 2024

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Dec 16, 2024

Similar to #569, but as an icon button.

Works towards microsoft/playwright#33865 by adding a Select All / Unselect All button. Once we have that, we can start automatically selecting all projects by default.

Screen.Recording.2024-12-16.at.10.36.20.mov

@Skn0tt Skn0tt self-assigned this Dec 16, 2024

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • media/settingsView.css: Language not supported
  • media/theme.css: Language not supported
function setAllProjects(checked) {
for (const input of projectsElement.querySelectorAll('input[type=checkbox]')) {
input.checked = checked;
input.dispatchEvent(new Event('change'));
Copy link
Member

Choose a reason for hiding this comment

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

This would do a lot of things many times if you have 20 projects. I'd recommend making it a bit more MVC-y:

Option 1:
You currently dispatch an event in line 343 that you listen to in line 327. You can consider short-cutting it and making setProjectEnabled receive array of values for a batch update. That way instead of 20 whole-UI updates we get 1.

Option 2:
Going even further MVC where sidebar is a View, introduce an event "setAllProjectEnabled(boolean)" that would site next to setProjectEnabled and would do the right thing, also once.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I implemented Option 2 in 8f2b484 - Option 1 would've required keeping a list of project names within the view, which felt weird.

@Skn0tt Skn0tt merged commit 258fbef into microsoft:main Dec 20, 2024
5 of 6 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.

2 participants