Skip to content

Commit a395b66

Browse files
mcuelenaereclaude
andcommitted
refactor: retire wheelReport JSON-RPC fallback
Per PR review (#1462): the Cloud SPA is versioned and LAN access always serves a matching Go API and JS SPA, so the backwards-compat fallback is unnecessary. Drop the `rpcHidReady ? binary : send(...)` branch from getMouseWheelHandler — always use the binary path — and remove the `wheelReport` entry from the JSON-RPC handler map. The binary 0x04 dispatch and rpcWheelReport itself stay; the function is now reached only via handleHidRPCMessage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 06b5eab commit a395b66

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

jsonrpc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,6 @@ var rpcHandlers = map[string]RPCHandler{
13441344
"keypressReport": {Func: rpcKeypressReport, Params: []string{"key", "press"}},
13451345
"absMouseReport": {Func: rpcAbsMouseReport, Params: []string{"x", "y", "buttons"}},
13461346
"relMouseReport": {Func: rpcRelMouseReport, Params: []string{"dx", "dy", "buttons"}},
1347-
"wheelReport": {Func: rpcWheelReport, Params: []string{"wheelY", "wheelX"}},
13481347
"wakeHost": {Func: rpcWakeHost},
13491348
"getVideoState": {Func: rpcGetVideoState},
13501349
"getUSBState": {Func: rpcGetUSBState},

ui/src/hooks/useMouse.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,15 @@ export default function useMouse() {
142142

143143
if (wheelY === 0 && wheelX === 0) return;
144144

145-
if (rpcHidReady) {
146-
reportWheelEvent(wheelY, wheelX);
147-
} else {
148-
// kept for backward compatibility
149-
send("wheelReport", { wheelY, wheelX });
150-
}
145+
reportWheelEvent(wheelY, wheelX);
151146

152147
// Apply blocking delay based of throttling settings
153148
if (scrollThrottling && !blockWheelEvent) {
154149
setBlockWheelEvent(true);
155150
setTimeout(() => setBlockWheelEvent(false), scrollThrottling);
156151
}
157152
},
158-
[send, reportWheelEvent, rpcHidReady, blockWheelEvent, scrollThrottling, invertScroll],
153+
[reportWheelEvent, blockWheelEvent, scrollThrottling, invertScroll],
159154
);
160155

161156
const resetMousePosition = useCallback(() => {

0 commit comments

Comments
 (0)