Skip to content

[REF] replace the sheetView plugin by a store#8939

Open
hokolomopo wants to merge 4 commits into
masterfrom
master-viewport-store-adrm
Open

[REF] replace the sheetView plugin by a store#8939
hokolomopo wants to merge 4 commits into
masterfrom
master-viewport-store-adrm

Conversation

@hokolomopo

Copy link
Copy Markdown
Contributor

Description:

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

Task: TASK_ID

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 18, 2026

Copy link
Copy Markdown
Collaborator

Pull request status dashboard

@hokolomopo hokolomopo force-pushed the master-viewport-store-adrm branch 5 times, most recently from 13b6359 to 7f7d820 Compare June 24, 2026 07:19
@hokolomopo hokolomopo force-pushed the master-viewport-store-adrm branch from 87a9eb8 to 059e6b0 Compare June 24, 2026 11:37
The model was already almost independent from the sheetView, this
commit changes the last remaining parts.

- `getMaxFigureSize`: during the copy/paste, we bounded the image size
with the size of the viewport. This feels quite arbitrary, using a
constant value seems as arbitrary and less hassle.
- `POPOUT_CHART_FROM_CAROUSEL`: we can compute the new chart position
before sending the command rather than in the command handling

Task: 6314784
Helper `getChartPositionAtCenterOfViewport` is not used anywhere.

Task: 6314784
@hokolomopo hokolomopo force-pushed the master-viewport-store-adrm branch from 059e6b0 to a9f0988 Compare June 24, 2026 11:38
const { x, y } = this.env.model.getters.getVisibleRect({
const { height } = this.viewStore.sheetViewDimensionWithHeaders;
const sheetId = this.env.model.getters.getActiveSheetId();
const visible = this.viewStore.viewports.isVisibleInViewport({ sheetId, col, row });

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.

Kinda sucks to have to do viewStore.viewports ... But we cannot have getters that take arguments in a store.

The main issue is that we can call viewStore.viewports.setViewportOffset(x,y) rather than viewStore.setViewportOffset(x,y) which will skip the render(true) of the stores... Maybe we should create a type manually removing the problematic methods ? Won't work in odoo tho.

@hokolomopo hokolomopo force-pushed the master-viewport-store-adrm branch 2 times, most recently from 41d8e89 to 4f77309 Compare June 24, 2026 12:38
This commit move all the viewport logic out of the model and into
a new store. This will de-correlate the viewport logic from the model,
and allow to display multiple independent viewports.

Task: 6314784
@hokolomopo hokolomopo force-pushed the master-viewport-store-adrm branch from 4f77309 to 1ee7dc6 Compare June 24, 2026 13:15
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