Skip to content

Conversation

@williamchong
Copy link
Member

image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds navigation arrows to the carousel modal, allowing users to navigate between carousel items directly from the modal view without closing it.

Changes:

  • Replaced direct modal item ref with index-based tracking for navigation support
  • Added left/right chevron navigation buttons to the modal with semi-transparent styling
  • Implemented circular navigation logic that wraps around at carousel boundaries

Comment on lines 96 to 109
<UButton
icon="i-material-symbols-chevron-left"
color="neutral"
variant="ghost"
class="absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(-1)"
/>
<UButton
icon="i-material-symbols-chevron-right"
color="neutral"
variant="ghost"
class="absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(1)"
/>
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The navigation arrows are always displayed, even when there's only one item in the carousel. The carousel itself only renders when carouselItems.length > 1 (line 3), but the modal with navigation arrows will still appear when clicking on a single BookCover (the else branch starting at line 115). The buttons should be conditionally rendered based on whether there are multiple items to navigate through.

Copilot uses AI. Check for mistakes.
Comment on lines 96 to 109
<UButton
icon="i-material-symbols-chevron-left"
color="neutral"
variant="ghost"
class="absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(-1)"
/>
<UButton
icon="i-material-symbols-chevron-right"
color="neutral"
variant="ghost"
class="absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(1)"
/>
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The navigation buttons lack accessible labels for screen readers. Icon-only buttons should include aria-label attributes to describe their purpose for users relying on assistive technology. Add aria-label="Previous" to the left button and aria-label="Next" to the right button (or use appropriate internationalized strings).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

:alt="props.alt"
class="w-full h-auto max-h-[80vh] object-contain"
>
<div class="relative">
Copy link
Member

Choose a reason for hiding this comment

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

why not add relative to content slot

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +172 to +175
function navigateModal(direction: number) {
const len = carouselItems.value.length
modalItemIndex.value = (modalItemIndex.value + direction + len) % len
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Consider adding keyboard navigation support (ArrowLeft/ArrowRight keys) for improved accessibility and user experience. The PDFReader component (components/PDFReader.vue:571-593) implements keyboard navigation using event listeners. This would allow users to navigate through carousel items using keyboard shortcuts in addition to clicking the arrow buttons.

Copilot uses AI. Check for mistakes.
Comment on lines +101 to +111
class="absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(-1)"
/>
<UButton
icon="i-material-symbols-chevron-right"
color="neutral"
variant="ghost"
aria-label="Next"
class="absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 text-white hover:bg-black/70 cursor-pointer"
@click="navigateModal(1)"
/>
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The cursor-pointer class is redundant for UButton components as buttons already have pointer cursor by default. This is a minor styling nit and doesn't affect functionality.

Copilot uses AI. Check for mistakes.
@williamchong williamchong merged commit 20b13ba into likecoin:develop Feb 2, 2026
7 checks passed
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.

2 participants