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

Info and relationships issues #16231

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Info and relationships issues #16231

wants to merge 32 commits into from

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Apr 17, 2024

Suggested merge commit message (convention)

Docs: Improved accessibility of tooltips in documentation by switching from aria-expanded to aria-describedby in elements they are attached to.
Feature (engine): Improved accessibility of editor placeholders by adding aria-placeholder attributes to elements that placeholders are attached to.
Fix: Source mode and show block buttons are no longer marked as dropdown buttons in aria attributes.
Fix (ui): Improve accessibility of menu bar toggle items by marking them as menucheckbox aria roles.


Additional information

Closes https://github.com/cksource/ckeditor5-commercial/issues/6037
Commercial PR: https://github.com/cksource/ckeditor5-commercial/pull/6180

Summary by CodeRabbit

  • New Features

    • Enhanced button functionalities across various UI components, setting roles as 'menuitemcheckbox' and making them toggleable for improved accessibility and user interaction.
  • Refactor

    • Optimized button creation and property settings in multiple classes to streamline command bindings and role assignments.
  • Style

    • Updated ARIA attributes across UI components to better align with accessibility standards, including the removal of 'ariaChecked' and introduction of '_ariaPressed' and '_ariaChecked'.
  • Bug Fixes

    • Corrected ARIA attribute handling in button views to ensure proper state reflection based on button roles and toggle states.
  • Tests

    • Expanded test cases to cover new ARIA attribute checks and button state validations, ensuring robust functionality.

@Mati365 Mati365 changed the title Use aria-describedby instead of aria-expanded in docs tooltips Info and relationships issues Apr 17, 2024
@Mati365 Mati365 marked this pull request as ready for review April 18, 2024 09:15
@ckeditor ckeditor deleted a comment from coderabbitai bot Apr 19, 2024
Copy link
Contributor

coderabbitai bot commented Apr 19, 2024

Walkthrough

The recent updates across various CKEditor5 packages primarily focus on enhancing accessibility by standardizing roles like 'menuitemcheckbox' and adjusting properties related to ARIA states such as 'aria-pressed' and 'aria-checked. These changes aim to ensure consistent handling of UI components, particularly buttons, across different editor functionalities, promoting better accessibility practices within the editor's UI components.

Changes

File Path Change Summary
.../src/bold/boldui.ts
.../src/italic/italicui.ts
.../src/strikethrough/strikethroughui.ts
.../src/subscript/subscriptui.ts
.../src/superscript/superscriptui.ts
.../src/underline/underlineui.ts
Updated button creation with role: 'menuitemcheckbox' and bindings to command's value.
.../src/code/codeui.ts Adjusted command initialization and button view configuration.
.../src/codeblockui.ts Updated menuView.buttonView properties and removed ariaChecked binding.
.../src/list/utils.ts
.../src/sourceediting.ts
Added role: 'menuitemcheckbox' and isToggleable: true to button properties.
.../src/button/button.ts
.../src/dropdown/button/splitbuttonview.ts
Removed ariaChecked from public entities.
.../src/button/buttonview.ts Introduced _ariaPressed and _ariaChecked attributes for managing ARIA states.
.../tests/button/buttonview.js
.../tests/dropdown/utils.js
Updated tests to reflect changes in ARIA attribute handling and button roles.

This table groups files with similar changes together, providing a clear overview of the type of modifications made across different components of the CKEditor5 project.


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between df984ae and 050ad43.
Files selected for processing (1)
  • packages/ckeditor5-engine/tests/view/placeholder.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/ckeditor5-engine/tests/view/placeholder.js

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Mati365 Mati365 requested a review from oleq April 19, 2024 08:40
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

packages/ckeditor5-ui/tests/dropdown/utils.js Show resolved Hide resolved
Copy link
Member

@oleq oleq left a comment

Choose a reason for hiding this comment

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

Some things are fine, some need changes and some need to be cleared up.

packages/ckeditor5-show-blocks/src/showblocksui.ts Outdated Show resolved Hide resolved
role: 'menuitemcheckbox'
} );

buttonView.bind( 'isOn' ).to( command, 'value' );
Copy link
Member

Choose a reason for hiding this comment

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

This change gives menu bar buttons like bold, italic, etc. the "on" state

image

that sometimes is not announced in menu bar implementations

image image

or gets expressed as a check mark (we don't have this functionality yet)

image

This is a big design decision. Let's talk it over.

packages/ckeditor5-code-block/src/codeblockui.ts Outdated Show resolved Hide resolved
packages/ckeditor5-list/src/list/utils.ts Show resolved Hide resolved
packages/ckeditor5-engine/src/view/placeholder.ts Outdated Show resolved Hide resolved
element: child2
} );

expect( parent.getAttribute( 'aria-placeholder' ) ).to.be.equal( 'Hello World!, Helloooo!!' );
Copy link
Member

Choose a reason for hiding this comment

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

What value would that be to the users? There could be 10 placeholders in 10 random places in the document (at different nesting levels). It doesn't seem like aggregation is the way to go here. Here's the screenshot from http://fake.ckeditor.com:8125/ckeditor5-heading/tests/manual/title.html

Screenshot 2024-04-29 at 16 09 09

Shouldn't the aria-placeholder attribute change dynamically as users move between placeholder-enabled elements? Would a screen reader even respect that?

Copy link
Member

Choose a reason for hiding this comment

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

Placeholder should provide an additional description for the field that is currently focused. Reading placeholders of all fields in one place defeats the purpose of that mechanism.

I would simply leave aria-placeholders in the title and body fields, removing it from the editor itself. But I'm not sure if it would be read 🤔 Dynamically changing placeholder also sounds like something that would be ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Comandeer / @oleq So what should we do?

@Mati365 Mati365 marked this pull request as draft April 30, 2024 05:10
@Mati365 Mati365 marked this pull request as ready for review April 30, 2024 12:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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.

None yet

3 participants