Skip to content

a11y: implement new SemanticsAction "showOnScreen" #11135

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

Closed
wants to merge 2 commits into from

Conversation

goderbauer
Copy link
Member

This action is triggered when the user swipes (in accessibility mode) to the last visible item of a scrollable list to bring that item fully on screen.

This requires engine rolled to flutter/engine#3856.

I am in the process of adding tests, but I'd like to get early feedback to see if this approach is OK.

@@ -11,6 +11,8 @@ import 'package:flutter/painting.dart';
import 'package:vector_math/vector_math_64.dart';

import 'node.dart';
import 'object.dart';
import 'viewport.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

we can't import viewport.dart here. That's a layering violation.

The rendering library has several layers. At the bottom is object.dart, layer.dart, node.dart, semantics.dart -- features that are coordinate system agnostic.

Below that we have RenderSliver, RenderBox, and the like, which know about coordinate systems but are agnostic to specific layout algorithms.

Below that we have things like flex.dart, proxy_box.dart, the various slivers, etc. They introduce specific opinions about layout and paint and so on.

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 document this extended layer cake somewhere so people can refer to it? According to the layer cake in https://flutter.io/technical-overview/ this is all in the same layer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, feel free to copy-paste the above into a README or object.dart or whatever. Not sure where it should go.

Sorry it wasn't written down before, it kind of grew organically in Adam and I's head.

FWIW, the other libraries have similar inner layers, e.g. widget has framework.dart at the base, with basic.dart on top, and everything else on top of that. In theory, anyway; that one has some cross-talk currently via debug.dart.

Fundamentally though this is just a manifestation of the more concrete best practice of avoiding reference cycles. It's a general truism that a good architecture has a dependency graph that's a DAG, with the units being as small as possible (ideally much smaller than 1000 lines of Dart, based on our experience so far). Cycles usually indicate a bug factory. Files larger than 1000 lines usually indicate a bug factory. (And yes, we have plenty of bug factories, unfortunately. We should try to minimise them.) This is one reason we stopped using part, it encourages designs that turn into bug factories.

I've considered trying to enforce our dependency graph being a DAG. We do enforce it at the library level now (e.g. widgets can't depend on material). I suspect that enforcing it at the library level today would involve a few weeks of disentangling. cc @a14n in case you're interested in creating a lint for this. :-)

@goderbauer
Copy link
Member Author

@Hixie I am closing this PR. Please take a look at my second attempt: #11156

@goderbauer goderbauer closed this Jul 11, 2017
@goderbauer goderbauer deleted the showOnScreen2 branch September 25, 2017 22:18
@goderbauer goderbauer added the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Oct 17, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants