Skip to content

Conversation

@tylersticka
Copy link
Member

@tylersticka tylersticka commented Jul 7, 2021

Overview

Adds a not-quite-complete version of a c-comment component. Remaining to-dos are specified in the "Status" section of the Storybook docs page.

I made a few changes from the designs:

  • I increased some of the horizontal spacing but tightened up the vertical spacing to make longer threads a bit easier to scan.
  • I added a 🔗 icon to the permalink for consistency with our permalinked headings.
  • I did not increase the avatar size to the same degree because I haven't found a technique for doing so yet that I'm happy with. (Do not be surprised if this changes in the next revision!)

Screenshots

Screenshot 2021-07-07 at 10-33-20 Storybook

Testing

Deploy preview

Remember, you can view a page on its own by opening a story in "Canvas" view and clicking the top right icon that looks like an iOS "share" icon (arrow pointing upward from rectangle). This may streamline VoiceOver testing by focusing on the specific story!


/CC @AriannaChau

@changeset-bot
Copy link

changeset-bot bot commented Jul 7, 2021

🦋 Changeset detected

Latest commit: 92142e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tylersticka
Copy link
Member Author

@calebeby I'm having trouble resolving some TypeScript errors related to some imports in a dummy data generator. If I follow what TypeScript tells me to do, I get eslint errors, if I follow what eslint tells me to do, I get TypeScript errors. Help would be appreciated!

@tylersticka
Copy link
Member Author

@calebeby Thank you!

@tylersticka tylersticka requested review from a team July 7, 2021 19:03
@tylersticka tylersticka marked this pull request as ready for review July 7, 2021 19:03
@tylersticka tylersticka removed request for a team July 7, 2021 20:46
@tylersticka tylersticka marked this pull request as draft July 7, 2021 20:47
@tylersticka
Copy link
Member Author

tylersticka commented Jul 7, 2021

Unfortunately I found a regression, moving this back to draft state until I'm able to address.

Edit: This has been addressed.

@tylersticka tylersticka marked this pull request as ready for review July 7, 2021 21:15
@tylersticka tylersticka requested review from a team July 7, 2021 21:16
@gerardo-rodriguez
Copy link
Member

This is looking great, @tylersticka!

Quick question…should there be a bit of extra breathing room at the bottom of the reply? It feels uncomfortably close to the bottom edge and makes me think there is more to see/scroll. Of course, this design is out of context and this may not matter when within the full page layout. Figured I'd ask about it. 🙂

Screen Shot 2021-07-07 at 3 47 10 PM

<h{{_heading_depth}} class="c-comment__heading">
{{comment.author.name}}
<span class="u-hidden-visually">
{% if comment.is_child %}replied{% else %}said{% endif %}:
Copy link
Member

Choose a reason for hiding this comment

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

I very much enjoyed this audible experience, thank you! ❤️

Copy link
Contributor

@Paul-Hebert Paul-Hebert left a comment

Choose a reason for hiding this comment

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

This looks (and sounds) great!

I left a few nits and questions inline. I think we may want to switch from using a title to visually hidden text for comment links? Everything else is non-blocking though.

grid-template-areas:
'object header'
'thread-line content'
'thread-line footer';
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh this is clever. 👍 CSS Grid is awesome

Comment on lines 51 to 52
// We generally want comment contents to align to the start/top, but the
// the heading looks better center-aligned with the avatar.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Suggested change
// We generally want comment contents to align to the start/top, but the
// the heading looks better center-aligned with the avatar.
// We generally want comment contents to align to the start/top, but
// the heading looks better center-aligned with the avatar.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Paul-Hebert I've addressed this feedback, but I removed a different "the" because there was plenty of room below the 80 character threshold for that line.

src: comment.avatar,
size: 'full'
} only %}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we confident there will always be avatars when using this pattern? (e.g. will we use Wordpress's fallbacks or something else if there's no avatar?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, and if the avatar is omitted, you'll just see a placeholder circle with the current pattern, so it's pretty fault-tolerant.

<div class="c-comment__meta-detail">
<a class="c-comment__meta-link"
href="{{comment.link}}"
title="Permalink to {{comment.author.name}}’s {{comment.date|date('M j')}} {% if comment.is_child %}reply{% else %}comment{% endif %}">
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is that some screen readers have issues with the title attribute: https://www.tpgi.com/using-the-html-title-attribute

I wonder if it would be better to include some visually hidden text for assistive technologies?

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried this in VoiceOver and the title text wasn't announced so I just heard a link with a date. It seems like this title info would be useful context for assistive technologies.

Copy link
Member

@gerardo-rodriguez gerardo-rodriguez Jul 7, 2021

Choose a reason for hiding this comment

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

Thanks, @Paul-Hebert! I saw the title attribute usage and was trying to find a reference article but you already found one. I wasn't 100% sure if using title might be cause for concern but I had stored somewhere in the back of my mind that I should be cautious.

FWIW, I did hear the info in the title attribute using VO + Safari + keyboard as my input (which I was surprised by) but the fact we heard varying, inconsistent experiences is reason enough to use visually hidden text instead. 😉

Thanks again, @tylersticka, for the thoughtful UX design! ❤️

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, interesting! I wonder why we heard different things 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

@Paul-Hebert @gerardo-rodriguez I believe I've addressed this comment by moving the text into visually hidden span elements. One nice side effect of this is that I can now re-use the existing time element for that portion of the fallback text.

Copy link
Contributor

Choose a reason for hiding this comment

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

I now get the full context, thanks!

Screen Shot 2021-07-08 at 8 55 52 AM

via <a class="c-comment__meta-link" href="{{source.url}}">{{source.name}}</a>
</div>
{% endif %}
{% if demo_control %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: could we add a comment explaining this var name? It confused me until I went back to the docs page

Copy link
Member Author

Choose a reason for hiding this comment

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

@Paul-Hebert Good idea, I've added a TODO comment with more context.

@tylersticka
Copy link
Member Author

Of course, this design is out of context and this may not matter when within the full page layout. Figured I'd ask about it. 🙂

@gerardo-rodriguez We use a Storybook add-on called addon-paddings that did an update recently that seems to have added some regressions in the padding of displayed elements. Another example occurs if you look at the Button docs at any stories that are side by side, you'll see the buttons now run together. The good news is that it doesn't have anything to do with my comment CSS, it's something you can recreate in other stories prior to this PR.

Would greatly appreciate a separate issue to address!

Comment on lines 62 to 64
<h{{_section_heading_depth}} class="u-hidden-visually">
Replies
</h{{_section_heading_depth}}>
Copy link
Member

Choose a reason for hiding this comment

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

Clever! I totally missed this the first time I turned VoiceOver on.

For a moment, I had a slight concern that seeing multiple "Replies" headings might be confusing within the context of the VO rotor but since the rotor lists them in order, I think there is enough contextual information that it makes sense. 👍

IMG_9939

Copy link
Member Author

Choose a reason for hiding this comment

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

@gerardo-rodriguez I've made a slight adjustment based on this observation, adding the original comment author's name to the "Replies" heading. I think this makes the headings more distinct and the relationship a bit more clear between heading levels now.

IMG_4292

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a great improvement 👍

@tylersticka tylersticka requested review from a team July 8, 2021 15:52
@Paul-Hebert Paul-Hebert self-requested a review July 8, 2021 15:57
Copy link
Contributor

@Paul-Hebert Paul-Hebert left a comment

Choose a reason for hiding this comment

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

Looks great! 🚢

@tylersticka tylersticka merged commit 157fad1 into v-next Jul 8, 2021
@tylersticka tylersticka deleted the feature/c-comment branch July 8, 2021 15:59
@github-actions github-actions bot mentioned this pull request Jul 8, 2021
const random = require('lodash/random');
const sample = require('lodash/sample');
const uniqueId = require('lodash/uniqueId');
import Jabber from 'jabber';

Choose a reason for hiding this comment

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

Hi @tylersticka , thanks for using Jabber, I have added ts support in v.1.5.2.
regards
Anil

@dejavu1987
Copy link

Hi @tylersticka , thanks for using Jabber, I have added ts support in v.1.5.2.
regards
Anil

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.

6 participants