Skip to content

Conversation

siverne
Copy link
Member

@siverne siverne commented Nov 13, 2026

Follow-up to #54.

.message:empty { display: none; } hid the status message when it was empty. Several screen readers
stop watching a region that is hidden that way, so «Dommen er lagret» was never announced. The rule
is removed; an empty paragraph takes almost no space.

Also adds tests for StudentReviews: the average, the distribution, the newest reviews, saving,
updating, deleting, a failed save, a failed fetch and axe. One of them checks that the live region
is in the DOM and empty before saving, so this cannot happen again. The review list also got an
aria-label, so screen readers say «Studentenes dommer, liste».

Tested: npm run check passes.

@siverne siverne requested a review from a team as a code owner November 13, 2026 10:46
@siverne
Copy link
Member Author

siverne commented Nov 14, 2026

The status

is outside every condition now, so it is never replaced. The hook exposes hasData, and the skeleton only shows on the first load (loading && !hasData), so a refetch keeps the content and the focus.
The test checks the element it grabbed before saving.
The empty paragraph is visually hidden (absolute + clip-path) instead of removed from layout, so it adds no grid gap but stays in the accessibility tree.
.message is back in the CSS.
The list uses aria-labelledby on the

instead of repeating the text.

Copy link
Member

@williasc williasc left a comment

Choose a reason for hiding this comment

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

Looks great. Requested changes were fixed

@williasc williasc merged commit 71882b2 into main Nov 16, 2026
@williasc williasc deleted the 51-fix-live-region branch November 16, 2026 10:56
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants