odoo/o-spreadsheet#6125

Created by Ronakkumar Mukeshbhai Bharadiya (rmbh)

Blocked

label
odoo:master-imp-allow-to-de-select-zone-rmbh
head
f2f9ea15c80a23e00ff3eb711d3bb736484f962f
odoo/o-spreadsheet
master #6125 missing r+

[FIX] selection: allow to de-select a zone

Description:

Before this pr:
- Ctrl+Click on a selected cell had no effect.
- Users could add to the selection, but couldn't remove cells or zones.

Issue Example:
1. Select range A1:C3.
2. Ctrl+Click on B2.
3. Expected: Selection splits into A1:C1, A2, C2, A3:C3.
4. Previously, Ctrl+Click did not deselect B2.

After this pr:
- Ctrl+Click on a selected cell now removes it.
- The selection splits into separate zones as needed.

Technical Changes:
- UpdateSelection is now triggered on mouseup, allowing precise detection of Ctrl+Click behavior.
- The selection logic removes the zone from any existing selection zones.
- Splits overlapping zones into non-overlapping parts.

Task: 4647187

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