Skip to content
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

Calc: Don't switch tabs when context menu is triggered #7377

Conversation

bayramcicek
Copy link
Member

@bayramcicek bayramcicek commented Oct 6, 2023

  • Trying to open context menu from a sheet tab, also changes the active tab. This occurs when right click on a sheet tab (or long tap on mobile or tablet)

  • moveLeft and moveRight of inactive tabs are implemented.

  • added _moveSheetLR and _moveOrCopySheet functions.

Change-Id: I5b25a8cb363b8e04fd6dcec1f500e7ff2982b678

Summary

TODO

Checklist

  • Code is properly formatted
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

Copy link
Contributor

@eszkadev eszkadev left a comment

Choose a reason for hiding this comment

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

it was introduced previously because if we right-clicked on non-selected sheet to open context menu - actions were applied to the selected sheet. It still happens for some actions:
"move sheet left", "move sheet right", "move or copy sheet"

steps to reproduce:

  • have 3 sheets, 1st is scurrently selected
  • right click on 3rd sheet and do "move sheet left"
    result: sheet 1 is moved
    expected: sheet 3 is moved

@bayramcicek
Copy link
Member Author

it was introduced previously because if we right-clicked on non-selected sheet to open context menu - actions were applied to the selected sheet. It still happens for some actions: "move sheet left", "move sheet right", "move or copy sheet"

steps to reproduce:

  • have 3 sheets, 1st is scurrently selected
  • right click on 3rd sheet and do "move sheet left"
    result: sheet 1 is moved
    expected: sheet 3 is moved

@eszkadev : I see that https://github.com/CollaboraOnline/online/pull/7377/files#diff-a3b5fb6d0c66140a66a5e27fed984875e9c8f1194a8dfb152a5716b17fc2ea6dL282 _moveSheet only moves the selected sheet to new index with sendUnoCommand('.uno:Move?Copy:bool=false&UseCurrentDocument:bool=true&Index=' + newIndex);

There should be a way to move inactive sheets. I'm not sure but it seems there should be some hack on the core side to make this happen, I wonder what do you think about that?

Thanks for the review.

@bayramcicek
Copy link
Member Author

bayramcicek commented Oct 17, 2023

upstream: 158078: (WIP) sc: make inactive sheets movable/copyable | https://gerrit.libreoffice.org/c/core/+/158078

@bayramcicek bayramcicek force-pushed the private/bayram/bug-7354-calc-context-menu branch from 350a687 to cc2e3fb Compare October 18, 2023 11:45
@bayramcicek bayramcicek force-pushed the private/bayram/bug-7354-calc-context-menu branch from cc2e3fb to 71f91ed Compare October 27, 2023 07:35
@bayramcicek bayramcicek requested a review from eszkadev October 29, 2023 13:47
@eszkadev
Copy link
Contributor

eszkadev commented Nov 2, 2023

please rebase so Unit & Cypers will pass

@bayramcicek bayramcicek force-pushed the private/bayram/bug-7354-calc-context-menu branch from 71f91ed to 03454c0 Compare November 2, 2023 17:14
@bayramcicek
Copy link
Member Author

fail:

  • calc/sheet_operation_spec.js
    • Sheet Operations. Move sheet left/right)
  • most of the writer tests failed
  • Since we changed the behavior of the sheet tabs and upstream patch is not merged, I think, the fail in the Calc is expected(?).
  • and test for the Sheet Operations (sheet_operation_spec.js) should be rewritten/updated since it assumes that right click on a sheet tab will change tab page.

@eszkadev : what should be the next step. ?

I think:

should I update the sheet_operation_spec.js test?

@eszkadev
Copy link
Contributor

eszkadev commented Nov 3, 2023

should I update the sheet_operation_spec.js test?

If we will merge core part first, then this PR will pass right?
So we will wait for core.

@bayramcicek
Copy link
Member Author

bayramcicek commented Nov 3, 2023

FYI: I encountered an issue with selecting sheet tabs while testing the patch (it selects the previous/next tab, then selects the correct tab). I'm working on that too. (this is no needed)

@bayramcicek bayramcicek force-pushed the private/bayram/bug-7354-calc-context-menu branch from 03454c0 to ab03f1b Compare November 8, 2023 22:11
- Trying to open context menu from a sheet tab also
changes the active tab. This occurs when right click
on a sheet tab (or long tap on mobile or tablet)

- moveLeft and moveRight of inactive tabs are
implemented.

- added _moveSheetLR and _moveOrCopySheet functions.

Signed-off-by: Bayram Çiçek <[email protected]>
Change-Id: I5b25a8cb363b8e04fd6dcec1f500e7ff2982b678
@bayramcicek bayramcicek force-pushed the private/bayram/bug-7354-calc-context-menu branch from ab03f1b to 872e17b Compare January 18, 2024 09:20
@bayramcicek
Copy link
Member Author

bayramcicek commented Jan 18, 2024

upstream: 158078: sc: make inactive sheets movable and copyable | https://gerrit.libreoffice.org/c/core/+/158078
CI is green. Ready for review.

Copy link
Contributor

@pedropintosilva pedropintosilva left a comment

Choose a reason for hiding this comment

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

/me Pulls gerrit change ... sorry


Thanks @bayramcicek I have tested all the actions in the context menu. There don't work as expected:

  • Move sheet left
  • Move sheet right
  • Move or copy sheet...
  1. If you have: [sheet1] [sheet2] [sheet3] [sheet4] [sheet5] current sheet in bold
  2. Right Click in the [sheet4]
  3. Choose any of the actions listed above
  4. Notice: the actions affect the current sheet instead of the one that was clicked on

@pedropintosilva pedropintosilva self-requested a review January 19, 2024 13:51
Copy link
Contributor

@pedropintosilva pedropintosilva left a comment

Choose a reason for hiding this comment

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

requires: https://gerrit.libreoffice.org/c/core/+/158078

Works awesomely, thanks @bayramcicek !

@pedropintosilva
Copy link
Contributor

Would like to have +2 from @gokaysatir

Copy link
Contributor

@gokaysatir gokaysatir left a comment

Choose a reason for hiding this comment

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

Thanks @bayramcicek :)

@gokaysatir
Copy link
Contributor

I tested and found no issues. I think we can merge this.

@pedropintosilva pedropintosilva removed the request for review from eszkadev January 22, 2024 11:48
@pedropintosilva pedropintosilva merged commit 0ad2c24 into CollaboraOnline:master Jan 22, 2024
11 checks passed
@bayramcicek bayramcicek deleted the private/bayram/bug-7354-calc-context-menu branch January 22, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Calc: sheet tab: triggering context menu switches tabs
4 participants