Skip to content

Add in-window browser-style tabs - #9692

Closed
adro0303 wants to merge 2 commits into
FreeTubeApp:developmentfrom
adro0303:tabs-feature
Closed

Add in-window browser-style tabs#9692
adro0303 wants to merge 2 commits into
FreeTubeApp:developmentfrom
adro0303:tabs-feature

Conversation

@adro0303

@adro0303 adro0303 commented Aug 25, 2026

Copy link
Copy Markdown

Refs #333.

Scoped to in-window tabs only (no drag-out to a new window, no split view) - see discussion in #333, which is locked so I couldn't comment there directly.

Screencastfrom2026-08-2517-09-42-ezgif com-video-to-gif-converter
  • Ctrl/Cmd+click or middle-click on a video/channel/playlist link opens it in a background tab, without navigating away or autoplaying
  • Video only starts playing once you switch into that tab
  • Shift+click keeps opening a new OS window (unchanged)
  • Ctrl+T / Ctrl+Shift+W / Ctrl+Tab / Ctrl+Shift+Tab for new/close/next/previous tab

Opening as a draft for early feedback on the approach before going further.

Ctrl/Cmd+click and middle-click open internal links in a background tab
instead of a new window; tabs don't play until switched into. Uses Vue
Router's per-route KeepAlive so switching tabs is instant. Refs FreeTubeApp#333.
@adro0303
adro0303 marked this pull request as ready for review August 25, 2026 15:16
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 25, 2026 15:16
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 25, 2026
@adro0303
adro0303 marked this pull request as draft August 25, 2026 15:17
auto-merge was automatically disabled August 25, 2026 15:17

Pull request was converted to draft

@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 25, 2026
Several distinct issues could leave a video's audio playing from a tab
that's no longer visible, or cause a tab to reload/duplicate a player:

- beforeRouteLeave's pause-vs-destroy decision didn't account for the
  closing tab having just been removed from the tabs list, so closing
  the active tab while others stayed open could leave its player merely
  paused (and un-destroyed) instead of torn down.
- App.vue's KeepAlive key formula branched on the current tab count, so
  opening/closing any tab could silently change the key of whatever
  video was on screen and force an unwanted remount mid-playback; it's
  now keyed by each tab's own stable id instead.
- Vue doesn't pause a component's plain `watch()` subscriptions just
  because KeepAlive deactivated it, so switching back to an already-open
  tab could re-trigger Watch.js's `$route` watcher and reload a
  perfectly fine, already-loaded player; it's now guarded by comparing
  against the fullPath already loaded.
- Closing a tab that wasn't the active one never destroyed its player,
  since nothing navigates away from a background tab close - it's now
  torn down via a direct Vuex mutation subscription.
- Vue Router treats navigating between two videos (same `/watch/:id`
  route, different params) as an in-place update, not a leave, so
  `beforeRouteLeave` (and the autoplay-countdown cancellation inside it)
  never ran for a tab switch between two watch tabs - a "play next
  video" countdown left running from a tab that finished playing right
  before being backgrounded could later fire and hijack whatever tab is
  currently on screen. Now cancelled on deactivate too.
- Opening several tabs without waiting for each to finish loading before
  switching away backgrounds them before their player exists, so
  `deactivated` had nothing to pause; the player they mount once loading
  finishes could then autoplay unattended. Now suppressed via a
  foreground check on load completion.

Also adds a small collapse/fade transition to the tab bar instead of it
appearing/disappearing abruptly when going to/from a single tab.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W7w6acz9RQvViSQdvRcEES
@adro0303

Copy link
Copy Markdown
Author

Hi, I noticed the policy-violation label was added but there's no comment explaining what triggered it — could you clarify what the concern is so I can address it? Happy to talk through the approach/scope, or anything else, if that helps.

@Shadorc

Shadorc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Hello,
When creating this MR, you've probably removed the header of the template without reading it, it would have answered your question:

<!-- Thanks for sending a pull request! Make sure to follow the contributing guidelines. -->
<!-- Important note, we may remove your pull request if you do not use this provided PR template correctly. -->
<!-- Do not create PR's with AI! (PRs created mainly with AI will be closed. They waste our team's time. We ban repeat offenders.) -->

@adro0303

Copy link
Copy Markdown
Author

Hi, thanks for the clarification - you're right, I missed that line in the template, sorry about that.

To be upfront about it: I've been away from home without my laptop, so I put this together from my phone with Claude Code's help. Once I'm back I'll go through it and push it manually myself. In the meantime everything proposed has been reviewed and tested by me in the running app - I've been reporting back real, reproducible issues I hit while testing and asking for them to be fixed at the root rather than accepting whatever was first suggested, trying to follow clean code practices and the rest of the guidelines here throughout.

Let me know if you'd still rather I close this for now and reopen once it's fully hand-pushed - happy to do that if that's preferred.

@Shadorc

Shadorc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

You also missed the second line, which applies for drafts too:

Important note, we may remove your pull request if you do not use this provided PR template correctly.

Talking about drafts, I don't really see the purpose of reviewing a draft MR written by an AI if it will be rewritten manually later. You don't have to rush to open a MR!

If you have implementation questions regarding #333, feel free to join the Matrix server, it will be more suited than opening a prototype draft.

@adro0303

Copy link
Copy Markdown
Author

Fair enough, that makes sense - I'll close this for now. This is actually my first time contributing to open source, and I got a bit ahead of myself with the draft, but it was with the best of intentions. I'll join the Matrix server if I have implementation questions, and open a fresh PR once I've gone through it manually. Thanks for the pointers.

@adro0303 adro0303 closed this Aug 26, 2026
@Shadorc

Shadorc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I did the same mistake for my first contributions to this project, so I totally understand
Welcome to open source!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants