Skip to content

Feat: prev next buttons when watching videos#161

Draft
giou wants to merge 14 commits into
Segergren:mainfrom
giou:feat/video-prev-next
Draft

Feat: prev next buttons when watching videos#161
giou wants to merge 14 commits into
Segergren:mainfrom
giou:feat/video-prev-next

Conversation

@giou

@giou giou commented Jun 12, 2026

Copy link
Copy Markdown

Works with PGDN/PGUP too.

Anonymous and others added 12 commits June 8, 2026 00:47
The Compress option was only shown for Clip and Highlight types.
Added Lowlight to the condition so the dropdown menu matches
the other content types (Copy, Rename, Open File Location,
Compress, Delete).
Both buttons were only shown for Clip/Highlight/Buffer types.
Added Lowlight to match the full dropdown (Upload with yellow text,
Copy, Rename, Open File Location, Compress, Delete).
Adds Previous and Next buttons to the video player controls in Full
Sessions, Clips, Highlights, and Lowlights. The buttons sit inside the
existing join control box, flanking the -5s / Play-Pause / +5s cluster
on the left and right.

- Navigation iterates videos of the same type, ordered newest-first to
  match the ContentPage default
- Buttons disable at the ends of the list
- PageUp / PageDown keyboard shortcuts mirror the button behaviour
- aria-labels added for accessibility
- Bonus: adds aria-labels to the existing -5s/Play/Pause/+5s buttons
The window keydown handler captured currentVideoIndex via closure and was
re-attached whenever hasPrevious/hasNext changed. In practice the
captured index could go stale on the very next video switch, so the
shortcut only worked once for each direction before becoming a no-op.
The on-screen buttons (which call setSelectedVideo via the same
component) were fine.

Resolve by routing the shortcut through a navRef that always holds the
latest sameTypeVideos and currentVideoIndex, so the handler (registered
once on mount) reads fresh state on every keystroke. Also add e.repeat
guards so holding PageDown doesn't mash the queue.
Adds 'Lowlight' to the video.type check that gates the Upload and Copy
buttons in the video player toolbar, so lowlights behave the same as
highlights and clips.
- menu.tsx: respect the sidebar visibility toggle for Lowlights like the
  other items, while still gating the menu by enableLowlights. Splits the
  old behaviour into 'item.visible && settings.enableLowlights', so users
  who turn the feature off get the item hidden in any state, and users
  who leave it on get the standard sidebar toggle behaviour plus the
  default placement (above Settings).
- LowlightsSection.tsx: drop the inner 'box inside a box' wrapper so the
  section layout matches HighlightsSection exactly.
@giou giou marked this pull request as draft June 12, 2026 21:50
Anonymous added 2 commits June 12, 2026 23:00
The previous/next buttons (and PageUp/PageDown shortcuts) iterated over
videos of the same type ordered newest-first. That ignored whatever
filter (game checkboxes) or sort the user had selected on the content
page, so a Next click while sorted by Size jumped to a date-adjacent
video instead of the next heaviest one.

Pull the filter+sort pipeline out of ContentPage into a shared
SectionView helper (filterAndSortContent + per-section localStorage
readers + ContentType -> sectionId map). ContentPage and video.tsx now
share the exact same iterator, so prev/next walks the visible content
list in the same order/cut the user sees on the page.

If a filter excludes the currently-playing video, prev/next are
disabled at the boundaries — surfacing the filter gap is better than
silently jumping to an unrelated neighbour.

Also tidy ContentPage to drop its duplicated ordering code.
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