WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#32053 closed defect (bug) (fixed)

Customizer: change title of collapse sidebar anchor when sidebar is collapsed

Reported by: thorbrink Owned by:
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords: needs-patch
Focuses: ui, accessibility Cc:

Description

When the sidebar is collapsed, the collapse sidebar anchor should have a different title than "Collapse Sidebar". Perhaps "Expand Sidebar" would make more sense.

Attachments (3)

customize-collapsed.png (32.6 KB) - added by thorbrink 3 years ago.
Screenshot of the bug
customizer-toggle.php.patch (703 bytes) - added by LewisCowles 3 years ago.
Patch for ./wp-admin/customize.php to reflect more accurately collapse text
admin-en_GB.po (443.5 KB) - added by LewisCowles 3 years ago.
admin translation file patched to more accurately describe behaviour

Download all attachments as: .zip

Change History (16)

@thorbrink
3 years ago

Screenshot of the bug

#1 follow-up: @LewisCowles
3 years ago

  • Type changed from defect (bug) to enhancement

Is this in the backend or a theme, as this looks to be a theme-specific issue. More information is needed to proceed.

#2 @LewisCowles
3 years ago

  • Focuses template added

#3 in reply to: ↑ 1 @thorbrink
3 years ago

Replying to LewisCowles:

Is this in the backend or a theme, as this looks to be a theme-specific issue. More information is needed to proceed.

This is whn using the Customize panel on any theme. The theme partially visible in the screenshot is Twentyfifteen. To reproduce: Set theme to Twentyfifteen, go to Customize, click "Collapse sidebar" at the bottom of the Customize panel.

@LewisCowles
3 years ago

Patch for ./wp-admin/customize.php to reflect more accurately collapse text

@LewisCowles
3 years ago

admin translation file patched to more accurately describe behaviour

#4 follow-ups: @LewisCowles
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

I think this needs to be closed down, two ways to modify the text have been included (the .po translation file being the best way)

#5 in reply to: ↑ 4 @thorbrink
3 years ago

Replying to LewisCowles:

I think this needs to be closed down, two ways to modify the text have been included (the .po translation file being the best way)

I don't quite follow what you mean by altering the text in the translation file being a good way. This method would leave the original string unaltered, would it not? I have tested the first patch, customizer-toggle.php.patch, and it looks like a good solution and is working for me.

#6 @SergeyBiryukov
3 years ago

  • Focuses template removed
  • Resolution invalid deleted
  • Status changed from closed to reopened

Tickets are closed when a commit is made to WordPress trunk to fix the issue, not when a patch is posted.

#7 in reply to: ↑ 4 @helen
3 years ago

  • Type changed from enhancement to defect (bug)
  • Version changed from trunk to 3.4

Replying to LewisCowles:

I think this needs to be closed down, two ways to modify the text have been included (the .po translation file being the best way)

The issue here is about screen readers / text-based navigation and how they explain the interaction to users with sight difficulty or otherwise use accessibility tools. The icon on its own is also quite cryptic, so the title attribute can be helpful even outside of that context. If you're unsure what's happening, feel free to ask in Slack or bypass the ticket. The component and focuses of the ticket should also help to clarify. Let's not confuse new reporters with misunderstandings.

And welcome to Trac, @thorbrink :) Great first bug report!

#8 @LewisCowles
3 years ago

Guys @SergeyBiryukov

Tickets are closed when a commit is made to WordPress trunk to fix the issue, not when a patch is posted.

I closed it because it seemed invalid, I was only following what I have watched you do, apologies if this was wrong, but it had nothing to do with the patch

@helen

The issue here is about screen readers / text-based navigation and how they explain the interaction to users with sight difficulty or otherwise use accessibility tools.

Not the issue reported, but okay, then we need more details on a proposed remmedy don't we?

I take on board that the code in-place was confusing and do thank Thor for pointing this out, hence my attempt to provide a middle-ground update via language file & php patch to show Thor how he could modify in either of those two places, neither patch is intended for the core, but AFAIK, I cannot just send Thor attachments; (Happy to learn if I can, but so far there seems to be some problem or another with anything I try to input to WordPress, none so far has given me many clues as to why...)

@thorbrink

I have tested the first patch, customizer-toggle.php.patch, and it looks like a good solution and is working for me.

Thanks for the feedback, apologies for any additional confusion.

Basically WordPress has these language files, where we can change the text, as well as code files, where we can change a lookup string, so I would suggest a language change; rather than a core code change.

I have provided how you could change the text in core file (.php patch), and language file (entire lang file, as I don't know too much about their process, or how that works).

Making the text change when clicked or interacted with would likely require DOM changes, some interactive JS, and over-complicate the text, which was why I decided it might be best to just change the content to a more general language of "Toggle Sidebar" from "Sidebar Collapse" to see if that would be to your mind, clearer.

There are other ways to make this more accessible, but not without changing the DOM code used, and even then I think it may break, so I posted the language file method immediately after posting a subtle change to the code (literally a string literal substitution, which AFAIK, changes the text, at least it did on my 4.1.2)

Thanks all for feedback on my feedback from everyone, I am on #slack if anyone could give guidance on how to make this thing easier.

#9 @helen
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Reports themselves are about problems, not solutions. Requiring that a solution be proposed to understand the problem is not viable.

The string needs to change dynamically in core, in a future release that is not 4.2. We should seek further feedback from the accessibility team as to how the state change is announced, ensuring that focus does not get trapped in that sidebar when it's hidden, etc.

This ticket was mentioned in Slack in #accessibility by helen. View the logs.


3 years ago

#11 @afercia
3 years ago

  • Summary changed from Change title of collapse sidebar anchor when sidebar is collapsed to Customizer: change title of collapse sidebar anchor when sidebar is collapsed

#12 @afercia
3 years ago

Related: #31201

#13 @celloexpressions
3 years ago

  • Milestone changed from Future Release to 4.3
  • Resolution set to fixed
  • Status changed from reopened to closed

This was fixed in [33153] (title attribute was removed, text is now dynamic though).

Note: See TracTickets for help on using tickets.