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

Fix VO issue for date ranges #1555

Merged
merged 4 commits into from
Feb 22, 2019
Merged

Conversation

monokrome
Copy link
Contributor

@monokrome monokrome commented Feb 21, 2019

This fixes an issue where VoiceOver and other accessibility tools don't let people know that dates are selected when they are somewhere between the start and end date of a date range/span.

@monokrome monokrome changed the title Clean up calendar day settings Fix VO issue for date ranges Feb 21, 2019
@coveralls
Copy link

coveralls commented Feb 21, 2019

Coverage Status

Coverage decreased (-0.008%) to 84.496% when pulling 3a93bc5 on bailey-bugfix-vo-range-selection into 1a55d68 on master.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Confirmed this is not a breaking change; but could you add some tests?

@monokrome monokrome force-pushed the bailey-bugfix-vo-range-selection branch from 521e02b to 0170b81 Compare February 21, 2019 07:19
Bailey Stoner added 2 commits February 20, 2019 23:32
We may want different phrases for spans vs single selections. Need to
look further into this!
@monokrome
Copy link
Contributor Author

@ljharb Apologies for confusion - this isn't ready for review yet. Does creating a new PR cause it to be considered ready for review? Sorry if you got pinged about this or anything, as I know it's late.

@monokrome monokrome added the semver-patch: fixes/refactors/etc Anything that's not major or minor. label Feb 21, 2019
@ljharb
Copy link
Member

ljharb commented Feb 21, 2019

@monokrome there's a new "draft" status you could have used; but either way no worries! ping me when it's ready for review.

@monokrome
Copy link
Contributor Author

@ljharb How do you enable the draft status? Is it a label, a new feature in GitHub, or something else?

@ljharb
Copy link
Member

ljharb commented Feb 21, 2019

@monokrome it's (recently) in a dropdown on the "create pull request" button; non-draft PRs can't be made drafts.

@majapw
Copy link
Collaborator

majapw commented Feb 21, 2019

In a more old-school way, you can also just clarify in the PR description and add a WIP tag to the PR! :)

@monokrome
Copy link
Contributor Author

@ljharb I added a test (was going to do this anyway) last night, but not 100% sure what other tests I should add. Specifically, I think that we should have tests to ensure the styles are applied appropriately to CalendarDay but I also don't want to introduce them in this PR since we don't have those tests yet for the already-existing logic. So, I may make another PR for that stuff if it feels like something we should invest in, which I believe it is.

@majapw
Copy link
Collaborator

majapw commented Feb 22, 2019

Can you add a bit of context to the description as to what this is fixing? QQ: are you intending to follow up on adding a phrase for within range in this PR or in a follow-up (I don't want to merge in early if so)?

@monokrome
Copy link
Contributor Author

monokrome commented Feb 22, 2019

@majapw Added in description! Thanks 😺

@ljharb ljharb requested a review from majapw February 22, 2019 20:53
@monokrome monokrome merged commit 9c878ad into master Feb 22, 2019
@monokrome
Copy link
Contributor Author

monokrome commented Feb 22, 2019

@ljharb I'm confused. I'm merged because it said you approved, but I just noticed that it says you requested a review from maja. Do we expect more than one approving review to merge? I can revert if so.

(maja's only comment was regarding the description and it wasn't in a review, so I'm not sure that she wants to review or not)

@monokrome monokrome deleted the bailey-bugfix-vo-range-selection branch February 22, 2019 20:57
@majapw
Copy link
Collaborator

majapw commented Feb 22, 2019

If it's stamped, it's stamped! def fine to merge.

@ljharb
Copy link
Member

ljharb commented Feb 22, 2019

@monokrome we don't have any such policy here, was more thinking that it's always better to get more eyes :-) if it was a blocker tho, i'd not have stamped.

Copy link
Contributor

@backwardok backwardok left a comment

Choose a reason for hiding this comment

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

@monokrome I found an issue in your code that will likely cause some regressions. Please check

ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
if (modifiers.has('selected-start') && dateIsSelectedAsStartDate) {
return getPhrase(dateIsSelectedAsStartDate, formattedDate);
} if (modifiers.has('selected-end') && dateIsSelectedAsEndDate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're missing the else part of this logic

Copy link
Contributor

Choose a reason for hiding this comment

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

oh wait I just noticed that you're returning so this ends up being technically ok, but visually confusing (because it looks like an else if but it's actually a standalone if statement

Copy link
Member

Choose a reason for hiding this comment

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

whoops, that'd be great to clean up in a followup :-) @monokrome

Copy link
Contributor Author

@monokrome monokrome Feb 26, 2019

Choose a reason for hiding this comment

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

@backwardok @ljharb hmm... Think I should use an else?

Feels bad to use let when we don't need it, but also feels worse to have a final return in a branch instead of in the function's root block. Feels like it could lead to confusing behavior?

I can change it if that's our code style, though!

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't use an else; but a newline should be inserted between } and if.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch: fixes/refactors/etc Anything that's not major or minor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants