diff --git a/AGENTS.md b/AGENTS.md index d828426..6c1a5d8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -193,16 +193,23 @@ lib.rs # re-exports hidrpc + jsonrpc ``` main.rs # WASM entry: panic hook + tracing-wasm + mount Leptos App -├── app.rs # root component, layout, top-level signals/routing +├── app.rs # root component: connection state, handlers, page content inside the shell +├── shell/ # Claude Desktop frame: sidebar.rs (52px rail / 256px overlay), titlebar.rs +├── ui/ # design-system components: icon.rs, button.rs (Button, IconButton), field.rs (Field, Callout) +├── i18n.rs # zh/en copy via `i18n.t("中文", "English")`, zh by default +├── theme.rs # light/dark toggle (boot script in index.html applies it before paint) ├── rpc.rs # JSON-RPC over WebRTC data channel ├── net/ # peer.rs (WebRTC PeerConnection), rest.rs (HTTP), upload.rs (virtual media) ├── hid/ # keymap.rs (re-exports rkvm_proto::keymap) + mod.rs (keyboard/mouse → hidrpc via rkvm-proto) ├── terminal.rs # vt100 terminal view ├── ocr.rs # screen OCR via Tesseract.js (JS interop, CDN-loaded) -├── settings.rs / settings_advanced.rs # settings drawer +├── settings.rs / settings_advanced.rs # settings dialog sections +├── settings_nav.rs # settings dialog pages, search └── util.rs ``` +Styles live in `crates/rkvm-web/style/` (`tokens.css` → `base.css` → `components.css` → `shell.css` → `panels.css`, linked from `index.html` with `data-trunk rel="css"`). The design rules (tokens, layout, components, copy) are in [`docs/design-system.md`](docs/design-system.md); follow it for any UI change. + ## Frontend The SPA is the in-tree **`crates/rkvm-web`** crate (Leptos 0.8, CSR / `wasm32-unknown-unknown`). It is **excluded from the workspace** — it has its own `Cargo.lock`, `rust-toolchain.toml` (`stable` + `wasm32-unknown-unknown`), `Trunk.toml`, and `deny.toml`. diff --git a/crates/rkvm-web/Cargo.toml b/crates/rkvm-web/Cargo.toml index c8ac344..ba13f6c 100644 --- a/crates/rkvm-web/Cargo.toml +++ b/crates/rkvm-web/Cargo.toml @@ -30,6 +30,7 @@ web-sys = { version = "0.3", features = [ "HtmlVideoElement", "HtmlMediaElement", "MediaStream", + "MediaQueryList", "RtcPeerConnection", "RtcConfiguration", "RtcIceServer", @@ -70,6 +71,7 @@ web-sys = { version = "0.3", features = [ "Navigator", "WebSocket", "Node", + "Storage", ] } [profile.release] diff --git a/crates/rkvm-web/index.html b/crates/rkvm-web/index.html index 5916db7..ccc2cab 100644 --- a/crates/rkvm-web/index.html +++ b/crates/rkvm-web/index.html @@ -4,7 +4,7 @@