-
Notifications
You must be signed in to change notification settings - Fork 74
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
Conversation
There was a problem hiding this comment.
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
src/settingsView.ts
Outdated
function setAllProjects(checked) { | ||
for (const input of projectsElement.querySelectorAll('input[type=checkbox]')) { | ||
input.checked = checked; | ||
input.dispatchEvent(new Event('change')); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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