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] Dashboard: Cache clickable cells #4090
Conversation
b9cda0c
to
489742f
Compare
489742f
to
5a99f26
Compare
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.
Faster dashboards 👀
The Odoo's PR is missing tho
if ( | ||
invalidateEvaluationCommands.has(cmd.type) || | ||
cmd.type === "EVALUATE_CELLS" || | ||
(cmd.type === "UPDATE_CELL" && cmd.content) |
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.
also need to check cmd.format theoritically (=CELL
formula)
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 explain why? Not sure how a change in the format could have an impact on the clickable cell features.
Now, assuming you are right, I guess we should factorize this kind of condition because I think it's not clear :D
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.
|
||
private findClickableAction(position: CellPosition) { | ||
const getters = this.getters; | ||
for (const item of clickableCellRegistry.getAll().sort((a, b) => a.sequence - b.sequence)) { |
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.
Probably a non-factor because the registry isn't big, be we create a new array + sort it at each call of this method
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 could be better 👍
if (getters.isInMerge(position)) { | ||
zone = getters.getMerge(position)!; | ||
} else { | ||
zone = positionToZone({ col, row }); |
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.
zone = positionToZone({ col, row }); | |
zone = positionToZone(position); |
nitpick
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.
also nitpick: this could be a ternary
const rect = getters.getVisibleRect(zone); | ||
cells.push({ | ||
coordinates: rect, | ||
position: position, |
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.
still nitpicking
position: position, | |
position, |
let zone: Zone; | ||
if (getters.isInMerge(position)) { | ||
zone = getters.getMerge(position)!; |
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 the case of emrges, we will re-compute this.getClickableAction
for each cell of the merge, and have a ClickableCell with the same zone for each cell right ? That doesn't seems right ... (we love merges)
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.
agreed that it's a waste of resource but not fundamentally wrong ^^
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 could be fixed in prior versions as well actually
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
The computation of the clickable cells visibility condition can sometimes be costy (per cell). At the moment, we recompute those conditions at each rendering request, which can become quickly costy if we simply scroll the viewport. This revision introduces a caching of this computations to smooth out the user experience when scrolling a dashboard. Task: 3869752
5a99f26
to
8f5be05
Compare
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.
robodoo r+
The computation of the clickable cells visibility condition can sometimes be costy (per cell). At the moment, we recompute those conditions at each rendering request, which can become quickly costy if we simply scroll the viewport. This revision introduces a caching of this computations to smooth out the user experience when scrolling a dashboard. closes #4090 Task: 3869752 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752
Following odoo/o-spreadsheet#4090, Some helpers are adapted to suit their use with the clickable cell refactoring. task-3869752 Part-of: #163358
Description:
The computation of the clickable cells visibility condition can
sometimes be costy (per cell). At the moment, we recompute those
conditions at each rendering request, which can become quickly costy
if we simply scroll the viewport.
This revision introduces a caching of this computations to smooth out
the user experience when scrolling a dashboard.
Task: 3869752
Task: : 3869752
review checklist