Skip to content

Master carousel canvas renderer adrm#8976

Open
hokolomopo wants to merge 10 commits into
masterfrom
master-carousel-canvas-renderer-adrm
Open

Master carousel canvas renderer adrm#8976
hokolomopo wants to merge 10 commits into
masterfrom
master-carousel-canvas-renderer-adrm

Conversation

@hokolomopo

Copy link
Copy Markdown
Contributor

Description:

description of this task, what is implemented and why it is implemented that way.

Task: 6320421

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo

robodoo commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Pull request status dashboard

@hokolomopo hokolomopo force-pushed the master-carousel-canvas-renderer-adrm branch 3 times, most recently from 4fa2506 to 638b325 Compare June 22, 2026 12:14

@hokolomopo hokolomopo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of ugly things to improve with FIXME CAROUSELS comments

Comment on lines +512 to +536
buildViewportGetters(
getHeaderDimensions: (sheetId: UID, dimension: "COL" | "ROW", index: number) => HeaderDimensions
): ViewportsGetters {
return {
findLastVisibleColRowIndex: this.getters.findLastVisibleColRowIndex,
isReadonly: this.getters.isReadonly,
getMainCellPosition: this.getters.getMainCellPosition,
getNextVisibleCellPosition: this.getters.getNextVisibleCellPosition,
isColHidden: this.getters.isColHidden,
isRowHidden: this.getters.isRowHidden,
isHeaderHidden: this.getters.isHeaderHidden,
getNumberHeaders: this.getters.getNumberHeaders,
getSheetIds: this.getters.getSheetIds,
tryGetSheet: this.getters.tryGetSheet,
getNumberCols: this.getters.getNumberCols,
getNumberRows: this.getters.getNumberRows,
getFigures: this.getters.getFigures,

getColDimensions: (sheetId, index) => getHeaderDimensions(sheetId, "COL", index),
getRowDimensions: (sheetId, index) => getHeaderDimensions(sheetId, "ROW", index),
getHeaderSize: (sheetId, dim, index) =>
dim === "COL"
? getHeaderDimensions(sheetId, "COL", index).size
: getHeaderDimensions(sheetId, "ROW", index).size,
getColSize: (sheetId, col) => getHeaderDimensions(sheetId, "COL", col).size,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the greatest. The goal is to be able to give a custom size to the headers in the viewport, independently from their size in the model.

The internal viewports had indirect knowledge of frozen panes, as they
used an `offsetCorrectX/Y` to adjust coordinates based on their
boundary zone.

But this meant that we couldn't use a viewport to display an arbitrary
zone. If the viewport started at the column 2, it would offset
all of its coordinates by the width of the first column to leave space
for a frozen pane.

With this commit, the viewports no longer care about that. They are
given a zone to display, and return coordinates relative to that zone.
It's the responsibility of their caller to adjust the coordinates
if the viewport is not rendered in `{0,0}`.

Task: 6320421
This commit extracts the clickable cell overlay logic into a separate
component.

Task: 6320421
There was a default `FOOTER_SIZE` that was applied to all viewports.

- It didn't make sense to have a footer size in the topLeft/topRight
viewports (even if it didn't seem to be actually used in those)
- The footer size only make sense in the context of a grid, not
for print or for an independent viewport.

Task: 6320421
To render the row (or col) headers, we would create a zone that goes
from the first column to the last column of the sheet. Then we would
proceed to ignore the width of this zone, and only use its x/width.

We can use the zone of the first column, instead of bothering with
a zone that includes all the columns.

Task: 6320421
The goal of this commit is to make the rendering process
mode-agnostic by removing the use of any getter.

The rendering methods were taken out of the renderer store to
make sure we will not add any getter in the future.

Task: 6320421
This commit adds a new hook `useChildStoreProvider`. It allows for
a component (and it's children) to use a different store provider,
so it doesn't share some store with its parent.

It will be useful to display a standalone viewport that have a
`HoveredCellStore` that is not a local store, but should not be the
same as in the main grid.

Task: 6320421
@hokolomopo hokolomopo force-pushed the master-carousel-canvas-renderer-adrm branch from 64a6752 to eb74976 Compare June 25, 2026 13:01
@hokolomopo hokolomopo force-pushed the master-carousel-canvas-renderer-adrm branch from eb74976 to 9004acf Compare June 25, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants