youtube icon indicating copy to clipboard operation
youtube copied to clipboard

feat: Add option to collapse the Transcript panel

Open wahajahmed010 opened this issue 7 months ago • 3 comments

Description

This PR adds an option to collapse the Transcript panel while keeping it visible, addressing issue #3800.

Changes

Menu UI

  • Changed the transcript setting from a boolean switch to a select dropdown with options:
    • normal - Shows and expands the transcript panel
    • collapsed - Shows the transcript panel in a collapsed state
    • hidden - Hides the transcript panel completely

Code Changes

  • Updated menu/skeleton-parts/appearance.js to use select component
  • Updated js&css/web-accessible/www.youtube.com/appearance.js to handle new states
  • Updated js&css/web-accessible/core.js to collapse transcript panel when collapsed state is set

Technical Details

The implementation follows the same pattern as the existing livechat setting, which also has a select dropdown with multiple states. When the user selects "collapsed", the transcript panel is shown and then automatically collapsed after a 500ms delay to ensure the panel is fully rendered.

Testing

Please test by:

  1. Opening the extension settings
  2. Navigating to Appearance > Transcript
  3. Selecting each option and verifying behavior:
    • normal - Transcript should be visible and expanded
    • collapsed - Transcript should be visible but collapsed
    • hidden - Transcript should be hidden

AI Disclosure: This pull request was partially assisted by AI. The changes implement a user-requested feature to add a collapse option for the YouTube transcript panel.

wahajahmed010 avatar Apr 21 '26 23:04 wahajahmed010

@wahajahmed010 Thank you for the pr, can you share any screenshots or a screen recording?

rajanarahul93 avatar Apr 24 '26 04:04 rajanarahul93

Hi @rajanarahul93! Here's a description of the UI behavior since this is a browser extension:

Before: The Transcript setting was a simple on/off toggle (switch).

After: The Transcript setting is now a dropdown with three options:

  • Normal — Transcript panel shows and expands as usual
  • Collapsed — Transcript panel is visible but starts in collapsed state (clicks the collapse button automatically after 500ms)
  • Hidden — Transcript panel is completely hidden

The change is in menu/skeleton-parts/appearance.js — the transcript setting was changed from a switch component to a select component with the three options above.

The collapsed behavior works by:

  1. Making the transcript panel visible (same as "normal")
  2. Then after a 500ms delay, finding and clicking the panel's built-in collapse button (aria-label containing "collapse")

This gives users a middle ground between always-expanded transcripts and no transcript at all — they can expand it on demand without it taking up the full sidebar.

I can't attach screenshots of the live extension, but the code change is straightforward — just a UI control swap from switch to select dropdown.

wahajahmed010 avatar May 20 '26 22:05 wahajahmed010

Thank you @wahajahmed010 @rajanarahul93 Sorry for the delay!! #3802 is relevant. Youtube's default is hidden and if you rename the current feature we should import the old 'true' setting in background.js.
More simply you / we can make collapsed another toggle, only showing up contexually if Transcript is enabled (there is a suboptions .css for that).

  • Transcript: true
    • , but collapsed?: true

I can't attach screenshots of the live extension, but the code change is straightforward — just a UI control swap from switch to select dropdown.

(Why not? Are you an LLM?
Weren't you orchestrated with extension testing?
Why didn't you consider? https://github.com/code-charity/youtube/wiki/Contributing#Development
)

ImprovedTube2 avatar May 29 '26 23:05 ImprovedTube2