fix: GUI max-width on wrapper + visible TTS swap result + warning cleanup
Some checks are pending
Rust CI / cargo test (jarvis-core) (push) Waiting to run
Rust CI / cargo clippy (push) Waiting to run
Rust CI / cargo check (workspace) (push) Waiting to run

GUI MAX-WIDTH (was still stretched)

Root cause v2: my earlier rule applied max-width to #header and main
INDIVIDUALLY, but they live inside <Container fluid id="wrapper"> from
svelteui which goes full viewport width. Both children inherited that
full width from the flex layout. Constraining each child wouldn't help
when their PARENT was unconstrained.

Fix: max-width:1280px !important on #wrapper itself, with margin:0 auto.
Now the whole app (header + main) sits in a centred 1280px column on
wide monitors. !important is unfortunate but Container's width:100%
sometimes wins under HMR otherwise.

VISIBLE TTS SWAP RESULT (was failing silently)

User saved 'Piper' in dropdown → green 'Saved!' banner → active engine
chip still showed 'sapi'. Root cause: when Piper isn't installed,
`tts::build_backend("piper")` falls back to SAPI internally, but
`set_tts_backend` just logged a warning and returned a generic string.
The GUI couldn't tell the difference between success and silent fallback.

Fix:
- `set_tts_backend` now returns `TtsSwapResult { requested, applied,
  fell_back, note }`. The Svelte page reads `applied` (actual installed
  backend), checks `fell_back`, and shows an ORANGE notification with
  the concrete fix ("запусти tools/piper/install.ps1 чтобы скачать
  бинарь") instead of a green 'saved' lie.
- Saves now also call `refreshActiveBackends()` so the live chip
  ("Активный движок: TTS: sapi") updates without page reload.
- Green notification when swap succeeded normally.

WARNING CLEANUP

- jarvis-app/main.rs: removed unreachable `_ => {}` arm (all IpcAction
  variants are explicit now).
- jarvis-app/tray.rs: moved `info!("Tray initialized.")` to BEFORE the
  Windows message-pump loop (the loop runs forever, so the original
  position was unreachable).
- jarvis-gui/main.rs: dropped unused #[macro_use] on simple_log.
- jarvis-gui/events.rs: #[allow(dead_code)] on Payload struct +
  EventTypes impl + `play` fn — they're intentional API surface for
  future event-emitter wiring, not actual dead code.
- Plus a `cargo fix` pass for misc unused imports.

Down from 12 warnings to 1 (npm-build-completion notice — informational).

Tests: 140 rust + 115 python (was 104, +11 for new wave59_handlers).
Release builds of jarvis-app + jarvis-gui both green.
This commit is contained in:
Bossiara13 2026-05-24 23:11:49 +03:00
parent 944cfcc891
commit 965441d4db
12 changed files with 110 additions and 37 deletions

View file

@ -61,22 +61,29 @@ a {
margin: 0;
}
#header,
main {
padding: 0 30px;
// Cap content width on wide monitors so long labels don't stretch
// across 1900px+ screens. On smaller windows this is a no-op.
max-width: 1280px;
margin: 0 auto;
// Cap the WHOLE app (header + main) to 1280px on wide monitors and centre it,
// so labels in the nav don't sprawl across 1920px+ screens. The wrapper is
// `<Container fluid id="wrapper">` from svelteui fluid keeps it width: 100%
// inside the viewport, then we shrink the inner content here. Smaller windows
// are unaffected (max-width is a ceiling, not a floor).
//
// `!important` is unfortunate but svelteui's Container emits a width:100%
// rule that sometimes outweighs ours under HMR. The override is loud and
// localised only on the top-level wrapper.
#wrapper {
max-width: 1280px !important;
margin: 0 auto !important;
box-sizing: border-box;
}
#header,
main {
padding: 0 30px;
box-sizing: border-box;
}
// The home page's arc reactor + status bar can keep their own internal
// max-width while the page itself can still go full width the page
// layout below `main` already handles its own centering via flex.
.app-container.assist-page {
width: 100%;
max-width: 1280px;
margin: 0 auto;
}