Skip to content

[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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman
Copy link
Contributor Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/01816abba62ab60/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/01816abba62ab60/output.txt

Total script time: 0.95 mins

Published

@calixteman calixteman force-pushed the editor_toolbar_color branch 2 times, most recently from 27ae433 to ab5c1e7 Compare July 9, 2025 14:36
@calixteman calixteman force-pushed the editor_toolbar_color branch from ab5c1e7 to 5a03f26 Compare July 9, 2025 15:12
@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/6e495e613178db4/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9bd421a16698c80/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9bd421a16698c80/output.txt

Total script time: 13.36 mins

  • Integration Tests: FAILED

@calixteman calixteman marked this pull request as ready for review July 9, 2025 15:29
@calixteman calixteman requested a review from a team as a code owner July 9, 2025 15:29
@calixteman calixteman requested review from timvandermeij and removed request for a team July 9, 2025 15:29
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/6e495e613178db4/output.txt

Total script time: 27.15 mins

  • Integration Tests: FAILED

Copy link
Contributor

@timvandermeij timvandermeij left a 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 {
Copy link
Contributor

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]];
Copy link
Contributor

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":
Copy link
Contributor

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 () => {
Copy link
Contributor

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]) => {
Copy link
Contributor

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]) => {
, so let's do that there too for consistency: 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", () => {
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants