2.5 KiB
2.5 KiB
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: screens (message, signin, home, detail, player), Back stack, start-up, sign-in
src/home.rs tabs (Kezdőlap, Filmek, Sorozatok, Listám, Keresés): rows, focus, lazy images, backdrop, search
src/detail.rs title page: Play/Continue/Next target, My List, seasons, episodes
src/player.rs sources -> /api/play/start -> probe -> sf_ui::video::Player; tracks, seek, OSD, progress
src/api.rs Netflex HTTP API (mirrors netflex/packages/client/src/api.ts)
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/{home,detail,player,signin}.slint, ui/types.slint
tools/mock_server.py stand-in server (real Cinemeta data, password "netflex", --video file streamed)
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 callingimages.load*; a cached picture calls back at once. Use theThenenum pattern: decide under the borrow, act after it. - Glass: new glass elements need their
glasslisted in a rootout property <[GlassRect]>, and that array added inmain.rs. Nothing Slint draws may sit under a glass pane. - Texts are Hungarian. Follow the Netflex web app's behaviour (resume rules, track picking:
player.rstests).
Check your change
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, notlocalhost(the IPv6 fallback costs ~2 s).