Bug 156311 - Cycle directly from the last to first sheet in a Calc file
Summary: Cycle directly from the last to first sheet in a Calc file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.7.2 release
Hardware: All All
: medium enhancement
Assignee: Denis Sorotnik
URL:
Whiteboard: target:24.2.0 inReleaseNotes:24.2
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Shortcuts-Accelerators Sheet
  Show dependency treegraph
 
Reported: 2023-07-16 15:13 UTC by Michi
Modified: 2024-04-19 09:26 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michi 2023-07-16 15:13:07 UTC
Description:
At the moment, when wanting to move from the last to the first sheet in calc file using the keyboard requires to move through every intervening sheet using the SHIFT+CRTL+TAB shortcut. While SHIFT+CTRL that would move the next right sheet is non operational when in the last sheet.

I would like to propose that when in the last sheet, pressing SHIFT+TAB moves to the first sheet in the file. And vice versa SHIFT+CTRL+TAB to move to the last sheet if currently in the first.



Steps to Reproduce:
A)
1. When in last sheet
2. Hit SHIFT+TAB
3. Switch to first sheet

B)
1. When in first sheet
2. Press SHIFT+CTRL+TAB
3. Go to last sheet

Actual Results:
A)
1. When in last sheet
2. Hit SHIFT+TAB
3. Nothing happens

B)
1. When in first sheet
2. Press SHIFT+CTRL+TAB
3. Nothing happens

Expected Results:
A)
1. When in last sheet
2. Hit SHIFT+TAB
3. Switch to first sheet

B)
1. When in first sheet
2. Press SHIFT+CTRL+TAB
3. Go to last sheet


Reproducible: Always


User Profile Reset: No

Additional Info:
None
Comment 1 Rafael Lima 2023-07-17 11:14:53 UTC
On my system the shortcut is Ctrl+PgUp/PgDn to jump to next/previous table.

Indeed the current implementation does not allow to cycle through the sheets.

I think this proposal makes sense. Let's hear from the UX team.
Comment 2 ady 2023-07-17 11:42:32 UTC
(In reply to Rafael Lima from comment #1)
> Ctrl+PgUp/PgDn to jump to next/previous table.

Not "table" but "tab". For example, open menu Tools > Customize and use [CTRL]+[PgUp] or [CTRL]+[PgDn] in order to change the Tab.

In Calc, [CTRL]+[TAB] changes the focus to the "next" worksheet and [CTRL]+[SHIFT]+[TAB] changes the focus to the "prior" worksheet. OTOH, [CTRL]+[SHIFT]+[PgUp] or +[PgDn] _select_ multiple adjacent (displayed) worksheets (according to the "direction" of the move).
Comment 3 ady 2023-07-17 14:26:06 UTC
Re-reading my comment 2, I think it needs some clarification.

On MS Windows, [CTRL]+([SHIFT]+)[TAB] is used (on the whole OS) to move the next(previous) tab.

In MS Excel and in Calc, [CTRL]+[PgDn] and [CTRL]+[PgUp] are used to move to the next (displayed) worksheet.

In Calc, there was a "request" to add [CTRL]+([SHIFT]+)[TAB] to move between worksheets (IIUC, this was bug 86404, implemented in LO 6.1/6.2). There were problems with this request:

* conflict on other OSes/DEs.
* misinterpretation of the original request.

Instead of having the same action(s) for different shortcuts, the real improvement should be to make the shortcuts with [TAB] more useful.

For example, having the Tabbed UI, it would be useful to move to the next/previous UI *tab* (not worksheet) with [CTRL]+([SHIFT]+)[TAB] (respectively).

The original request about [CTRL]+[TAB] (bug 86404) was to be able to move between the "last used" worksheet (not to the next/prior worksheet), similar to switching between windows with [ALT]+[TAB] under MS windows in general. There are additional possible shortcuts for slightly different actions, such as holding [CTRL] while pressing [TAB] multiple times.

Currently, a lot of actions related to changing worksheets is messed up (including RTL layout, the on-screen controls...), so also re-evaluating the shortcuts (while maintaining the more traditional shortcuts that are also used by other spreadsheet tools too) would make sense.
Comment 4 ady 2023-07-17 16:06:58 UTC
Yet another inconsistency: [CTRL]+[SHIFT]+[PgDn] and [CTRL]+[SHIFT]+[PgUp] used to be assigned to selection of multiple adjacent worksheets (as MS Excel), but at some recent point it was changed to zooming. :(.
Comment 5 Roman Kuznetsov 2023-07-17 16:42:46 UTC
Useful proposal, +1
Comment 6 Heiko Tietze 2023-07-18 07:43:21 UTC
Let's focus in this ticket on the (reasonable) request to make the Next-command on the last (worksheet) tab continue at the first, ie. cycle through tabs. Going backwards on the first item should consequently go to the last.

uno:JumpToNextTable / SID_NEXT_TABLE and JumpToPrevTable / SID_PREV_TABLE 

Question is whether or not to include the selection, ie. JumpToNextTableSel / SID_NEXT_TABLE_SEL and JumpToPrevTableSel / SID_PREV_TABLE_SEL.

Anyway, all use ScTabView::SelectNextTab() where the patch needs to make some small adjustments.
Comment 7 Denis Sorotnik 2023-08-16 03:02:23 UTC
I sent a patch to gerrit (https://gerrit.libreoffice.org/c/core/+/155449)
Comment 8 Commit Notification 2023-08-16 10:48:16 UTC
Denis Sorotnik committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/552170c9c8ad6d215aa456ba9d622af01c25d275

tdf#156311 Cycling through tabs in Calc

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 BogdanB 2023-08-16 16:19:43 UTC
Wow, nice, working well.
Thanks, Denis.


Verified with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b4cbf44e8d5072e79b62e6b4e3b1c2480e4a34f3
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 10 Stéphane Guillou (stragu) 2024-01-28 02:02:48 UTC
Thanks for this improvement! Added to release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.2&type=revision&diff=732233&oldid=731258