Skip to content

Conversation

@omkarhole
Copy link
Contributor

@omkarhole omkarhole commented Dec 3, 2025

Replaced non-semantic

elements with proper elements to improve keyboard accessibility, screen reader support, and WCAG compliance. Preserved styling, IDs, aria-labels, and existing behavior.

Changes

  • Replaced L.DomUtil.createWithId('div', …) with 'button'
  • Removed ARIA roles no longer needed

Preserved:

  • IDs
  • classes
  • aria-labels
  • onclick handlers
  • icon images
  • No visual or behavioral regression

Issue Link:#12017

@rparth07 @Darshan-upadhyay1110

Copilot AI review requested due to automatic review settings December 3, 2025 17:40
@github-project-automation github-project-automation bot moved this to To Review in Collabora Online Dec 3, 2025
@omkarhole omkarhole changed the title A11y: Replace <div role="button"> with <button> in URLPopUpSection A11y: Replace non-semantic div buttons with <button> in URLPopUpSection Dec 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves accessibility by replacing non-semantic <div role="button"> elements with proper <button> elements in the URL popup section, aligning with WCAG guidelines and improving keyboard navigation and screen reader support.

Key Changes:

  • Replaced three <div role="button"> elements with native <button> elements (copy, edit, and remove buttons)
  • Removed redundant role="button" attributes since native buttons have implicit button semantics
  • Fixed a bug where the edit button incorrectly used copyLinkText for its aria-label instead of editLinkText

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch from b31a89d to 0bf8743 Compare December 3, 2025 17:49
@omkarhole
Copy link
Contributor Author

Hi,
This PR replaces the non-semantic

elements inside URLPopUpSection.ts with native elements to align with A11y best practices. The original behavior, styling, aria-labels, icons, and event handlers remain unchanged.

This improves:

  • Keyboard accessibility (automatic Enter/Space behavior)
  • Screen reader semantics
  • WCAG compliance
  • Reduces need for ARIA patches
  • Let me know if any additional updates or tests are needed. Thanks!

@Darshan-upadhyay1110
Copy link
Contributor

Thanks @omkarhole! I noticed the Change-Id is missing. Please make sure your commits include both a Signed-off-by (DCO) line and a Change-Id.

Add Change-Id

To automatically generate a Change-Id:

  1. Copy the commit hook:

    cp .git-hooks/commit-msg .git/hooks/commit-msg
    
  2. Amend the commit so the Change-Id is added:

    git commit --amend
    git push -f
    

@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch from 0bf8743 to d9c26f7 Compare December 7, 2025 12:23
@omkarhole
Copy link
Contributor Author

Thanks for the feedback. I’ve added the Change-Id and updated the commit as requested.
The Signed-off-by line is also included @Darshan-upadhyay1110

Copy link
Contributor

@rparth07 rparth07 left a comment

Choose a reason for hiding this comment

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

Thanks @omkarhole for patch:)
Overall changes are good! This enhancement will make it better :)

app.LOUtil.setImage(imgCopyBtn, 'lc_copyhyperlinklocation.svg', app.map);
imgCopyBtn.setAttribute('width', 18);
imgCopyBtn.setAttribute('height', 18);
imgCopyBtn.setAttribute('alt', copyLinkText);
Copy link
Contributor

Choose a reason for hiding this comment

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

As we have aria-label on parent button. we can avoid populating alt attribute on <img> to avoid confusion for assistive technology. we can set it to empty. i.e. imgCopyBtn.setAttribute('alt', '');

app.LOUtil.setImage(imgEditBtn, 'lc_edithyperlink.svg', app.map);
imgEditBtn.setAttribute('width', 18);
imgEditBtn.setAttribute('height', 18);
imgEditBtn.setAttribute('alt', editLinkText);
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above, we can update alt to empty string.

app.LOUtil.setImage(imgRemoveBtn, 'lc_removehyperlink.svg', app.map);
imgRemoveBtn.setAttribute('width', 18);
imgRemoveBtn.setAttribute('height', 18);
imgRemoveBtn.setAttribute('alt', removeLinkText);
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above, we can update alt to empty string.

@rparth07
Copy link
Contributor

rparth07 commented Dec 8, 2025

URL Pop-up dialog:
Before:
image

After:
image

I see this will affect UI as above.
cc: @Darshan-upadhyay1110 @pedropintosilva

Copy link
Contributor

@Darshan-upadhyay1110 Darshan-upadhyay1110 left a comment

Choose a reason for hiding this comment

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

@omkarhole the URL popup UI fully broken now it's not looking okay. A11y should not change the UI look the buttons should be consistent as it was before....

@github-project-automation github-project-automation bot moved this from To Review to In Progress in Collabora Online Dec 8, 2025
@omkarhole
Copy link
Contributor Author

sure i will fix it .

@omkarhole
Copy link
Contributor Author

omkarhole commented Dec 13, 2025

attempted to verify the fix using the Ona development environment, but environment creation requires credit-card verification.
The change is limited to CSS and semantic HTML, and has been manually verified to preserve the previous UI while improving accessibility. @Darshan-upadhyay1110

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rparth07
Copy link
Contributor

@omkarhole Merge commits are not allowed... can you please rebase?

@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch from 9fb23eb to 2b804be Compare December 23, 2025 13:44
@omkarhole
Copy link
Contributor Author

omkarhole commented Dec 23, 2025

Hi @rparth07 , @Darshan-upadhyay1110
I’ve rebased the branch on top of upstream master and removed the merge commit.
Please let me know if anything else is needed. Thanks!

@eszkadev
Copy link
Contributor

Hi @rparth07 , @Darshan-upadhyay1110 I’ve rebased the branch on top of upstream master and removed the merge commit. Please let me know if anything else is needed. Thanks!

hi @omkarhole I see it still has merge commit on top: 47da10f

could you please rebase it instead?
how to do it:

git log <-- see commits in your branch
git reset HEAD~1 --hard <-- remove 1 patch from the top
git branch -u origin/main <-- follow branch main
git pull -r <-- pull form origin/main with rebasing of your branch on top
git log <-- see there is origin/main commit and on top your changes
push...

@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch from 47da10f to 3fa947d Compare January 1, 2026 07:32
vertical-align: middle;
}

.hyperlink-popup-btn {
Copy link
Contributor

Choose a reason for hiding this comment

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

Image

I can still see that the button UI is affected. This CSS is being overridden. Could you please check again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hii , @rparth07 . I Have Check the changes on my local machine and it dosent shows button UI affected
Screenshot 2026-01-02 113121
Screenshot 2026-01-02 112938

would you please recheck it again ?

Copy link
Contributor

Choose a reason for hiding this comment

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

hi @omkarhole, can you please do a make clean and built it again and check.
I can see the UI affected.

  1. till commit c191d64771 UI is normal
    i.e.
Screencast.from.2026-01-02.11-58-25.webm
  1. on commit 3fa947dda2 UI is broken
    i.e.
Screencast.from.2026-01-02.12-01-14.webm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rparth07 which browser are you using chrome or other ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Chromium Version 143.0.7499.146

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2026-01-02 160934

@rparth07
i have check the again CSS but it dosent show any UI Broken and i use google chrome browser in that i works fine ! .would you please check on different browser on you local system please .

@omkarhole omkarhole requested a review from rparth07 January 2, 2026 12:14
@Darshan-upadhyay1110
Copy link
Contributor

Darshan-upadhyay1110 commented Jan 2, 2026

hi @omkarhole I also tested this patch

here how it looks , I can also reproduce the issue what @rparth07 mentioned in above comments...

image
Screencast.from.2026-01-02.17-10-26.webm

Using chrome : Version 143.0.7499.109 (Official Build) (64-bit)

Same goes to Fire fox :
image

so i would suggest you do a clean build ? and then test ?

@omkarhole
Copy link
Contributor Author

@Darshan-upadhyay1110 , @rparth07 i have done clean code and make some changes and also created video and now the UI looks Good . please go through video and check on your local machine also

video:

Untitled.video.-.Made.with.Clipchamp.1.mp4

@Darshan-upadhyay1110
Copy link
Contributor

Please add change ID and DCO. And i see the cypress is not happy can you please check if it's passes the cases in local or not ?

@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch 2 times, most recently from 6cb86fe to 5fc6582 Compare January 5, 2026 07:08
@rparth07
Copy link
Contributor

rparth07 commented Jan 5, 2026

hi @omkarhole, it looks like you accidentally includes already merged commits in this PR. can you please fix it. Thanks :)

- Replaced div role='button' elements with proper button elements
- Removed redundant ARIA roles (button role is implicit in button elements)
- Fixed aria-label on edit button (was using copyLinkText instead of editLinkText)
- Set alt='' on images since buttons already have aria-labels (avoiding redundancy)
- Added CSS reset for button elements to maintain consistent styling
- Improved keyboard accessibility and screen reader support

Issue: CollaboraOnline#12017
Signed-off-by: omkar hole <[email protected]>
Change-Id: I06f6da85ffbaa656962fad3207c6a4c132d07572
@omkarhole omkarhole force-pushed the replace-role-div-with-button- branch from 5fc6582 to 642cf20 Compare January 5, 2026 14:40
@omkarhole
Copy link
Contributor Author

@rparth07 i have fix the branch and make it clean you can review it .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants