From c3c58e84c69a51de8e7695197481c9e4978a1110 Mon Sep 17 00:00:00 2001 From: "Dr.Vegapunk1337" <44306276+FieteGM@users.noreply.github.com> Date: Fri, 29 May 2026 00:21:45 +0200 Subject: [PATCH 1/5] Refactor sidebar bundle, add i18n sweep, popup resize, JS fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Module extraction - Extract bingewatcher.py helpers into bw/{constants,settings_types, shutdown,session,episode_logic,player_loop}.py - Move sidebar JS out of inline Python r-strings into bw/assets/ (sidebar_inject.js, sidebar_polish.js, continue_watching.js) - Split sidebar_inject.js into 7 chunk files under bw/assets/sidebar/ and aggregate via bw/ui/{header,series_list,cast_modal,tools_menu, settings_panel}.py. bw/ui_sidebar.py becomes a re-export shim. - bingewatcher.py shrinks ~10.5k -> ~8.8k lines Test + lint infrastructure - Add tests/ with pytest wrappers around the legacy selftest_phase*.py modules, plus targeted suites (imports, i18n parity, settings validation, JS asset integrity, shutdown markers, episode logic, Selenium smoke against tests/fixtures/jw_player.html) - pyproject.toml: ruff + mypy config, per-file overrides - pytest.ini: slow marker for live-network tests - .github/workflows/ci.yml: lint, typecheck, fast+slow matrix - scripts/_split_sidebar_inject.py, _extract_player_loop.py and friends — reproducible build steps for the JS chunking and the play_loop helper-binding migration JS bug fixes - Fix 8 SyntaxErrors in sidebar_inject.js where i18n fallback expressions used template literal ${...} syntax inside single-quoted strings instead of backticks (privacy popover, cast modal, audio hint, bookmarks label). Validated with node --check. UX polish - Add window.__bwAttachResize helper: bottom-right grip on Tools, Settings, and SeriesSkip popups. Minimum size = default; max = viewport - 16. Persists per-popup to localStorage. Double-click to reset. - Tools menu: drag handle on TOOLS heading with grip glyph + drag hint, close X anchored right via margin-left:auto - Settings panel: width bumped 480 -> min(540, viewport-40); X pinned to right edge; dropdowns get fixed 180px column, color-scheme:dark + custom chevron + dark-styled