Skip to content

Commit f7d27c5

Browse files
committed
Fix CI lint failures
1 parent e3ca3c2 commit f7d27c5

5 files changed

Lines changed: 35 additions & 28 deletions

File tree

client/src/app/AppShell.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,12 @@ export function AppShell({
738738
[selectedSimulator?.udid, streamStamp],
739739
);
740740
const chromeUsesAsset = Boolean(
741-
viewportChromeProfile && viewportChromeProfile.chromeStyle !== "css-android",
741+
viewportChromeProfile &&
742+
viewportChromeProfile.chromeStyle !== "css-android",
742743
);
743744
const chromeRequired = Boolean(
744745
(shouldRenderChrome && !chromeProfileReady) ||
745-
(chromeUsesAsset && chromeUrl),
746+
(chromeUsesAsset && chromeUrl),
746747
);
747748
const simulatorRotationQuarterTurns =
748749
normalizeSimulatorRotationQuarterTurns(selectedSimulator);

client/src/styles/components.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,7 @@
12371237
border-radius: 64px;
12381238
background:
12391239
linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 22%),
1240-
linear-gradient(315deg, rgba(0, 0, 0, 0.42), transparent 34%),
1241-
#17191f;
1240+
linear-gradient(315deg, rgba(0, 0, 0, 0.42), transparent 34%), #17191f;
12421241
box-shadow:
12431242
inset 0 0 0 2px rgba(255, 255, 255, 0.08),
12441243
inset 0 0 0 9px rgba(0, 0, 0, 0.34),
@@ -1268,7 +1267,11 @@
12681267
height: 17px;
12691268
border-radius: 50%;
12701269
background:
1271-
radial-gradient(circle at 58% 42%, rgba(105, 150, 180, 0.9), transparent 24%),
1270+
radial-gradient(
1271+
circle at 58% 42%,
1272+
rgba(105, 150, 180, 0.9),
1273+
transparent 24%
1274+
),
12721275
#08090c;
12731276
box-shadow:
12741277
inset 0 0 0 2px rgba(255, 255, 255, 0.06),

docs/extensions/browser-client.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ client/
3939
└── styles/
4040
```
4141

42-
| Folder | Responsibility |
43-
| ------------------------- | ----------------------------------------------------------------------- |
44-
| `api/` | Typed wrappers around the SimDeck REST API and shared TypeScript types. |
45-
| `features/simulators/` | Sidebar list of simulators plus boot/shutdown affordances. |
46-
| `features/viewport/` | Frame canvas, chrome compositing, hit testing. |
42+
| Folder | Responsibility |
43+
| ------------------------- | ---------------------------------------------------------------------------- |
44+
| `api/` | Typed wrappers around the SimDeck REST API and shared TypeScript types. |
45+
| `features/simulators/` | Sidebar list of simulators plus boot/shutdown affordances. |
46+
| `features/viewport/` | Frame canvas, chrome compositing, hit testing. |
4747
| `features/stream/` | WebRTC H.264 client for iOS and Android, receiver stats, and frame plumbing. |
48-
| `features/input/` | Touch / keyboard / hardware-button affordances. |
49-
| `features/accessibility/` | Accessibility tree pane and source switcher. |
50-
| `features/toolbar/` | Top toolbar (rotate, home, app switcher, dark mode toggle, refresh). |
48+
| `features/input/` | Touch / keyboard / hardware-button affordances. |
49+
| `features/accessibility/` | Accessibility tree pane and source switcher. |
50+
| `features/toolbar/` | Top toolbar (rotate, home, app switcher, dark mode toggle, refresh). |
5151

5252
## Bootstrap flow
5353

docs/guide/architecture.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Owns the public CLI shape (`simdeck`, `simdeck ui`, `daemon`, `boot`, `shutdown`
2020

2121
Key modules:
2222

23-
| Module | Responsibility |
24-
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------- |
25-
| `server/src/main.rs` | CLI entrypoint, project daemon management, AppKit main-thread shim, tokio runtime bootstrap. |
26-
| `server/src/api/routes.rs` | Every `/api/*` route, including simulator control, accessibility, and inspector proxy. |
23+
| Module | Responsibility |
24+
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- |
25+
| `server/src/main.rs` | CLI entrypoint, project daemon management, AppKit main-thread shim, tokio runtime bootstrap. |
26+
| `server/src/api/routes.rs` | Every `/api/*` route, including simulator control, accessibility, and inspector proxy. |
2727
| `server/src/android.rs` | Android AVD discovery, emulator lifecycle, emulator gRPC input/video, screenshots, UIAutomator, and logcat. |
28-
| `server/src/transport/webrtc.rs` | WebRTC offer/answer endpoint for H.264 browser video. |
29-
| `server/src/transport/packet.rs` | Shared encoded frame type used between simulator sessions and transports. |
30-
| `server/src/inspector.rs` | WebSocket hub for the NativeScript runtime inspector. |
31-
| `server/src/simulators/registry.rs` | Per-UDID session registry with lazy attachment to the native bridge. |
32-
| `server/src/simulators/session.rs` | Frame broadcast channel, keyframe gating, refresh requests. |
33-
| `server/src/metrics/counters.rs` | Atomic counters and per-client stream stats accepted from stream transports or `/api/client-stream-stats`. |
34-
| `server/src/logs.rs` | `os_log` log streaming and filtering. |
28+
| `server/src/transport/webrtc.rs` | WebRTC offer/answer endpoint for H.264 browser video. |
29+
| `server/src/transport/packet.rs` | Shared encoded frame type used between simulator sessions and transports. |
30+
| `server/src/inspector.rs` | WebSocket hub for the NativeScript runtime inspector. |
31+
| `server/src/simulators/registry.rs` | Per-UDID session registry with lazy attachment to the native bridge. |
32+
| `server/src/simulators/session.rs` | Frame broadcast channel, keyframe gating, refresh requests. |
33+
| `server/src/metrics/counters.rs` | Atomic counters and per-client stream stats accepted from stream transports or `/api/client-stream-stats`. |
34+
| `server/src/logs.rs` | `os_log` log streaming and filtering. |
3535

3636
The Rust server runs the tokio runtime on a worker thread while the AppKit main loop spins on the main thread. The native bridge needs the main loop to deliver display callbacks and HID events.
3737

server/src/android.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const RUNNING_EMULATOR_CACHE_TTL: Duration = Duration::from_secs(2);
2222
const AVD_GRPC_PORT_CACHE_TTL: Duration = Duration::from_secs(60);
2323
const SCREEN_SIZE_CACHE_TTL: Duration = Duration::from_secs(60);
2424

25+
type TimedMap<T> = Option<(Instant, HashMap<String, T>)>;
26+
type ScreenSizeCache = HashMap<String, (Instant, (f64, f64))>;
27+
2528
#[derive(Clone, Default)]
2629
pub struct AndroidBridge;
2730

@@ -244,7 +247,7 @@ impl AndroidBridge {
244247

245248
pub fn pasteboard_text(&self, id: &str) -> Result<String, AppError> {
246249
let serial = self.serial_for_id(id)?;
247-
Ok(self.run_adb_shell(&serial, "cmd clipboard get")?)
250+
self.run_adb_shell(&serial, "cmd clipboard get")
248251
}
249252

250253
pub fn send_touch(&self, id: &str, x: f64, y: f64, phase: &str) -> Result<(), AppError> {
@@ -732,7 +735,7 @@ impl AndroidBridge {
732735
}
733736

734737
fn running_emulators(&self) -> Result<HashMap<String, String>, AppError> {
735-
static CACHE: OnceLock<Mutex<Option<(Instant, HashMap<String, String>)>>> = OnceLock::new();
738+
static CACHE: OnceLock<Mutex<TimedMap<String>>> = OnceLock::new();
736739
let cache = CACHE.get_or_init(|| Mutex::new(None));
737740
if let Some((updated_at, running)) = cache.lock().unwrap().as_ref() {
738741
if updated_at.elapsed() < RUNNING_EMULATOR_CACHE_TTL {
@@ -766,7 +769,7 @@ impl AndroidBridge {
766769
}
767770

768771
fn grpc_port_for_avd(&self, avd_name: &str) -> Result<u16, AppError> {
769-
static CACHE: OnceLock<Mutex<Option<(Instant, HashMap<String, u16>)>>> = OnceLock::new();
772+
static CACHE: OnceLock<Mutex<TimedMap<u16>>> = OnceLock::new();
770773
let cache = CACHE.get_or_init(|| Mutex::new(None));
771774
if let Some((updated_at, ports)) = cache.lock().unwrap().as_ref() {
772775
if updated_at.elapsed() < AVD_GRPC_PORT_CACHE_TTL {
@@ -793,7 +796,7 @@ impl AndroidBridge {
793796
}
794797

795798
fn screen_size_for_serial(&self, serial: &str) -> Result<(f64, f64), AppError> {
796-
static CACHE: OnceLock<Mutex<HashMap<String, (Instant, (f64, f64))>>> = OnceLock::new();
799+
static CACHE: OnceLock<Mutex<ScreenSizeCache>> = OnceLock::new();
797800
let cache = CACHE.get_or_init(|| Mutex::new(HashMap::new()));
798801
if let Some((updated_at, size)) = cache.lock().unwrap().get(serial) {
799802
if updated_at.elapsed() < SCREEN_SIZE_CACHE_TTL {

0 commit comments

Comments
 (0)