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

browser: accessibility: add label to combobox #9905

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hcvcastro
Copy link
Member

Change-Id: Ib462aa34f450a84ad27c1a37ed554dff772c1c27
Signed-off-by: Henry Castro [email protected]

@caolanm caolanm requested a review from eszkadev August 27, 2024 14:34
Labels : {
'.uno:CharFontName' : _('Font:'),
'.uno:FontHeight' : _('Size:'),
'.uno:StyleApply' : _('Style:')
Copy link
Contributor

Choose a reason for hiding this comment

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

we usually try to avoid :

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks

@@ -3,13 +3,18 @@
* L.Map.StateChanges stores the state changes commands coming from core
* LOK_CALLBACK_STATE_CHANGED callback
*/
/* global $ app */
/* global $ app _ */
/*eslint no-extend-native:0*/
L.Map.mergeOptions({
stateChangeHandler: true
});

L.Map.StateChangeHandler = L.Handler.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

StateChangeHandler seems to be not a perfect place for such things.
Let's keep it doing only one thing - storing status values for a command.
We use _UNO('command') for getting the translated "label" for uno command, which seems to already exist and do that correctly :) can we reuse it or there is some problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me check, I did read it. It translate with hotkeys underscore I think.

@@ -183,6 +183,12 @@ JSDialog.combobox = function (parentContainer, data, builder) {
var container = L.DomUtil.create('div', 'ui-combobox ' + builder.options.cssClass, parentContainer);
container.id = data.id;

var labelText = L.Map.StateChangeHandler.prototype.Labels[data.command];
Copy link
Contributor

@eszkadev eszkadev Aug 28, 2024

Choose a reason for hiding this comment

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

in general - JSDialog widgets should be built only based on data available inside JSON.
For correct behavior on updates, etc. We need "widget building function" to be stateless (not depending on external state).

Copy link
Member Author

Choose a reason for hiding this comment

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

Occurs that the stateless does not have label info data, so If you read the task description,
I am doing a short path (hack) to resolve the problem.

var labelText = L.Map.StateChangeHandler.prototype.Labels[data.command];
if (labelText) {
var label = L.DomUtil.create('label', '', container);
label.textContent = labelText;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we want that? combobox is the combobox field (input + dropdown).
If we want some label, we should put separate label widget next to it (in the .ui file in core, in the JSON).

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it, but for some reason, the parent container is removed and it messes up the combo box.
Somewhere it is not using well the combox which it is out of the scope of the task.

On the other hand, the label requires the LO Core .ui file changes that I am trying to avoid to do it.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's acctually what we should do (addin in .ui file).
Container can be replaced when we do some updates to the widget.
see update or action commands handling executeAction or updateWidget in JSDialogBuilder.
they work correctly as I know, but if you changed the structure here... action might not be able to change eg. text

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, Please clarify in the task description that the changes also require changes in LibreOffice desktop accessibility.

@hcvcastro hcvcastro force-pushed the pr/master/7A branch 5 times, most recently from b286fc6 to 03bae19 Compare August 29, 2024 18:50
@timar timar force-pushed the master branch 2 times, most recently from ebbad3c to 61cf2b4 Compare August 29, 2024 20:13
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.

marking as reviewed, we need input from @pedropintosilva

@hcvcastro hcvcastro force-pushed the pr/master/7A branch 3 times, most recently from e428973 to af6b5a2 Compare September 3, 2024 10:53
.
Change-Id: Ib462aa34f450a84ad27c1a37ed554dff772c1c27
Signed-off-by: Henry Castro <[email protected]>
@eszkadev eszkadev added design info needed Needs further details draft labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants