Skip to content

feat: Add option to collapse the Transcript panel#3802

Open
wahajahmed010 wants to merge 1 commit into
code-charity:masterfrom
wahajahmed010:master
Open

feat: Add option to collapse the Transcript panel#3802
wahajahmed010 wants to merge 1 commit into
code-charity:masterfrom
wahajahmed010:master

Conversation

@wahajahmed010
Copy link
Copy Markdown

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.

- Change transcript setting from boolean to enum (normal, collapsed, hidden)
- Add collapse functionality when 'collapsed' option is selected
- Update appearance.js to handle new states
- Update core.js to collapse transcript when set to 'collapsed' state
@rajanarahul93
Copy link
Copy Markdown
Contributor

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

@wahajahmed010
Copy link
Copy Markdown
Author

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.

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