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
[IMP] highlight: add drag & drop to array formula highlight #4083
base: master
Are you sure you want to change the base?
Conversation
31b24ba
to
352822f
Compare
We sometime need to create a UI plugin specifically to handle a command so that its sub-commands are batched in a single history step. This is kind of a problem when working with stores, because then we need both a store to handle all the business logic, and a plugin that handle a command created specifically to batch sub-commands (looking at you find & replace). We can fix that easily by creating a local command `BATCH_COMMANDS` that take a callback as argument, and that batches every command and sub-command executed in the callback within one history step. Task: 3870119
Now that we can batch commands, the plugin find & replace is now useless. Task: 3870119
The component that handle highlight's UI interactions is named `Highlight`, which is the same as the type `Highlight`. This is annoying because we always end up importing the wrong `Highlight`, and need named imports if we want to use both the type and the component in a file. This commit renames the component to `HighlightOverlay` Task: 3869873
The hitbox for the borders of the highlight was not very well placed. There was some margins computations, I'm assuming they were there to avoid overlapping with the highlight corners but they were both wrong (there was overlap) and useless (the corner is above the border). The highlight border was also not centered on the cell border, and was quite small, making it hard to click. This commit removed the "margins", and widened and centered the borders. Task: 3869873
With this commit, it is now possible to drag & drop an array formula by clicking on its highlight. Task 3869873
352822f
to
e050917
Compare
@@ -353,7 +353,7 @@ function constructZonesFromProfiles( | |||
pendingZones = nextPendingZones; | |||
} | |||
mergedZone.push(...pendingZones); | |||
return mergedZone; | |||
return mergedZone as T[]; |
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.
Not really happy about that but it's mighty annoying to type...
The rationale is that, as far as I know, calling recomputeZones on only Zones (and no unbounded zones) will always return Zones. So it'd be nice if it was typed as such.
The fact that it's typed as returning UnboundedZones make it very annoying to use for simple cases where we only handle zones. Do you have any good ideas @laa-odoo ?
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.
Indeed, this is never supposed to happen: recompute non-UnboundedZones will always give non-UnBoundedZones
But it will also be complicated to type the mechanics of recomputeZone.... The best would be to force the typing within recomputeZone itself so that it doesn't bother anyone. (
imo I am for)
[IMP] highlight: add drag & drop to array formula highlight
With this commit, it is now possible to drag & drop an array formula
by clicking on its highlight.
[IMP] highlight: improve border hitbox
The hitbox for the borders of the highlight was not very well placed.
There was some margins computations, I'm assuming they were there
to avoid overlapping with the highlight corners but they we both
wrong (there was overlap) and useless (the corner is above the border).
The highlight border was also not centered on the cell border, and
was quite small, making it hard to click.
This commit removed the "margins", and widened and centered the borders.
[REF] highlight: rename Highlight component:
The component that handle highlight's UI interactions is named
Highlight
, which is the same as the typeHighlight
. This is annoyingbecause we always end up importing the wrong
Highlight
, and neednamed imports if we want to use both the type and the component in a
file.
This commit renames the component to
HighlightOverlay
Task: : 3869873
review checklist