-
Notifications
You must be signed in to change notification settings - Fork 143
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(config): add pause assistant #2204
base: main
Are you sure you want to change the base?
Conversation
a69ed5e
to
3eef519
Compare
51160fd
to
7a75b4c
Compare
a4293ad
to
14b5a20
Compare
Updated copy according to the #2226 (comment) |
"pages/notifications/pause-assistant.html", | ||
"pages/notifications/pause-resume.html", | ||
"pages/notifications/pause-feedback.html" |
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.
how about we put all those in a single page?
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.
Then, we will have much more overcomplicated logic in JS, like using a router and many views. It is better to have three separate "views" rather than one with parameters.
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.
It is JS logic in one place or configuration in three places. Question is what is more likely to break
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.
It is easier to reason about what happens if each notification has a separate structure. We would still need almost the same amount of files, the only advantage is one html
file, but with a more complex structure in an index JS file. It is not worth it.
'Enter flags to test:', | ||
[FLAG_PAUSE_ASSISTANT, FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS].join(', '), | ||
); | ||
if (!flags) return; |
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.
There may be a bug here. What if I want to clear all flags?
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.
Use "force sync". This prompt is for adding flags on top of existing ones, not to overwrite them.
flags: { | ||
[flag]: { enabled: true }, | ||
}, | ||
flags: flags.split(',').reduce((acc, flag) => { |
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.
How about?
flags: flags.split(',').reduce((acc, flag) => { | |
[FLAG_PAUSE_ASSISTANT]: { enabled: flags.include(FLAG_PAUSE_ASSISTANT) }, | |
[FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS]: { enabled: flags.include(FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS) }, |
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.
You will need to add here each new flag. We still use those IDs for prompt placeholder, but this looks overcomplicated.
"pages/notifications/pause-assistant.html", | ||
"pages/notifications/pause-resume.html", | ||
"pages/notifications/pause-feedback.html" |
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.
It is JS logic in one place or configuration in three places. Question is what is more likely to break
import { REVIEW_PAGE_URL } from '/utils/urls.js'; | ||
import { openTabWithUrl } from '/utils/tabs.js'; | ||
|
||
const close = setupNotificationPage(360); |
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.
const close = setupNotificationPage(360); | |
const close = () => setupNotificationPage(360); |
so it can be called <ui-button type="success" onclick="${close}">
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.
No. The setupNotificationPage()
returns a function, you cannot wrap close
as a function, you need a result of that function call. As the close takes an argument, you can't use it directly, so it's wrapped in an arrow function.
9ec404c
to
92c7f64
Compare
Builds for commit 92c7f64: |
92c7f64
to
874e631
Compare
Builds for commit 874e631: |
Fixes #2226. To test:
pause-assistant
flagpause-assistant
actionProgress: