Bug 120086 - Wrong TAB-ing order of Gallery sidebar panel
Summary: Wrong TAB-ing order of Gallery sidebar panel
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Aditya Sahu
URL:
Whiteboard: target:6.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks:
 
Reported: 2018-09-23 11:03 UTC by Tamás Zolnai
Modified: 2019-01-09 19:55 UTC (History)
4 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 Tamás Zolnai 2018-09-23 11:03:18 UTC
Description:
On the Gallery sidebar pane there are two icons with which we can switch the view of the selected gallery (Icon View, Detailed View). These buttons seems have a wrong position in the order of the items, while we are moving the focus by TAB key.

Steps to Reproduce:
1. Open Impress
2. Open sidebar -> gallery panel
3. Select Arrow gallery -> to make the panel get the focus
3. Move focus inside the panel with TAB

Actual Results:
Actual order of items: Gallery label -> x button -> Gallery list -> Gallery items list -> view buttons -> New Theme button

Expected Results:
The expected order: Gallery label -> x button -> New Theme button -> Gallery list -> view buttons -> Gallery items list


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 V Stuart Foote 2018-09-24 21:07:57 UTC
Confirmed. On Windows 10 Ent 64-bit en-US (1803) with

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 8b1501d80dc9d3f42c351c6e026fa737e116cae5
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-09-22_23:19:22
Locale: en-US (en_US); Calc: CL

sequencing for keyboard navigation needs to "flow" through the elements on the content panels/decks--it makes for better UX and does help with a11y.
Comment 2 Jim Raykowski 2018-09-27 19:00:57 UTC
Hi All,
Is anyone working on this? Is there anyone that would like to work on it? I can provide code pointers and review.
Comment 3 Jim Raykowski 2018-09-28 06:45:35 UTC
Here are some code pointers.

GalleryControl class:
svx/inc/GalleryControl.hxx
svx/source/gallery2/GalleryControl.cxx

GalleryBrowser1 class:
svx/source/gallery2/galbrws1.hxx
svx/source/gallery2/galbrws1.cxx

GalleryBrowser2 class:
svx/inc/galbrws2.hxx
svx/source/gallery2/galbrws2.cxx

FocusManager class:
include/sfx2/sidebar/FocusManager.hxx
sfx2/source/sidebar/FocusManager.cxx

Add code to svx/source/gallery2/galbrws1.cxx:void GalleryBrowser1::GetFocus() that checks if the New Theme button is enabled svx/source/gallery2/galbrws1.hxx:class GalleryBrowser1 VclPtr<GalleryButton> maNewTheme. The New Theme button is disabled in GalleryBrowser1 constructor if a writable directory is not available. 

If the New Theme button is enabled then grab focus to it to make it the focus from deck title bar to panel content transition. Currently the focus goes to GalleryThemeListBox from deck title bar. 

Focus transition from deck title bar to panel content is done by the FocusManager here: 
sfx2/source/sidebar/FocusManager.cxx
void FocusManager::MoveFocusInsideDeckTitle (
    const FocusLocation& rFocusLocation,
    const sal_Int32 nDirection)

Modify the tab order logic for GalleryControl to match the order specified in Expected Results of the initial bug report.

Tab order logic for GalleryControl is found here:
svx/source/gallery2/GalleryControl.cxx
bool GalleryControl::GalleryKeyInput( const KeyEvent& rKEvt )
Comment 4 Tamás Zolnai 2018-09-28 08:13:38 UTC
Thanks for the code pointers. Let's make this one an easyhack, so beginners also find this issue and can work on it.
Comment 5 Aditya Sahu 2019-01-05 22:07:51 UTC
(In reply to Tamás Zolnai from comment #0)
> Description:
> On the Gallery sidebar pane there are two icons with which we can switch the
> view of the selected gallery (Icon View, Detailed View). These buttons seems
> have a wrong position in the order of the items, while we are moving the
> focus by TAB key.
> 
> Steps to Reproduce:
> 1. Open Impress
> 2. Open sidebar -> gallery panel
> 3. Select Arrow gallery -> to make the panel get the focus
> 3. Move focus inside the panel with TAB
> 
> Actual Results:
> Actual order of items: Gallery label -> x button -> Gallery list -> Gallery
> items list -> view buttons -> New Theme button
> 
> Expected Results:
> The expected order: Gallery label -> x button -> New Theme button -> Gallery
> list -> view buttons -> Gallery items list
> 
> 
> Reproducible: Always
> 
> 
> User Profile Reset: No
> 
> 
> 
> Additional Info:

Cannot TAB into "Gallery label" and "x button" on my machine, it just skips these two. The order is "Gallery list -> Gallery items list -> view buttons -> New Theme button". Can you re-check if the order's the same as you mentioned in the original thread?

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 8626e81d00c253696c6b60b9a2188079120817c7
OS: Windows 10.0; UI render: GL;
Comment 6 Jim Raykowski 2019-01-05 23:15:31 UTC
(In reply to Aditya Sahu from comment #5)
> Cannot TAB into "Gallery label" and "x button" on my machine, it just skips
> these two. The order is "Gallery list -> Gallery items list -> view buttons
> -> New Theme button". Can you re-check if the order's the same as you
> mentioned in the original thread?
> 
> Version: 6.3.0.0.alpha0+ (x64)
> Build ID: 8626e81d00c253696c6b60b9a2188079120817c7
> OS: Windows 10.0; UI render: GL;

Hi Aditya, to get to the "Gallery label" press the escape key when in the Gallery panel content. You will then be able to use tab to get to the "x button"

See https://wiki.documentfoundation.org/Design/SideBar

HTH
Comment 7 Aditya Sahu 2019-01-06 06:40:16 UTC
Thank you for the help Jim. I have fixed the TAB-ing order of the gallery sidebar panel, but there seems to be an issue with the reverse TAB-ing(Shift+TAB) order also. Rather than filing another bug and resolving it, I can provide a fix for the reversing TAB order in the same patch, of course with everyone's accord. I'd like to ask the bug issuer, Tamás Zolnai if the following reverse TAB-ing order is okay (or do you even want me to fix this):

Gallery items list -> view buttons -> Gallery list -> New Theme button -> (Gallery label and x button (works fine))
Comment 8 Aditya Sahu 2019-01-06 16:56:51 UTC
(In reply to Jim Raykowski from comment #3)
> Here are some code pointers.
> 
> GalleryControl class:
> svx/inc/GalleryControl.hxx
> svx/source/gallery2/GalleryControl.cxx
> 
> GalleryBrowser1 class:
> svx/source/gallery2/galbrws1.hxx
> svx/source/gallery2/galbrws1.cxx
> 
> GalleryBrowser2 class:
> svx/inc/galbrws2.hxx
> svx/source/gallery2/galbrws2.cxx
> 
> FocusManager class:
> include/sfx2/sidebar/FocusManager.hxx
> sfx2/source/sidebar/FocusManager.cxx
> 
> Add code to svx/source/gallery2/galbrws1.cxx:void
> GalleryBrowser1::GetFocus() that checks if the New Theme button is enabled
> svx/source/gallery2/galbrws1.hxx:class GalleryBrowser1 VclPtr<GalleryButton>
> maNewTheme. The New Theme button is disabled in GalleryBrowser1 constructor
> if a writable directory is not available. 
> 
> If the New Theme button is enabled then grab focus to it to make it the
> focus from deck title bar to panel content transition. Currently the focus
> goes to GalleryThemeListBox from deck title bar. 
> 
> Focus transition from deck title bar to panel content is done by the
> FocusManager here: 
> sfx2/source/sidebar/FocusManager.cxx
> void FocusManager::MoveFocusInsideDeckTitle (
>     const FocusLocation& rFocusLocation,
>     const sal_Int32 nDirection)
> 
> Modify the tab order logic for GalleryControl to match the order specified
> in Expected Results of the initial bug report.
> 
> Tab order logic for GalleryControl is found here:
> svx/source/gallery2/GalleryControl.cxx
> bool GalleryControl::GalleryKeyInput( const KeyEvent& rKEvt )

I have added the code in "svx/source/gallery2/galbrws1.cxx:void GalleryBrowser1::GetFocus()" to check if the New Theme Button is enabled or not. If it is enabled then the focus is grabbed to it. Otherwise, do I change the focus to GalleryThemeList? or take no action otherwise?
Comment 9 Jim Raykowski 2019-01-06 17:13:25 UTC
Aditya, Nice to see you are working on this bug. If you submit what you have to gerrit I will gladly review.
Comment 10 Aditya Sahu 2019-01-06 20:11:30 UTC
(In reply to Jim Raykowski from comment #9)
> Aditya, Nice to see you are working on this bug. If you submit what you have
> to gerrit I will gladly review.

Please find the patch below for review. 
https://gerrit.libreoffice.org/#/c/65907/
Comment 11 Aditya Sahu 2019-01-07 18:02:26 UTC
(In reply to Jim Raykowski from comment #9)
> Aditya, Nice to see you are working on this bug. If you submit what you have
> to gerrit I will gladly review.

Thank you for reviewing Patch set - 2. I have uploaded Patch Set 3 to fix the comments and issues mentioned by considering the review. Please review the change.
Comment 12 Commit Notification 2019-01-09 07:07:27 UTC
Aditya committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/c9a7c4358d902900eb0fe66db36e283dc8df0336%5E%21

tdf#120086: Patch for TAB-ing order of Gallery sidebar panel

It will be available in 6.3.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.