department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
97 stars 69 forks source link

Update character counter on Figma for VBA RO MVP #16523

Closed xiongjaneg closed 8 months ago

xiongjaneg commented 9 months ago

Description or Additional Context

CMS collab cycle feedback was documented in ticket #16073.

One of the recommendations was to standardize the character counters used in VBA. CMS Team owns standardization across Drupal products. This is to align VBA character counters with CMS standard (after discussion with Blake) and use it consistently across VBA.

Design

Figma file

Acceptance Criteria

thejordanwood commented 9 months ago

I discussed the character counter with @BlakeOrgan. We agree that it should follow the same functionality as the USWDS character counter.

@swirtSJW @omahane We'd like to get an idea on if it's possible to change the current character counter.

Changes to current character counter:

This is the current character counter I'm referring to. There are several counter designs in the CMS, but I'm wondering if this one would be the easiest to change.

Screenshot 2023-12-21 at 2 50 23 PM

cc: @xiongjaneg

davidmpickett commented 9 months ago

Note from Sprint Planning - one of my tasks is to write up the character count enhancement ticket so we have that captured clearly for prioritization and conversation with CMS Design System Team

Notes for myself:

davidmpickett commented 9 months ago

Dave's analysis of the feasibility of @BlakeOrgan and @thejordanwood's suggested changes to current character counter

Change text from "X characters remaining" to "X characters allowed"

Easy!

This is a Site Building task that can be managed per character counter widget. Totally within the purview of Facilities Team to implement.

Current field value <span class="remaining_count">@remaining_count</span> characters remaining

New field value would be <span class="maxlength_count">@maxlength</span> characters allowed

Screenshot 2024-01-03 154401

--

When character count is reached, the counter text should change to "X characters over limit" in bold, red text

Complicated.

The logic of changing the text from one message to another would likely need to be an upstream change to the Textfield Counter module. Need a more Drupally mind to understand the lift.

Changing the color of the message in that circumstance is easier to control as part of our instance of Drupal. However, this change would affect all teams so while Facilities could draft the PR, would definitely need review and approval from CMS Platform.

--

Text field should not be highlighted with a red or green box at any time.

Half and half?

The green box is the Focus Border that indicates the active part of the form. I'm not sure why it's green though. @laflannery do you know this?

Resolving the Focus color problem here is not specific to character counts and seems like a CMS Platform team responsibility.

Screenshot 2024-01-03 155159

The inner red box highlight that appears when the user is over the limit seems a little easier to change just for our Drupal instance. Could be a Facilities PR with CMS Platform review

Screenshot 2024-01-03 155151

davidmpickett commented 9 months ago

Incredibly drupally rabbit hole:

https://git.drupalcode.org/project/textfield_counter/-/blob/2.3.0/js/textfield_counter.js

https://git.drupalcode.org/project/textfield_counter/-/blob/2.3.0/config/schema/textfield_counter.schema.yml https://git.drupalcode.org/project/textfield_counter/-/blob/2.3.0/src/Plugin/Field/FieldWidget/TextFieldCounterWidgetTrait.php

davidmpickett commented 9 months ago

Very rough outline of an upstream Drupal issue https://www.drupal.org/project/textfield_counter/issues/3412208

davidmpickett commented 9 months ago

Have started drafting a CMS experimental design request https://github.com/department-of-veterans-affairs/va.gov-cms/issues/16659

davidmpickett commented 9 months ago

Shared experimental design request ticket in Slack for feedback

swirtSJW commented 9 months ago

Very rough outline of an upstream Drupal issue https://www.drupal.org/project/textfield_counter/issues/3412208

This is a great upstream issue @davidmpickett thank you for taking the time to create it. There are likely a few issues that might keep this from becoming part of the module. (does not mean it could not just exist as a patch that people could apply if they choose)

There is a fairly high level of effort to creating this in a way that would not instantly break and would update existing field instances. Since there is a low likelihood of this patch getting merged in, it means the VA could be maintaining this patch for a long time.

By my way of thinking, the gain is not worth the investment. Do we have any data that suggests our editors are currently confused by the text counter as it is now?

omahane commented 9 months ago

@swirtSJW Instead of a patch to the current module, could we not create a submodule that would add the ability to configure the messaging based on the conditions that Dave described? The submodule would not break other sites, as it could be disabled by default, but could add the functionality requested.

swirtSJW commented 9 months ago

That is a good idea @omahane. A submodule could work, iff the structure of text_field counter allowed for it. It might. I'd have to spend more time looking to make sure. Extending another module's JS is sometimes dicy. Would likely need a complete replacement of the JS rather than an extension. The php side would likely be easier and might be handled by third_party_settings.

I think the lift would still be significant and not worth the investment to solve a non-existent problem that results in no Veteran facing benefit. You know I like making new modules :smiley: ... but this is not one I would choose to create and maintain. If we went down that route, I do not think Facilities Team needs to pick this battle.

davidmpickett commented 9 months ago

Broke off the smaller piece for estimating in Drupal pre-refinement: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/16732

@thejordanwood I don't think that ticket warrants a mock up, but if you could specify the exact color for the red text, that would be great.

thejordanwood commented 9 months ago

@xiongjaneg @davidmpickett What are next steps for me to complete this ticket? It sounds like aligning the current character counter with the USWDS counter may be a big lift. I can leave it as is in my design for now, which is a character counter that says "X characters remaining."

Note: I considered changing it to "X character allowed" since that seems like an easier change, but realized the USWDS counter changes to "X characters left" once a user starts typing in the field. I believe that will also be a bit difficult to implement.

xiongjaneg commented 9 months ago

@thejordanwood It does sound like it's a big lift and out of scope at least for pilot MVP.

@davidmpickett Should we discuss in UX sync this week, just to get folks on the same page? Then I could stub a future ticket for post-MVP or later and possibly another team.

davidmpickett commented 9 months ago

@thejordanwood - I think you are off the hook for this ticket. You specified the desired behavior and we agreed no mockup was needed based on expected path forward. You can take yourself off the ticket.

I still need to do my full review of the character counters and make sure all the numbers are correct. I will close this out once that's complete.

I will also add this to UX sync agenda for tomorrow, but mostly for talking about the next steps that are captured in other tickets

thejordanwood commented 9 months ago

@davidmpickett Thanks! I'll stay on for now just in case I need to update character counts in Figma after you review them.

davidmpickett commented 9 months ago

I left comments in the Figma file about fields that have character limits that aren't currently showing a character counter. Most of these are just default 255 character limits. This is based on the new guidance that I wrote up as part of the Experimental Design ticket

Text (plain)

  • SHOULD use the Textfield with counter widget. Since this field always has a character limit, we should always make users aware of that.

This is an item I think we should discuss in UX Sync if we all agree on. I don't know if it's worth @thejordanwood's time to update all these instances in Figma, vs I can just put together a PR that would implement this change in VBA instances in Drupal.

jilladams commented 8 months ago

From UX sync: