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

feat: toggle #3822

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: toggle #3822

wants to merge 9 commits into from

Conversation

HeleenSG
Copy link
Contributor

@HeleenSG HeleenSG commented Nov 11, 2024

Changes

Adds toggle element. Test case is placed within "generate report > Select objects"

Todo:

  • Check accessibility
  • Add JS to set aria-current on current view

Issue link

Closes #3812

Demo

Screenshot 2024-11-11 at 13 42 18

Hover:
Screenshot 2024-11-11 at 13 42 41

QA notes

Please review:


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

Copy link

Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Nice feature 👍 Just a tiny remark about the texts used in the partial template

rocky/reports/templates/partials/report_ooi_list.html Outdated Show resolved Hide resolved
@TwistMeister TwistMeister marked this pull request as ready for review November 28, 2024 11:18
@TwistMeister TwistMeister requested a review from a team as a code owner November 28, 2024 11:18
@TwistMeister
Copy link
Contributor

TwistMeister commented Nov 28, 2024

Since this solution is very implementation specific I've created a new issue to refactor this to a generic solution.

@TwistMeister
Copy link
Contributor

@ppvg Since @HeleenSG absence, could you maybe check the accessibility for the current implementation of this component?

Copy link
Member

@ppvg ppvg left a comment

Choose a reason for hiding this comment

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

As discussed offline, this component seems a great fit for applying the ARIA APG Tabs pattern. It would make sense to follow the Tabs with Manual Activation example. Note for example how the aria-controls attribute would be a great semantic alternative to the current data-target-id.

I understand the time pressure but as discussed before, in its current form it is not fully accessible.

Comment on lines 16 to 18
document
.getElementById(option.getAttribute("data-target-id"))
.classList.add("hidden");
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say, Hide all of them by applyting a className to it.
And then use the :target selector and the url to show the one being active. that moves the state-management from JS to Css for most of this.
It would not be compatible with nested versions of this component, as selecting a nested 'tab' would hide the parent tab, But I don't think we have that usecase anyway.

Copy link
Member

Choose a reason for hiding this comment

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

While it would be nice if state management didn't require JS, it's unfortunately not possible to make this fully accessible without using JS to manage ARIA attributes.

@underdarknl could you please verify whether the APG's Tabs pattern aligns with the expected use here, as I suspect? If so I would implore you to follow one of the APG's example implementations. If not, let's look together for fitting ARIA roles and behaviours.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do think the Tabs pattern fits this nicely. Do you have a preference on which example to follow? Especially if we want to move this to Manon upstream at some point?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know the exact context. If switching accidentally would be a problem, manual activation would make sense. For upstream we could add both and make it configurable.

@TwistMeister TwistMeister removed their assignment Dec 12, 2024
@stephanie0x00
Copy link
Contributor

The 'Live filter' doesn't seem to pick up the chosen filtered items. The list of items remains empty with the following filter applied:

image

image

The manual selection does pick up the applied filter:

image

@stephanie0x00 stephanie0x00 added the 😸 Review/QA feedback Review/QA feedback provided label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😸 Review/QA feedback Review/QA feedback provided
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Add toggle to report object selection
6 participants