Bug 141136 - Tabbed toolbar mode keeps switching you away from the current tab to the "Home" tab each time you enter (focus) or leave a comment
Summary: Tabbed toolbar mode keeps switching you away from the current tab to the "Hom...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: Notebookbar-Tabbed
  Show dependency treegraph
 
Reported: 2021-03-20 23:32 UTC by Jeff Fortin Tam
Modified: 2023-06-23 20:24 UTC (History)
1 user (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 Jeff Fortin Tam 2021-03-20 23:32:27 UTC
The "Review" tab has many functions that are relevant to comments, and changes tracking. Namely:
- Comment
- Reply Comment
- Delete Comment
- Format All Comments (only available in the "Tabbed Compact" mode, but I would want to see it available in the regular Tabbed mode too...)



If I am inside that tab (in Tabbed or Tabbed Compact toolbar), LibreOffice should not switch me away from that tab automatically, yet this is what happens currently:

- If I am in the page's contents, reviewing various tracked changes, and then I click inside a comment to edit the comment, it switches me away from the Review tab to the Home tab.

- If I am inside a comment, and I would like to use the various comment-related functions, I switch to the Review tab... but as soon as I click away from the comment, it switches me back to the Home tab! That's a huge waste of time if you want to do that for multiple comments.
Comment 1 Jeff Fortin Tam 2021-03-20 23:36:05 UTC
In fact this change, when entering/exiting a comment, switches you away from _any_ tab to the Home tab. So if you were in the "References" or "Insert" tabs, it'll switch you away from those too.

At the end of the day, I'm not sure any auto-switching is a good idea unless you're selecting image/chart/form objects vs text.
Comment 2 Jeff Fortin Tam 2021-03-21 18:18:25 UTC
Note that this happens not only in Writer, but in Calc too.
Comment 3 Timur 2021-03-22 15:17:52 UTC
I'll confirm behavior. 
As for solution, Is rather see an option for auto-switching. 
If not feasible, better not to have it, rather leave what user selected.
Comment 4 Jeff Fortin Tam 2021-03-22 15:47:38 UTC
In this particular case, clicking inside or outside a comment, you're going from the same "type" of content (text to text) so there should be no context switch triggered when the fundamental type is the same (unless comment management actions are added to the "Home" tab, but then it would get a bit crowded).

Generally speaking (outside of this scenario), I would say that "an option for auto-switching" is not the approach I would recommend. Don't add options for things that should "just work". In theory either the app should not make a mistaken assumption, or it shouldn't do any switching at all, but I still think the auto-switching makes sense for some clear-cut cases (like when you select an image, chart, multimedia/audio/video, or form element, or index/references table).
Comment 5 Timur 2021-03-22 16:32:08 UTC
Ok, you are right. No idea who could be invited or interested to look into this.
Comment 6 QA Administrators 2023-03-23 03:24:01 UTC Comment hidden (obsolete)
Comment 7 Jeff Fortin Tam 2023-04-04 19:50:37 UTC
To answer the bot: problem is still present in

Version: 7.5.2.2 (X86_64)
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: fr-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 8 Justin L 2023-06-16 19:46:08 UTC
repro 24.2+
The same thing is true for switching between textbox content and the main body. The issue is that these are "editeng" components which have a different menu structure. At best we could see if both menus have the same "tab" and restore the tab after the menu switch.
Comment 9 Justin L 2023-06-22 19:06:51 UTC
NotebookbarTabControlBase::SetContext knows eLastContext, and is passed vcl::EnumContext::Context::Default when it is deactivated (but LOKit doesn't deactive).

Then it activates with a real context, which always seems to match HOME if it doesn't have a specific tab (so even skipping deactivation won't help).

If the current tab is vcl::EnumContext::Context::Any, then we don't want to switch to another ANY control. ANY pages are always visible.
Comment 10 Commit Notification 2023-06-23 00:55:02 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7626e37b7c77980ba41bdc7e9131b9c373dea038

tdf#141136 NBB SetContext: don't SetCurPageId twice for the same page

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 11 Commit Notification 2023-06-23 18:44:45 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9f5393abea012be04ab7ecb26d8031019bc50f62

tdf#141136 NBB SetContext: try to stay on the same tab

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 12 Commit Notification 2023-06-23 18:45:50 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/805abacd0d1fe2d5522a2041fc3c07961a62ba5f

related tdf#68695 tdf#141136 sc: comment can't resize; avoid context change

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 13 Justin L 2023-06-23 20:24:40 UTC
I'm going to mark this bug report as fixed. The general fix handles the reported issue in Writer, and a specific fix mitigates jump when entering a comment in calc (and exiting the comment also is not causing a jump).

I'm sure there are many more instances where tab jumping occurs. Those should be reported separately, as likely each one will need a unique patch.
Please do not report an "unwanted jump" when it jumps to a "newly visible tab", as that is a context jump and is generally intended and desirable. Only report "jumps to the home tab" from a regular tab that is always visible.