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

Added TodoMVC example (Rust mock version) #5396

Merged
merged 17 commits into from
Jun 13, 2024
Merged

Added TodoMVC example (Rust mock version) #5396

merged 17 commits into from
Jun 13, 2024

Conversation

FloVanGH
Copy link
Member

@FloVanGH FloVanGH commented Jun 12, 2024

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

Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

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

examples/todo_mvc/ui/widgets/selection_list_view.slint Outdated Show resolved Hide resolved
}

content-layer := HorizontalBox {
check-box := CheckBox {
Copy link
Member

Choose a reason for hiding this comment

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

I think the CheckBox might have a default horizontal-stretch that wants to expand in Qt because of the Text (Arguably this might be a bug in Qt) So maybe fixing the horizontal-stretch would help.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes could be. I will try it, thx.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you try it again for the qt style?

examples/todo_mvc/rust/src/adapters/task_list_adapter.rs Outdated Show resolved Hide resolved
@FloVanGH
Copy link
Member Author

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.

examples/todo_mvc/ui/views/task_list_view.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/action_button.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/icon_button.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/text_button.slint Outdated Show resolved Hide resolved
FloVanGH and others added 2 commits June 12, 2024 15:16
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
examples/todo_mvc/ui/views/task_list_view.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/action_button.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/icon_button.slint Outdated Show resolved Hide resolved
examples/todo_mvc/ui/widgets/text_button.slint Outdated Show resolved Hide resolved
examples/todo_mvc/rust/src/models/task_model.rs Outdated Show resolved Hide resolved
.reuse/dep5 Outdated Show resolved Hide resolved
examples/todo_mvc/rust/src/adapters/create_task_adapter.rs Outdated Show resolved Hide resolved
examples/todo_mvc/rust/src/adapters/create_task_adapter.rs Outdated Show resolved Hide resolved
examples/todo_mvc/rust/src/adapters/task_list_adapter.rs Outdated Show resolved Hide resolved
examples/todo_mvc/rust/src/lib.rs Outdated Show resolved Hide resolved
@DataTriny
Copy link
Contributor

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.

@FloVanGH
Copy link
Member Author

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.

.reuse/dep5 Outdated Show resolved Hide resolved
.reuse/dep5 Outdated Show resolved Hide resolved
FloVanGH and others added 4 commits June 13, 2024 09:10
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
@FloVanGH FloVanGH mentioned this pull request Jun 13, 2024
7 tasks
@FloVanGH
Copy link
Member Author

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

FloVanGH and others added 3 commits June 13, 2024 11:44
…r.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@FloVanGH FloVanGH merged commit 0870585 into master Jun 13, 2024
36 checks passed
@FloVanGH FloVanGH deleted the florian/todo-mvc branch June 13, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants