# Notes for AI agents working on Netflex TV Read first: - `../../docs/store-app-guide.md`: what a Fennec OS store app must be (manifest, sandbox, remote, packaging, release). - `../../docs/sf-ui.md`: the UI kit. Liquid Glass model, components, focus, dev tools, pitfalls. ## Layout ``` app.toml store manifest (id support.bluefox.netflex; permissions network, gpu, audio) src/main.rs window, glass layer (lists every exported [GlassRect]), images, controller src/app.rs Controller: screen stack, keys, input/picker/toast overlays, backdrop, start-up, sign-in src/page.rs the line-based page engine: lines (L) and chips (Ch) -> layout, focus, scroll, lazy images src/screens/mod.rs sections of the top nav, shared cards, Load, opening a card src/screens/home.rs Kezdőlap: admin setup checklist, spotlight, Folytatás, the server's rows src/screens/source.rs Filmek / Sorozatok: Ajánlott, Könyvtáram, Böngészés (genre, year, rating, sort) src/screens/detail.rs film / series page: Play/Continue, My List, season cards, episodes, nCore versions src/screens/anime_hub.rs Anime: Ajánlott, Könyvtáram, Böngészés (AniList filters) src/screens/anime_detail.rs anime page: franchise seasons, release group, episodes, nyaa versions src/screens/mylist.rs Listám: saved and history src/screens/search.rs Keresés: embedded keyboard, results src/screens/settings.rs Beállítások: account, users, server; admin: VPN, nCore, seeding, sources, anime, TMDB; player; look src/player.rs source -> torrent -> probe -> sf_ui::video::Player; tracks, quality, prev/next, up next, skip intro src/api.rs Netflex HTTP API (mirrors netflex/packages/client/src/api.ts) src/config.rs server + token (config.toml), per-TV settings (device.toml: glass look, anime release groups) src/format.rs Hungarian texts: times, dates, languages, genres src/task.rs blocking work on a thread, result on the UI thread ui/app.slint root: screen fades, one FocusScope -> Rust `key`, glass exports ui/page.slint LinePage: draws the lines Rust lays out (nav, side list, keyboard) ui/{player,signin,overlays,types}.slint tools/mock_server.py stand-in server: Cinemeta + AniList data, admin pages, password "netflex", --video file ``` ## Rules of this codebase - **Rust owns state and focus.** Slint only draws. Every key goes to `Controller::key`, except while an on-screen keyboard has the focus (signin, search). - **Short borrows:** never hold `state.borrow_mut()` while calling `images.load*`; a cached picture calls back at once. Use the `Then` enum pattern: decide under the borrow, act after it. - **Glass:** new glass elements need their `glass` listed in a root `out property <[GlassRect]>`, and that array added in `main.rs`. Nothing Slint draws may sit under a glass pane. - **A new page** is a `Screen` (src/app.rs): `spec` returns lines, `activate` gets (line id, chip id). Never draw focus in Slint; the page engine does it. - **Feature parity:** every screen follows a page of the web app (`netflex/apps/web/src`); the module docs name it. Check there first. - **Texts are Hungarian.** Follow the Netflex web app's behaviour (resume rules, track picking, skip segments: `player.rs` tests). - **Free-standing `GlassButton`** (outside a layout) needs `width: self.preferred-width`, else it fills its parent. - **`match state.borrow().x { ... }` keeps the borrow for the whole match:** copy the value out first. ## Check your change ```sh cargo test python3 tools/mock_server.py --port 7881 & HOME=/tmp/nfhome NETFLEX_SERVER=http://127.0.0.1:7881 SF_UI_SIZE=1920x1080 \ SF_UI_KEYS="wait wait d e v down enter wait n e t f l e x down enter wait wait wait down right enter wait wait" \ SF_UI_SNAPSHOT=/tmp/shot.png cargo run # then look at /tmp/shot.png ``` - **Signed in once:** later runs start on home, so drop the sign-in keys. - **Playback** needs Linux (GStreamer): run the mock with `--video some.mkv`. - **On Windows** use `127.0.0.1`, not `localhost` (the IPv6 fallback costs ~2 s).