-
Notifications
You must be signed in to change notification settings - Fork 71
[IMP] Figure: Allow dragNdrop of multiple figures #7643
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
hokolomopo
left a comment
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.
A bunch of small issues, and added some testing notes in the pad. But the feature is very cool :D
| import { Command, CommandResult } from "../../types/commands"; | ||
| import { UIPlugin } from "../ui_plugin"; | ||
|
|
||
| export class FigureUIPlugin extends UIPlugin { |
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.
I think we're trying to replace feature UI plugins by stores.
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 this case as there is no state and the plugin is only used to group the commands. I feel a plugin is a better choice according to this
packages/o-spreadsheet-engine/src/plugins/ui_stateful/carousel_ui.ts
Outdated
Show resolved
Hide resolved
packages/o-spreadsheet-engine/src/plugins/ui_stateful/carousel_ui.ts
Outdated
Show resolved
Hide resolved
| if (this.copiedData?.figureIds && this.copiedData.figureIds.length) { | ||
| const figureId = this.copiedData.figureIds[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.
can we add all the copied charts inside the 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.
The reason for this is that I want getClipboardTextAndImageContent to have matching HTML and Image content.
But I cannot add more image to the OS clipboard without a larger refactor of the clipboard to have multiple Image (which i plan to do another task for). So in the mean time, both method only copy the first image to the OS clipboard
| const figuresUI = selectedFiguresIds | ||
| .map((id) => this.getters.getFigure(sheetId, id)) | ||
| .filter(isDefined) | ||
| .map((f) => this.getters.getFigureUI(sheetId, f)); | ||
| const topLeft = rectUnion(...figuresUI); |
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.
I'd say it's the responsibility of the clipboard handlers to figure the top-left, not of the clipboard plugin
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.
I feel like I would rather leave it there compared to having this copied thrice in the three figure clipboard handlers (which would then need to act based on data they don't copy).
Task: 3323871
42f3d68 to
0739df9
Compare

Task: 3323871
Description:
description of this task, what is implemented and why it is implemented that way.
Task: TASK_ID
review checklist