Skip to content

fix(lyrics-plus): fall back when legacy resize host is missing - #4017

Open
hayktonoy wants to merge 2 commits into
spicetify:mainfrom
hayktonoy:fix/lyrics-plus-resize-host
Open

hayktonoy wants to merge 2 commits into
spicetify:mainfrom
hayktonoy:fix/lyrics-plus-resize-host

Conversation

@hayktonoy

@hayktonoy hayktonoy commented Oct 5, 2026 •

Copy link
Copy Markdown

Opening Lyrics Plus on Spotify 1.3.3.264 with Spicetify 2.45.3 can crash the entire view with TypeError: Cannot read properties of null (reading 'clientWidth') in TopBarContent. In the affected layout, .Root__main-view is absent, so none of the existing resize-host selectors match.

Keep the existing selectors as the first choice, then fall back to the main content element and finally the document root. This gives the width measurement and ResizeObserver a valid element while preserving existing behavior on older layouts.

Related historical report: #2381. This reproduces the same exception on the current Windows client; the issue is already closed.

Validation:

  • Reproduced the crash in Windows Spotify 1.3.3.264 with Spicetify 2.45.3 and inspected the missing selector in DevTools.
  • Applied the equivalent fix locally and verified that Lyrics Plus opens, synced lyrics display on a vocal track, and an instrumental track displays its instrumental state.
  • Ran a focused Node VM check covering legacy-host priority, main-element fallback, document-root fallback, resize updates, and observer cleanup. The unmodified source reproduces the null/clientWidth exception; the patched source passes all scenarios.
  • node --check CustomApps/lyrics-plus/TabBar.js and git diff --check pass.

Summary by CodeRabbit

  • Bug Fixes
    • Improved resizing behavior in Lyrics Plus. When the usual resize area is unavailable, resizing now falls back to the main page area to help keep the layout responsive.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: spicetify/cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21e88e13-9339-4add-b6f0-1c2c9c09f454
📥 Commits

Reviewing files that changed from the base of the PR and between 8c92e30 and f1e1499.

📒 Files selected for processing (1)
  • CustomApps/lyrics-plus/TabBar.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

TopBarContent now checks main and then document.documentElement when its main-view resize-host selectors do not find an element.

Changes

Lyrics Plus resize host

Layer / File(s) Summary
Resize host fallback
CustomApps/lyrics-plus/TabBar.js
TopBarContent falls back to main, then document.documentElement, if its main-view resize-host selectors find no element.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f1e14

The fallback targets preserve the existing resize-observation path, and no concrete user-visible regression is established. The change appears mergeable with normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a fallback when the legacy resize host is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant