Repository navigation
Polish the dialog's accessibility and test growing ColorPickerStrings - #359
Merged
Merged
Conversation
The dialog's header made the original half a button only once the color was edited, so a screen reader met a plain swatch first and a button after an edit, with nothing saying why it appeared. BasicColorComparison and ColorComparison take enabled, and the header keeps the half a button that is disabled until the color is modified. A disabled comparison draws its colors unchanged: dimmed, the swatch would show colors other than the ones compared. The header also converts the original color once rather than on every frame of a drag.
Beyond five spaces the switcher is a button that opens a menu. A screen reader heard a button named after the space shown, then menu items with no sign of which one was chosen. The button is a drop-down list and the items are radio buttons in one selectable group, as the segmented row's already are.
The dialog's content stays composed in its stacked form while laid out side by side, only to measure it. A slider there that held keyboard focus when the content flipped, as it does when a window is resized, kept it while not placed: nothing on screen showed where focus was, and the next key moved a slider that was not drawn. The content clears that focus once it lays out side by side, and only that focus.
An app that replaces the title slot still has the dialog announced by ColorPickerStrings.dialogTitle, and needs to know that and the two ways to change it: provided strings, or a paneTitle in the modifier. The last works only because the library sets its own inside the caller's modifier, which a test and a comment now hold in place. An empty spaces with the default initialSpace throws NoSuchElementException from spaces.first() in the default expression, which the KDoc says beside the IllegalArgumentException cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four changes to the 2.0 dialog that touch its API or what assistive technology hears, cheaper before 2.0 than after, and a check that
ColorPickerStringscan grow in 2.x. Builds on #358.BasicColorComparisonandColorComparisontakeenabled, and the header keeps the half a button, disabled until the color changes. A disabled restore takes no keyboard focus, and a disabled comparison draws its colors unchanged.ColorPickerStrings.dialogTitle()whatever the title slot shows, that provided strings or apaneTitleinmodifierchange it, and that an emptyspaceswith the defaultinitialSpacethrowsNoSuchElementException. Tests pin the pane-title cases; one fails when the library's pane title is set outside the caller's modifier.The API dumps change only in the two comparison signatures, each with one
Booleanmore. The 30 screenshot references validate unchanged.ColorPickerStringscan grow in 2.xcolorpicker-foundationwas published from this branch three times to a local repository: as it is (link1), with one member added toColorPickerStringswith a body (link2), and with the same member abstract (link3), as a control. A library compiled againstlink1holds two implementations: one that overridesdialogTitle()alone, and one that forwards every member to another withby. An app compiled against the later version linked that library and called the new member through each.link2: the override answers the new member with its bodylink2: the forwarder answers it with its body toolink2: the forwarder, given a base overriding the new memberlink3, the control: any of the threeAbstractMethodErrorIrLinkageErrorSo a member added with a body in 2.x reaches an implementation compiled against an earlier 2.x on both platforms, and the control shows the test would have caught it otherwise. On JVM this rests on Kotlin compiling interface bodies to default methods (
-jvm-default=enable, the default since Kotlin 2.2); under the olderdisablemode an added member hitsAbstractMethodErroreven with a body. An implementation that forwards withbyforwards only the members it was compiled with: until it is recompiled, it answers a new member with the library's English rather than its base's override.