af32a36f1c75a55813bcacf4746e3b08080508f5
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e439ccd102 |
spotify-lyrics (#214)
* Add spotify-lyrics plugin * fix(spotify-lyrics): resolve race conditions and add plugin_api * fix(spotify-lyrics): update plugin_api to 3 * fix(spotify-lyrics): resolve github actions validation errors * fix(spotify-lyrics): resize thumbnail to 960x540 to fix validation error * fix(spotify-lyrics): bump version to 1.2.1 * fix(spotify-lyrics): update namespace and replace misleading thumbnail * fix(spotify-lyrics): declare runtime dependencies in plugin.toml and update README requirements * feat(lyrics): implement dynamic panel width sizing * Revert "feat(lyrics): implement dynamic panel width sizing" This reverts commit ef91e6f9f688df7deeb41ba9e5c7606a4904b47a. * feat(spotify-lyrics): implement dynamic panel width sizing * fix(spotify-lyrics): correct target width pre-calculation for upcoming lines * fix(spotify-lyrics): prevent vertical spill by enforcing maxLines=1 * fix(spotify-lyrics): implement dynamic height resizing to encapsulate wrapped text * fix(spotify-lyrics): remove horizontal cap to prevent vertical spill * fix(spotify-lyrics): restore minHeight and implement perfectly safe wrapping height prediction * fix(spotify-lyrics): lock panel width and use vertical dynamic resizing exclusively * fix(spotify-lyrics): implement dynamic font scaling and remove panel dimension animations * fix(spotify-lyrics): restore robust dynamic height logic and discard font scaling * refactor(spotify-lyrics): rewrite height estimation and clean up codebase Root cause: the charUnits per-character width estimation consistently underestimated real rendered widths because the 0.80 multipliers in getLineWidth and getLinesCount cancelled each other out, making the effective calculation ignore the safety margin entirely. Fix: replaced the complex charUnits/toChars/getLineWidth machinery with a simple #text / chars-per-line heuristic using a conservative 0.60x character width factor. This reliably overestimates line count, ensuring the panel always allocates enough height for wrapped text. Quality of life improvements: - Split monolithic render() into renderEmpty/renderPaused/renderPlaying - Reduced update interval from 33ms (30 FPS) to 100ms (10 FPS) - Removed file-read timer (reads every frame at lower FPS instead) - Added clear section headers and inline documentation - Removed all dead code (charUnits, toChars, getLineWidth, etc.) * fix(spotify-lyrics): set panel height=280 in plugin.toml — the actual fix The root cause of the lyrics spilling was never in the Lua code. Noctalia panels are sized exclusively by plugin.toml, not by minHeight on the column layout. Since we had removed width/height from plugin.toml to make sizing 'dynamic', noctalia used a tiny default that couldn't contain wrapped lyrics. minHeight on ui.column had zero effect on the actual panel window size. Set height=280 to comfortably fit 3 lyrics lines even when they wrap. * feat(spotify-lyrics): add dynamic font scaling for long lyrics Long lyrics (>40 chars) now get progressively smaller fonts: - Every 15 chars beyond 40 reduces font by 2px - Minimum font: 10px (panel) / 11px (widget) This prevents vertical overflow regardless of container size by ensuring long lines take up less vertical space when they wrap. * fix(spotify-lyrics): fix plugin IDs and tilde path expansion - Updated bar.luau to toggle correct panel ID - Replaced ~ in noctalia.readFile with absolute path since Lua doesn't auto-expand it - Updated plugin.toml height to 280 and id to noctalia/spotify-lyrics * Fix UI bugs, implement reactive updates, and add album art * Fix plugin manifest validation errors * fix(spotify-lyrics): address PR review comments - Change plugin id from noctalia/ to goatnath/ namespace - Declare runtime dependencies: playerctl, python3, syncedlyrics - Replace hardcoded /home/goatnath path with noctalia.expandPath() - Add [[desktop_widget]] manifest entry for widget.luau - Rewrite README to follow README_TEMPLATE.md structure - Update all references to use corrected plugin id --------- Co-authored-by: goatnath <aadinathkeshav1978@gmail.com> |