Skip to content

Commit a5f197b

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 a5f6d70 commit a5f197b

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
@@ -1256,7 +1256,6 @@ var rpcHandlers = map[string]RPCHandler{
12561256
"keypressReport": {Func: rpcKeypressReport, Params: []string{"key", "press"}},
12571257
"absMouseReport": {Func: rpcAbsMouseReport, Params: []string{"x", "y", "buttons"}},
12581258
"relMouseReport": {Func: rpcRelMouseReport, Params: []string{"dx", "dy", "buttons"}},
1259-
"wheelReport": {Func: rpcWheelReport, Params: []string{"wheelY", "wheelX"}},
12601259
"getVideoState": {Func: rpcGetVideoState},
12611260
"getUSBState": {Func: rpcGetUSBState},
12621261
"unmountImage": {Func: rpcUnmountImage},

ui/src/hooks/useMouse.ts

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

139139
if (wheelY === 0 && wheelX === 0) return;
140140

141-
if (rpcHidReady) {
142-
reportWheelEvent(wheelY, wheelX);
143-
} else {
144-
// kept for backward compatibility
145-
send("wheelReport", { wheelY, wheelX });
146-
}
141+
reportWheelEvent(wheelY, wheelX);
147142

148143
// Apply blocking delay based of throttling settings
149144
if (scrollThrottling && !blockWheelEvent) {
150145
setBlockWheelEvent(true);
151146
setTimeout(() => setBlockWheelEvent(false), scrollThrottling);
152147
}
153148
},
154-
[send, reportWheelEvent, rpcHidReady, blockWheelEvent, scrollThrottling, invertScroll],
149+
[reportWheelEvent, blockWheelEvent, scrollThrottling, invertScroll],
155150
);
156151

157152
const resetMousePosition = useCallback(() => {

0 commit comments

Comments
 (0)