-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Editor] Add a color picker in the toolbar of Ink and Freetext annotations #20070
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
base: master
Are you sure you want to change the base?
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/01816abba62ab60/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/01816abba62ab60/output.txt Total script time: 0.95 mins Published |
27ae433
to
ab5c1e7
Compare
ab5c1e7
to
5a03f26
Compare
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/6e495e613178db4/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/9bd421a16698c80/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/9bd421a16698c80/output.txt Total script time: 13.36 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/6e495e613178db4/output.txt Total script time: 27.15 mins
|
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.
Mostly looks good to me, with some questions answered that I'm unsure about before I approve this.
@@ -304,4 +304,61 @@ class ColorPicker { | |||
} | |||
} | |||
|
|||
export { ColorPicker }; | |||
class BasicColorPicker { |
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's not immediately clear to me what the difference is between a basic color picker and the pre-existing regular color picker. It might be good to add a short docstring to both classes to explain the difference to the reader so it's clear which should be used in different scenarios.
@@ -407,7 +407,7 @@ class HighlightEditor extends AnnotationEditor { | |||
const colorPicker = (this.#colorPicker = new ColorPicker({ | |||
editor: this, | |||
})); | |||
return [["colorPicker", colorPicker]]; | |||
return [["highlightColorPicker", colorPicker]]; |
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.
Why is this renamed, because the ink and freetext ones are already both called colorPicker
?
@@ -163,7 +163,7 @@ class EditorToolbar { | |||
|
|||
async addButton(name, tool) { | |||
switch (name) { | |||
case "colorPicker": | |||
case "highlightColorPicker": |
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 ties in to the renaming comment above, but this case seems to be identical to the one of colorPicker
below. Can we collapse them into one to have a generic color picker addition call for all annotation types, and let the annotation types themselves determine (via toolbarButtons
) if they provide the basic or the regular color picker since that seems simpler overall?
await closePages(pages); | ||
}); | ||
|
||
it("must check that the stroke color is the one choose from the color picker", async () => { |
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.
s/choose/chosen
|
||
it("must check that the stroke color is the one choose from the color picker", async () => { | ||
await Promise.all( | ||
pages.map(async ([_browserName, 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.
In other places if the parameter is not used we only use an underscore to indicate that; see
pages.map(async ([_, page]) => { |
async ([_, page])
@@ -1294,3 +1294,45 @@ describe("Should switch from an editor and mode to others by double clicking", ( | |||
); | |||
}); | |||
}); | |||
|
|||
describe("Ink must update its color", () => { |
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.
Could you also add a test like this for freetext annotations so that part of the PR is also covered?
No description provided.