fix(review): address review blockers from PR #475
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 3m51s
CI / OCR Service Tests (pull_request) Successful in 47s
CI / Backend Unit Tests (pull_request) Failing after 3m31s
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 3m51s
CI / OCR Service Tests (pull_request) Successful in 47s
CI / Backend Unit Tests (pull_request) Failing after 3m31s
- CommentData.java: add @Nullable on annotationId to match codebase convention - DashboardService: isEmpty() → isBlank() for commentPreview null-guard - ChronikRow.svelte: always set aria-label on comment rows (not only when preview present) - ChronikRow.svelte.spec.ts: add test for aria-label on comment row without preview Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -149,7 +149,7 @@ public class DashboardService {
|
|||||||
UUID commentId = row.getCommentId();
|
UUID commentId = row.getCommentId();
|
||||||
CommentData commentData = commentId != null ? commentDataByComment.get(commentId) : null;
|
CommentData commentData = commentId != null ? commentDataByComment.get(commentId) : null;
|
||||||
UUID annotationId = commentData != null ? commentData.annotationId() : null;
|
UUID annotationId = commentData != null ? commentData.annotationId() : null;
|
||||||
String commentPreview = commentData != null && !commentData.preview().isEmpty()
|
String commentPreview = commentData != null && !commentData.preview().isBlank()
|
||||||
? commentData.preview() : null;
|
? commentData.preview() : null;
|
||||||
return new ActivityFeedItemDTO(
|
return new ActivityFeedItemDTO(
|
||||||
org.raddatz.familienarchiv.audit.AuditKind.valueOf(row.getKind()),
|
org.raddatz.familienarchiv.audit.AuditKind.valueOf(row.getKind()),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.raddatz.familienarchiv.document.comment;
|
package org.raddatz.familienarchiv.document.comment;
|
||||||
|
|
||||||
|
import jakarta.annotation.Nullable;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public record CommentData(UUID annotationId, String preview) {}
|
public record CommentData(@Nullable UUID annotationId, String preview) {}
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ const rowHref: string = $derived(
|
|||||||
<a
|
<a
|
||||||
href={rowHref}
|
href={rowHref}
|
||||||
data-variant={variant}
|
data-variant={variant}
|
||||||
aria-label={variant === 'comment' && item.commentPreview
|
aria-label={variant === 'comment'
|
||||||
? `${m.chronik_comment_added({ actor: actorName, doc: docTitle })} — ${item.commentPreview}`
|
? item.commentPreview
|
||||||
|
? `${m.chronik_comment_added({ actor: actorName, doc: docTitle })} — ${item.commentPreview}`
|
||||||
|
: m.chronik_comment_added({ actor: actorName, doc: docTitle })
|
||||||
: undefined}
|
: undefined}
|
||||||
class="group flex items-start gap-3 p-3 transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:outline-none
|
class="group flex items-start gap-3 p-3 transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:outline-none
|
||||||
{variant === 'for-you' ? 'border-l-[3px] border-accent bg-accent-bg/10' : ''}"
|
{variant === 'for-you' ? 'border-l-[3px] border-accent bg-accent-bg/10' : ''}"
|
||||||
|
|||||||
@@ -229,6 +229,18 @@ describe('ChronikRow', () => {
|
|||||||
expect(link?.getAttribute('aria-label')).toContain('A wonderful letter from grandma');
|
expect(link?.getAttribute('aria-label')).toContain('A wonderful letter from grandma');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('link still has aria-label for comment variant when commentPreview is absent', async () => {
|
||||||
|
const item: ActivityFeedItemDTO = {
|
||||||
|
...baseItem,
|
||||||
|
kind: 'COMMENT_ADDED',
|
||||||
|
commentPreview: undefined
|
||||||
|
};
|
||||||
|
render(ChronikRow, { item });
|
||||||
|
const link = document.querySelector('a[aria-label]');
|
||||||
|
expect(link).not.toBeNull();
|
||||||
|
expect(link?.getAttribute('aria-label')).not.toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
// --- robustness: title rendering for edge cases ---
|
// --- robustness: title rendering for edge cases ---
|
||||||
it('still renders the row link when documentTitle is an empty string', async () => {
|
it('still renders the row link when documentTitle is an empty string', async () => {
|
||||||
// Felix: verbText.indexOf(docTitle) returned 0 for empty titles — the span
|
// Felix: verbText.indexOf(docTitle) returned 0 for empty titles — the span
|
||||||
|
|||||||
Reference in New Issue
Block a user