slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.09k stars 575 forks source link

Added TodoMVC example (Rust mock version) #5396

Closed FloVanGH closed 3 months ago

FloVanGH commented 3 months ago

Screenshot from 2024-06-12 14-58-42

FloVanGH commented 3 months ago

Should probably be renamed todo-mvc Or Just todo and replace the previous example. Although the previous example has the advantage of being simpler.

@ogoffart I want to replace the old todo example after the new one has the same feature set as the old one like android support and other languages. After that it will be just todo, if that is ok.

DataTriny commented 3 months ago

In case anyone is interested, accessibility of this app is broken on so many levels:

AccessKit doesn't yet expose listview-type widgets to assistive technologies (I'm currently working on it) but the core data type are there already for you to use.

FloVanGH commented 3 months ago

In case anyone is interested, accessibility of this app is broken on so many levels:

* The main list view is exposed as a `Role::List` instead of `Role::ListBox` and doesn't have an accessible name. It should be possible to navigate through items using up/down arrows, which should place the focus on the item's container element.

* The containing element of each task should have `Role::ListBoxOption` and have `is_selected` set to `false`. When one element gets selected `is_selected` should be set to `true`.

* Most buttons seems to not be labelled (except the "Done" one for some reason). In fact the button to add a new task seem to not even be marked as a proper button.

* When adding a new task, the list view is still present in the accessibility tree.

* The text entry called "Task name" should have its accessible name set to that. "Describe your task" is a placeholder and should be exposed by setting the dedicated `placeholder` property (exposed to ATs in a more recent version than the one Slint is currently using).

* The widgets to pick the date and time are broken as well but they would require significantly more work...

AccessKit doesn't yet expose listview-type widgets to assistive technologies (I'm currently working on it) but the core data type are there already for you to use.

Hi, thank you for your feedback. I'm aware of that. Goal with this example is mainly to show how you can use the model view controller pattern with Slint and Rust. But I think it does not hurt to tweak the example to have better accessibility support in this example. So because there are custom widgets that could be also an example for people sneaking in the code.

FloVanGH commented 3 months ago

In case anyone is interested, accessibility of this app is broken on so many levels:

* The main list view is exposed as a `Role::List` instead of `Role::ListBox` and doesn't have an accessible name. It should be possible to navigate through items using up/down arrows, which should place the focus on the item's container element.

* The containing element of each task should have `Role::ListBoxOption` and have `is_selected` set to `false`. When one element gets selected `is_selected` should be set to `true`.

* Most buttons seems to not be labelled (except the "Done" one for some reason). In fact the button to add a new task seem to not even be marked as a proper button.

* When adding a new task, the list view is still present in the accessibility tree.

* The text entry called "Task name" should have its accessible name set to that. "Describe your task" is a placeholder and should be exposed by setting the dedicated `placeholder` property (exposed to ATs in a more recent version than the one Slint is currently using).

* The widgets to pick the date and time are broken as well but they would require significantly more work...

AccessKit doesn't yet expose listview-type widgets to assistive technologies (I'm currently working on it) but the core data type are there already for you to use.

@DataTriny I will doe the accessibility improvements in a following PR, I have added to issue of this task ask todo #5363