-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[Editor] Add the ability to make multiple selections (bug 1779582) #15200
Conversation
calixteman
commented
Jul 21, 2022
- several editors can be selected/unselected using ctrl+click;
- and then they can be copied, pasted, their properties can be changed.
return this.#isEditing; | ||
} | ||
|
||
set isEditing(value) { |
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.
Please add a JSDoc-comment for the value
parameter.
src/display/editor/tools.js
Outdated
setSelected(editor) { | ||
if (!this.#isMultipleSelection) { | ||
if (this.#selectedEditors.has(editor)) { | ||
if (this.#selectedEditors.size >= 2) { |
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.
Optional-nit:
if (this.#selectedEditors.size >= 2) { | |
if (this.#selectedEditors.size > 1) { |
} | ||
this.#selectedEditors.clear(); | ||
this.#selectedEditors.add(editor); | ||
this.#dispatchUpdateUI(editor.propertiesToUpdate); |
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.
Don't you also need a dispatchUpdateStates
-call in this case too?
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 useless because the only value we could update is hasSelectedEditor
but its value won't change since we already know that the #selectedEditors
is non-empty, and after the removal it's still non-empty (we let the select editor inside).
} | ||
|
||
.annotationEditorLayer .inkEditor:not(:focus) { | ||
.annotationEditorLayer .inkEditor.disabled:not(.selectedEditor) { |
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.
Is the last part actually necessary here, or does the following work (given the rule just below which override it when necessary)?
.annotationEditorLayer .inkEditor.disabled:not(.selectedEditor) { | |
.annotationEditorLayer .inkEditor.disabled { |
.annotationEditorLayer .background { | ||
z-index: 0; |
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 was just removed, in another PR, so is this perhaps a rebase mistake?
2fffc1a
to
96feefb
Compare
src/display/editor/editor.js
Outdated
|
||
/** | ||
* If true then the editor is currently edited. | ||
* @return {boolean} |
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.
Looking at our other getters, elsewhere in the code-base, I believe that you want the following for things to work generally:
* @return {boolean} | |
* @type {boolean} |
await page.keyboard.press("v"); | ||
await page.keyboard.up("Control"); | ||
|
||
// 0,1,3 are unselected and new paster editors are selected. |
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.
Nit: Did you mean the following?
// 0,1,3 are unselected and new paster editors are selected. | |
// 0,1,3 are unselected and new pasted editors are selected. |
// Select that all the editors are correctly selected (and the focus | ||
// didn't move on the body when the empty editor has been removed). |
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.
Nit: Did you mean the following?
// Select that all the editors are correctly selected (and the focus | |
// didn't move on the body when the empty editor has been removed). | |
// Check that all the editors are correctly selected (and the focus | |
// didn't move to the body when the empty editor was removed). |
.withContext(`In ${browserName}`) | ||
.toEqual([7]); | ||
|
||
// Get the focus to 2 and check that only 2 is selected. |
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.
Nit: Did you mean the following?
// Get the focus to 2 and check that only 2 is selected. | |
// Set the focus to 2 and check that only 2 is selected. |
src/display/editor/tools.js
Outdated
|
||
/** | ||
* An editor just got a mousedown with ctrl key pressed. | ||
* @param {boolean}} isMultiple |
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.
* @param {boolean}} isMultiple | |
* @param {boolean} isMultiple |
|
||
/** | ||
* An editor just got a mousedown with ctrl key pressed. | ||
* @param {boolean}} isMultiple |
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.
* @param {boolean}} isMultiple | |
* @param {boolean} isMultiple |
- several editors can be selected/unselected using ctrl+click; - and then they can be copied, pasted, their properties can be changed.
96feefb
to
d6b9ca4
Compare
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/ca5e8e0d1bda87b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/761cc3dfb7ee27b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/ca5e8e0d1bda87b/output.txt Total script time: 4.73 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/761cc3dfb7ee27b/output.txt Total script time: 7.25 mins
|