Skip to content

Conversation

@fdamhaut
Copy link
Contributor

Task: 4606648

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
Copy link
Collaborator

robodoo commented Sep 30, 2025

Pull request status dashboard

@fdamhaut fdamhaut force-pushed the master-zoom-flda branch 2 times, most recently from 0dc11ae to a8282d4 Compare October 3, 2025 11:29
@fdamhaut fdamhaut force-pushed the master-zoom-flda branch 5 times, most recently from b173063 to 202f299 Compare October 13, 2025 11:51
Copy link
Collaborator

@pro-odoo pro-odoo left a comment

Choose a reason for hiding this comment

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

Nice !

A lot better with the canvas directly zoomed :)

@fdamhaut fdamhaut force-pushed the master-zoom-flda branch 4 times, most recently from 810a2e6 to 2312dae Compare October 17, 2025 10:01
Comment on lines +79 to +81
options: { zoom?: number } = { zoom: 1 }
) {
// const zoom = options.zoom || 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👀
and it doesn't seem to be used

"getPositionAnchorOffset",
"getGridOffset",
"getViewportZoomLevel",
"getVisibleRectWithZoom",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: move this right next to "getVisibleRect",

Comment on lines +549 to +550
rect.x = rect.x * zoom + this.gridOffsetX + HEADER_WIDTH * (zoom - 1);
rect.y = rect.y * zoom + this.gridOffsetY + HEADER_HEIGHT * (zoom - 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we'll probably want to support zoom level for dashboards as well, especially in mobile

icon: "o-spreadsheet-Icon.IRREGULARITY_MAP",
};

export const zoomAction: (zoom: number) => ActionSpec = (zoom) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
export const zoomAction: (zoom: number) => ActionSpec = (zoom) => {
export function zoomAction(zoom: number): ActionSpec {

Comment on lines +19 to +20
top: Pixel;
left: Pixel;
Copy link
Collaborator

Choose a reason for hiding this comment

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

if these are pixels, we usually name them x, y and we actually have a type for that: DOMCoordinates

It could be changed in a follow up commit

this.env.model.dispatch("SET_ZOOM", { zoom: fontSize / 100 });
}

onToggle() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
onToggle() {
toggle() {

Comment on lines +54 to +55
get isActive() {
return this.topBarToolStore.isActive;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't really need this. Just use this.topBarToolStore.isActive the only place it's used

class: string;
}

export class ToolBarZoom extends Component<Props, SpreadsheetChildEnv> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's probably room for factorization with TopBarFontSizeEditor if you want to give it a try

Comment on lines +11 to +12
min="min"
max="max"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
min="min"
max="max"
t-att-min="min"
t-att-max="max"

Comment on lines +764 to +765
const zv = ZOOM_VALUES;
describe.each(zv)("Edge-Scrolling on mouseMove of hightlights with zoom %s%", (zoomValue) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const zv = ZOOM_VALUES;
describe.each(zv)("Edge-Scrolling on mouseMove of hightlights with zoom %s%", (zoomValue) => {
describe.each(ZOOM_VALUES)("Edge-Scrolling on mouseMove of hightlights with zoom %s%", (zoomValue) => {

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.

4 participants