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

Edit Item, Bitstreams tab: Accessibility improvements #3464

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

Conversation

AAwouters
Copy link
Contributor

@AAwouters AAwouters commented Oct 17, 2024

References

Fixes

Backports

Description

This PR refactors the Edit Item, Bitstreams tab so that the content appears in a <table> element. Visually, very little has changed. Structurally, the component works completely different.

Every bundle now has its own <table> element with each bitstream in a different <tr>. The table, columns and bitstream name cells now have id's which are referenced by headers tags in the other table cells to aid accessibility tools.

The bitstream rows' drag handles are now always visible. Previously they were partially hidden which made them harder to tab-target. In addition to being draggable, a row can now be selected by clicking the drag handle, or pressing space/enter when the handle is in focus. Once a row is in focus it can be moved around using the arrow keys. All performed actions are announced in the live region.

This PR also makes a small change to the notifications-board component: The content of all notifications that are shown in the board is also announced in the live region.

Instructions for Reviewers

  • Create an item with multiple bitstreams (~12 is ideal)
  • Optional: Create a second bundle within the item, again with a large amount of bitstreams
  • Optional: Make the live-region visible as described in Live Region #3337
  • Go to the 'Edit Item', 'Bitstreams' tab of the newly created item
  • Verify pagination sizes can be set for each individual bundle
  • Move a bitstream around with the drag handle
    • Verify a notification appears which mentions the change was saved when dropped
    • Verify a tooltip appears on the pagination which mentions you can move the bitstream to a different page
    • Verify the bitstream can be moved to a different page by dropping it on the page number
    • Verify you are redirected to the correct page after dropping the bitstream on a page number
  • Move a bitstream around using the keyboard
    • Select a bitstream by clicking the drag handle, or by tab-selecting it and pressing enter/space
    • Move the bitstream around by pressing the up/down arrows
    • When moving across pages, you are redirected to the page that the selected bitstream is currently on
    • Confirm the current position by pressing enter/space again
    • Cancel the move and return the bitstream to its original position by pressing the escape key
  • When the live-region is enabled: Notice that all actions are mentioned in the live-region

Moving bitstreams with the keyboard is slow

Depending on the backend you use, you might notice that the moving the bitstreams around with the keyboard might take some time. The reason for this is that every move is immediately sent to the backend, so the UI has to wait for the backend to respond with the new order of the bitstreams in the bundle before it can show the current order.
I considered creating a 'preview' of the order and only sending the request when the user confirms the new position, but creating a correct preview when the user moves around in the different pages or changes the page size is difficult. (Unless all bitstreams of all bundles are retrieved immediately, but then there is almost no reason to keep using the pagination.)

Checklist

  • PRs should be smaller in size (ideally less than 1,000 lines of code, not including comments & tests)
  • PRs must pass ESLint validation using yarn lint
  • PRs must not introduce circular dependencies (verified via yarn check-circ-deps)
  • PRs must include TypeDoc comments for all new (or modified) public methods and classes. Large or complex private methods should also have TypeDoc.
  • PRs must pass all automated pecs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • User interface changes must align with Accessibility guidelines
  • PRs must use i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • Details on how to test the PR must be provided. Reviewers must be aware of any steps they need to take to successfully test your fix or feature.
  • If a PR includes new libraries/dependencies (in package.json), then their software licenses must align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • Basic technical documentation should be provided for any new features or configuration, either in the PR itself or in the DSpace Wiki documentation.
  • If a PR fixes an issue ticket, please link them together.

For most screen sizes, the ResponsiveTableSizes is enough to resize the
table columns. On very small screens, or when zoomed in a lot, even the
smallest column sizes are too big. To make it possible to view the
rest of the content even in these situations, the ability to scroll
horizontally is added.
…ms-table-main

# Conflicts:
#	src/app/item-page/edit-item-page/edit-item-page.module.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.html
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.html
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts
#	src/app/shared/notifications/models/notification-options.model.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts
#	src/app/shared/notifications/notifications-board/notifications-board.component.ts
#	src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.spec.ts
#	src/app/shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component.ts
@artlowel
Copy link
Member

Create an item with multiple bitstreams (~12 is ideal)

An easy way to do that is to go to the add a bitstream to an existing item as an admin, then find that POST request to the /api/core/bundles/${uuid}/bitstreams endpoint in the network tab. Right click on it, select copy as curl, and then execute that command a dozen times, in the same folder as the file you uploaded.

Afterwards it is a good idea to at least rename some of the bitstreams, so you can see the effect of a reorder

@AAwouters AAwouters marked this pull request as ready for review October 23, 2024 12:35
@tdonohue tdonohue added claimed: Atmire Atmire team is working on this issue & will contribute back funded Task is funded via the DSpace Development Fund bug labels Oct 23, 2024
@kanasznagyzoltan
Copy link

We have tested the main and the dspace 8.x version of this PR:

  • created an intem with 12 bitstreams in 2 separate bundles
  • changing the page size can be done separatly for each bundle

image

  • dragging an item makes to help tooltip pop up

image

Result:

  • moving the bitstream on the page number correctly moves it to the next page
  • moving the bitstream with the arrow keys also works correctly

@tdonohue tdonohue self-requested a review December 3, 2024 15:22
@tdonohue tdonohue added this to the 9.0 milestone Dec 6, 2024
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@AAwouters : I tested and reviewed this today. It works great! I verified that it fixes all the accessibility bugs mentioned in the description, and verified that I can now move bitstreams using only the keyboard.

That said, I found a single console.log which needs to be removed before we merge this. Once you delete it, I will officially approve this and merge it.

@AAwouters AAwouters force-pushed the item-edit-bitstreams-table-main branch from 430f716 to cc70eaa Compare December 11, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility bug claimed: Atmire Atmire team is working on this issue & will contribute back funded Task is funded via the DSpace Development Fund
Projects
Status: 👍 Reviewer Approved
4 participants