2026-06-10-claude-move-to-top-inserts-after-top.md 1.2 KB

Session Report: Move "Move to Top" to insert after top

Request

in the popup main view, the menu has a "move to top" button, which brings the video to the "top" of the playlist. I would like to modify it to move it to the position after the top of the playlist.

Changes

File: popup/popup.js

Three targeted edits:

  1. Insertion position in moveVideoToTop(): changed playlist.splice(topPosition, 0, video)playlist.splice(topPosition + 1, 0, video) so the video lands right after the current top video instead of displacing it.

  2. Early-return guard in moveVideoToTop(): updated if (index === topPosition) returnif (index === topPosition + 1) return to match the new target position.

  3. Disabled binding in moveToTopButton: changed return index === topPositionreturn index === topPosition + 1 so the button disables when the video is already at the 2nd (post-top) position.

The button label "Move to Top" was kept as-is per user preference.

The change applies to both the main playlists view and the individual playlist view since both share the same moveToTopButton binding and moveVideoToTop() function.