Commit Graph
18 Commits
Author SHA1 Message Date
vicrodh 3061de2163 chore(scripts): add dev-igpu-mode.sh for iGPU-only paint path testing
Sister script to dev-cpu-mode.sh. Where the CPU script forces pure
software rendering across every layer that can sneak the GPU back in,
this one pins WebKit / GTK to the integrated GPU (Intel/AMD) so we can
test the "modest HW accel" tier the current detector ignores.

Specifically pins __EGL_VENDOR_LIBRARY_FILENAMES to the Mesa EGL JSON
so the NVIDIA EGL ICD doesn't win (it has the lower 10_* priority
prefix and WebKitGTK prefers EGL). Leaves WEBKIT_DISABLE_COMPOSITING_
MODE, WEBKIT_DISABLE_DMABUF_RENDERER, GSK_RENDERER, and LIBGL_ALWAYS_
SOFTWARE unset — the inverse of dev-cpu-mode — so real iGPU paint
paths exercise.

Header documents verification commands (nvidia-smi must not list
QBZ; intel_gpu_top / nvtop should show activity on Intel only).

Purpose is to inform a future refinement of graphicsState's detector:
binary hardware_accel_enabled doesn't differentiate "iGPU is fine for
balanced visuals" from "no GPU at all, force lite". Manual harness
first; detector smarts second once we know what actually works on
real iGPU paint.

cc
2026-05-13 15:04:35 -06:00
vicrodh 884da638e0 chore(scripts): add dev-cpu-mode.sh for forced software rendering
Sister script of dev-ultra-restore.sh. Runs `npm run tauri dev` with
the full degraded-rendering env applied so the SW path can be
exercised even when the persisted graphics_settings DB has HW accel
enabled. Useful for testing the modal mount cost, splash spinner
smoothness, and Discovery V2 paint cost under WebKitGTK without GPU.

Sets five env vars:
  QBZ_HARDWARE_ACCEL=0              (QBZ's own nuclear opt-out)
  WEBKIT_DISABLE_COMPOSITING_MODE=1
  WEBKIT_DISABLE_DMABUF_RENDERER=1
  GSK_RENDERER=cairo                (GTK4 SW renderer)
  LIBGL_ALWAYS_SOFTWARE=1           (Mesa llvmpipe)

Flags:
  --no-kill  skip stale-process cleanup
  --print    print the env vars and exit (for sourcing)

cc
2026-05-12 11:32:43 -06:00
vicrodh 03af983a1b chore(scripts): add measure-cpu-window for structured perf sampling
Samples /proc/PID/stat directly (no pidstat dependency) for the qbz binary
and any WebKit child processes. Outputs mean/p50/p95/max per process plus
appends a CSV row to /tmp/qbz-cpu-measurements.csv for cross-run comparison.

Usage:
  ./scripts/measure-cpu-window.sh <label> [duration_seconds]

Built during the 2026-05-11 perf debug session to replace seat-of-the-pants
"does it feel faster?" with comparable numbers across changes.

cc
2026-05-11 20:43:49 -06:00
vicrodh 4fe2390129 chore(scripts): update v2 backend purity check for commands_v2 directory layout
The script was created when commands_v2 was a single file. After the
refactor to a directory, the path was stale and the script errored on
missing file. Also switch from rg to grep so the check works in
environments without ripgrep installed.

cc
2026-05-05 22:29:01 -06:00
vicrodh e3caff7f65 chore(audit): add config::favorites_cache to legacy_module_roots
Completes the legacy root list by adding config::favorites_cache,
which is registered in lib.rs (e.g., is_track_favorite) but was
missing from the audit's known-roots list. No frontend currently
invokes it, so this is preventive — guards against future silent
misclassification as 'unknown'.

Found in code review of commit 3ea96fb5.

cc
2026-04-25 19:45:01 -06:00
vicrodh 3ea96fb5ee chore(audit): classify legacy commands by leaf identifier and add roots
The frontend invoke audit was capturing the wrong segment of legacy
handler registrations. The pattern 'commands::([A-Za-z0-9_]+)' grabbed
the submodule name (e.g. 'search', 'playback') instead of the function
leaf, so commands like 'commands::search::get_artist_albums' fell into
the unknown bucket even though they were registered.

Switch to a per-root regex of the form
'<root_path>(::<segment>)*::(<leaf>),' which captures the leaf
identifier regardless of how many submodule levels sit between the root
and the function. Also add four legacy module roots that were missing:
- updates (has_flatpak_welcome_been_shown, has_snap_welcome_been_shown)
- config::legal_settings (get_qobuz_tos_accepted)
- desktop_theme (detect_desktop_theme)
- flatpak (get_flatpak_help_text)

After this change the unknown bucket is empty and the 16 callsites that
were previously misclassified as 'unknown' now correctly show up as
'legacy', which is the accurate status pending future V2 migration.

cc
2026-04-25 18:23:53 -06:00
vicrodh 58443b020e fix(scripts): audit-frontend-invokes recognizes commands from any namespace
The previous regex only matched commands registered under commands_v2::,
missing 50+ legitimate v2_qconnect_* commands registered under
qconnect_service::. This produced 64 false-positive "missing_v2" callsites
that obscured real audit signal.

Generalize the registration regex to match any module prefix ending in
::v2_* or ::runtime_*, so future modules that follow the v2_ naming
convention are picked up automatically without script changes. The inner
alternation still excludes legacy commands, which never carry the v2_ or
runtime_ prefix on the function name.

After the fix, missing_v2_callsites drops from 64 to 6 (the remaining 6
are real frontend typos, not audit-script bugs); legacy_callsites stays
at 0; unknown_callsites stays at 16.

cc
2026-04-25 18:07:06 -06:00
vicrodh 9d6c2f7eba fix: harden session restore/persist to prevent ghost CSS errors
When last_view pointed to a view with incomplete context (e.g.
album without selectedAlbum data), the Svelte CSS extraction
pipeline would corrupt and produce PostCSS "Unknown word" errors
that survived cache cleans and npm ci.

- Add isSessionRestoreSafeView() whitelist for context-free views
- Add getSessionFallbackView() for graceful degradation
- Centralize persist logic in getPersistedSessionViewState()
- Only persist views that have valid context data
- Add purchase-album to restore path
- Add dev:reset-last-view script to reset session.db
- Fix AlbumCreditsModal.svelte event handler typing
2026-03-11 17:02:29 -06:00
vicrodh 067264e7ec chore(scripts): add ghost-doctor and ultra-restore dev tooling
Add dev-ghost-doctor.sh (t-shadow check + runtime clean + restart) and
dev-ultra-restore.sh (deep clean with --full/--no-start/--check flags).
Improve check-no-t-shadow.sh patterns for broader t-variable detection.
Clean-dev-runtime now runs guardrail check automatically. Remove --force
from vite dev. Add npm script shortcuts for all new tools.
2026-02-26 02:44:06 -06:00
vicrodh 835fd19934 feat(oauth): persist session token for automatic re-auth on restart
- Save user_auth_token after successful OAuth login
- On bootstrap, restore session via saved token if no email/password creds
- If token is expired, clear it so user sees login screen normally
- Clear OAuth token on v2_clear_saved_credentials (logout)
- Add login_with_token() to api client (reuses OAuth /user/login step)

Also rename t->translateStore in NowPlayingBar.svelte (ADR-001 fix from Codex)
and improve clean-dev-runtime.sh to kill all stale processes and ports
2026-02-23 15:30:43 -06:00
vicrodh e843cb736f fix(svelte): remove hidden t shadow and harden checker
cx
2026-02-23 10:09:41 -06:00
vicrodh 2508ea9e55 chore(dev): improve dev scripts and runtime cleanup
Add svelte-kit sync + --force to dev script, add clean-runtime script,
bind vite to 127.0.0.1 explicitly.

cc
2026-02-19 16:18:53 -06:00
vicrodh 11b3486c63 fix(v2): close frontend/backend command audit gaps
- add/register missing v2 commands surfaced by audit
- migrate frontend invokes to v2 equivalents
- eliminate legacy invoke callsites in audit report
- harden invoke audit parser for generic/multiline invoke usage

cx
2026-02-18 12:59:28 -06:00
vicrodh d4b5dedc90 chore(v2): add migration guardrails for backend purity and invoke audit
cx
2026-02-16 03:29:02 -06:00
vicrodh 8b7a2dd6e6 fix(i18n): catch and remove remaining t-shadow reduce callback
cx
2026-02-09 02:34:40 -06:00
vicrodh ff15efde39 chore(i18n): add checker for t shadowing in svelte files
cx
2026-02-09 02:15:24 -06:00
vicrodh 6e21b3ed1f docs(dev): add script and docs for local API key loading
- Create dev-with-env.sh script to load .env before build
- Add npm run dev:tauri command that uses the script
- Document why .env must be loaded before compilation
- Explain compile-time vs runtime environment variables

The issue: option_env!() reads vars at compile time, but .env
loads at runtime. Solution: source .env before cargo build.

cp
2026-01-14 19:43:18 -06:00
vicrodh 3e8fe0771a perf: add adaptive polling and fix lyrics interval leak
- Playback state polling: 1000ms when paused, 250ms when playing
- Audio thread timeout: 500ms when idle, 100ms when playing
- Lyrics interval: self-check to auto-stop when conditions not met
- Add cleanup return to lyrics  in +page.svelte
- Add build-and-run.sh and monitor-resources.sh scripts
- Add OPTIMIZATION_PLAN.md documentation
2026-01-12 20:38:48 -06:00