Skip to content

(fix): music-lyrics-share-and-header-truncation - #880

Open
Captain-Vikram wants to merge 6 commits into
Flow-Tube:mainfrom
Captain-Vikram:fix/music-lyrics-share-and-header-truncation
Open

Captain-Vikram wants to merge 6 commits into
Flow-Tube:mainfrom
Captain-Vikram:fix/music-lyrics-share-and-header-truncation

Conversation

@Captain-Vikram

Copy link
Copy Markdown
Contributor

Summary

This PR bundles five targeted stability, UI, settings UX, and performance fixes across the music player, DASH playback teardown, settings layout, and Rust IPC filtering:

  1. Prevent LyricsShareDialog crash on track auto-advance (src/components/music/lyrics/LyricsShareDialog.tsx):

    • Pinned song, lines, and playingIndex on dialog open (matching the picker's "read once" intent) and guarded selected index lookups via flatMap.
    • Previously, auto-advancing to the next track while on the "style" step cleared useLyricsStore underneath selected, throwing TypeError: Cannot read properties of undefined (reading 'text').
    • Added a regression test in src/components/music/lyrics/LyricsShareDialog.test.ts.
  2. Fix "Playing from ..." header pill vertical clipping (src/components/music/sheet/FullLayer.tsx):

    • Replaced line-clamp-1 with truncate (whitespace-nowrap overflow-hidden text-ellipsis) on the "Playing from ..." <p> element.
    • Previously, combining line-clamp-1 with py-2 allowed a wrapped second line of a long title to peek into and clip inside the bottom padding of the pill.
  3. Abort pending dash.js XHRs before destroy (src/components/player/Player.tsx):

    • Tracked in-flight XMLHttpRequest instances via RequestModifier.modifyRequestHeader and aborted them during effect cleanup before calling player.destroy(), preventing dash.js manifest callbacks from throwing an unhandled TypeError: Cannot read properties of null (reading 'load') during rapid video switches or unmount.
  4. Surface Shorts & Music visibility toggles at the top of Settings (src/components/settings/tabs/ContentTab.tsx, src/components/settings/tabs/MusicTab.tsx):

    • Moved the Shorts and Music groups to the top of Content & UI so master switches (Show Shorts, Show Music) appear before dependent toggles (Shorts shelf, Home Shorts shelf, Hide watched Shorts).
    • Added Show Music (music_content_enabled) to the top of the Music settings tab for direct discoverability.
  5. Filter disabled Shorts & Music content on the backend before IPC (src-tauri/src/db/settings.rs, src-tauri/src/db/watch_history.rs, src-tauri/src/commands/db.rs, src-tauri/src/commands/youtube.rs):

    • Added db::settings::is_enabled and db::watch_history::get_filtered_watch_history (filtering is_short = 0 / is_music = 0 in SQLite for get_watch_history, with a new filters_shorts_and_music_in_sql unit test).
    • Stripped is_short items from search_videos and get_subscription_rss_feed / stream_subscription_rss_feed responses when shorts_content_enabled is off (after recording known_shorts), and cleared description_extras.music in get_video_details when music_content_enabled is off.

Related issue

Closes #804

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Documentation
  • Build, packaging, or CI

Validation

Ran on Windows 11 (x64):

  • pnpm test (vitest run: SettingsLayout.test.ts 4/4 passed after final Settings edit; LyricsShareDialog.test.ts 6/6 and full 503-file / 2912-test suite passed after the earlier frontend fixes)
  • pnpm build (tsc --noEmit + vite build passed after final frontend edit)
  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check (passed after final Rust edit)
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features (cargo clippy --lib --tests compiled with 0 errors; --all-targets --all-features not run)
  • cargo test --manifest-path src-tauri/Cargo.toml --all-targets --all-features (db::watch_history compiled cleanly; local Windows test runner hit 0xc0000139 STATUS_ENTRYPOINT_NOT_FOUND in shell)
  • I smoke-tested the affected desktop behavior.

Screenshots or recordings

Before ("Playing from ..." pill wrapping & clipping "Only" into bottom padding):

image

Risk and compatibility

  • No database migrations or schema changes; get_filtered_watch_history uses existing is_short and is_music columns.

  • Existing internal callers of db::watch_history::get_watch_history (such as shorts_engine.rs) remain unchanged.

  • known_shorts and home_feed caches continue to record Shorts metadata before IPC filtering.

  • No new secrets, private data, telemetry, or broad Tauri permissions were introduced.

  • User-facing documentation was updated where needed.

  • Dependency and lockfile changes are intentional and limited to this PR.

  • Breaking changes and upgrade steps are clearly documented.

This branch has not been deployed

No deployments
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.

[Bug]: Full music player "Playing from" header pill clips wrapped second line when title is long

1 participant