Skip to content

[dtq-dev-93] Fix file preview focus and community tree levels - #1758

Open
milanmajchrak wants to merge 4 commits into
dtq-dev-93from
93/fe-item-view-a11y
Open

milanmajchrak wants to merge 4 commits into
dtq-dev-93from
93/fe-item-view-a11y

Conversation

@milanmajchrak

@milanmajchrak milanmajchrak commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

References

No dtq-dev source for the focus fix. The MD5 row for a file without a description is fixed by FE 1749 (port of the dtq-dev item page fixes), which shows N/A for an empty description. The community tree bug is new in DSpace 9 and is not fixed upstream yet (DSpace/dspace-angular main has the same tree code).

Description

Two small accessibility fixes: focus returns to Preview after the file preview closes, and the community tree reports the right levels to screen readers.

Instructions for Reviewers

List of changes in this PR:

  • FileDescriptionComponent: the close control of the preview panel calls a new closePreview(). It collapses the panel and focuses the Preview control. Before, the close control was hidden with the panel and focus fell to the page body.
  • CommunityListComponent: <cdk-tree> gets expansionKey, the node id, like trackBy. The tree builds new node objects on every reload, but a kept row holds its first one. CDK 20 looks up aria-level, aria-posinset and aria-setsize by that key, so kept rows read level 1 after a community expanded or after "Show more".
  • New specs for both. Each fails on the old code.

How to test:

  1. Open an item with a previewable file (text or archive). Tab to Preview and press Enter. Tab to the close control and press Enter. Focus is on Preview, not on the page.
  2. Open /community-list. Expand one community, then another. In DevTools the children of the first one still have aria-level="2". Click "Show more" under a community with many collections: the kept collections still have aria-level="2".
  • npm run test -- --include=src/app/item-page/simple/field-components/preview-section/file-description/file-description.component.spec.ts --include=src/app/community-list-page/community-list/community-list.component.spec.ts

Codex review (gpt-6.2-sol, high): 1 finding, not changed. It is about duplicate collections when two pages of the tree overlap. The base already keys tree rows by id through trackBy, so this PR does not change that case.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

🤖 Generated with Claude Code

milanmajchrak and others added 4 commits November 26, 2026 14:14
The close control is hidden with the preview panel, so focus fell to the page body.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An empty value now clears its floated label, as Bootstrap 3 dl-horizontal did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tree now keys rows by id, so kept rows no longer report aria-level 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The port of the dtq-dev item page fixes shows N/A for an empty description,
so the value is never empty and the MD5 row stays in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@milanmajchrak milanmajchrak changed the title [dtq-dev-93] Fix file preview focus, MD5 row and community tree levels [dtq-dev-93] Fix file preview focus and community tree levels Nov 26, 2026
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.

1 participant