From 5cd13f97d30fc43383ab82a79e036624584e9394 Mon Sep 17 00:00:00 2001
From: Kennedy <854543+kennedy@users.noreply.github.com>
Date: Wed, 2 Dec 2026 05:20:20 -0500
Subject: [PATCH 01/18] feat: Angry Miao Infinity image rule and separate
lighting cards
Match the names Angry Miao Infinity and AM Infinity to angry-miao-infinity.png (the image itself still needs uploading to the device-image bucket).
Render one lighting card per zone when the driver sets ui.separateLightingZones (mouse and receiver lights on the Angry Miao Infinity), and honour ui.hideAdvancedLighting so a light is not shown twice.
---
src/features/devices/OverviewPage.tsx | 9 +++++++--
src/shared/device-images.test.ts | 8 +++++++-
src/shared/device-images.ts | 3 +++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/features/devices/OverviewPage.tsx b/src/features/devices/OverviewPage.tsx
index c74786f1..309d6cdb 100644
--- a/src/features/devices/OverviewPage.tsx
+++ b/src/features/devices/OverviewPage.tsx
@@ -457,9 +457,14 @@ export function Workspace({
].filter((node) => node !== null);
const lightingZones = status.lightingZones?.length ? status.lightingZones : status.lighting ? [status.lighting] : [];
+ const lightingCards = !show(has.lighting, ["lighting"]) ? []
+ : status.ui?.separateLightingZones
+ ? lightingZones.map((zone, index) => (
+
+ ))
+ : [];
const lighting = [
- show(has.lighting, ["lighting"])
- ? : null,
+ ...lightingCards,
!powerOverview && show(has.teevolutionDpiLighting, ["lighting"])
? : null,
].filter((node) => node !== null);
diff --git a/src/shared/device-images.test.ts b/src/shared/device-images.test.ts
index 087754c9..3a1ea622 100644
--- a/src/shared/device-images.test.ts
+++ b/src/shared/device-images.test.ts
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { deviceImage, isUnknownDevice, placeholderImage } from "./device-images.ts";
+import { deviceImage, deviceImageFilename, isUnknownDevice, placeholderImage } from "./device-images.ts";
const CDN = "https://img.openmouse.app/";
@@ -135,6 +135,12 @@ test("ROG Harpe Ace Aim Lab Edition resolves by name on every connection", () =>
assert.equal(deviceImage(null, "ROG Omni receiver"), CDN + "unknown-device.png");
});
+test("Angry Miao Infinity resolves by the name the gearhub driver reads back", () => {
+ assert.equal(deviceImageFilename("Angry Miao Infinity"), "angry-miao-infinity.png");
+ assert.equal(deviceImageFilename("AM Infinity 8K Mouse"), "angry-miao-infinity.png");
+ assert.equal(deviceImageFilename("GearHub V5 mouse"), "unknown-device.png");
+});
+
test("Attack Shark R2 resolves by name (PID 0x402D is shared with the M5 Pro)", () => {
// TEMPORARY: served from the repo override (see LOCAL_OVERRIDES in
// device-images.ts / public/devices/README.md) until a maintainer uploads
diff --git a/src/shared/device-images.ts b/src/shared/device-images.ts
index c424bf4d..1e4bb56d 100644
--- a/src/shared/device-images.ts
+++ b/src/shared/device-images.ts
@@ -73,6 +73,9 @@ function computeDeviceImageFilename(displayName: string): string {
// R2 shares PID 0x402D with the Lingbao M5 Pro, so it can only be told apart
// by the name the gearhub driver reads back from the device id.
if (/\battack\s*shark\s*r2\b/i.test(displayName)) return "attackshark-r2.png";
+ // Same shared GearHub-V5 PIDs; the gearhub driver names it from device id 2222.
+ // "AM" is Angry Miao's own short form, as in the Bridge label "AM Infinity 8K Mouse".
+ if (/\b(?:angry\s*miao|am)\s*infinity\b/i.test(displayName)) return "angry-miao-infinity.png";
if (/\bdelux\b.*\bm800/i.test(displayName) || /\bm800\s*(mini|pro)?\b/i.test(displayName)) {
return "delux-m800-mini.png";
}
From 8eb4273fbcd7783fe287cdcf38e704c2163b73a8 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Thu, 3 Dec 2026 01:08:30 -0500
Subject: [PATCH 02/18] feat(traits): give the angry-miao driver family the
advanced, sleep and debounce cards
---
src/device/traits.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/device/traits.ts b/src/device/traits.ts
index 5dacd182..fb047ef4 100644
--- a/src/device/traits.ts
+++ b/src/device/traits.ts
@@ -83,6 +83,9 @@ const BY_FAMILY: Readonly>> = {
// CompX direct-mode driver — it publishes its own debounce/sleep option
// lists, so it takes the plain flags.
gearhub: { advancedSection: true, sleep: true, debounce: true },
+ // Angry Miao's own Yichip driver: the same option block cards, read and
+ // written with its own layout.
+ "angry-miao": { advancedSection: true, sleep: true, debounce: true },
// MCHOSE reads debounce and sleep from its config blob and writes both, but
// it is not a direct-mode (CompX) driver, so it takes the plain flags.
mchose: { advancedSection: true, sleep: true, debounce: true },
From 34b603e25dc88a413f97cb32285dc7333142b8c1 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:09:07 -0500
Subject: [PATCH 03/18] feat(preview): Angry Miao Infinity .100, .97 and .100R2
fixtures
Adds ?preview=angry-miao-infinity-100 (am30), -97 (am35) and -100r2 (am30r2), all on the 2.4 GHz receiver and on the device shelf. The .100 comes from the 2026-12-02 vendor-app read and runs on a stand-in built from the real AM30 client, so the DPI, debounce and sleep options are the driver's own. The .97 and .100R2 use the read-only AM35 driver's shape; nobody has read either mouse, so their settings borrow the .100's.
Refs kennedy/openmouse#15
---
src/device/controller.ts | 101 +++++++++++++++-
src/device/driver-classes.ts | 6 +-
.../preview/angry-miao-fixtures.test.ts | 71 +++++++++++
src/device/preview/angry-miao-fixtures.ts | 114 ++++++++++++++++++
src/device/preview/preview-fixtures.ts | 2 +
src/device/preview/preview-modes.test.ts | 7 ++
src/device/preview/preview-modes.ts | 10 ++
7 files changed, 309 insertions(+), 2 deletions(-)
create mode 100644 src/device/preview/angry-miao-fixtures.test.ts
create mode 100644 src/device/preview/angry-miao-fixtures.ts
diff --git a/src/device/controller.ts b/src/device/controller.ts
index cff4a95d..7174a843 100644
--- a/src/device/controller.ts
+++ b/src/device/controller.ts
@@ -8696,6 +8696,93 @@ function steelseriesStagePreviewClient(initial: MouseStatus): SupportedClient {
return client as unknown as SupportedClient;
}
+/**
+ * Angry Miao Infinity .100 preview: the real AM30 prototype supplies the driver's own option lists
+ * (DPI steps, debounce stops, sleep presets); writes land on an in-memory status instead of the mouse.
+ */
+function angryMiaoPreviewClient(initial: MouseStatus): SupportedClient {
+ const status = structuredClone(initial);
+ // The mouse keeps all eight stages; the count only picks how many the DPI button cycles.
+ const table = [...(status.dpiStages ?? [])];
+ const colors = [...(status.dpiStageColors ?? [])];
+ let count = table.length;
+ const sync = (): void => {
+ status.dpiStages = table.slice(0, count);
+ status.dpiStageColors = colors.slice(0, count);
+ const activeStage = Math.min(status.activeDpiStage ?? 0, count - 1);
+ status.activeDpiStage = activeStage;
+ status.dpi = table[activeStage] ?? status.dpi;
+ status.dpiY = status.dpi;
+ };
+ const writeStage = (stage: number, dpi: number): number => {
+ table[stage] = dpi;
+ sync();
+ return dpi;
+ };
+ const set = (key: K) => async (value: MouseStatus[K]): Promise => {
+ status[key] = value;
+ return value;
+ };
+ const setLighting = async (lighting: MouseLighting): Promise => {
+ status.lightingZones = status.lightingZones?.map((zone) => (zone.zone === lighting.zone ? { ...lighting } : zone));
+ if (status.lighting?.zone === lighting.zone) status.lighting = { ...lighting };
+ };
+ return Object.assign(Object.create(C().AngryMiaoAm30HidClient.prototype) as object, {
+ device: {} as HIDDevice,
+ open: async () => undefined,
+ close: async () => undefined,
+ readStatus: async () => structuredClone(status),
+ setPollingRate: set("pollingRateHz"),
+ setReportRate: set("pollingRateHz"),
+ setLiftOffDistance: set("liftOffDistance"),
+ setAngleSnapping: set("angleSnapping"),
+ setRippleControl: set("rippleControl"),
+ setMotionSync: set("motionSync"),
+ setTurboMode: set("turboMode"),
+ setDebounceTime: set("debounceMs"),
+ setSleepTimeout: set("sleepTimeout"),
+ setDpi: async (dpi: number) => writeStage(status.activeDpiStage ?? 0, dpi),
+ setDpiStageValue: async (stage: number, dpi: number) => writeStage(stage, dpi),
+ setDpiForStage: async (x: number, _y: number, stage: number) => writeStage(stage, x),
+ setActiveDpiStage: async (stage: number) => {
+ status.activeDpiStage = stage;
+ sync();
+ return stage;
+ },
+ setDpiStageCount: async (next: number) => {
+ count = next;
+ sync();
+ return next;
+ },
+ setDpiStageColor: async (stage: number, color: string) => {
+ colors[stage] = color.toLowerCase();
+ sync();
+ return colors[stage];
+ },
+ setLighting,
+ setReceiverLight: setLighting,
+ }) as unknown as SupportedClient;
+}
+
+/** .97 / .100R2 preview on the real read-only AM35 prototype: its option lists, and no write reaches anything. */
+function angryMiaoReadOnlyPreviewClient(
+ cls: DriverModules["AngryMiaoAm35HidClient"],
+ initial: MouseStatus,
+): SupportedClient {
+ const status = structuredClone(initial);
+ return Object.assign(Object.create(cls.prototype) as object, {
+ device: {} as HIDDevice,
+ queue: Promise.resolve(),
+ settingsQueue: Promise.resolve(),
+ open: async () => undefined,
+ close: async () => undefined,
+ readStatus: async () => structuredClone(status),
+ send: async (): Promise => {
+ throw new Error(st("ctl.previewNoMouse"));
+ },
+ }) as unknown as SupportedClient;
+}
+
function showSlotsPreview(): void {
dpiOptions = [100, 200, 400, 800, 1600, 3200, 6400, 8000, 16000, 32000];
const stages = [
@@ -8841,7 +8928,10 @@ function showG703PreviewProfiles(): void {
active = previewClient();
}
-const PREVIEW_SHELF: readonly FixturePreviewMode[] = ["razer", "pulsar-pro", "g703", "egg-op1", "nape-pro"];
+const PREVIEW_SHELF: readonly FixturePreviewMode[] = [
+ "razer", "pulsar-pro", "g703", "egg-op1", "nape-pro",
+ "angry-miao-infinity-100", "angry-miao-infinity-97", "angry-miao-infinity-100r2",
+];
let previewShelfKeys: readonly FixturePreviewMode[] = [];
function previewShelfEntry(index: number, name: string, selected: boolean): SidebarDevice {
@@ -8899,6 +8989,15 @@ async function showFixturePreview(name: Exclude | null = null;
@@ -151,6 +153,8 @@ export function ensureDriverModules(): Promise {
import("@openmouse/protocol/drivers/hitscan/hid"),
import("@openmouse/protocol/drivers/xiaomi/hid"),
import("@openmouse/protocol/drivers/thermaltake/hid"),
+ import("@openmouse/protocol/drivers/angry-miao/am30-hid"),
+ import("@openmouse/protocol/drivers/angry-miao/am35-hid"),
]).then((mods) => (loaded = Object.assign({}, ...mods) as DriverModules));
return loading;
}
diff --git a/src/device/preview/angry-miao-fixtures.test.ts b/src/device/preview/angry-miao-fixtures.test.ts
new file mode 100644
index 00000000..ca9bf197
--- /dev/null
+++ b/src/device/preview/angry-miao-fixtures.test.ts
@@ -0,0 +1,71 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { ANGRY_MIAO_FIXTURES } from "./angry-miao-fixtures.ts";
+import { PREVIEW_FIXTURES } from "./preview-fixtures.ts";
+import { familyOf, traitsFor } from "../traits.ts";
+import { cardAvailability } from "../../features/devices/cards/availability.ts";
+import type { ControlSnapshot } from "../types.ts";
+
+function cardsFor(key: keyof typeof ANGRY_MIAO_FIXTURES): ReturnType {
+ const status = ANGRY_MIAO_FIXTURES[key].status;
+ return cardAvailability({
+ status,
+ traits: traitsFor(status),
+ settingsPending: status.ui?.settingsReady === false,
+ } as ControlSnapshot);
+}
+
+test("every Angry Miao fixture is reachable from the preview table", () => {
+ for (const [key, fixture] of Object.entries(ANGRY_MIAO_FIXTURES)) {
+ assert.equal(PREVIEW_FIXTURES[key as keyof typeof ANGRY_MIAO_FIXTURES], fixture);
+ assert.equal(familyOf(fixture.status), "angry-miao");
+ assert.equal(fixture.status.connectionDetail, "2.4 GHz");
+ }
+});
+
+test("the Infinity .100 fixture matches the AM30 driver on its receiver", () => {
+ const { status } = ANGRY_MIAO_FIXTURES["angry-miao-infinity-100"];
+ assert.equal(status.name, "Angry Miao Infinity .100");
+ assert.equal(status.dpiStages?.length, status.ui?.dpiStageEditor?.maxStages);
+ assert.equal(status.dpiStageColors?.length, status.dpiStages?.length);
+ assert.equal(status.dpi, status.dpiStages?.[status.activeDpiStage ?? 0]);
+ assert.deepEqual(status.lightingZones?.map((zone) => zone.zone), ["Mouse", "Receiver"]);
+ assert.deepEqual(status.spareBattery, { percent: 99, state: "Charging" });
+ // Without a profile read the driver reports neither profiles nor a button map.
+ assert.equal(status.profileCount, undefined);
+ assert.equal(status.buttonMappings, undefined);
+});
+
+test("the Infinity .100 fixture opens its own cards and no duplicate light", () => {
+ const has = cardsFor("angry-miao-infinity-100");
+ assert.equal(has.lighting, true);
+ assert.equal(has.lightingAdvanced, false);
+ assert.equal(has.debounce, true);
+ assert.equal(has.sleep, true);
+ assert.equal(has.onboardProfiles, false);
+ assert.equal(has.buttonMapping, false);
+});
+
+test("the .97 and .100R2 fixtures carry the read-only driver's shape", () => {
+ for (const [key, name] of [
+ ["angry-miao-infinity-97", "Angry Miao Infinity .97"],
+ ["angry-miao-infinity-100r2", "Angry Miao Infinity .100R2"],
+ ] as const) {
+ const { status } = ANGRY_MIAO_FIXTURES[key];
+ assert.equal(status.name, name);
+ assert.equal(status.ui?.settingsReady, false);
+ assert.equal(status.ui?.valuesVerified, true);
+ assert.equal(status.ui?.pollingReadOnly, true);
+ // The read-only status drops every editor and the lights.
+ assert.equal(status.ui?.dpiStageEditor, undefined);
+ assert.equal(status.lighting, undefined);
+ assert.equal(status.lightingZones, undefined);
+ assert.equal(status.buttonOptions, undefined);
+ assert.deepEqual(status.firmware, []);
+ }
+});
+
+test("the .100R2 fixture names its two extra buttons the way its driver does", () => {
+ const { status } = ANGRY_MIAO_FIXTURES["angry-miao-infinity-100r2"];
+ assert.deepEqual(Object.keys(status.buttonMappings ?? {}).slice(-2), ["Custom 1", "Custom 2"]);
+});
diff --git a/src/device/preview/angry-miao-fixtures.ts b/src/device/preview/angry-miao-fixtures.ts
new file mode 100644
index 00000000..1ad9051b
--- /dev/null
+++ b/src/device/preview/angry-miao-fixtures.ts
@@ -0,0 +1,114 @@
+import type { MouseLighting, MouseStatus } from "@openmouse/protocol/drivers/mouse-types";
+import {
+ ANGRY_MIAO_INFINITY_100R2_MODEL,
+ ANGRY_MIAO_INFINITY_97_MODEL,
+} from "@openmouse/protocol/angry-miao";
+import type { PreviewFixture } from "./preview-fixtures.ts";
+
+export type AngryMiaoPreviewMode = "angry-miao-infinity-100" | "angry-miao-infinity-97" | "angry-miao-infinity-100r2";
+
+const MOUSE_LIGHT: MouseLighting = {
+ zone: "Mouse", modes: ["Off", "Static"], mode: "Off", color: "#ffffff", color2: null,
+ colorModes: ["Static"], dualColorModes: [], reactiveModes: [], speeds: [], speed: null,
+};
+
+const RECEIVER_EFFECTS: MouseLighting["modes"] = ["Static", "Breathing single", "Neon", "Wave", "Marquee", "Ring", "Buffer", "Chase"];
+
+const RECEIVER_LIGHT: MouseLighting = {
+ zone: "Receiver", modes: ["Off", ...RECEIVER_EFFECTS], mode: "Neon", color: "#ffffff", color2: null,
+ colorModes: RECEIVER_EFFECTS.filter((mode) => mode !== "Neon"), dualColorModes: [],
+ reactiveModes: RECEIVER_EFFECTS.filter((mode) => mode !== "Static"),
+ speeds: [1, 2, 3, 4, 5], speed: 1, brightness: 100, brightnessLevels: [0, 25, 50, 75, 100],
+};
+
+/**
+ * Angry Miao Infinity .100 (AM30) on its 2.4 GHz receiver, from the vendor-app read of 2026-12-02
+ * (mouse-protocol captures/angry-miao-infinity/dongle-reads.json); the receiver light is the captured
+ * `88`/`87` reply in src/angry-miao/index.test.ts. No profile read, so no profiles or button map.
+ */
+const ANGRY_MIAO_INFINITY_100_MODEL: MouseStatus = {
+ brand: "Angry Miao",
+ name: "Angry Miao Infinity .100",
+ ui: {
+ family: "angry-miao",
+ settingsReady: true,
+ defaultDisplayName: "Angry Miao Infinity .100",
+ hideAdvancedLighting: true,
+ separateLightingZones: true,
+ dpiStageEditor: { maxStages: 8, minDpi: 50, maxDpi: 30000, stepDpi: 50, countEditable: true },
+ },
+ dpi: 1600,
+ dpiY: 1600,
+ supportsSeparateDpiAxes: true,
+ dpiStages: [400, 800, 1200, 1600, 3200, 6400, 10000, 30000],
+ dpiStageColors: ["#ff0000", "#ff3200", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff", "#ffffff"],
+ activeDpiStage: 3,
+ pollingRateHz: 1000,
+ supportedPollingRates: [125, 250, 500, 1000, 2000, 4000, 8000],
+ connectionType: "Wireless",
+ connectionDetail: "2.4 GHz",
+ liftOffDistance: "Medium",
+ angleSnapping: false,
+ debounceMs: 10,
+ rippleControl: false,
+ motionSync: false,
+ sleepTimeout: 30,
+ activeProfile: null,
+ firmware: ["Mouse SoC 0x0318", "Receiver USB 0x0008", "Receiver RF 0xf0", "Receiver LED 0x0109", "PixArt PAW3950"],
+ batteryPercent: 100,
+ batteryState: "Discharging",
+ spareBattery: { percent: 99, state: "Charging" },
+ lighting: MOUSE_LIGHT,
+ lightingZones: [MOUSE_LIGHT, RECEIVER_LIGHT],
+ turboMode: false,
+};
+
+/**
+ * The .97 and .100R2 on their 2.4 GHz receivers, in the shape the read-only AM35 driver reports
+ * (`readOnlyStatus` in @openmouse/protocol). Nobody has read either mouse yet: the settings are the
+ * .100's captured ones and the buttons are the model's factory map. Firmware stays unknown.
+ */
+function readOnlyInfinity(model: typeof ANGRY_MIAO_INFINITY_97_MODEL): MouseStatus {
+ const name = `${model.brand} ${model.model}`;
+ return {
+ brand: model.brand,
+ name,
+ ui: {
+ family: "angry-miao",
+ settingsReady: false,
+ valuesVerified: true,
+ pollingReadOnly: true,
+ defaultDisplayName: name,
+ hideAdvancedLighting: true,
+ separateLightingZones: true,
+ statusNote: "OpenMouse reads this mouse but does not change it yet. Run Hardware test and share the report so settings can be turned on.",
+ },
+ dpi: ANGRY_MIAO_INFINITY_100_MODEL.dpi,
+ dpiY: ANGRY_MIAO_INFINITY_100_MODEL.dpiY,
+ supportsSeparateDpiAxes: true,
+ dpiStages: ANGRY_MIAO_INFINITY_100_MODEL.dpiStages,
+ dpiStageColors: ANGRY_MIAO_INFINITY_100_MODEL.dpiStageColors,
+ activeDpiStage: ANGRY_MIAO_INFINITY_100_MODEL.activeDpiStage,
+ pollingRateHz: ANGRY_MIAO_INFINITY_100_MODEL.pollingRateHz,
+ supportedPollingRates: ANGRY_MIAO_INFINITY_100_MODEL.supportedPollingRates,
+ connectionType: "Wireless",
+ connectionDetail: "2.4 GHz",
+ liftOffDistance: ANGRY_MIAO_INFINITY_100_MODEL.liftOffDistance,
+ angleSnapping: ANGRY_MIAO_INFINITY_100_MODEL.angleSnapping,
+ debounceMs: ANGRY_MIAO_INFINITY_100_MODEL.debounceMs,
+ rippleControl: ANGRY_MIAO_INFINITY_100_MODEL.rippleControl,
+ motionSync: ANGRY_MIAO_INFINITY_100_MODEL.motionSync,
+ sleepTimeout: ANGRY_MIAO_INFINITY_100_MODEL.sleepTimeout,
+ activeProfile: null,
+ firmware: [],
+ batteryPercent: ANGRY_MIAO_INFINITY_100_MODEL.batteryPercent,
+ batteryState: ANGRY_MIAO_INFINITY_100_MODEL.batteryState,
+ buttonMappings: { ...model.defaultButtonMappings },
+ };
+}
+
+export const ANGRY_MIAO_FIXTURES: Record = {
+ "angry-miao-infinity-100": { label: "Angry Miao Infinity .100 (AM30)", status: ANGRY_MIAO_INFINITY_100_MODEL },
+ "angry-miao-infinity-97": { label: "Angry Miao Infinity .97 (AM35)", status: readOnlyInfinity(ANGRY_MIAO_INFINITY_97_MODEL) },
+ "angry-miao-infinity-100r2": { label: "Angry Miao Infinity .100R2 (AM30R2)", status: readOnlyInfinity(ANGRY_MIAO_INFINITY_100R2_MODEL) },
+};
diff --git a/src/device/preview/preview-fixtures.ts b/src/device/preview/preview-fixtures.ts
index 742f1f1d..3673f4af 100644
--- a/src/device/preview/preview-fixtures.ts
+++ b/src/device/preview/preview-fixtures.ts
@@ -1,6 +1,7 @@
import type { MouseLighting, MouseStatus } from "@openmouse/protocol/drivers/mouse-types";
import { LUNAFURY_BUTTON_ACTIONS } from "@openmouse/protocol/lamzu";
import { PREVIEW_KEYS, type FixturePreviewMode } from "./preview-modes.ts";
+import { ANGRY_MIAO_FIXTURES } from "./angry-miao-fixtures.ts";
export { PREVIEW_KEYS };
@@ -1261,4 +1262,5 @@ export const PREVIEW_FIXTURES: Record = {
"logitech-legacy": { label: "Logitech G402 (legacy DPI)", status: LOGITECH_LEGACY },
"steelseries-gen2": { label: "SteelSeries Rival 3 Wireless Gen 2", status: STEELSERIES_GEN2 },
incott: { label: "Incott G23 Pro", status: INCOTT },
+ ...ANGRY_MIAO_FIXTURES,
};
diff --git a/src/device/preview/preview-modes.test.ts b/src/device/preview/preview-modes.test.ts
index 9a48d50e..1f5109a4 100644
--- a/src/device/preview/preview-modes.test.ts
+++ b/src/device/preview/preview-modes.test.ts
@@ -12,6 +12,13 @@ test("preview mode accepts every explicitly supported route", () => {
for (const key of PREVIEW_KEYS) assert.equal(parsePreviewMode(key), key);
});
+test("the Angry Miao previews also answer to their model names", () => {
+ assert.equal(parsePreviewMode("am30"), "angry-miao-infinity-100");
+ assert.equal(parsePreviewMode("angry-miao-infinity"), "angry-miao-infinity-100");
+ assert.equal(parsePreviewMode("am35"), "angry-miao-infinity-97");
+ assert.equal(parsePreviewMode("am30r2"), "angry-miao-infinity-100r2");
+});
+
test("arbitrary URL values cannot disable HID startup", () => {
assert.equal(parsePreviewMode(null), null);
assert.equal(parsePreviewMode(""), null);
diff --git a/src/device/preview/preview-modes.ts b/src/device/preview/preview-modes.ts
index 918917b6..b71ae653 100644
--- a/src/device/preview/preview-modes.ts
+++ b/src/device/preview/preview-modes.ts
@@ -47,6 +47,9 @@ export const PREVIEW_KEYS = [
"logitech-legacy",
"steelseries-gen2",
"incott",
+ "angry-miao-infinity-100",
+ "angry-miao-infinity-97",
+ "angry-miao-infinity-100r2",
"arbiter-polar-65-pro",
"arbiter-polar-65",
"glorious-gmmk2-65-iso",
@@ -110,6 +113,13 @@ export function parsePreviewMode(value: string | null): PreviewMode | null {
case "logitech-legacy": return "logitech-legacy";
case "steelseries-gen2": return "steelseries-gen2";
case "incott": return "incott";
+ case "angry-miao-infinity":
+ case "am30":
+ case "angry-miao-infinity-100": return "angry-miao-infinity-100";
+ case "am35":
+ case "angry-miao-infinity-97": return "angry-miao-infinity-97";
+ case "am30r2":
+ case "angry-miao-infinity-100r2": return "angry-miao-infinity-100r2";
case "arbiter-polar-65-pro": return "arbiter-polar-65-pro";
case "arbiter-polar-65": return "arbiter-polar-65";
case "glorious-gmmk2-65-iso": return "glorious-gmmk2-65-iso";
From d2e040d74a07d563bfb1f8fcd243a5b0f527382c Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:27:46 -0500
Subject: [PATCH 04/18] revert: drop the Angry Miao Infinity image rule until
there is licensed art
---
src/shared/device-images.test.ts | 8 +-------
src/shared/device-images.ts | 3 ---
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/shared/device-images.test.ts b/src/shared/device-images.test.ts
index 3a1ea622..087754c9 100644
--- a/src/shared/device-images.test.ts
+++ b/src/shared/device-images.test.ts
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { deviceImage, deviceImageFilename, isUnknownDevice, placeholderImage } from "./device-images.ts";
+import { deviceImage, isUnknownDevice, placeholderImage } from "./device-images.ts";
const CDN = "https://img.openmouse.app/";
@@ -135,12 +135,6 @@ test("ROG Harpe Ace Aim Lab Edition resolves by name on every connection", () =>
assert.equal(deviceImage(null, "ROG Omni receiver"), CDN + "unknown-device.png");
});
-test("Angry Miao Infinity resolves by the name the gearhub driver reads back", () => {
- assert.equal(deviceImageFilename("Angry Miao Infinity"), "angry-miao-infinity.png");
- assert.equal(deviceImageFilename("AM Infinity 8K Mouse"), "angry-miao-infinity.png");
- assert.equal(deviceImageFilename("GearHub V5 mouse"), "unknown-device.png");
-});
-
test("Attack Shark R2 resolves by name (PID 0x402D is shared with the M5 Pro)", () => {
// TEMPORARY: served from the repo override (see LOCAL_OVERRIDES in
// device-images.ts / public/devices/README.md) until a maintainer uploads
diff --git a/src/shared/device-images.ts b/src/shared/device-images.ts
index 1e4bb56d..c424bf4d 100644
--- a/src/shared/device-images.ts
+++ b/src/shared/device-images.ts
@@ -73,9 +73,6 @@ function computeDeviceImageFilename(displayName: string): string {
// R2 shares PID 0x402D with the Lingbao M5 Pro, so it can only be told apart
// by the name the gearhub driver reads back from the device id.
if (/\battack\s*shark\s*r2\b/i.test(displayName)) return "attackshark-r2.png";
- // Same shared GearHub-V5 PIDs; the gearhub driver names it from device id 2222.
- // "AM" is Angry Miao's own short form, as in the Bridge label "AM Infinity 8K Mouse".
- if (/\b(?:angry\s*miao|am)\s*infinity\b/i.test(displayName)) return "angry-miao-infinity.png";
if (/\bdelux\b.*\bm800/i.test(displayName) || /\bm800\s*(mini|pro)?\b/i.test(displayName)) {
return "delux-m800-mini.png";
}
From 7c549f3378460bd5e2f7e3ca68fd108a52d6a035 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:30:00 -0500
Subject: [PATCH 05/18] fix(devices): lock debounce, sleep and processing
controls while settings are read-only
A driver that reports ui.settingsReady: false refuses every write, but these controls still staged changes. They now follow snapshot.settingsPending like the DPI and polling cards.
Refs kennedy/openmouse#19
---
src/features/devices/cards/AdvancedCards.tsx | 30 +++++++++++++-------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/features/devices/cards/AdvancedCards.tsx b/src/features/devices/cards/AdvancedCards.tsx
index 3e3c5124..1011f023 100644
--- a/src/features/devices/cards/AdvancedCards.tsx
+++ b/src/features/devices/cards/AdvancedCards.tsx
@@ -226,7 +226,7 @@ export function DebounceCard({ snapshot }: { snapshot: ControlSnapshot }): React
id="atk-debounce-toggle"
label={t(locale, "adv.keyDebounce")}
value={ms > 0}
- disabled={snapshot.settingInProgress}
+ disabled={snapshot.settingInProgress || snapshot.settingsPending}
onChange={(next) => control.applyPulsarValue("debounce", next ? 1 : 0)}
/>
}
@@ -236,7 +236,7 @@ export function DebounceCard({ snapshot }: { snapshot: ControlSnapshot }): React
step={1}
scale={["0 ms", "10 ms", "20 ms"]}
formatValue={(shown) => `${shown} ms`}
- disabled={snapshot.settingInProgress}
+ disabled={snapshot.settingInProgress || snapshot.settingsPending}
pendingKey="debounce"
onCommit={(next) => control.applyPulsarValue("debounce", next)}
/>
@@ -263,7 +263,7 @@ export function DebounceCard({ snapshot }: { snapshot: ControlSnapshot }): React
disabled: offered != null && !offered.includes(ms),
}))}
value={status.debounceMs}
- disabled={status.debounceMs === null || status.debounceMs === undefined}
+ disabled={status.debounceMs === null || status.debounceMs === undefined || snapshot.settingsPending}
onChange={(next) => control.applyPulsarValue("debounce", next)}
/>
@@ -314,6 +314,7 @@ export function SleepCard({ snapshot }: { snapshot: ControlSnapshot }): ReactNod
id="sleep-toggle"
label={t(locale, "adv.autoSleep")}
value={asleep}
+ disabled={snapshot.settingsPending}
onChange={(next) => control.toggleSleep(next)}
/>
) : null}
@@ -330,7 +331,7 @@ export function SleepCard({ snapshot }: { snapshot: ControlSnapshot }): ReactNod
ariaLabel={t(locale, "adv.sleepTimeout")}
options={options.map(([value, label]) => ({ value, label }))}
value={status.sleepTimeout}
- disabled={!asleep}
+ disabled={!asleep || snapshot.settingsPending}
onChange={(next) => control.applyPulsarValue("sleep", next)}
/>
)}
@@ -432,6 +433,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
const ui = status.ui;
const { traits, capabilities } = snapshot;
const teevolutionProfile = capabilities?.teevolutionProfile;
+ const locked = snapshot.settingsPending;
const sensorUi = traits.teevolution && teevolutionProfile && status.connectionType
? teevolutionSensorModeUi({
@@ -466,6 +468,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
label={displayText(locale, hyperLabel)}
value={status.hyperMode}
hidden={status.hyperMode == null}
+ disabled={locked}
onChange={(next) => control.applyPulsarToggle("hyperMode", next)}
/>
);
@@ -484,7 +487,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
.filter((mode) => mode === "Ultra" || teevolutionProfile.sensorModes.includes(mode))
.map((mode) => ({ value: mode, label: mode }))}
value={sensorUi.mode}
- disabled={!sensorUi.editable}
+ disabled={!sensorUi.editable || locked}
onChange={(next) => control.applyTeevolutionSensorMode(
next as NonNullable,
)}
@@ -505,7 +508,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
ariaLabel={t(locale, "adv.sensorSampling")}
options={(["Eco", "High", "Ultra"] as const).map((mode) => ({ value: mode, label: mode }))}
value={status.sensorMode}
- disabled={status.sensorModeEditable === false}
+ disabled={status.sensorModeEditable === false || locked}
onChange={(next) => control.applySensorMode(
next as NonNullable,
)}
@@ -518,7 +521,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
label={displayText(locale, lunafurySettingLabel(status, locale, "motionSync") ?? "Motion Sync")}
value={status.motionSync}
hidden={ui?.hideMotionSync === true}
- disabled={motionSyncBlocked}
+ disabled={motionSyncBlocked || locked}
onChange={(next) => control.applyPulsarToggle("motionSync", next)}
/>
{motionSyncBlocked ? (
@@ -529,6 +532,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
label={displayText(locale, angleSnappingLabel)}
value={status.angleSnapping}
hidden={ui?.hideAngleSnapping === true || traits.finalmouse}
+ disabled={locked}
onChange={(next) => control.applyPulsarToggle("angleSnapping", next)}
/>
control.applyPulsarToggle("rippleControl", next)}
/>
{status.atkAntiMistouchMs != null ? (
) : null}
@@ -552,6 +557,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
label={displayText(locale, performanceLabel)}
value={status.performanceMode}
hidden={status.performanceMode == null || traits.eggFamily || traits.finalmouse || !lunafuryTrackingVisible(status)}
+ disabled={locked}
onChange={(next) => control.applyPulsarToggle("performanceMode", next)}
/>
{status.brand !== "LunaFury" ? hyperModeControl : null}
@@ -560,7 +566,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
label={t(locale, "adv.turboMode")}
value={status.turboMode}
hidden={status.turboMode == null}
- disabled={status.hyperMode === false}
+ disabled={status.hyperMode === false || locked}
onChange={(next) => control.applyPulsarToggle("turboMode", next)}
/>
control.applyPulsarToggle("buttonCombination", next)}
/>
control.applyPulsarToggle("longRangeMode", next)}
/>
{angleTuning != null ? (
@@ -597,7 +605,7 @@ export function ProcessingCard({ snapshot }: { snapshot: ControlSnapshot }): Rea
{displayText(locale, "Precise horizontal movement regardless of mouse grip style. Rotation writes touch calibration and stay locked pending a USB capture — calibrate in ATK HUB for now.")}
>
) : capabilities?.angleTuningWritable
- ?
+ ?
: (
control.applyTeevolutionPerformanceDuration(next)}
/>
From 0ac4fbe181ba2513190031197204461b9a7ee543 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:31:23 -0500
Subject: [PATCH 06/18] feat(devices): say when a mouse is read-only or only
its receiver answers
The device header now says "Device is set to read-only. It needs more testing before settings can be changed." when the driver reads the mouse but refuses writes (settingsReady false, valuesVerified true), and "The receiver cannot detect the mouse." when ui.receiverOnly is set.
When the receiver cannot detect the mouse, the mouse cards (sleep, debounce, processing, buttons, profiles) are hidden, the receiver's own light stays usable, and the device list calls it a receiver. The vendor app changes the receiver light with the mouse disconnected, so the write is expected to work.
Refs kennedy/openmouse#19, kennedy/openmouse#16, kennedy/openmouse#18
---
src/features/devices/DeviceHero.tsx | 10 ++++++-
src/features/devices/DevicesHome.tsx | 2 +-
src/features/devices/cards/LightingCard.tsx | 3 ++-
.../devices/cards/availability.test.ts | 27 +++++++++++++++++++
src/features/devices/cards/availability.ts | 12 +++++----
src/i18n/index.ts | 3 +++
src/i18n/locales/ar.ts | 3 +++
src/i18n/locales/de.ts | 3 +++
src/i18n/locales/es.ts | 3 +++
src/i18n/locales/fr.ts | 3 +++
src/i18n/locales/ja.ts | 3 +++
src/i18n/locales/ko.ts | 3 +++
src/i18n/locales/pt.ts | 3 +++
src/i18n/locales/ru.ts | 3 +++
src/i18n/locales/tr.ts | 3 +++
src/i18n/locales/vi.ts | 3 +++
src/i18n/locales/zh.ts | 3 +++
src/styles/device.css | 1 +
18 files changed, 83 insertions(+), 8 deletions(-)
diff --git a/src/features/devices/DeviceHero.tsx b/src/features/devices/DeviceHero.tsx
index ce8da69f..d9dba0ef 100644
--- a/src/features/devices/DeviceHero.tsx
+++ b/src/features/devices/DeviceHero.tsx
@@ -1,5 +1,5 @@
import { connectionText, displayText, t, tp, type I18nKey } from "../../i18n/index";
-import { ChevronRight, ImageUp } from "lucide-react";
+import { ChevronRight, ImageUp, Lock, Unplug } from "lucide-react";
import { useEffect, useMemo, useState, type KeyboardEvent, type ReactNode } from "react";
import * as control from "../../device/controller";
import { cachedBatterySamples, type BatterySample } from "./battery-history";
@@ -38,6 +38,8 @@ export function DeviceHero({
status.name,
)));
const artworkHref = `${ARTWORK_DISCUSSION_URL}${name ? `&title=${encodeURIComponent(`Artwork request: ${name}`)}` : ""}`;
+ const receiverOnly = status?.ui?.receiverOnly === true;
+ const readOnly = !receiverOnly && snapshot.settingsPending && status?.ui?.valuesVerified === true;
const onTabKey = (event: KeyboardEvent, current: WorkspaceTab): void => {
const index = tabs.indexOf(current);
@@ -73,6 +75,12 @@ export function DeviceHero({
{connectionText(locale, status.connectionType)}
) : null}
+ {receiverOnly || readOnly ? (
+
+ {receiverOnly ? : }
+ {t(locale, receiverOnly ? "dev.receiverOnly" : "dev.readOnly")}
+
+ ) : null}
{status?.ui?.x11ConfigurationAvailable ? (
- {[brand, device.kind === "keyboard" ? t(locale, "home.keyboard") : t(locale, "home.mouse"), device.transport === "bridge" ? t(locale, "bridge.title") : null]
+ {[brand, device.kind === "keyboard" ? t(locale, "home.keyboard") : status?.ui?.receiverOnly ? t(locale, "home.receiver") : t(locale, "home.mouse"), device.transport === "bridge" ? t(locale, "bridge.title") : null]
.filter(Boolean)
.join(" · ")}
diff --git a/src/features/devices/cards/LightingCard.tsx b/src/features/devices/cards/LightingCard.tsx
index 61d83b6b..0b0161c4 100644
--- a/src/features/devices/cards/LightingCard.tsx
+++ b/src/features/devices/cards/LightingCard.tsx
@@ -29,7 +29,8 @@ export function LightingCard({
const lighting = zones?.[activeZoneIndex] ?? suppliedLighting ?? snapshot.status?.lighting;
if (!lighting) return null;
const prefix = `${variant === "advanced" ? "lighting" : "lighting-tab"}-${activeZoneIndex}`;
- const disabled = snapshot.settingsPending;
+ // Disabled in Read-Only mode; the Receiver light stays usable when Receiver cannot detect mouse.
+ const disabled = snapshot.settingsPending && snapshot.status?.ui?.receiverOnly !== true;
const mode = lighting.mode;
const usesColor = mode !== null && lighting.colorModes.includes(mode);
const usesColor2 = mode !== null && lighting.dualColorModes.includes(mode);
diff --git a/src/features/devices/cards/availability.test.ts b/src/features/devices/cards/availability.test.ts
index c6148c5b..2a23ddf6 100644
--- a/src/features/devices/cards/availability.test.ts
+++ b/src/features/devices/cards/availability.test.ts
@@ -877,3 +877,30 @@ test("Rival 650 shows the button editor only outside game profile drafts", () =>
assert.equal(cardAvailability(snapshot({ status })).buttonMapping, true);
assert.equal(cardAvailability(snapshot({ status, gameProfileDraft: true })).buttonMapping, false);
});
+
+test("a receiver whose mouse is away keeps only the receiver's own cards", () => {
+ const receiverLight = {
+ zone: "Receiver", modes: ["Off", "Static"], mode: "Static", color: "#ffffff", color2: null,
+ colorModes: ["Static"], dualColorModes: [], reactiveModes: [], speeds: [], speed: null,
+ } as const;
+ const has = cardAvailability(snapshot({
+ settingsPending: true,
+ status: {
+ brand: "Angry Miao",
+ name: "Angry Miao Receiver",
+ ui: { family: "angry-miao", settingsReady: false, receiverOnly: true, separateLightingZones: true },
+ dpi: 0,
+ pollingRateHz: 0,
+ batteryPercent: null,
+ lightingZones: [receiverLight],
+ buttonMappings: { Left: "Left Click" },
+ buttonOptions: ["Left Click"],
+ profileCount: 2,
+ activeProfile: 1,
+ },
+ }));
+ assert.equal(has.lighting, true);
+ for (const card of ["dpi", "polling", "sleep", "debounce", "processing", "buttonMapping", "onboardProfiles"] as const) {
+ assert.equal(has[card], false, card);
+ }
+});
diff --git a/src/features/devices/cards/availability.ts b/src/features/devices/cards/availability.ts
index e0125c94..2fefa425 100644
--- a/src/features/devices/cards/availability.ts
+++ b/src/features/devices/cards/availability.ts
@@ -135,6 +135,8 @@ function computeCardAvailability(snapshot: ControlSnapshot): CardAvailability {
const ui = status.ui;
const { traits, capabilities } = snapshot;
const ready = !snapshot.settingsPending;
+ // Receiver detected, mouse disconnected.
+ const mouseDisconnected = ui?.receiverOnly === true;
const host = traits.advancedSection;
const isNoirKsnake = isNoirKsnakeStatus(status);
@@ -186,8 +188,8 @@ function computeCardAvailability(snapshot: ControlSnapshot): CardAvailability {
magnetic: status.magneticButtons?.buttons.length === 2,
lighting: Boolean(status.lighting || status.lightingZones?.length),
lightingAdvanced: host && ui?.hideAdvancedLighting !== true && !isNoirKsnake && Boolean(status.lighting || status.lightingZones?.length),
- onboardProfiles: (status.profileCount ?? 0) > 1 && status.activeProfile != null,
- buttonMapping: Boolean(status.buttonMappings) && Boolean(status.buttonOptions?.length)
+ onboardProfiles: !mouseDisconnected && (status.profileCount ?? 0) > 1 && status.activeProfile != null,
+ buttonMapping: !mouseDisconnected && Boolean(status.buttonMappings) && Boolean(status.buttonOptions?.length)
&& !(snapshot.gameProfileDraft && ui?.family === "steelseries-rival650"),
// K-snake/M2-NEX exposes the macro write/commit path. The editor starts
// with local slots because this firmware does not expose a reliable macro
@@ -213,14 +215,14 @@ function computeCardAvailability(snapshot: ControlSnapshot): CardAvailability {
advancedHost: host,
signal: host && traits.signal,
- debounce: host && traits.debounce
+ debounce: host && !mouseDisconnected && traits.debounce
&& status.lunafury?.leftDebounceMs == null && status.lunafury?.rightDebounceMs == null
&& status.debounceMs !== null && status.debounceMs !== undefined,
- sleep: host && (traits.sleep || capabilities?.sleepOptions != null || razerSleep)
+ sleep: host && !mouseDisconnected && (traits.sleep || capabilities?.sleepOptions != null || razerSleep)
&& ui?.hideSleepCard !== true,
ksnakeScroll: (ui?.family === "ksnake" || isNoirKsnake || ui?.family === "keychron-8k") && status.scrollDirection != null,
lowPower: host && razerLowPower,
- processing: host && processing,
+ processing: host && !mouseDisconnected && processing,
ninjutsoSensor: host && traits.ninjutso
&& Boolean(status.ninjutsoSystemMode || status.ninjutsoOpticalEngine),
ninjutsoClick: host && traits.ninjutso
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 9fd410e4..d52d57e0 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -119,6 +119,9 @@ const en = {
"bridge.bodyOn": "Bridge is running and carrying device reports for this page, so Razer mice, game profiles and low-battery alerts are available.",
"bridge.releaseNotes": "Release notes",
"dev.status": "Device status",
+ "dev.readOnly": "Device is set to read-only. It needs more testing before settings can be changed.",
+ "dev.receiverOnly": "The receiver cannot detect the mouse.",
+ "home.receiver": "Receiver",
"dev.breadcrumb": "Breadcrumb",
"ov.sensitivity": "Sensitivity",
"ov.stageOf": "Stage {n} of {total}",
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts
index bf3f5f33..cc9d5529 100644
--- a/src/i18n/locales/ar.ts
+++ b/src/i18n/locales/ar.ts
@@ -1918,6 +1918,9 @@ export const ar: Record = {
"bridge.bodyOn": "يعمل Bridge وينقل تقارير الجهاز لهذه الصفحة، لذا تتوفر فئران Razer وملفات الألعاب وتنبيهات انخفاض البطارية.",
"bridge.releaseNotes": "ملاحظات الإصدار",
"dev.status": "حالة الجهاز",
+ "dev.readOnly": "الجهاز مضبوط على القراءة فقط. يحتاج إلى مزيد من الاختبار قبل أن يمكن تغيير الإعدادات.",
+ "dev.receiverOnly": "لا يستطيع جهاز الاستقبال اكتشاف الماوس.",
+ "home.receiver": "جهاز الاستقبال",
"dev.breadcrumb": "مسار التنقل",
"ov.sensitivity": "الحساسية",
"ov.stageOf": "المرحلة {n} من {total}",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index 81f2df18..c7ead482 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -1948,6 +1948,9 @@ export const de: Record = {
"bridge.bodyOn": "Bridge läuft und überträgt die Geräteberichte für diese Seite, damit Razer-Mäuse, Spielprofile und Warnungen bei niedrigem Akku verfügbar sind.",
"bridge.releaseNotes": "Versionshinweise",
"dev.status": "Gerätestatus",
+ "dev.readOnly": "Das Gerät ist schreibgeschützt eingestellt. Es braucht weitere Tests, bevor Einstellungen geändert werden können.",
+ "dev.receiverOnly": "Der Empfänger kann die Maus nicht erkennen.",
+ "home.receiver": "Empfänger",
"dev.breadcrumb": "Navigationspfad",
"ov.sensitivity": "Empfindlichkeit",
"ov.stageOf": "Stufe {n} von {total}",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 983ea869..d103f6cf 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -1928,6 +1928,9 @@ export const es: Record = {
"bridge.bodyOn": "Bridge está en ejecución y transmite los informes del dispositivo a esta página, así que tienes ratones Razer, perfiles de juego y avisos de batería baja.",
"bridge.releaseNotes": "Notas de la versión",
"dev.status": "Estado del dispositivo",
+ "dev.readOnly": "El dispositivo está configurado como de solo lectura. Necesita más pruebas antes de que se puedan cambiar los ajustes.",
+ "dev.receiverOnly": "El receptor no puede detectar el ratón.",
+ "home.receiver": "Receptor",
"dev.breadcrumb": "Ruta de navegación",
"ov.sensitivity": "Sensibilidad",
"ov.stageOf": "Etapa {n} de {total}",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index 84ff545e..3815436a 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -1920,6 +1920,9 @@ export const fr: Record = {
"bridge.bodyOn": "Bridge est lancé et relaie les rapports de l'appareil vers cette page : souris Razer, profils de jeu et alertes de batterie faible sont disponibles.",
"bridge.releaseNotes": "Notes de version",
"dev.status": "État de l'appareil",
+ "dev.readOnly": "L'appareil est configuré en lecture seule. Il a besoin de tests supplémentaires avant que les réglages puissent être modifiés.",
+ "dev.receiverOnly": "Le récepteur ne peut pas détecter la souris.",
+ "home.receiver": "Récepteur",
"dev.breadcrumb": "Fil d'Ariane",
"ov.sensitivity": "Sensibilité",
"ov.stageOf": "Palier {n} sur {total}",
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index b0f9370c..ddb039c8 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -1920,6 +1920,9 @@ export const ja: Record = {
"bridge.bodyOn": "Bridge が起動しており、このページにデバイスのレポートを中継しています。Razer マウス、ゲームプロファイル、バッテリー低下通知が使えます。",
"bridge.releaseNotes": "リリースノート",
"dev.status": "デバイスの状態",
+ "dev.readOnly": "このデバイスは読み取り専用に設定されています。設定を変更できるようになるには、さらにテストが必要です。",
+ "dev.receiverOnly": "レシーバーがマウスを検出できません。",
+ "home.receiver": "レシーバー",
"dev.breadcrumb": "パンくずリスト",
"ov.sensitivity": "感度",
"ov.stageOf": "ステージ {n} / {total}",
diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts
index 4fb4a282..04ebd1d7 100644
--- a/src/i18n/locales/ko.ts
+++ b/src/i18n/locales/ko.ts
@@ -1920,6 +1920,9 @@ export const ko: Record = {
"bridge.bodyOn": "Bridge가 실행 중이며 이 페이지로 장치 보고를 전달하고 있어 Razer 마우스, 게임 프로필, 배터리 부족 알림을 사용할 수 있습니다.",
"bridge.releaseNotes": "릴리스 노트",
"dev.status": "장치 상태",
+ "dev.readOnly": "이 장치는 읽기 전용으로 설정되어 있습니다. 설정을 변경하려면 추가 테스트가 필요합니다.",
+ "dev.receiverOnly": "수신기가 마우스를 감지할 수 없습니다.",
+ "home.receiver": "수신기",
"dev.breadcrumb": "탐색 경로",
"ov.sensitivity": "감도",
"ov.stageOf": "{total}단계 중 {n}단계",
diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts
index 8c0005fe..f2f20525 100644
--- a/src/i18n/locales/pt.ts
+++ b/src/i18n/locales/pt.ts
@@ -1920,6 +1920,9 @@ export const pt: Record = {
"bridge.bodyOn": "O Bridge está em execução e leva os relatórios do dispositivo para esta página, então mouses Razer, perfis de jogo e alertas de bateria fraca estão disponíveis.",
"bridge.releaseNotes": "Notas da versão",
"dev.status": "Status do dispositivo",
+ "dev.readOnly": "O dispositivo está configurado como somente leitura. Ele precisa de mais testes antes que as configurações possam ser alteradas.",
+ "dev.receiverOnly": "O receptor não consegue detectar o mouse.",
+ "home.receiver": "Receptor",
"dev.breadcrumb": "Navegação",
"ov.sensitivity": "Sensibilidade",
"ov.stageOf": "Estágio {n} de {total}",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 0fdfc34f..7b1b7a15 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -1920,6 +1920,9 @@ export const ru: Record = {
"bridge.bodyOn": "Bridge запущен и передаёт отчёты устройства этой странице, поэтому доступны мыши Razer, игровые профили и уведомления о низком заряде.",
"bridge.releaseNotes": "Примечания к выпуску",
"dev.status": "Состояние устройства",
+ "dev.readOnly": "Устройство настроено только на чтение. Ему нужно больше тестов, прежде чем можно будет менять настройки.",
+ "dev.receiverOnly": "Приёмник не может обнаружить мышь.",
+ "home.receiver": "Приёмник",
"dev.breadcrumb": "Навигация",
"ov.sensitivity": "Чувствительность",
"ov.stageOf": "Ступень {n} из {total}",
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index c0ad1a62..dca033c2 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -1918,6 +1918,9 @@ export const tr: Record = {
"bridge.bodyOn": "Bridge çalışıyor ve bu sayfaya cihaz raporlarını taşıyor; Razer fareler, oyun profilleri ve düşük pil uyarıları kullanılabilir.",
"bridge.releaseNotes": "Sürüm notları",
"dev.status": "Cihaz durumu",
+ "dev.readOnly": "Cihaz salt okunur olarak ayarlı. Ayarların değiştirilebilmesi için daha fazla test gerekiyor.",
+ "dev.receiverOnly": "Alıcı fareyi algılayamıyor.",
+ "home.receiver": "Alıcı",
"dev.breadcrumb": "Gezinti yolu",
"ov.sensitivity": "Hassasiyet",
"ov.stageOf": "Kademe {n} / {total}",
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index aefbe0c0..347faba2 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -1925,6 +1925,9 @@ export const vi: Record = {
"bridge.bodyOn": "Bridge đang chạy và chuyển báo cáo thiết bị cho trang này, nên chuột Razer, hồ sơ trò chơi và cảnh báo pin yếu đều dùng được.",
"bridge.releaseNotes": "Ghi chú phát hành",
"dev.status": "Trạng thái thiết bị",
+ "dev.readOnly": "Thiết bị được đặt ở chế độ chỉ đọc. Thiết bị cần được kiểm tra thêm trước khi có thể thay đổi cài đặt.",
+ "dev.receiverOnly": "Bộ thu không thể phát hiện chuột.",
+ "home.receiver": "Bộ thu",
"dev.breadcrumb": "Đường dẫn",
"ov.sensitivity": "Độ nhạy",
"ov.stageOf": "Mức {n} trên {total}",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index 5f444e14..ee8fd1ff 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -1920,6 +1920,9 @@ export const zh: Record = {
"bridge.bodyOn": "Bridge 正在运行并为此页面传递设备报告,因此可以使用 Razer 鼠标、游戏配置和低电量提醒。",
"bridge.releaseNotes": "发行说明",
"dev.status": "设备状态",
+ "dev.readOnly": "该设备已设为只读。在可以更改设置之前,它还需要更多测试。",
+ "dev.receiverOnly": "接收器无法检测到鼠标。",
+ "home.receiver": "接收器",
"dev.breadcrumb": "导航路径",
"ov.sensitivity": "灵敏度",
"ov.stageOf": "第 {n} 档,共 {total} 档",
diff --git a/src/styles/device.css b/src/styles/device.css
index 83aeff59..432cf6b0 100644
--- a/src/styles/device.css
+++ b/src/styles/device.css
@@ -14,6 +14,7 @@
.om-device-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--text-2); font-size: var(--fs-connection); }
.om-device-fact { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.om-device-fact > svg { width: 15px; height: 15px; color: var(--text-3); }
+.om-device-fact.is-note { white-space: normal; }
.om-device-art { position: relative; width: var(--rail-art-stacked); aspect-ratio: 1 / 1; margin-top: 12px; }
.om-device-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.om-device-artreq { justify-self: start; }
From ea4fdf37d822582e73b1f29608496326a4513dc6 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:32:33 -0500
Subject: [PATCH 07/18] feat(devices): show a spare battery next to the mouse
battery
Any driver that reports status.spareBattery (a second battery outside the mouse, such as the one charging in the Angry Miao Infinity's receiver dock) now gets a battery bar, percent and state in Current setup and on its device card.
Refs kennedy/openmouse#8, kennedy/openmouse#18
---
src/features/devices/DeviceHero.tsx | 17 ++++++++++++++---
src/features/devices/DeviceStats.tsx | 7 +++++++
src/i18n/index.ts | 1 +
src/i18n/locales/ar.ts | 1 +
src/i18n/locales/de.ts | 1 +
src/i18n/locales/es.ts | 1 +
src/i18n/locales/fr.ts | 1 +
src/i18n/locales/ja.ts | 1 +
src/i18n/locales/ko.ts | 1 +
src/i18n/locales/pt.ts | 1 +
src/i18n/locales/ru.ts | 1 +
src/i18n/locales/tr.ts | 1 +
src/i18n/locales/vi.ts | 1 +
src/i18n/locales/zh.ts | 1 +
src/styles/device.css | 1 +
15 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/src/features/devices/DeviceHero.tsx b/src/features/devices/DeviceHero.tsx
index d9dba0ef..0a3d83dc 100644
--- a/src/features/devices/DeviceHero.tsx
+++ b/src/features/devices/DeviceHero.tsx
@@ -1,4 +1,4 @@
-import { connectionText, displayText, t, tp, type I18nKey } from "../../i18n/index";
+import { batteryStateText, connectionText, displayText, t, tp, type I18nKey } from "../../i18n/index";
import { ChevronRight, ImageUp, Lock, Unplug } from "lucide-react";
import { useEffect, useMemo, useState, type KeyboardEvent, type ReactNode } from "react";
import * as control from "../../device/controller";
@@ -6,6 +6,7 @@ import { cachedBatterySamples, type BatterySample } from "./battery-history";
import type { ControlSnapshot, WorkspaceTab } from "../../device/types";
import { deviceImage, isUnknownDevice, placeholderImage } from "../../shared/device-images";
import { ConnectionIcon } from "./DeviceStats";
+import { BatteryIcon } from "../../shared/ui";
const ARTWORK_DISCUSSION_URL =
"https://github.com/OpenMouse-Project/openmouse/discussions/new?category=artwork-request";
@@ -143,7 +144,7 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
const stages = Array.isArray(status.dpiStages) ? status.dpiStages.filter((value) => value > 0) : [];
const activeStage = typeof status.activeDpiStage === "number" ? status.activeDpiStage : -1;
const maxRate = status.supportedPollingRates?.length ? Math.max(...status.supportedPollingRates) : null;
- const figures: Array<{ key: string; label: string; value: string; unit?: string; sub?: string }> = [];
+ const figures: Array<{ key: string; label: string; value: string; unit?: string; sub?: string; icon?: ReactNode }> = [];
if (status.dpi > 0) {
figures.push({
key: "dpi",
@@ -173,6 +174,16 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
} else if (status.ui?.forceShowBattery === true) {
figures.push({ key: "battery", label: t(locale, "ov.batteryLabel"), value: "–" });
}
+ if (status.spareBattery) {
+ figures.push({
+ key: "spare-battery",
+ label: t(locale, "ov.spareBattery"),
+ value: String(status.spareBattery.percent),
+ unit: "%",
+ sub: batteryStateText(locale, status.spareBattery.state),
+ icon: ,
+ });
+ }
if (status.activeProfile != null) {
figures.push({ key: "profile", label: t(locale, "ov.onboardProfile"), value: String(status.activeProfile) });
}
@@ -187,7 +198,7 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
{figures.map((figure) => (
{figure.label}
- {figure.value}{figure.unit ? {figure.unit} : null}
+ {figure.icon}{figure.value}{figure.unit ? {figure.unit} : null}
{figure.sub ? {figure.sub} : null}
))}
diff --git a/src/features/devices/DeviceStats.tsx b/src/features/devices/DeviceStats.tsx
index cc77b77d..a25672b9 100644
--- a/src/features/devices/DeviceStats.tsx
+++ b/src/features/devices/DeviceStats.tsx
@@ -47,6 +47,13 @@ export function DeviceStats({
{"–"}
) : null}
+ {status.spareBattery ? (
+
+
+ {t(locale, "ov.spareBattery")}
+ {status.spareBattery.percent}%
+
+ ) : null}
{status.pollingRateHz > 0 ? (
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index d52d57e0..c7129998 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -128,6 +128,7 @@ const en = {
"ov.pollingRate": "Polling rate",
"ov.upTo": "Up to {v}",
"ov.batteryLabel": "Battery",
+ "ov.spareBattery": "Spare battery",
"ov.onboardProfile": "Onboard profile",
"ov.setupTitle": "Current setup",
"ov.setupMeta": "Read from the device",
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts
index cc9d5529..396fe4f1 100644
--- a/src/i18n/locales/ar.ts
+++ b/src/i18n/locales/ar.ts
@@ -1927,6 +1927,7 @@ export const ar: Record = {
"ov.pollingRate": "معدل الاستقصاء",
"ov.upTo": "حتى {v}",
"ov.batteryLabel": "البطارية",
+ "ov.spareBattery": "البطارية الاحتياطية",
"ov.onboardProfile": "الملف المدمج",
"ov.setupTitle": "الإعداد الحالي",
"ov.setupMeta": "مقروء من الجهاز",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index c7ead482..81e17177 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -1957,6 +1957,7 @@ export const de: Record = {
"ov.pollingRate": "Abfragerate",
"ov.upTo": "Bis zu {v}",
"ov.batteryLabel": "Akku",
+ "ov.spareBattery": "Ersatzakku",
"ov.onboardProfile": "Onboard-Profil",
"ov.setupTitle": "Aktuelles Setup",
"ov.setupMeta": "Vom Gerät gelesen",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index d103f6cf..77f4d040 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -1937,6 +1937,7 @@ export const es: Record = {
"ov.pollingRate": "Tasa de sondeo",
"ov.upTo": "Hasta {v}",
"ov.batteryLabel": "Batería",
+ "ov.spareBattery": "Batería de repuesto",
"ov.onboardProfile": "Perfil integrado",
"ov.setupTitle": "Configuración actual",
"ov.setupMeta": "Leído del dispositivo",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index 3815436a..fd12eaa1 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -1929,6 +1929,7 @@ export const fr: Record = {
"ov.pollingRate": "Taux de rapport",
"ov.upTo": "Jusqu'à {v}",
"ov.batteryLabel": "Batterie",
+ "ov.spareBattery": "Batterie de rechange",
"ov.onboardProfile": "Profil embarqué",
"ov.setupTitle": "Configuration actuelle",
"ov.setupMeta": "Lu depuis l'appareil",
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index ddb039c8..2fb9d10c 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -1929,6 +1929,7 @@ export const ja: Record = {
"ov.pollingRate": "ポーリングレート",
"ov.upTo": "最大 {v}",
"ov.batteryLabel": "バッテリー",
+ "ov.spareBattery": "予備バッテリー",
"ov.onboardProfile": "オンボードプロファイル",
"ov.setupTitle": "現在の設定",
"ov.setupMeta": "デバイスから読み取り",
diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts
index 04ebd1d7..b053c4cd 100644
--- a/src/i18n/locales/ko.ts
+++ b/src/i18n/locales/ko.ts
@@ -1929,6 +1929,7 @@ export const ko: Record = {
"ov.pollingRate": "폴링 레이트",
"ov.upTo": "최대 {v}",
"ov.batteryLabel": "배터리",
+ "ov.spareBattery": "예비 배터리",
"ov.onboardProfile": "온보드 프로필",
"ov.setupTitle": "현재 설정",
"ov.setupMeta": "장치에서 읽음",
diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts
index f2f20525..881bf1e2 100644
--- a/src/i18n/locales/pt.ts
+++ b/src/i18n/locales/pt.ts
@@ -1929,6 +1929,7 @@ export const pt: Record = {
"ov.pollingRate": "Taxa de polling",
"ov.upTo": "Até {v}",
"ov.batteryLabel": "Bateria",
+ "ov.spareBattery": "Bateria reserva",
"ov.onboardProfile": "Perfil interno",
"ov.setupTitle": "Configuração atual",
"ov.setupMeta": "Lido do dispositivo",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 7b1b7a15..6cf73821 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -1929,6 +1929,7 @@ export const ru: Record = {
"ov.pollingRate": "Частота опроса",
"ov.upTo": "До {v}",
"ov.batteryLabel": "Батарея",
+ "ov.spareBattery": "Запасная батарея",
"ov.onboardProfile": "Встроенный профиль",
"ov.setupTitle": "Текущая настройка",
"ov.setupMeta": "Прочитано с устройства",
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index dca033c2..2b745976 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -1927,6 +1927,7 @@ export const tr: Record = {
"ov.pollingRate": "Yoklama hızı",
"ov.upTo": "En fazla {v}",
"ov.batteryLabel": "Pil",
+ "ov.spareBattery": "Yedek pil",
"ov.onboardProfile": "Dahili profil",
"ov.setupTitle": "Güncel kurulum",
"ov.setupMeta": "Cihazdan okundu",
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index 347faba2..d420f7a5 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -1934,6 +1934,7 @@ export const vi: Record = {
"ov.pollingRate": "Tần số báo cáo",
"ov.upTo": "Tối đa {v}",
"ov.batteryLabel": "Pin",
+ "ov.spareBattery": "Pin dự phòng",
"ov.onboardProfile": "Hồ sơ trên thiết bị",
"ov.setupTitle": "Thiết lập hiện tại",
"ov.setupMeta": "Đọc từ thiết bị",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index ee8fd1ff..31af9579 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -1929,6 +1929,7 @@ export const zh: Record = {
"ov.pollingRate": "回报率",
"ov.upTo": "最高 {v}",
"ov.batteryLabel": "电量",
+ "ov.spareBattery": "备用电池",
"ov.onboardProfile": "板载配置",
"ov.setupTitle": "当前设置",
"ov.setupMeta": "从设备读取",
diff --git a/src/styles/device.css b/src/styles/device.css
index 432cf6b0..eeb9bab7 100644
--- a/src/styles/device.css
+++ b/src/styles/device.css
@@ -70,6 +70,7 @@
.om-setup-figure:first-child { padding-inline-start: 0; border-inline-start: 0; }
.om-setup-figure .om-fig { font-size: var(--fs-figure); line-height: 32px; }
.om-setup-figure .om-fig .om-unit { line-height: 1; }
+.om-setup-figure .om-fig .battery-icon { display: inline-block; width: 26px; height: 13px; margin-inline-end: 8px; vertical-align: 0.1em; }
.om-setup-stages {
display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
padding: 14px var(--panel-pad) var(--panel-pad);
From 161c3fb3601b4371f2b16dbbb53cf297e2e4ffd9 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 20:33:16 -0500
Subject: [PATCH 08/18] fix(hardware-test): read-only skip reason and
receiver-only link check
A read-only driver's write test now says the driver is read-only instead of blaming staged changes. When only the receiver answered (ui.receiverOnly), the wireless-link check fails rather than passing on the receiver alone.
Refs kennedy/openmouse#19
---
src/features/hardware-test/HardwareTestPage.tsx | 4 +++-
.../hardware-test/hardware-test-report.test.ts | 13 +++++++++++++
src/features/hardware-test/hardware-test-report.ts | 10 ++++++++++
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/src/features/hardware-test/HardwareTestPage.tsx b/src/features/hardware-test/HardwareTestPage.tsx
index eccf9623..27aebfff 100644
--- a/src/features/hardware-test/HardwareTestPage.tsx
+++ b/src/features/hardware-test/HardwareTestPage.tsx
@@ -310,8 +310,10 @@ export function HardwareTestPage({ snapshot }: { snapshot: ControlSnapshot }): R
flashResult = flashWriteResult({ skipped: true, skippedReason: t(locale, "hw.x11ReadFailed") });
} else if (!liveStatus) {
flashResult = flashWriteResult({ skipped: true, skippedReason: "no live device status — cannot round-trip a write." });
- } else if (live.settingsPending || live.pending.count > 0 || live.gameProfileDraft) {
+ } else if (live.pending.count > 0 || live.gameProfileDraft) {
flashResult = flashWriteResult({ skipped: true, skippedReason: "you have staged, unapplied changes — apply or revert them first." });
+ } else if (live.settingsPending) {
+ flashResult = flashWriteResult({ skipped: true, skippedReason: "driver is set to read-only; it needs more testing before writes can be checked." });
} else {
const legs: FlashSettingRoundTrip[] = [];
const settings = verifiedDeviceSettings(liveStatus);
diff --git a/src/features/hardware-test/hardware-test-report.test.ts b/src/features/hardware-test/hardware-test-report.test.ts
index 92bcb475..d87b1a65 100644
--- a/src/features/hardware-test/hardware-test-report.test.ts
+++ b/src/features/hardware-test/hardware-test-report.test.ts
@@ -157,6 +157,19 @@ test("the wireless-link check fails when the receiver reports the mouse offline"
assert.match(link?.detail ?? "", /offline/);
});
+test("the wireless-link check fails when only the receiver answered", () => {
+ const info = deviceInfoFromSnapshot(
+ snapshotFor({
+ status: mouseStatus({ connectionType: "Wireless", ui: { settingsReady: false, receiverOnly: true } }),
+ devices: [],
+ }),
+ );
+ assert.equal(info.receiverOnly, true);
+ const link = automaticChecks(info).find((result) => result.key === "link");
+ assert.equal(link?.status, "fail");
+ assert.match(link?.detail ?? "", /receiver cannot detect mouse/);
+});
+
test("automatic checks flag a polling rate outside the supported set", () => {
const snapshot = snapshotFor({
status: mouseStatus({ pollingRateHz: 333, supportedPollingRates: [125, 250, 500, 1000] }),
diff --git a/src/features/hardware-test/hardware-test-report.ts b/src/features/hardware-test/hardware-test-report.ts
index c378b6ab..4e6fc1c5 100644
--- a/src/features/hardware-test/hardware-test-report.ts
+++ b/src/features/hardware-test/hardware-test-report.ts
@@ -43,6 +43,8 @@ export interface HardwareDeviceInfo {
receiverOnline?: boolean | null;
receiverRfId?: string | null;
pairingInProgress?: boolean;
+ /** Receiver detected, Mouse disconnected **/
+ receiverOnly?: boolean;
}
export interface HardwareTestReport {
@@ -122,6 +124,7 @@ export function deviceInfoFromSnapshot(snapshot: ControlSnapshot): HardwareDevic
receiverOnline: receiver != null ? receiver.online : null,
receiverRfId: receiver?.rfId ?? null,
pairingInProgress: receiver != null ? receiver.pairingStatus === 1 : false,
+ receiverOnly: status?.ui?.receiverOnly === true,
};
}
@@ -262,6 +265,13 @@ export function automaticChecks(info: HardwareDeviceInfo): HardwareTestResult[]
// where the driver exposes receiver telemetry the link must be online.
if (info.connectionType !== "Wireless") {
results.push({ key: "link", label: "Wireless link (receiver)", status: "skip", detail: null });
+ } else if (info.receiverOnly) {
+ results.push({
+ key: "link",
+ label: "Wireless link (receiver)",
+ status: "fail",
+ detail: "receiver cannot detect mouse.",
+ });
} else if (info.receiverOnline === null) {
results.push({
key: "link",
From 436d71fd76dbd3d44ea9482921f393996c9bd86b Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 22:01:32 -0500
Subject: [PATCH 09/18] fix(buttons): show the Default note only when the menu
offers Default
Drivers without a per-button Default action (the Angry Miao Infinity resets the whole map instead) no longer show "Default restores a button's factory function."
Closes kennedy/openmouse#11
---
src/features/devices/cards/AdvancedCards.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/features/devices/cards/AdvancedCards.tsx b/src/features/devices/cards/AdvancedCards.tsx
index 1011f023..f4a2a5cf 100644
--- a/src/features/devices/cards/AdvancedCards.tsx
+++ b/src/features/devices/cards/AdvancedCards.tsx
@@ -3804,7 +3804,7 @@ export function ButtonMappingCard({ snapshot }: { snapshot: ControlSnapshot }):
) : null}
) : null}
- {!selectedM2NexProfile && !isRival650 ? (
+ {!selectedM2NexProfile && !isRival650 && options.includes("Default") ? (
{t(locale, "map.defaultNote")}
) : null}
From 6792bf61907c6f40a988f15e3a1170ae61df14ec Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 22:02:12 -0500
Subject: [PATCH 10/18] fix(hardware-test): don't repeat the brand in the
device identity row
Names that already start with the brand ("Angry Miao Infinity .100") were shown as "Angry Miao Angry Miao Infinity .100".
Closes kennedy/openmouse#12
---
src/features/hardware-test/hardware-test-report.test.ts | 8 ++++++++
src/features/hardware-test/hardware-test-report.ts | 8 +++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/features/hardware-test/hardware-test-report.test.ts b/src/features/hardware-test/hardware-test-report.test.ts
index d87b1a65..8a0d93f6 100644
--- a/src/features/hardware-test/hardware-test-report.test.ts
+++ b/src/features/hardware-test/hardware-test-report.test.ts
@@ -4,6 +4,7 @@ import test from "node:test";
import type { ControlSnapshot } from "../../device/types.ts";
import {
automaticChecks,
+ brandedName,
deviceInfoFromSnapshot,
flashWriteResult,
formatHexId,
@@ -80,6 +81,13 @@ test("formatHexId pads to four hex digits and uppercases", () => {
assert.equal(formatHexId(0x5), "0x0005");
});
+test("brandedName adds the brand only when the name lacks it", () => {
+ assert.equal(brandedName("Acme", "MaxPoint One"), "Acme MaxPoint One");
+ assert.equal(brandedName("Angry Miao", "Angry Miao Infinity .100"), "Angry Miao Infinity .100");
+ assert.equal(brandedName("Razer", "razer viper"), "razer viper");
+ assert.equal(brandedName(null, "G23 Pro"), "G23 Pro");
+});
+
test("automatic checks fail connection and skip the rest without a device", () => {
const results = automaticChecks(deviceInfoFromSnapshot(snapshotFor({ devices: [] })));
assert.equal(results[0]?.status, "fail");
diff --git a/src/features/hardware-test/hardware-test-report.ts b/src/features/hardware-test/hardware-test-report.ts
index 4e6fc1c5..b0def09a 100644
--- a/src/features/hardware-test/hardware-test-report.ts
+++ b/src/features/hardware-test/hardware-test-report.ts
@@ -89,6 +89,12 @@ export function formatHexId(value: number): string {
return `0x${value.toString(16).toUpperCase().padStart(4, "0")}`;
}
+/** "Angry Miao Infinity .100", not "Angry Miao Angry Miao Infinity .100". */
+export function brandedName(brand: string | null, name: string): string {
+ if (!brand || name.toLowerCase().startsWith(brand.toLowerCase())) return name;
+ return `${brand} ${name}`;
+}
+
/** Extracts everything the suite needs to know about the connected device. */
export function deviceInfoFromSnapshot(snapshot: ControlSnapshot): HardwareDeviceInfo {
const status = snapshot.status;
@@ -186,7 +192,7 @@ export function automaticChecks(info: HardwareDeviceInfo): HardwareTestResult[]
key: "identity",
label: "Device identity",
status: identityOk ? "pass" : "fail",
- detail: identityOk ? `${info.brand ?? ""} ${info.name}`.trim() : "The device did not answer the identity query.",
+ detail: identityOk ? brandedName(info.brand, info.name!) : "The device did not answer the identity query.",
});
const driver = info.driverFamily ? `${info.brand ?? ""} ${info.driverFamily}`.trim() : (info.brand ?? null);
From cc2528245d4d91f7509de910ca09bb1800f10ae0 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 22:03:34 -0500
Subject: [PATCH 11/18] feat(devices): say Bluetooth for Bluetooth connections
Drivers report Bluetooth as connectionType "Wireless" with connectionDetail "Bluetooth". The device header, device card, overview and device list now show "Bluetooth" and the Bluetooth icon for that link, and keep "Wireless" for 2.4 GHz receivers. Polling and game-profile logic still treat it as wireless.
Closes kennedy/openmouse#17
---
src/device/controller.ts | 4 ++--
src/features/devices/DeviceHero.tsx | 6 +++---
src/features/devices/DeviceStats.tsx | 6 +++---
src/features/devices/OverviewPage.tsx | 4 ++--
src/i18n/i18n.test.ts | 8 +++++++-
src/i18n/index.ts | 7 +++++++
src/i18n/locales/ar.ts | 1 +
src/i18n/locales/de.ts | 1 +
src/i18n/locales/es.ts | 1 +
src/i18n/locales/fr.ts | 1 +
src/i18n/locales/ja.ts | 1 +
src/i18n/locales/ko.ts | 1 +
src/i18n/locales/pt.ts | 1 +
src/i18n/locales/ru.ts | 1 +
src/i18n/locales/tr.ts | 1 +
src/i18n/locales/vi.ts | 1 +
src/i18n/locales/zh.ts | 1 +
17 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/src/device/controller.ts b/src/device/controller.ts
index 7174a843..28863283 100644
--- a/src/device/controller.ts
+++ b/src/device/controller.ts
@@ -89,7 +89,7 @@ import {
type InterfacePreferences,
type InterfaceTheme,
} from "../features/settings/interface-preferences";
-import { displayText, displayTemplate, batteryStateText, connectionText, ensureDisplayLocale, layerLabel, t, tp, type I18nKey } from "../i18n/index";
+import { displayText, displayTemplate, batteryStateText, connectionLink, connectionText, ensureDisplayLocale, layerLabel, t, tp, type I18nKey } from "../i18n/index";
import type {
EggButtonIndex,
EggButtonMapping,
@@ -3596,7 +3596,7 @@ async function sidebarEntries(devices: HIDDevice[]): Promise {
? client.displayName()
: (device.productName ?? `${await deviceBrand(client)} mouse`));
const detail = slot?.isOnline === false ? `Logitech · ${st("ctl.notConnected")}`
- : status ? `${status.brand} · ${connectionText(interfacePreferences.locale, status.connectionType, "ctl.connected")}`
+ : status ? `${status.brand} · ${connectionText(interfacePreferences.locale, connectionLink(status), "ctl.connected")}`
: `${await deviceBrand(client)} · Available`;
entries.push({
index,
diff --git a/src/features/devices/DeviceHero.tsx b/src/features/devices/DeviceHero.tsx
index 0a3d83dc..f2199adb 100644
--- a/src/features/devices/DeviceHero.tsx
+++ b/src/features/devices/DeviceHero.tsx
@@ -1,4 +1,4 @@
-import { batteryStateText, connectionText, displayText, t, tp, type I18nKey } from "../../i18n/index";
+import { batteryStateText, connectionLink, connectionText, displayText, t, tp, type I18nKey } from "../../i18n/index";
import { ChevronRight, ImageUp, Lock, Unplug } from "lucide-react";
import { useEffect, useMemo, useState, type KeyboardEvent, type ReactNode } from "react";
import * as control from "../../device/controller";
@@ -72,8 +72,8 @@ export function DeviceHero({
{status?.connectionType ? (
-
- {connectionText(locale, status.connectionType)}
+
+ {connectionText(locale, connectionLink(status))}
) : null}
{receiverOnly || readOnly ? (
diff --git a/src/features/devices/DeviceStats.tsx b/src/features/devices/DeviceStats.tsx
index a25672b9..b29fb9a0 100644
--- a/src/features/devices/DeviceStats.tsx
+++ b/src/features/devices/DeviceStats.tsx
@@ -2,7 +2,7 @@ import { Bluetooth, Cable, Crosshair, Gauge, Layers, Usb, Wifi } from "lucide-re
import type { ReactNode } from "react";
import type { MouseStatus } from "@openmouse/protocol/drivers/mouse-types";
import * as control from "../../device/controller";
-import { connectionText, t } from "../../i18n/index";
+import { connectionLink, connectionText, t } from "../../i18n/index";
import type { InterfaceLocale } from "../settings/interface-preferences";
import { BatteryIcon } from "../../shared/ui";
@@ -31,8 +31,8 @@ export function DeviceStats({
{status.connectionType ? (
-
- {connectionText(locale, status.connectionType)}
+
+ {connectionText(locale, connectionLink(status))}
) : null}
{status.batteryPercent !== null ? (
diff --git a/src/features/devices/OverviewPage.tsx b/src/features/devices/OverviewPage.tsx
index 309d6cdb..1d70c20d 100644
--- a/src/features/devices/OverviewPage.tsx
+++ b/src/features/devices/OverviewPage.tsx
@@ -18,7 +18,7 @@ import { lazy, Suspense, useEffect, useRef, type ReactNode } from "react";
import * as control from "../../device/controller";
import { isNoirE1Status, isNoirKsnakeStatus, isNoirS1Status, noirBrandLabel } from "../../device/noir.ts";
import type { ControlSnapshot, WorkspaceTab } from "../../device/types";
-import { t, tp, connectionText, type I18nKey } from "../../i18n/index";
+import { t, tp, connectionLink, connectionText, type I18nKey } from "../../i18n/index";
import { Diagnostics, LogitechDetails } from "./Diagnostics";
import { KeychronNapeLayers } from "./KeychronNapeLayers";
import { Profiles } from "../profiles/Profiles";
@@ -301,7 +301,7 @@ export function DeviceShowcaseSidebar({ snapshot }: { snapshot: ControlSnapshot
{t(locale, "side.connected")}
{status.connectionType ? (
- {displayText(locale, " · ")}{displayText(locale, connectionText(locale, status.connectionType))}
+ {displayText(locale, " · ")}{displayText(locale, connectionText(locale, connectionLink(status)))}
) : null}
{status.batteryPercent !== null ? (
diff --git a/src/i18n/i18n.test.ts b/src/i18n/i18n.test.ts
index 9080ca54..32c171f2 100644
--- a/src/i18n/i18n.test.ts
+++ b/src/i18n/i18n.test.ts
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { batteryStateText, connectLabelText, ensureLocale, missingTranslations, t, tp } from "./index.ts";
+import { batteryStateText, connectionLink, connectionText, connectLabelText, ensureLocale, missingTranslations, t, tp } from "./index.ts";
import { tr } from "./locales/tr.ts";
test("i18n falls back to English until the locale table resolves", async () => {
@@ -25,6 +25,12 @@ test("i18n maps known connect labels and passes dynamic ones through", () => {
assert.equal(connectLabelText("pt", "Use Add device if lost"), "Use Add device if lost");
});
+test("a Bluetooth link reads as Bluetooth, a 2.4 GHz one as wireless", () => {
+ assert.equal(connectionText("en", connectionLink({ connectionType: "Wireless", connectionDetail: "Bluetooth" })), "Bluetooth");
+ assert.equal(connectionText("en", connectionLink({ connectionType: "Wireless", connectionDetail: "2.4 GHz" })), "Wireless");
+ assert.equal(connectionText("en", connectionLink({ connectionType: "Wired", connectionDetail: "USB" })), "Wired");
+});
+
test("every locale translates every key", async () => {
assert.deepEqual(await missingTranslations(), []);
});
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index c7129998..65268d41 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -1077,6 +1077,7 @@ const en = {
"key.layerName": "Layer {n}",
"conn.wired": "Wired",
"conn.wireless": "Wireless",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "No effect",
"light.speedN": "speed {n}",
"page.locale": "Language",
@@ -2592,8 +2593,14 @@ export function connectLabelText(locale: InterfaceLocale, label: string): string
const CONNECTIONS: Readonly
> = {
Wired: "conn.wired",
Wireless: "conn.wireless",
+ Bluetooth: "conn.bluetooth",
};
+/** Drivers report Bluetooth as "Wireless" and name the link in connectionDetail. */
+export function connectionLink(status: { connectionType?: string | null; connectionDetail?: string | null }): string | null | undefined {
+ return status.connectionDetail === "Bluetooth" ? "Bluetooth" : status.connectionType;
+}
+
export function connectionText(
locale: InterfaceLocale,
connection: string | null | undefined,
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts
index 396fe4f1..59c5ea0c 100644
--- a/src/i18n/locales/ar.ts
+++ b/src/i18n/locales/ar.ts
@@ -1015,6 +1015,7 @@ export const ar: Record = {
"key.layerName": "الطبقة {n}",
"conn.wired": "سلكي",
"conn.wireless": "لاسلكي",
+ "conn.bluetooth": "بلوتوث",
"light.noEffect": "بلا تأثير",
"light.speedN": "السرعة {n}",
"page.locale": "اللغة",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index 81e17177..d9acb3b8 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -1016,6 +1016,7 @@ export const de: Record = {
"key.layerName": "Ebene {n}",
"conn.wired": "Kabelgebunden",
"conn.wireless": "Kabellos",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Kein Effekt",
"light.speedN": "Geschwindigkeit {n}",
"page.locale": "Sprache",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 77f4d040..5360e390 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -1016,6 +1016,7 @@ export const es: Record = {
"key.layerName": "Capa {n}",
"conn.wired": "Con cable",
"conn.wireless": "Inalámbrico",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Sin efecto",
"light.speedN": "velocidad {n}",
"page.locale": "Idioma",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index fd12eaa1..193e31de 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -1016,6 +1016,7 @@ export const fr: Record = {
"key.layerName": "Couche {n}",
"conn.wired": "Filaire",
"conn.wireless": "Sans fil",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Aucun effet",
"light.speedN": "vitesse {n}",
"page.locale": "Langue",
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index 2fb9d10c..53b2ad13 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -1016,6 +1016,7 @@ export const ja: Record = {
"key.layerName": "レイヤー{n}",
"conn.wired": "有線",
"conn.wireless": "無線",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "エフェクトなし",
"light.speedN": "速度{n}",
"page.locale": "言語",
diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts
index b053c4cd..2f6542ed 100644
--- a/src/i18n/locales/ko.ts
+++ b/src/i18n/locales/ko.ts
@@ -1016,6 +1016,7 @@ export const ko: Record = {
"key.layerName": "레이어 {n}",
"conn.wired": "유선",
"conn.wireless": "무선",
+ "conn.bluetooth": "블루투스",
"light.noEffect": "효과 없음",
"light.speedN": "속도 {n}",
"page.locale": "언어",
diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts
index 881bf1e2..798870bd 100644
--- a/src/i18n/locales/pt.ts
+++ b/src/i18n/locales/pt.ts
@@ -1016,6 +1016,7 @@ export const pt: Record = {
"key.layerName": "Camada {n}",
"conn.wired": "Com fio",
"conn.wireless": "Sem fio",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Sem efeito",
"light.speedN": "velocidade {n}",
"page.locale": "Idioma",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 6cf73821..2afb3992 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -1015,6 +1015,7 @@ export const ru: Record = {
"key.layerName": "Слой {n}",
"conn.wired": "Проводное",
"conn.wireless": "Беспроводное",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Без эффекта",
"light.speedN": "скорость {n}",
"page.locale": "Язык",
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index 2b745976..18413753 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -1004,6 +1004,7 @@ export const tr: Record = {
"key.layerName": "Katman {n}",
"conn.wired": "Kablolu",
"conn.wireless": "Kablosuz",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Efekt yok",
"light.speedN": "hız {n}",
"page.locale": "Dil",
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index d420f7a5..e7328795 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -958,6 +958,7 @@ export const vi: Record = {
"key.layerName": "Layer {n}",
"conn.wired": "Có dây",
"conn.wireless": "Không dây",
+ "conn.bluetooth": "Bluetooth",
"light.noEffect": "Không hiệu ứng",
"light.speedN": "tốc độ {n}",
"page.locale": "Ngôn ngữ",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index 31af9579..82ae5ac9 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -1016,6 +1016,7 @@ export const zh: Record = {
"key.layerName": "按键层 {n}",
"conn.wired": "有线",
"conn.wireless": "无线",
+ "conn.bluetooth": "蓝牙",
"light.noEffect": "无效果",
"light.speedN": "速度 {n}",
"page.locale": "语言",
From db0498e995869e02a468d4aa4890ad6830720e2c Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Fri, 4 Dec 2026 22:04:35 -0500
Subject: [PATCH 12/18] fix(hardware-test): put mouse and receiver firmware on
separate lines
On a receiver, the firmware row ran the mouse, receiver and sensor together. Entries that drivers prefix with "Receiver" or "Dongle" now go on their own line; the mouse and its sensor stay on the first.
Closes kennedy/openmouse#13
---
src/features/hardware-test/HardwareTestPage.tsx | 7 ++++++-
.../hardware-test/hardware-test-report.test.ts | 10 ++++++++++
src/features/hardware-test/hardware-test-report.ts | 7 +++++++
src/styles/areas/pages.css | 1 +
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/features/hardware-test/HardwareTestPage.tsx b/src/features/hardware-test/HardwareTestPage.tsx
index 27aebfff..a60d4990 100644
--- a/src/features/hardware-test/HardwareTestPage.tsx
+++ b/src/features/hardware-test/HardwareTestPage.tsx
@@ -12,6 +12,7 @@ import { brandChecks } from "./hardware-brand-checks";
import {
automaticChecks,
deviceInfoFromSnapshot,
+ firmwareLines,
flashWriteResult,
formatHexId,
isFlashBaseline,
@@ -763,7 +764,11 @@ export function HardwareTestPage({ snapshot }: { snapshot: ControlSnapshot }): R
{info.firmware && (
{t(locale, "test.firmware")}
- {info.firmware.join(", ")}
+
+ {firmwareLines(info.firmware).map((line) => (
+ {line}
+ ))}
+
)}
{info.deviceMode && (
diff --git a/src/features/hardware-test/hardware-test-report.test.ts b/src/features/hardware-test/hardware-test-report.test.ts
index 8a0d93f6..18d57220 100644
--- a/src/features/hardware-test/hardware-test-report.test.ts
+++ b/src/features/hardware-test/hardware-test-report.test.ts
@@ -6,6 +6,7 @@ import {
automaticChecks,
brandedName,
deviceInfoFromSnapshot,
+ firmwareLines,
flashWriteResult,
formatHexId,
pickFlashDpiTarget,
@@ -88,6 +89,15 @@ test("brandedName adds the brand only when the name lacks it", () => {
assert.equal(brandedName(null, "G23 Pro"), "G23 Pro");
});
+test("firmwareLines puts the mouse and the receiver on their own lines", () => {
+ assert.deepEqual(
+ firmwareLines(["Mouse SoC 0x0318", "Receiver USB 0x0008", "Receiver RF 0xf0", "Receiver LED 0x0109", "PixArt PAW3950"]),
+ ["Mouse SoC 0x0318, PixArt PAW3950", "Receiver USB 0x0008, Receiver RF 0xf0, Receiver LED 0x0109"],
+ );
+ assert.deepEqual(firmwareLines(["Dongle v1.2", "Mouse v3.4"]), ["Mouse v3.4", "Dongle v1.2"]);
+ assert.deepEqual(firmwareLines(["v1.2.3"]), ["v1.2.3"]);
+});
+
test("automatic checks fail connection and skip the rest without a device", () => {
const results = automaticChecks(deviceInfoFromSnapshot(snapshotFor({ devices: [] })));
assert.equal(results[0]?.status, "fail");
diff --git a/src/features/hardware-test/hardware-test-report.ts b/src/features/hardware-test/hardware-test-report.ts
index b0def09a..ce253656 100644
--- a/src/features/hardware-test/hardware-test-report.ts
+++ b/src/features/hardware-test/hardware-test-report.ts
@@ -95,6 +95,13 @@ export function brandedName(brand: string | null, name: string): string {
return `${brand} ${name}`;
}
+/** One line per device: drivers prefix receiver entries with "Receiver" or "Dongle". */
+export function firmwareLines(firmware: readonly string[]): string[] {
+ const receiver = firmware.filter((entry) => /^(receiver|dongle)\b/i.test(entry));
+ const mouse = firmware.filter((entry) => !receiver.includes(entry));
+ return [mouse, receiver].filter((entries) => entries.length > 0).map((entries) => entries.join(", "));
+}
+
/** Extracts everything the suite needs to know about the connected device. */
export function deviceInfoFromSnapshot(snapshot: ControlSnapshot): HardwareDeviceInfo {
const status = snapshot.status;
diff --git a/src/styles/areas/pages.css b/src/styles/areas/pages.css
index bdcb71a8..713bae3e 100644
--- a/src/styles/areas/pages.css
+++ b/src/styles/areas/pages.css
@@ -63,6 +63,7 @@
.hardware-test-status .mouse-test-device-row:first-child { border-top: 0; }
.hardware-test-status .mouse-test-device-key { color: var(--text-2); font-size: var(--fs-meta); flex: none; }
.hardware-test-status .mouse-test-device-val { min-width: 0; text-align: end; font-size: var(--fs-meta); font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
+.mouse-test-firmware-line { display: block; }
.hardware-test-status .mouse-test-dpi-stages { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.hardware-test-status .mouse-test-dpi-chip { padding: 2px 7px; border-radius: var(--r-xs); background: var(--well); color: var(--text-2); }
.hardware-test-status .mouse-test-dpi-chip.active { background: var(--accent-soft); color: var(--accent); }
From 8a0b84522e37766b5f374a70637cfab8d0658a4a Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 00:40:47 -0500
Subject: [PATCH 13/18] refactor(preview): keep the Angry Miao fixtures in
src/device/angry-miao/
Moves angry-miao-fixtures.ts and its test from src/device/preview/ to src/device/angry-miao/preview-fixtures.ts, next to the Angry Miao firmware converter. No fixture changed.
---
.../preview-fixtures.test.ts} | 4 ++--
.../angry-miao-fixtures.ts => angry-miao/preview-fixtures.ts} | 2 +-
src/device/preview/preview-fixtures.ts | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
rename src/device/{preview/angry-miao-fixtures.test.ts => angry-miao/preview-fixtures.test.ts} (96%)
rename src/device/{preview/angry-miao-fixtures.ts => angry-miao/preview-fixtures.ts} (98%)
diff --git a/src/device/preview/angry-miao-fixtures.test.ts b/src/device/angry-miao/preview-fixtures.test.ts
similarity index 96%
rename from src/device/preview/angry-miao-fixtures.test.ts
rename to src/device/angry-miao/preview-fixtures.test.ts
index ca9bf197..82a08d5f 100644
--- a/src/device/preview/angry-miao-fixtures.test.ts
+++ b/src/device/angry-miao/preview-fixtures.test.ts
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { ANGRY_MIAO_FIXTURES } from "./angry-miao-fixtures.ts";
-import { PREVIEW_FIXTURES } from "./preview-fixtures.ts";
+import { ANGRY_MIAO_FIXTURES } from "./preview-fixtures.ts";
+import { PREVIEW_FIXTURES } from "../preview/preview-fixtures.ts";
import { familyOf, traitsFor } from "../traits.ts";
import { cardAvailability } from "../../features/devices/cards/availability.ts";
import type { ControlSnapshot } from "../types.ts";
diff --git a/src/device/preview/angry-miao-fixtures.ts b/src/device/angry-miao/preview-fixtures.ts
similarity index 98%
rename from src/device/preview/angry-miao-fixtures.ts
rename to src/device/angry-miao/preview-fixtures.ts
index 1ad9051b..17fa0f08 100644
--- a/src/device/preview/angry-miao-fixtures.ts
+++ b/src/device/angry-miao/preview-fixtures.ts
@@ -3,7 +3,7 @@ import {
ANGRY_MIAO_INFINITY_100R2_MODEL,
ANGRY_MIAO_INFINITY_97_MODEL,
} from "@openmouse/protocol/angry-miao";
-import type { PreviewFixture } from "./preview-fixtures.ts";
+import type { PreviewFixture } from "../preview/preview-fixtures.ts";
export type AngryMiaoPreviewMode = "angry-miao-infinity-100" | "angry-miao-infinity-97" | "angry-miao-infinity-100r2";
diff --git a/src/device/preview/preview-fixtures.ts b/src/device/preview/preview-fixtures.ts
index 3673f4af..e61d4182 100644
--- a/src/device/preview/preview-fixtures.ts
+++ b/src/device/preview/preview-fixtures.ts
@@ -1,7 +1,7 @@
import type { MouseLighting, MouseStatus } from "@openmouse/protocol/drivers/mouse-types";
import { LUNAFURY_BUTTON_ACTIONS } from "@openmouse/protocol/lamzu";
import { PREVIEW_KEYS, type FixturePreviewMode } from "./preview-modes.ts";
-import { ANGRY_MIAO_FIXTURES } from "./angry-miao-fixtures.ts";
+import { ANGRY_MIAO_FIXTURES } from "../angry-miao/preview-fixtures.ts";
export { PREVIEW_KEYS };
From 5bcd1b6dc6447765a6afe19656b693a35dd443f7 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 00:40:47 -0500
Subject: [PATCH 14/18] feat(firmware): version names and packages in the
firmware manifest
Some vendors report raw codes instead of versions and name their firmware by package. Manifest entries can now say so, with no vendor code in the app:
- versionNames: the text after firmwareName (e.g. 0x0318) to the vendor's version name. An unlisted code stays unknown.
- packageOf: a package (mouse or receiver) whose version follows from the versions of its parts.
describeFirmware() turns these into the Firmware card's rows, one per package, each with its own Later. A device only gets package rows when it reports one of the parts; USB ids can be shared between brands, so any other device keeps its single getDfuInfo row as before.
---
src/device/firmware-updates.test.ts | 44 +++++++++++
src/device/firmware-updates.ts | 88 ++++++++++++++++++++-
src/features/devices/cards/FirmwareCard.tsx | 46 ++++++++---
3 files changed, 162 insertions(+), 16 deletions(-)
diff --git a/src/device/firmware-updates.test.ts b/src/device/firmware-updates.test.ts
index bc14b58e..18ee504d 100644
--- a/src/device/firmware-updates.test.ts
+++ b/src/device/firmware-updates.test.ts
@@ -4,6 +4,7 @@ import test from "node:test";
import {
compareVersions,
currentFirmwareVersion,
+ describeFirmware,
describeFirmwareEntities,
extractVersionToken,
getDfuInfo,
@@ -282,3 +283,46 @@ test("Cooler Master MM711 entry matches by interfaceId and compares version", ()
const current = getDfuInfo({ ...ref, firmware: ["1.05.00"] }, m);
assert.equal(current?.dfuAvailable, false);
});
+
+const coded: FirmwareManifest = {
+ manifestVersion: 3,
+ updatedAt: "2026-12-05T00:00:00.000Z",
+ source: "test",
+ devices: [
+ { id: "main", interfaceIds: ["1234_0001"], firmwareName: "Main", versionNames: { "0x0002": "2.0", "0x0003": "3.0" }, latestVersion: "3.0" },
+ { id: "radio", interfaceIds: ["1234_0001"], firmwareName: "Radio", versionNames: { "0x10": "1.0" }, latestVersion: "1.0" },
+ {
+ id: "mouse",
+ interfaceIds: ["1234_0001"],
+ packageOf: { device: "mouse", parts: ["Main", "Radio"], versions: { "2.0,1.0": "1.1", "3.0,1.0": "1.2" } },
+ latestVersion: "1.2",
+ },
+ ],
+};
+const codedRef = (firmware: string[]): FirmwareDeviceRef => ({ brand: "Any", name: "Any", firmware, interfaceId: "1234_0001" });
+
+test("versionNames turns a raw code into the vendor's version", () => {
+ const [main] = describeFirmwareEntities(codedRef(["Main 0x0002"]), coded);
+ assert.equal(main?.version, "2.0");
+ assert.equal(main?.available, true);
+ assert.equal(describeFirmwareEntities(codedRef(["Main 0x0009"]), coded)[0]?.version, null);
+});
+
+test("describeFirmware names a package from the versions of all its parts", () => {
+ const [row] = describeFirmware(codedRef(["Main 0x0002", "Radio 0x10"]), coded);
+ assert.equal(row?.info?.currentVersion, "1.1");
+ assert.equal(row?.info?.dfuAvailable, true);
+ assert.deepEqual(row?.parts, [{ element: "Main 0x0002", version: "2.0" }, { element: "Radio 0x10", version: "1.0" }]);
+
+ const [partial] = describeFirmware(codedRef(["Main 0x0002"]), coded);
+ assert.equal(partial?.info, null);
+ assert.equal(partial?.parts.length, 1);
+});
+
+test("package entries are never a device-level match", () => {
+ assert.equal(matchManifestEntry(codedRef(["Main 0x0002"]), coded), null);
+});
+
+test("describeFirmware gives a device without packages its getDfuInfo row", () => {
+ assert.deepEqual(describeFirmware(device(), manifest), [{ device: "mouse", info: getDfuInfo(device(), manifest), parts: [] }]);
+});
diff --git a/src/device/firmware-updates.ts b/src/device/firmware-updates.ts
index 4af51243..dea02df0 100644
--- a/src/device/firmware-updates.ts
+++ b/src/device/firmware-updates.ts
@@ -54,12 +54,29 @@ export interface FirmwareManifestEntry {
* bootloader entity from being compared against the mouse's latest.
*/
firmwareName?: string;
+ /**
+ * For elements that carry a raw code instead of a version: the text after
+ * `firmwareName` (lowercase, e.g. "0x0318") to the vendor's version name.
+ * A code missing from the list leaves the version unknown.
+ */
+ versionNames?: Record;
+ /** Makes the entry a package whose version follows from the versions of its parts. */
+ packageOf?: FirmwarePackage;
latestVersion: string;
required?: boolean;
downloadUrl?: string;
releaseNotes?: string;
}
+export interface FirmwarePackage {
+ /** What the package runs on; the card names its row after it. */
+ device: "mouse" | "receiver";
+ /** The `firmwareName` of each part entry, in the order `versions` joins them. */
+ parts: string[];
+ /** Part versions joined with "," to the package version, e.g. "1.0.3,1.1.1" to "1.6". */
+ versions: Record;
+}
+
export interface FirmwareManifest {
manifestVersion: number;
updatedAt: string;
@@ -156,13 +173,19 @@ export function matchManifestEntry(
): FirmwareManifestEntry | null {
for (const entry of manifest.devices) {
// Entity-specific entries are evaluated in getDfuInfo's entity pass,
- // never as device-level fallbacks.
- if (entry.firmwareName) continue;
+ // packages in describeFirmware; neither is a device-level fallback.
+ if (entry.firmwareName || entry.packageOf) continue;
if (deviceMatches(entry, device)) return entry;
}
return null;
}
+function elementVersion(entry: FirmwareManifestEntry, element: string): string | null {
+ if (!entry.versionNames) return extractVersionToken(element);
+ const code = element.slice(entry.firmwareName?.length ?? 0).trim().toLowerCase();
+ return entry.versionNames[code] ?? null;
+}
+
/** Per-element readout, so multi-entity firmware like
* ["MPM 39.00.B0004", "BL2 73.00.B0011"] never blames the wrong element.
* Element 0 falls back to the device-level entry; later elements only match
@@ -181,7 +204,6 @@ export function describeFirmwareEntities(
manifest: FirmwareManifest,
): FirmwareEntityInfo[] {
return device.firmware.map((element, index) => {
- const version = extractVersionToken(element);
const lowered = element.toLowerCase();
const entityEntry = manifest.devices.find(
(entry) =>
@@ -190,6 +212,7 @@ export function describeFirmwareEntities(
lowered.startsWith(entry.firmwareName.toLowerCase()),
);
const entry = entityEntry ?? (index === 0 ? matchManifestEntry(device, manifest) : null);
+ const version = entry ? elementVersion(entry, element) : extractVersionToken(element);
if (!entry || !version) {
return { element, version, latestVersion: null, entryId: entry?.id ?? null, available: null, required: false };
}
@@ -223,7 +246,7 @@ export function getDfuInfo(device: FirmwareDeviceRef, manifest: FirmwareManifest
item.toLowerCase().startsWith(entry.firmwareName!.toLowerCase()),
);
if (!element) continue;
- const current = extractVersionToken(element);
+ const current = elementVersion(entry, element);
if (!current) continue;
const available = compareVersions(current, entry.latestVersion) < 0;
entityInfos.push({
@@ -257,6 +280,63 @@ export function getDfuInfo(device: FirmwareDeviceRef, manifest: FirmwareManifest
};
}
+/** One row of the Firmware card: the device itself, or a package such as its receiver. */
+export interface FirmwareRow {
+ device: "mouse" | "receiver";
+ /** Null when the version is unknown or the manifest has no entry. */
+ info: DfuInfo | null;
+ /** A package's parts as the device reports them, each with its version name when known. */
+ parts: Array<{ element: string; version: string | null }>;
+}
+
+function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device: FirmwareDeviceRef, manifest: FirmwareManifest): FirmwareRow | null {
+ const parts: FirmwareRow["parts"] = [];
+ const versions: Array = [];
+ for (const name of pkg.parts) {
+ const prefix = name.toLowerCase();
+ const element = device.firmware.find((item) => item.toLowerCase().startsWith(prefix));
+ const partEntry = manifest.devices.find(
+ (candidate) => candidate.firmwareName?.toLowerCase() === prefix && deviceMatches(candidate, device),
+ );
+ const version = element && partEntry ? elementVersion(partEntry, element) : null;
+ if (element) parts.push({ element, version });
+ versions.push(version);
+ }
+ if (parts.length === 0) return null;
+ const current = versions.every((version) => version !== null) ? pkg.versions[versions.join(",")] ?? null : null;
+ if (!current) return { device: pkg.device, info: null, parts };
+ const available = compareVersions(current, entry.latestVersion) < 0;
+ return {
+ device: pkg.device,
+ info: {
+ currentVersion: current,
+ latestVersion: entry.latestVersion,
+ dfuAvailable: available,
+ dfuRequired: available && entry.required === true,
+ downloadUrl: entry.downloadUrl,
+ releaseNotes: entry.releaseNotes,
+ history: entry.history,
+ },
+ parts,
+ };
+}
+
+/**
+ * The Firmware card's rows. A device that reports parts of a package gets one
+ * row per such package; any other device gets one row from getDfuInfo. USB ids
+ * can be shared between brands, so a matching id alone never picks packages.
+ * The device's own row always comes first.
+ */
+export function describeFirmware(device: FirmwareDeviceRef, manifest: FirmwareManifest): FirmwareRow[] {
+ const rows = manifest.devices
+ .filter((entry) => entry.packageOf && deviceMatches(entry, device))
+ .map((entry) => packageRow(entry, entry.packageOf!, device, manifest))
+ .filter((row): row is FirmwareRow => row !== null);
+ if (rows.length === 0) return [{ device: "mouse", info: getDfuInfo(device, manifest), parts: [] }];
+ if (!rows.some((row) => row.device === "mouse")) rows.unshift({ device: "mouse", info: null, parts: [] });
+ return rows.sort((a, b) => Number(a.device !== "mouse") - Number(b.device !== "mouse"));
+}
+
interface ManifestCache {
fetchedAt: number;
manifest: FirmwareManifest;
diff --git a/src/features/devices/cards/FirmwareCard.tsx b/src/features/devices/cards/FirmwareCard.tsx
index 9c3e1aff..6142dd83 100644
--- a/src/features/devices/cards/FirmwareCard.tsx
+++ b/src/features/devices/cards/FirmwareCard.tsx
@@ -1,13 +1,14 @@
import { displayText } from "../../../i18n/index";
import { useEffect, useState, type ReactNode } from "react";
import {
+ describeFirmware,
dismissDfuVersion,
dismissKeyFor,
- getDfuInfo,
isDfuDismissed,
loadFirmwareManifest,
type DfuInfo,
type FirmwareManifest,
+ type FirmwareRow,
} from "../../../device/firmware-updates";
import type { ControlSnapshot } from "../../../device/types";
import * as control from "../../../device/controller";
@@ -81,8 +82,9 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
// Re-read dismissals after a Later click (same render pass otherwise).
void dismissTick;
- const mouseDfu: DfuInfo | null = manifest ? getDfuInfo(ref, manifest) : null;
- const mouseVisible = mouseDfu !== null && !isDfuDismissed(deviceKey, mouseDfu.latestVersion) ? mouseDfu : null;
+ const rows: FirmwareRow[] = manifest ? describeFirmware(ref, manifest) : [];
+ const rowKey = (row: FirmwareRow): string => (row.device === "mouse" ? deviceKey : `${deviceKey}:${row.device}`);
+ const visible = rows.map((row) => (row.info !== null && !isDfuDismissed(rowKey(row), row.info.latestVersion) ? row.info : null));
const receiver = snapshot.receiverFirmware;
// Both MCU readouts are bootloader identifiers (proven static across a
@@ -93,7 +95,7 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
// is informational until an app-firmware source exists.
const receiverMcus = receiver?.mcus ?? [];
- const available = [mouseVisible].filter((info) => info?.dfuAvailable);
+ const available = visible.filter((info) => info?.dfuAvailable);
const download = available.find((info) => info?.downloadUrl) ?? null;
let pill: string;
@@ -101,7 +103,7 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
pill = t(locale, "fw.checking");
} else if (available.length > 0) {
pill = t(locale, "fw.available");
- } else if (mouseVisible) {
+ } else if (visible.some((info) => info !== null)) {
pill = t(locale, "fw.upToDate");
} else {
pill = t(locale, "fw.unknown");
@@ -109,10 +111,27 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
const pillBadge = available.length > 0 ? "fw-badge-available" : undefined;
function dismissAll(): void {
- if (mouseVisible) dismissDfuVersion(deviceKey, mouseVisible.latestVersion);
+ rows.forEach((row, index) => {
+ const info = visible[index];
+ if (info) dismissDfuVersion(rowKey(row), info.latestVersion);
+ });
setDismissTick((n) => n + 1);
}
+ function partList(row: FirmwareRow): ReactNode {
+ if (row.parts.length === 0) return null;
+ return (
+ <>
+ {row.info ? {tp(locale, "fw.current", { version: row.info.currentVersion ?? "" })} : null}
+
+ {row.parts.map((part) => (
+ - {displayText(locale, part.version ? `${part.element} · v${part.version}` : part.element)}
+ ))}
+
+ >
+ );
+ }
+
function rowBadge(info: DfuInfo | null): ReactNode {
if (info?.dfuAvailable !== true) return null;
return ;
@@ -181,13 +200,16 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
) : (
<>
-
-
-
{status.name}
- {rowBadge(mouseVisible)}
+ {rows.map((row, index) => (
+
+
+
{row.device === "mouse" ? status.name : t(locale, "hw.receiver")}
+ {rowBadge(visible[index] ?? null)}
+
+ {deviceDetails(visible[index] ?? null, row.info?.currentVersion ?? null)}
+ {partList(row)}
- {deviceDetails(mouseVisible, mouseDfu?.currentVersion ?? null)}
-
+ ))}
{receiverMcus.length > 0 ? (
From 8e279a84f4243eafcd019d94ebfbb2377924951b Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 00:40:47 -0500
Subject: [PATCH 15/18] feat(firmware): name Angry Miao .100 firmware with the
vendor's versions
src/device/angry-miao/firmware.ts turns Angry Miao's AM30 version table (ammaster.angrymiao.com/mouse/api/am30/version-map) into ordinary manifest entries: one per part with versionNames, plus the mouse and receiver packages. The vendor keys codes in hex without leading zeros and the RF code in decimal; that is handled here, and its 0.0.0 placeholder is dropped.
generate-firmware-manifest.mjs runs the converter (Node 23.6 or later) and keeps the previous entries when the table cannot be downloaded. Regenerated public/firmware-manifest.json: only the seven Angry Miao entries were added.
The .97 and .100R2 are left out for now.
Closes kennedy/openmouse#3
---
public/firmware-manifest.json | 197 +++++++++++++++++++++----
scripts/generate-firmware-manifest.mjs | 51 ++++++-
src/device/angry-miao/firmware.test.ts | 102 +++++++++++++
src/device/angry-miao/firmware.ts | 86 +++++++++++
4 files changed, 402 insertions(+), 34 deletions(-)
create mode 100644 src/device/angry-miao/firmware.test.ts
create mode 100644 src/device/angry-miao/firmware.ts
diff --git a/public/firmware-manifest.json b/public/firmware-manifest.json
index a35cbb16..77bb9e58 100644
--- a/public/firmware-manifest.json
+++ b/public/firmware-manifest.json
@@ -1,9 +1,176 @@
{
- "_comment": "AUTO-GENERATED — do not edit by hand. Regenerate with: node scripts/generate-firmware-manifest.mjs. Sources: Logitech update CDN depots listed in scripts/firmware-depots.seed.json (plain HTTPS, no auth). Versions/hashes/blockers are re-derived from each depot's dfu.json every run.",
+ "_comment": "AUTO-GENERATED — do not edit by hand. Regenerate with: node scripts/generate-firmware-manifest.mjs. Sources: Logitech update CDN depots listed in scripts/firmware-depots.seed.json (plain HTTPS, no auth), and vendor version tables (ammaster.angrymiao.com). Versions/hashes/blockers are re-derived from each depot's dfu.json every run.",
"manifestVersion": 3,
- "updatedAt": "2026-10-10T19:45:56.998Z",
- "source": "scripts/generate-firmware-manifest.mjs over updates.ghub.logitechg.com",
+ "updatedAt": "2026-12-05T04:56:09.955Z",
+ "source": "scripts/generate-firmware-manifest.mjs over updates.ghub.logitechg.com and ammaster.angrymiao.com",
"devices": [
+ {
+ "id": "8bitdo-retro-r8-mouse",
+ "brand": "8BitDo",
+ "nameMatch": [
+ "Retro R8"
+ ],
+ "firmwareName": "Mouse",
+ "latestVersion": "11.03",
+ "required": false,
+ "downloadUrl": "https://support.8bitdo.com/",
+ "releaseNotes": "Mouse 11.03 == latest non-beta R8 mouse firmware in the 8BitDo firmware API (firmware_type 84) on 2026-12-01. Check-only: update through 8BitDo Ultimate Software V2."
+ },
+ {
+ "id": "8bitdo-retro-r8-receiver",
+ "brand": "8BitDo",
+ "nameMatch": [
+ "Retro R8"
+ ],
+ "firmwareName": "Receiver",
+ "latestVersion": "10.14",
+ "required": false,
+ "downloadUrl": "https://support.8bitdo.com/",
+ "releaseNotes": "Receiver 10.14 == latest non-beta R8 2.4G receiver firmware in the 8BitDo firmware API (firmware_type 85) on 2026-12-01. Check-only; see mouse entry."
+ },
+ {
+ "id": "angry-miao-am30-mouse",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "packageOf": {
+ "device": "mouse",
+ "parts": [
+ "Mouse USB",
+ "Mouse SoC"
+ ],
+ "versions": {
+ "1.0.3,1.0.4": "1.0",
+ "1.0.3,1.0.5": "1.1",
+ "1.0.3,1.0.7": "1.2",
+ "1.0.3,1.0.8": "1.3",
+ "1.0.3,1.0.9": "1.4",
+ "1.0.3,1.1.0": "1.5",
+ "1.0.3,1.1.1": "1.6",
+ "1.0.3,1.1.2": "1.7",
+ "1.0.3,1.1.3": "1.8",
+ "1.0.3,1.1.4": "1.9"
+ }
+ },
+ "latestVersion": "1.9"
+ },
+ {
+ "id": "angry-miao-am30-mouse-soc",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "firmwareName": "Mouse SoC",
+ "versionNames": {
+ "0x0317": "1.1.0",
+ "0x0318": "1.1.1",
+ "0x0319": "1.1.2",
+ "0x0320": "1.1.3",
+ "0x0321": "1.1.4"
+ },
+ "latestVersion": "1.1.4"
+ },
+ {
+ "id": "angry-miao-am30-mouse-usb",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "firmwareName": "Mouse USB",
+ "versionNames": {
+ "0x0100": "1.0.0",
+ "0x0101": "1.0.3"
+ },
+ "latestVersion": "1.0.3"
+ },
+ {
+ "id": "angry-miao-am30-receiver",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "packageOf": {
+ "device": "receiver",
+ "parts": [
+ "Receiver USB",
+ "Receiver RF",
+ "Receiver LED"
+ ],
+ "versions": {
+ "1.0.4,1.0.5,1.0.3": "1.0",
+ "1.0.4,1.0.5,1.0.4": "1.1",
+ "1.0.4,1.0.6,1.0.5": "1.2",
+ "1.0.4,1.0.7,1.0.5": "1.3",
+ "1.0.4,1.0.8,1.0.5": "1.4",
+ "1.0.5,1.0.8,1.0.5": "1.5",
+ "1.0.7,1.0.8,1.0.5": "1.6"
+ }
+ },
+ "latestVersion": "1.6"
+ },
+ {
+ "id": "angry-miao-am30-receiver-led",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "firmwareName": "Receiver LED",
+ "versionNames": {
+ "0x0104": "1.0.1",
+ "0x0105": "1.0.2",
+ "0x0106": "1.0.3",
+ "0x0108": "1.0.4",
+ "0x0109": "1.0.5"
+ },
+ "latestVersion": "1.0.5"
+ },
+ {
+ "id": "angry-miao-am30-receiver-rf",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "firmwareName": "Receiver RF",
+ "versionNames": {
+ "0xea": "1.0.3",
+ "0xeb": "1.0.4",
+ "0xec": "1.0.5",
+ "0xed": "1.0.6",
+ "0xee": "1.0.7",
+ "0xf0": "1.0.8"
+ },
+ "latestVersion": "1.0.8"
+ },
+ {
+ "id": "angry-miao-am30-receiver-usb",
+ "brand": "Angry Miao",
+ "interfaceIds": [
+ "3151_402a",
+ "3151_5007",
+ "3151_402c"
+ ],
+ "firmwareName": "Receiver USB",
+ "versionNames": {
+ "0x0004": "1.0.3",
+ "0x0005": "1.0.4",
+ "0x0006": "1.0.5",
+ "0x0008": "1.0.7"
+ },
+ "latestVersion": "1.0.7"
+ },
{
"id": "c53a_dfu@40.3.14:046d_c53a",
"depot": "c53a_dfu",
@@ -686,30 +853,6 @@
"releaseNotes": "Updated USB device name to \"Yeti X WoW Edition\"",
"startBlockers": [],
"startWarnings": []
- },
- {
- "id": "8bitdo-retro-r8-mouse",
- "brand": "8BitDo",
- "nameMatch": [
- "Retro R8"
- ],
- "firmwareName": "Mouse",
- "latestVersion": "11.03",
- "required": false,
- "downloadUrl": "https://support.8bitdo.com/",
- "releaseNotes": "Mouse 11.03 == latest non-beta R8 mouse firmware in the 8BitDo firmware API (firmware_type 84) on 2026-12-01. Check-only: update through 8BitDo Ultimate Software V2."
- },
- {
- "id": "8bitdo-retro-r8-receiver",
- "brand": "8BitDo",
- "nameMatch": [
- "Retro R8"
- ],
- "firmwareName": "Receiver",
- "latestVersion": "10.14",
- "required": false,
- "downloadUrl": "https://support.8bitdo.com/",
- "releaseNotes": "Receiver 10.14 == latest non-beta R8 2.4G receiver firmware in the 8BitDo firmware API (firmware_type 85) on 2026-12-01. Check-only; see mouse entry."
}
]
}
diff --git a/scripts/generate-firmware-manifest.mjs b/scripts/generate-firmware-manifest.mjs
index 44e10ad0..7ad02e09 100644
--- a/scripts/generate-firmware-manifest.mjs
+++ b/scripts/generate-firmware-manifest.mjs
@@ -21,7 +21,7 @@
//
// Usage:
// node scripts/generate-firmware-manifest.mjs [--only
] [--output ]
-// (Requires Node ≥ 18. Run from the openmouse repo root.)
+// (Requires Node ≥ 23.6, which runs the TypeScript converters it imports. Run from the openmouse repo root.)
//
// Encrypted depots: a few depots (some keyboards, some receivers) carry a
// {header-sha, key-id} index instead of a file list — per-depot
@@ -32,6 +32,13 @@
// Hand entries: scripts/firmware-manifest.extra.json holds confirmed values
// for devices without usable depots (merged last, extra wins on id clash).
//
+// Vendor version tables: some vendors publish a lookup from raw firmware codes
+// to their own version names instead of depots. A converter per vendor turns
+// the table into ordinary entries (`versionNames` for parts, `packageOf` for
+// packages), so the app never needs vendor code. The browser cannot read those
+// endpoints, so each run fetches them here. A table that fails to download
+// keeps that vendor's entries from the previous manifest.
+//
// Safety: downloads are verified (archive parses end-to-end; binaries are
// cross-checked against dfu.json hashes where present). A depot that fails
// to download or parse is skipped with a warning, never fatal — the
@@ -41,6 +48,7 @@ import { writeFileSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { createHash } from "node:crypto";
+import { AM30_ENTRY_PREFIX, AM30_VERSION_MAP_URL, am30ManifestEntries } from "../src/device/angry-miao/firmware.ts";
const here = dirname(fileURLToPath(import.meta.url));
const root = join(here, "..");
@@ -58,6 +66,17 @@ const outputPath = flag("--output") ?? join(root, "public", "firmware-manifest.j
const seed = JSON.parse(readFileSync(join(here, "firmware-depots.seed.json"), "utf8"));
+const VENDOR_TABLES = [
+ { id: AM30_ENTRY_PREFIX, url: AM30_VERSION_MAP_URL, toEntries: am30ManifestEntries },
+];
+
+let previousManifest = null;
+try {
+ previousManifest = JSON.parse(readFileSync(outputPath, "utf8"));
+} catch {
+ // First run: nothing to carry forward.
+}
+
function depotUrl(entry) {
return `${CDN_HOST}/depots/${entry.uuid}/${entry.name}.depot`;
}
@@ -115,6 +134,12 @@ async function fetchDepot(entry) {
return Buffer.from(await response.arrayBuffer());
}
+async function fetchVendorEntries(source) {
+ const response = await fetch(source.url, { signal: AbortSignal.timeout(30000) });
+ if (!response.ok) throw new Error(`HTTP ${response.status} for ${source.url}`);
+ return source.toEntries(await response.json());
+}
+
const devices = [];
const warnings = [];
const seen = new Set();
@@ -171,6 +196,19 @@ for (const entry of seed) {
}
}
+for (const source of VENDOR_TABLES) {
+ if (onlyFilter && !source.id.includes(onlyFilter.toLowerCase())) continue;
+ try {
+ const entries = await fetchVendorEntries(source);
+ devices.push(...entries);
+ console.log(`ok ${source.id} (${entries.length} entries)`);
+ } catch (error) {
+ const kept = (previousManifest?.devices ?? []).filter((device) => device.id.startsWith(source.id));
+ devices.push(...kept);
+ warnings.push(`${source.id}: ${kept.length > 0 ? "kept the previous entries" : "skipped"} (${error instanceof Error ? error.message : String(error)})`);
+ }
+}
+
// Hand-maintained entries (confirmed values, non-depot devices). Extra wins.
const extraPath = join(here, 'firmware-manifest.extra.json');
@@ -189,8 +227,8 @@ try {
// overwrites a real one) so each entry accumulates [{version, date}]
// whenever its version moves. First sightings start empty — history is
// earned, never invented.
-try {
- const previous = JSON.parse(readFileSync(outputPath, 'utf8'));
+if (previousManifest) {
+ const previous = previousManifest;
const prevById = new Map((previous.devices ?? []).map((d) => [d.id, d]));
for (const device of devices) {
const prev = prevById.get(device.id);
@@ -201,8 +239,6 @@ try {
}
if (history.length > 0) device.history = history.slice(0, 8);
}
-} catch {
- // No previous manifest (first run) — nothing to carry.
}
devices.sort((a, b) => a.id.localeCompare(b.id));
@@ -220,11 +256,12 @@ if (okCount <= 0) {
const manifest = {
_comment:
"AUTO-GENERATED — do not edit by hand. Regenerate with: node scripts/generate-firmware-manifest.mjs. " +
- "Sources: Logitech update CDN depots listed in scripts/firmware-depots.seed.json (plain HTTPS, no auth). " +
+ "Sources: Logitech update CDN depots listed in scripts/firmware-depots.seed.json (plain HTTPS, no auth), " +
+ "and vendor version tables (ammaster.angrymiao.com). " +
"Versions/hashes/blockers are re-derived from each depot's dfu.json every run.",
manifestVersion: MANIFEST_VERSION,
updatedAt: new Date().toISOString(),
- source: "scripts/generate-firmware-manifest.mjs over updates.ghub.logitechg.com",
+ source: "scripts/generate-firmware-manifest.mjs over updates.ghub.logitechg.com and ammaster.angrymiao.com",
devices,
};
diff --git a/src/device/angry-miao/firmware.test.ts b/src/device/angry-miao/firmware.test.ts
new file mode 100644
index 00000000..48b7c828
--- /dev/null
+++ b/src/device/angry-miao/firmware.test.ts
@@ -0,0 +1,102 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { am30FirmwareLabels, am30ReceiverFirmwareLabels } from "@openmouse/protocol/angry-miao";
+import { am30ManifestEntries } from "./firmware.ts";
+import { describeFirmware, type FirmwareManifest } from "../firmware-updates.ts";
+
+// Trimmed from the version-map response of 2026-12-05.
+const VERSION_MAP = {
+ ok: true,
+ table: {
+ usb: { "0": "0.0.0", "101": "1.0.3" },
+ soc: { "0": "0.0.0", "318": "1.1.1", "321": "1.1.4" },
+ d_usb: { "0": "0.0.0", "8": "1.0.7" },
+ d_soc: { "0": "0.0.0", "238": "1.0.7", "240": "1.0.8" },
+ d_led: { "0": "0.0.0", "109": "1.0.5" },
+ new_version: {
+ mouseVersion: "1.9", dongleVersion: "1.6", newUSBVersion: "1.0.3", newSoCVersion: "1.1.4",
+ newDUSBVersion: "1.0.7", newDSOCVersion: "1.0.8", newDLEDVersion: "1.0.5",
+ },
+ },
+ showVer: {
+ mouse: { "1.0.3,1.1.1": "1.6", "1.0.3,1.1.4": "1.9" },
+ dongle: { "1.0.7,1.0.7,1.0.5": "1.5", "1.0.7,1.0.8,1.0.5": "1.6" },
+ },
+};
+
+const manifest: FirmwareManifest = {
+ manifestVersion: 3, updatedAt: "2026-12-05T00:00:00.000Z", source: "test", devices: am30ManifestEntries(VERSION_MAP),
+};
+
+// The labels the AM30 driver builds from the captured cable and receiver reads.
+const CABLE = am30FirmwareLabels(0x0101, 0x0318);
+const RECEIVER = am30ReceiverFirmwareLabels(
+ Uint8Array.of(0, 0x08, 0x00), Uint8Array.of(0, 0, 0, 0xf0), Uint8Array.of(0, 0x09, 0x01),
+);
+
+function rows(firmware: string[], interfaceId = "3151_5007") {
+ return describeFirmware({ brand: "Angry Miao", name: "Angry Miao Infinity .100", firmware, interfaceId }, manifest);
+}
+
+test("every code the driver reports has the vendor's name", () => {
+ const named = rows([...CABLE, ...RECEIVER]).flatMap((row) => row.parts);
+ assert.deepEqual(named.map((part) => part.version), ["1.0.3", "1.1.1", "1.0.7", "1.0.8", "1.0.5"]);
+});
+
+test("the vendor's zero placeholder is not a version", () => {
+ const soc = manifest.devices.find((entry) => entry.firmwareName === "Mouse SoC");
+ assert.deepEqual(Object.keys(soc?.versionNames ?? {}), ["0x0318", "0x0321"]);
+});
+
+test("the RF code is keyed in decimal by the vendor and in hex by the driver", () => {
+ const rf = manifest.devices.find((entry) => entry.firmwareName === "Receiver RF");
+ assert.deepEqual(rf?.versionNames, { "0xee": "1.0.7", "0xf0": "1.0.8" });
+});
+
+test("the mouse package needs both mouse parts, so only the cable names it", () => {
+ const [mouse] = rows(CABLE, "3151_402a");
+ assert.equal(mouse?.device, "mouse");
+ assert.equal(mouse?.info?.currentVersion, "1.6");
+ assert.equal(mouse?.info?.latestVersion, "1.9");
+ assert.equal(mouse?.info?.dfuAvailable, true);
+
+ const [overReceiver] = rows(["Mouse SoC 0x0318", ...RECEIVER]);
+ assert.equal(overReceiver?.info, null);
+ assert.deepEqual(overReceiver?.parts, [{ element: "Mouse SoC 0x0318", version: "1.1.1" }]);
+});
+
+test("the receiver package is compared with the vendor's latest receiver package", () => {
+ const receiver = rows(["Mouse SoC 0x0318", ...RECEIVER]).find((row) => row.device === "receiver");
+ assert.equal(receiver?.info?.currentVersion, "1.6");
+ assert.equal(receiver?.info?.dfuAvailable, false);
+});
+
+test("an unlisted code leaves its package unknown", () => {
+ const receiver = rows(["Receiver USB 0x0008", "Receiver RF 0xf1", "Receiver LED 0x0109"]).find((row) => row.device === "receiver");
+ assert.equal(receiver?.info, null);
+ assert.deepEqual(receiver?.parts.map((part) => part.version), ["1.0.7", null, "1.0.5"]);
+});
+
+test("another mouse never matches the Angry Miao entries", () => {
+ assert.deepEqual(rows(CABLE, "046d_c094"), [{ device: "mouse", info: null, parts: [] }]);
+});
+
+test("another brand on a shared USB id keeps its own entry", () => {
+ // 0x3151 is an ODM vendor id: the Ajazz AJ179 PRO uses 3151_402c over Bluetooth too.
+ const shared: FirmwareManifest = {
+ ...manifest,
+ devices: [...manifest.devices, { id: "ajazz-aj179-pro", interfaceIds: ["3151_402c"], latestVersion: "3.01" }],
+ };
+ const ajazz = describeFirmware({ brand: "Ajazz", name: "Ajazz AJ179 PRO", firmware: ["v3.00"], interfaceId: "3151_402c" }, shared);
+ assert.equal(ajazz.length, 1);
+ assert.equal(ajazz[0]?.info?.latestVersion, "3.01");
+ assert.equal(ajazz[0]?.info?.dfuAvailable, true);
+
+ const angryMiao = describeFirmware({ brand: "Angry Miao", name: "Angry Miao Infinity .100", firmware: RECEIVER, interfaceId: "3151_402c" }, shared);
+ assert.equal(angryMiao.find((row) => row.device === "receiver")?.info?.currentVersion, "1.6");
+});
+
+test("a response without a table is refused", () => {
+ assert.throws(() => am30ManifestEntries({ ok: false }));
+ assert.throws(() => am30ManifestEntries(""));
+});
diff --git a/src/device/angry-miao/firmware.ts b/src/device/angry-miao/firmware.ts
new file mode 100644
index 00000000..7fec986f
--- /dev/null
+++ b/src/device/angry-miao/firmware.ts
@@ -0,0 +1,86 @@
+import type { FirmwareManifestEntry } from "../firmware-updates.ts";
+
+/** Angry Miao's Infinity .100 (AM30) version table, read by scripts/generate-firmware-manifest.mjs. */
+export const AM30_VERSION_MAP_URL = "https://ammaster.angrymiao.com/mouse/api/am30/version-map";
+
+/** Every manifest entry made here starts with this id. */
+export const AM30_ENTRY_PREFIX = "angry-miao-am30";
+
+/** Cable, receiver and Bluetooth identities of the .100. */
+const INTERFACE_IDS = ["3151_402a", "3151_5007", "3151_402c"];
+
+/**
+ * The AM30 driver's firmware labels and the vendor's tables for them. The vendor keys its tables by
+ * the code in hex without leading zeros, except the RF code, which it keys and shows in decimal.
+ */
+const PARTS = [
+ { firmwareName: "Mouse SoC", table: "soc", latest: "newSoCVersion", digits: 4, decimal: false },
+ { firmwareName: "Mouse USB", table: "usb", latest: "newUSBVersion", digits: 4, decimal: false },
+ { firmwareName: "Receiver USB", table: "d_usb", latest: "newDUSBVersion", digits: 4, decimal: false },
+ { firmwareName: "Receiver RF", table: "d_soc", latest: "newDSOCVersion", digits: 2, decimal: true },
+ { firmwareName: "Receiver LED", table: "d_led", latest: "newDLEDVersion", digits: 4, decimal: false },
+] as const;
+
+const PACKAGES = [
+ { id: "mouse", device: "mouse", parts: ["Mouse USB", "Mouse SoC"], showVer: "mouse", latest: "mouseVersion" },
+ { id: "receiver", device: "receiver", parts: ["Receiver USB", "Receiver RF", "Receiver LED"], showVer: "dongle", latest: "dongleVersion" },
+] as const;
+
+type Table = Record;
+
+function record(value: unknown): Table | null {
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
+ return Object.fromEntries(Object.entries(value).filter((pair): pair is [string, string] => typeof pair[1] === "string"));
+}
+
+/** The vendor's key as the driver formats the code, e.g. "318" to "0x0318" and RF "240" to "0xf0". */
+function driverCode(key: string, digits: number, decimal: boolean): string | null {
+ const value = Number.parseInt(key, decimal ? 10 : 16);
+ if (!Number.isFinite(value) || value <= 0) return null;
+ return `0x${value.toString(16).padStart(digits, "0")}`;
+}
+
+/** Turns the version-map response into ordinary manifest entries: one per part and one per package. */
+export function am30ManifestEntries(body: unknown): FirmwareManifestEntry[] {
+ const response = (typeof body === "object" && body !== null ? body : {}) as {
+ ok?: unknown;
+ table?: Record | null;
+ showVer?: Record | null;
+ };
+ const tables = response.ok === true && typeof response.table === "object" ? response.table : null;
+ if (!tables) throw new Error("no version table in the response");
+ const latest = record(tables.new_version) ?? {};
+ const showVer = response.showVer ?? {};
+
+ const entries: FirmwareManifestEntry[] = [];
+ for (const part of PARTS) {
+ const latestVersion = latest[part.latest];
+ if (!latestVersion) continue;
+ const versionNames: Table = {};
+ for (const [key, name] of Object.entries(record(tables[part.table]) ?? {})) {
+ const code = driverCode(key, part.digits, part.decimal);
+ if (code) versionNames[code] = name;
+ }
+ entries.push({
+ id: `${AM30_ENTRY_PREFIX}-${part.firmwareName.toLowerCase().replace(/ /g, "-")}`,
+ brand: "Angry Miao",
+ interfaceIds: INTERFACE_IDS,
+ firmwareName: part.firmwareName,
+ versionNames,
+ latestVersion,
+ });
+ }
+ for (const pkg of PACKAGES) {
+ const latestVersion = latest[pkg.latest];
+ const versions = record(showVer[pkg.showVer]);
+ if (!latestVersion || !versions) continue;
+ entries.push({
+ id: `${AM30_ENTRY_PREFIX}-${pkg.id}`,
+ brand: "Angry Miao",
+ interfaceIds: INTERFACE_IDS,
+ packageOf: { device: pkg.device, parts: [...pkg.parts], versions },
+ latestVersion,
+ });
+ }
+ return entries;
+}
From 9cb44490e4713f598a7f2faaf328e5df2b168dc3 Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 01:49:45 -0500
Subject: [PATCH 16/18] feat(devices): spare battery next to the mouse battery,
and receiver wording
The receiver of the Infinity .100 reports a spare battery and keeps working while the mouse is off. Tested on hardware with the mouse on and off.
- Sidebar device row: the spare comes after the mouse battery, smaller ("46% Spare 100%"). With only the receiver it shows the spare instead of "Connected".
- Current setup: with both batteries, the Battery figure gets the battery icon and a muted "Spare 100% Full" line under it. With only the receiver, the spare keeps its own figure.
- Both only draw when the status has a spareBattery, so other mice are unchanged.
- The open sidebar entry's name follows the status, so it switches between "Angry Miao Receiver" and "Angry Miao Infinity .100" without re-enumerating HID.
- Writes to a receiver on its own say "...to the receiver" instead of "...to the mouse".
- New keys side.spare, ctl.stagedFlashReceiver, ctl.flashedOneReceiver and ctl.flashedManyReceiver in every locale.
Receiver light with the mouse off: the change reached the receiver (colour changed) and read back after a reload.
Closes kennedy/openmouse#18
---
src/app/AppSidebar.tsx | 17 +++++++++++++++--
src/device/controller.ts | 12 +++++++++---
src/features/devices/DeviceHero.tsx | 22 +++++++++++++++++-----
src/i18n/index.ts | 4 ++++
src/i18n/locales/ar.ts | 4 ++++
src/i18n/locales/de.ts | 4 ++++
src/i18n/locales/es.ts | 4 ++++
src/i18n/locales/fr.ts | 4 ++++
src/i18n/locales/ja.ts | 4 ++++
src/i18n/locales/ko.ts | 4 ++++
src/i18n/locales/pt.ts | 4 ++++
src/i18n/locales/ru.ts | 4 ++++
src/i18n/locales/tr.ts | 4 ++++
src/i18n/locales/vi.ts | 4 ++++
src/i18n/locales/zh.ts | 4 ++++
src/styles/device.css | 3 +++
src/styles/shell.css | 4 ++++
17 files changed, 96 insertions(+), 10 deletions(-)
diff --git a/src/app/AppSidebar.tsx b/src/app/AppSidebar.tsx
index 4aff2351..9685d59e 100644
--- a/src/app/AppSidebar.tsx
+++ b/src/app/AppSidebar.tsx
@@ -68,6 +68,8 @@ const SidebarDeviceRow = memo(function SidebarDeviceRow({
live,
batteryPercent,
batteryState,
+ sparePercent,
+ spareState,
collapsed,
open,
}: {
@@ -75,6 +77,8 @@ const SidebarDeviceRow = memo(function SidebarDeviceRow({
live: boolean;
batteryPercent: number | null;
batteryState: MouseStatus["batteryState"];
+ sparePercent: number | null;
+ spareState: MouseStatus["batteryState"];
collapsed: boolean;
open: (index: number) => void;
// Bumps when a lazy locale table resolves; row text otherwise keeps the
@@ -113,9 +117,16 @@ const SidebarDeviceRow = memo(function SidebarDeviceRow({
{batteryPercent}%
>
- ) : (
+ ) : sparePercent == null ? (
{live ? t(locale, "side.connected") : t(locale, "home.notConnected")}
- )}
+ ) : null}
+ {sparePercent != null ? (
+
+ {t(locale, "side.spare")}
+
+ {sparePercent}%
+
+ ) : null}
@@ -144,6 +155,8 @@ function SidebarDeviceRowOutlet({
live={live}
batteryPercent={status?.batteryPercent ?? null}
batteryState={status?.batteryState ?? "Unknown"}
+ sparePercent={status?.spareBattery?.percent ?? null}
+ spareState={status?.spareBattery?.state ?? "Unknown"}
collapsed={collapsed}
open={open}
localeTableRevision={snapshot.localeTableRevision}
diff --git a/src/device/controller.ts b/src/device/controller.ts
index 28863283..61a88646 100644
--- a/src/device/controller.ts
+++ b/src/device/controller.ts
@@ -1796,7 +1796,7 @@ function stageChange(change: PendingChange, { force = false } = {}): void {
emit();
return;
}
- setReadStatus(st("ctl.stagedFlash", { label: change.label }));
+ setReadStatus(st(latestDeviceStatus?.ui?.receiverOnly ? "ctl.stagedFlashReceiver" : "ctl.stagedFlash", { label: change.label }));
});
}
@@ -3028,9 +3028,10 @@ async function flashStagedChanges(canWrite?: () => boolean): Promise entry.selected && entry.kind !== "keyboard");
+ if (listed && listed.name !== deviceStatus.name) {
+ sidebarDevices = sidebarDevices.map((entry) => (entry === listed ? { ...entry, name: deviceStatus.name } : entry));
+ }
}
deviceStatusText = st("ctl.connected");
diff --git a/src/features/devices/DeviceHero.tsx b/src/features/devices/DeviceHero.tsx
index f2199adb..5f7ec473 100644
--- a/src/features/devices/DeviceHero.tsx
+++ b/src/features/devices/DeviceHero.tsx
@@ -144,7 +144,8 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
const stages = Array.isArray(status.dpiStages) ? status.dpiStages.filter((value) => value > 0) : [];
const activeStage = typeof status.activeDpiStage === "number" ? status.activeDpiStage : -1;
const maxRate = status.supportedPollingRates?.length ? Math.max(...status.supportedPollingRates) : null;
- const figures: Array<{ key: string; label: string; value: string; unit?: string; sub?: string; icon?: ReactNode }> = [];
+ const spare = status.spareBattery ?? null;
+ const figures: Array<{ key: string; label: string; value: string; unit?: string; sub?: string; icon?: ReactNode; extra?: ReactNode }> = [];
if (status.dpi > 0) {
figures.push({
key: "dpi",
@@ -164,24 +165,34 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
});
}
if (status.batteryPercent !== null) {
+ // A spare battery joins the mouse's figure as a secondary line, so the mouse stays first.
figures.push({
key: "battery",
label: t(locale, "ov.batteryLabel"),
value: String(status.batteryPercent),
unit: "%",
sub: displayText(locale, status.batteryState),
+ icon: spare ? : undefined,
+ extra: spare ? (
+
+
+ {t(locale, "side.spare")}
+ {spare.percent}%
+ {batteryStateText(locale, spare.state)}
+
+ ) : undefined,
});
} else if (status.ui?.forceShowBattery === true) {
figures.push({ key: "battery", label: t(locale, "ov.batteryLabel"), value: "–" });
}
- if (status.spareBattery) {
+ if (spare && status.batteryPercent === null) {
figures.push({
key: "spare-battery",
label: t(locale, "ov.spareBattery"),
- value: String(status.spareBattery.percent),
+ value: String(spare.percent),
unit: "%",
- sub: batteryStateText(locale, status.spareBattery.state),
- icon: ,
+ sub: batteryStateText(locale, spare.state),
+ icon: ,
});
}
if (status.activeProfile != null) {
@@ -200,6 +211,7 @@ export function CurrentSetupPanel({ snapshot }: { snapshot: ControlSnapshot }):
{figure.label}
{figure.icon}{figure.value}{figure.unit ? {figure.unit} : null}
{figure.sub ? {figure.sub} : null}
+ {figure.extra}
))}
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 65268d41..20b23d18 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -129,6 +129,10 @@ const en = {
"ov.upTo": "Up to {v}",
"ov.batteryLabel": "Battery",
"ov.spareBattery": "Spare battery",
+ "side.spare": "Spare",
+ "ctl.stagedFlashReceiver": "{label} staged. Flash to write it to the receiver.",
+ "ctl.flashedOneReceiver": "Flashed 1 change to the receiver.",
+ "ctl.flashedManyReceiver": "Flashed {n} changes to the receiver.",
"ov.onboardProfile": "Onboard profile",
"ov.setupTitle": "Current setup",
"ov.setupMeta": "Read from the device",
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts
index 59c5ea0c..fadc371e 100644
--- a/src/i18n/locales/ar.ts
+++ b/src/i18n/locales/ar.ts
@@ -1929,6 +1929,10 @@ export const ar: Record
= {
"ov.upTo": "حتى {v}",
"ov.batteryLabel": "البطارية",
"ov.spareBattery": "البطارية الاحتياطية",
+ "side.spare": "احتياطية",
+ "ctl.stagedFlashReceiver": "{label} مُجهَّز. ثبّته لكتابته إلى جهاز الاستقبال.",
+ "ctl.flashedOneReceiver": "ثُبّت تغيير واحد إلى جهاز الاستقبال.",
+ "ctl.flashedManyReceiver": "ثُبّتت {n} تغييرات إلى جهاز الاستقبال.",
"ov.onboardProfile": "الملف المدمج",
"ov.setupTitle": "الإعداد الحالي",
"ov.setupMeta": "مقروء من الجهاز",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index d9acb3b8..ac9cecb8 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -1959,6 +1959,10 @@ export const de: Record = {
"ov.upTo": "Bis zu {v}",
"ov.batteryLabel": "Akku",
"ov.spareBattery": "Ersatzakku",
+ "side.spare": "Ersatz",
+ "ctl.stagedFlashReceiver": "{label} vorbereitet. Flashe, um es auf den Empfänger zu schreiben.",
+ "ctl.flashedOneReceiver": "1 Änderung auf den Empfänger geflasht.",
+ "ctl.flashedManyReceiver": "{n} Änderungen auf den Empfänger geflasht.",
"ov.onboardProfile": "Onboard-Profil",
"ov.setupTitle": "Aktuelles Setup",
"ov.setupMeta": "Vom Gerät gelesen",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 5360e390..9444b200 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -1939,6 +1939,10 @@ export const es: Record = {
"ov.upTo": "Hasta {v}",
"ov.batteryLabel": "Batería",
"ov.spareBattery": "Batería de repuesto",
+ "side.spare": "Repuesto",
+ "ctl.stagedFlashReceiver": "{label} preparado. Graba para escribirlo en el receptor.",
+ "ctl.flashedOneReceiver": "Se grabó 1 cambio en el receptor.",
+ "ctl.flashedManyReceiver": "Se grabaron {n} cambios en el receptor.",
"ov.onboardProfile": "Perfil integrado",
"ov.setupTitle": "Configuración actual",
"ov.setupMeta": "Leído del dispositivo",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index 193e31de..5361ff9d 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -1931,6 +1931,10 @@ export const fr: Record = {
"ov.upTo": "Jusqu'à {v}",
"ov.batteryLabel": "Batterie",
"ov.spareBattery": "Batterie de rechange",
+ "side.spare": "Rechange",
+ "ctl.stagedFlashReceiver": "{label} préparé. Gravez pour l'écrire sur le récepteur.",
+ "ctl.flashedOneReceiver": "1 modification gravée sur le récepteur.",
+ "ctl.flashedManyReceiver": "{n} modifications gravées sur le récepteur.",
"ov.onboardProfile": "Profil embarqué",
"ov.setupTitle": "Configuration actuelle",
"ov.setupMeta": "Lu depuis l'appareil",
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index 53b2ad13..a6d17b7d 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -1931,6 +1931,10 @@ export const ja: Record = {
"ov.upTo": "最大 {v}",
"ov.batteryLabel": "バッテリー",
"ov.spareBattery": "予備バッテリー",
+ "side.spare": "予備",
+ "ctl.stagedFlashReceiver": "{label}が準備できました。書き込んでレシーバーに反映してください。",
+ "ctl.flashedOneReceiver": "レシーバーに1件の変更を書き込みました。",
+ "ctl.flashedManyReceiver": "レシーバーに{n}件の変更を書き込みました。",
"ov.onboardProfile": "オンボードプロファイル",
"ov.setupTitle": "現在の設定",
"ov.setupMeta": "デバイスから読み取り",
diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts
index 2f6542ed..e73a3db3 100644
--- a/src/i18n/locales/ko.ts
+++ b/src/i18n/locales/ko.ts
@@ -1931,6 +1931,10 @@ export const ko: Record = {
"ov.upTo": "최대 {v}",
"ov.batteryLabel": "배터리",
"ov.spareBattery": "예비 배터리",
+ "side.spare": "예비",
+ "ctl.stagedFlashReceiver": "{label}이(가) 준비되었습니다. 기록하여 수신기에 적용하세요.",
+ "ctl.flashedOneReceiver": "수신기에 1개의 변경 사항을 기록했습니다.",
+ "ctl.flashedManyReceiver": "수신기에 {n}개의 변경 사항을 기록했습니다.",
"ov.onboardProfile": "온보드 프로필",
"ov.setupTitle": "현재 설정",
"ov.setupMeta": "장치에서 읽음",
diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts
index 798870bd..a65d0035 100644
--- a/src/i18n/locales/pt.ts
+++ b/src/i18n/locales/pt.ts
@@ -1931,6 +1931,10 @@ export const pt: Record = {
"ov.upTo": "Até {v}",
"ov.batteryLabel": "Bateria",
"ov.spareBattery": "Bateria reserva",
+ "side.spare": "Reserva",
+ "ctl.stagedFlashReceiver": "{label} na fila. Aplique para gravar no receptor.",
+ "ctl.flashedOneReceiver": "1 mudança gravada no receptor.",
+ "ctl.flashedManyReceiver": "{n} mudanças gravadas no receptor.",
"ov.onboardProfile": "Perfil interno",
"ov.setupTitle": "Configuração atual",
"ov.setupMeta": "Lido do dispositivo",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 2afb3992..91c732f6 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -1931,6 +1931,10 @@ export const ru: Record = {
"ov.upTo": "До {v}",
"ov.batteryLabel": "Батарея",
"ov.spareBattery": "Запасная батарея",
+ "side.spare": "Запасная",
+ "ctl.stagedFlashReceiver": "{label} в очереди. Прошейте, чтобы записать в приёмник.",
+ "ctl.flashedOneReceiver": "В приёмник записано 1 изменение.",
+ "ctl.flashedManyReceiver": "В приёмник записано изменений: {n}.",
"ov.onboardProfile": "Встроенный профиль",
"ov.setupTitle": "Текущая настройка",
"ov.setupMeta": "Прочитано с устройства",
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index 18413753..1880435a 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -1929,6 +1929,10 @@ export const tr: Record = {
"ov.upTo": "En fazla {v}",
"ov.batteryLabel": "Pil",
"ov.spareBattery": "Yedek pil",
+ "side.spare": "Yedek",
+ "ctl.stagedFlashReceiver": "{label} beklemeye alındı. Alıcıya kaydetmek için cihaza yazın.",
+ "ctl.flashedOneReceiver": "Alıcıya 1 değişiklik yazıldı.",
+ "ctl.flashedManyReceiver": "Alıcıya {n} değişiklik yazıldı.",
"ov.onboardProfile": "Dahili profil",
"ov.setupTitle": "Güncel kurulum",
"ov.setupMeta": "Cihazdan okundu",
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index e7328795..9d4ab6c0 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -1936,6 +1936,10 @@ export const vi: Record = {
"ov.upTo": "Tối đa {v}",
"ov.batteryLabel": "Pin",
"ov.spareBattery": "Pin dự phòng",
+ "side.spare": "Dự phòng",
+ "ctl.stagedFlashReceiver": "{label} đã được đưa vào hàng chờ. Hãy ghi để lưu vào bộ thu.",
+ "ctl.flashedOneReceiver": "Đã ghi 1 thay đổi vào bộ thu.",
+ "ctl.flashedManyReceiver": "Đã ghi {n} thay đổi vào bộ thu.",
"ov.onboardProfile": "Hồ sơ trên thiết bị",
"ov.setupTitle": "Thiết lập hiện tại",
"ov.setupMeta": "Đọc từ thiết bị",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index 82ae5ac9..3fc74faa 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -1931,6 +1931,10 @@ export const zh: Record = {
"ov.upTo": "最高 {v}",
"ov.batteryLabel": "电量",
"ov.spareBattery": "备用电池",
+ "side.spare": "备用",
+ "ctl.stagedFlashReceiver": "{label} 已就绪。写入以将其应用到接收器。",
+ "ctl.flashedOneReceiver": "已向接收器写入 1 项更改。",
+ "ctl.flashedManyReceiver": "已向接收器写入 {n} 项更改。",
"ov.onboardProfile": "板载配置",
"ov.setupTitle": "当前设置",
"ov.setupMeta": "从设备读取",
diff --git a/src/styles/device.css b/src/styles/device.css
index eeb9bab7..2261026d 100644
--- a/src/styles/device.css
+++ b/src/styles/device.css
@@ -71,6 +71,9 @@
.om-setup-figure .om-fig { font-size: var(--fs-figure); line-height: 32px; }
.om-setup-figure .om-fig .om-unit { line-height: 1; }
.om-setup-figure .om-fig .battery-icon { display: inline-block; width: 26px; height: 13px; margin-inline-end: 8px; vertical-align: 0.1em; }
+.om-setup-spare { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; color: var(--text-3); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
+.om-setup-spare b { color: var(--text-2); font-weight: 600; }
+.om-setup-spare .battery-icon { width: 16px; height: 8px; }
.om-setup-stages {
display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
padding: 14px var(--panel-pad) var(--panel-pad);
diff --git a/src/styles/shell.css b/src/styles/shell.css
index b7b7c4b6..3f0fad7e 100644
--- a/src/styles/shell.css
+++ b/src/styles/shell.css
@@ -81,6 +81,10 @@ html, body { background: var(--ink-1); }
.om-side-device-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.om-side-device-sub { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.om-side-device-sub .battery-icon { width: 18px; height: 9px; }
+.om-side-device-spare { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 4px; }
+.om-side-device-sub > :first-child.om-side-device-spare { margin-inline-start: 0; }
+.om-side-device-spare .battery-icon { width: 14px; height: 7px; }
+.om-side-device-spare .battery-icon.is-ok .battery-fill { fill: currentColor; }
.om-sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-1); }
.om-bridge { position: relative; }
From 73704b482413ba061c7cb20b6bde5b3df5d6189d Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 02:35:32 -0500
Subject: [PATCH 17/18] feat(firmware): one section per device, with version
names, open by default
- The Firmware card lists each device's firmware in its own section: the mouse, then each package such as the receiver.
- A package heading shows its version ("Receiver v1.6") and, when behind, the update badge, the version change, history and Later.
- Parts with a known code show the vendor's version ("Mouse SoC v1.1.1"); anything else shows as the device reports it.
- Elements outside a package go under the mouse, so nothing is listed twice.
- The header keeps the title, the status pill and Check. The card starts open and remembers when it is collapsed.
- Mice without packages get one section with their firmware as a list.
---
src/device/angry-miao/firmware.test.ts | 14 +++++-
src/device/firmware-updates.test.ts | 9 +++-
src/device/firmware-updates.ts | 31 ++++++++-----
src/features/devices/cards/FirmwareCard.tsx | 48 +++++++++++----------
src/styles/areas/advanced.css | 4 +-
5 files changed, 67 insertions(+), 39 deletions(-)
diff --git a/src/device/angry-miao/firmware.test.ts b/src/device/angry-miao/firmware.test.ts
index 48b7c828..820903fd 100644
--- a/src/device/angry-miao/firmware.test.ts
+++ b/src/device/angry-miao/firmware.test.ts
@@ -62,7 +62,7 @@ test("the mouse package needs both mouse parts, so only the cable names it", ()
const [overReceiver] = rows(["Mouse SoC 0x0318", ...RECEIVER]);
assert.equal(overReceiver?.info, null);
- assert.deepEqual(overReceiver?.parts, [{ element: "Mouse SoC 0x0318", version: "1.1.1" }]);
+ assert.deepEqual(overReceiver?.parts, [{ element: "Mouse SoC 0x0318", name: "Mouse SoC", version: "1.1.1" }]);
});
test("the receiver package is compared with the vendor's latest receiver package", () => {
@@ -78,7 +78,17 @@ test("an unlisted code leaves its package unknown", () => {
});
test("another mouse never matches the Angry Miao entries", () => {
- assert.deepEqual(rows(CABLE, "046d_c094"), [{ device: "mouse", info: null, parts: [] }]);
+ assert.deepEqual(rows(CABLE, "046d_c094"), [{
+ device: "mouse",
+ info: null,
+ parts: CABLE.map((element) => ({ element, name: null, version: null })),
+ }]);
+});
+
+test("elements outside a package go under the mouse", () => {
+ const [mouse, receiver] = rows(["Mouse SoC 0x0318", ...RECEIVER, "PixArt PAW3950"]);
+ assert.deepEqual(mouse?.parts.map((part) => part.element), ["Mouse SoC 0x0318", "PixArt PAW3950"]);
+ assert.deepEqual(receiver?.parts.map((part) => part.element), RECEIVER);
});
test("another brand on a shared USB id keeps its own entry", () => {
diff --git a/src/device/firmware-updates.test.ts b/src/device/firmware-updates.test.ts
index 18ee504d..bae945ff 100644
--- a/src/device/firmware-updates.test.ts
+++ b/src/device/firmware-updates.test.ts
@@ -312,7 +312,7 @@ test("describeFirmware names a package from the versions of all its parts", () =
const [row] = describeFirmware(codedRef(["Main 0x0002", "Radio 0x10"]), coded);
assert.equal(row?.info?.currentVersion, "1.1");
assert.equal(row?.info?.dfuAvailable, true);
- assert.deepEqual(row?.parts, [{ element: "Main 0x0002", version: "2.0" }, { element: "Radio 0x10", version: "1.0" }]);
+ assert.deepEqual(row?.parts, [{ element: "Main 0x0002", name: "Main", version: "2.0" }, { element: "Radio 0x10", name: "Radio", version: "1.0" }]);
const [partial] = describeFirmware(codedRef(["Main 0x0002"]), coded);
assert.equal(partial?.info, null);
@@ -324,5 +324,10 @@ test("package entries are never a device-level match", () => {
});
test("describeFirmware gives a device without packages its getDfuInfo row", () => {
- assert.deepEqual(describeFirmware(device(), manifest), [{ device: "mouse", info: getDfuInfo(device(), manifest), parts: [] }]);
+ const ref = device();
+ assert.deepEqual(describeFirmware(ref, manifest), [{
+ device: "mouse",
+ info: getDfuInfo(ref, manifest),
+ parts: ref.firmware.map((element) => ({ element, name: null, version: null })),
+ }]);
});
diff --git a/src/device/firmware-updates.ts b/src/device/firmware-updates.ts
index dea02df0..5b838f37 100644
--- a/src/device/firmware-updates.ts
+++ b/src/device/firmware-updates.ts
@@ -280,13 +280,13 @@ export function getDfuInfo(device: FirmwareDeviceRef, manifest: FirmwareManifest
};
}
-/** One row of the Firmware card: the device itself, or a package such as its receiver. */
+/** One section of the Firmware card: the device itself, or a package such as its receiver. */
export interface FirmwareRow {
device: "mouse" | "receiver";
/** Null when the version is unknown or the manifest has no entry. */
info: DfuInfo | null;
- /** A package's parts as the device reports them, each with its version name when known. */
- parts: Array<{ element: string; version: string | null }>;
+ /** Firmware elements as the device reports them; a package part also has its name and, when known, its version. */
+ parts: Array<{ element: string; name: string | null; version: string | null }>;
}
function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device: FirmwareDeviceRef, manifest: FirmwareManifest): FirmwareRow | null {
@@ -299,7 +299,7 @@ function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device:
(candidate) => candidate.firmwareName?.toLowerCase() === prefix && deviceMatches(candidate, device),
);
const version = element && partEntry ? elementVersion(partEntry, element) : null;
- if (element) parts.push({ element, version });
+ if (element) parts.push({ element, name, version });
versions.push(version);
}
if (parts.length === 0) return null;
@@ -322,21 +322,32 @@ function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device:
}
/**
- * The Firmware card's rows. A device that reports parts of a package gets one
- * row per such package; any other device gets one row from getDfuInfo. USB ids
- * can be shared between brands, so a matching id alone never picks packages.
- * The device's own row always comes first.
+ * The Firmware card's sections. A device that reports parts of a package gets
+ * one section per such package, and every other element goes under the device
+ * itself; any other device gets one section from getDfuInfo. USB ids can be
+ * shared between brands, so a matching id alone never picks packages. The
+ * device's own section always comes first.
*/
export function describeFirmware(device: FirmwareDeviceRef, manifest: FirmwareManifest): FirmwareRow[] {
const rows = manifest.devices
.filter((entry) => entry.packageOf && deviceMatches(entry, device))
.map((entry) => packageRow(entry, entry.packageOf!, device, manifest))
.filter((row): row is FirmwareRow => row !== null);
- if (rows.length === 0) return [{ device: "mouse", info: getDfuInfo(device, manifest), parts: [] }];
- if (!rows.some((row) => row.device === "mouse")) rows.unshift({ device: "mouse", info: null, parts: [] });
+ if (rows.length === 0) return [{ device: "mouse", info: getDfuInfo(device, manifest), parts: rawParts(device.firmware) }];
+ let mouse = rows.find((row) => row.device === "mouse");
+ if (!mouse) {
+ mouse = { device: "mouse", info: null, parts: [] };
+ rows.unshift(mouse);
+ }
+ const claimed = new Set(rows.flatMap((row) => row.parts.map((part) => part.element)));
+ mouse.parts.push(...rawParts(device.firmware.filter((element) => !claimed.has(element))));
return rows.sort((a, b) => Number(a.device !== "mouse") - Number(b.device !== "mouse"));
}
+function rawParts(firmware: readonly string[]): FirmwareRow["parts"] {
+ return firmware.map((element) => ({ element, name: null, version: null }));
+}
+
interface ManifestCache {
fetchedAt: number;
manifest: FirmwareManifest;
diff --git a/src/features/devices/cards/FirmwareCard.tsx b/src/features/devices/cards/FirmwareCard.tsx
index 6142dd83..6f0f510d 100644
--- a/src/features/devices/cards/FirmwareCard.tsx
+++ b/src/features/devices/cards/FirmwareCard.tsx
@@ -34,6 +34,7 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
const [checking, setChecking] = useState(false);
const [error, setError] = useState(null);
const [dismissTick, setDismissTick] = useState(0);
+ const [expanded, setExpanded] = useState(true);
useEffect(() => {
let cancelled = false;
@@ -82,7 +83,9 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
// Re-read dismissals after a Later click (same render pass otherwise).
void dismissTick;
- const rows: FirmwareRow[] = manifest ? describeFirmware(ref, manifest) : [];
+ const rows: FirmwareRow[] = manifest
+ ? describeFirmware(ref, manifest)
+ : [{ device: "mouse", info: null, parts: ref.firmware.map((element) => ({ element, name: null, version: null })) }];
const rowKey = (row: FirmwareRow): string => (row.device === "mouse" ? deviceKey : `${deviceKey}:${row.device}`);
const visible = rows.map((row) => (row.info !== null && !isDfuDismissed(rowKey(row), row.info.latestVersion) ? row.info : null));
@@ -121,14 +124,11 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
function partList(row: FirmwareRow): ReactNode {
if (row.parts.length === 0) return null;
return (
- <>
- {row.info ? {tp(locale, "fw.current", { version: row.info.currentVersion ?? "" })} : null}
-
- {row.parts.map((part) => (
- - {displayText(locale, part.version ? `${part.element} · v${part.version}` : part.element)}
- ))}
-
- >
+
+ {row.parts.map((part) => (
+ - {displayText(locale, part.version ? `${part.name ?? part.element} v${part.version}` : part.element)}
+ ))}
+
);
}
@@ -163,8 +163,8 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
);
}
- // The whole section is one collapsed dropdown: header row (title,
- // state pill, Check) always visible, device rows behind the toggle. The
+ // The whole section is one dropdown, open by default: header row (title,
+ // state pill, Check) always visible, device sections behind the toggle. The
// Check button stops its click reaching the summary, otherwise every
// check would also collapse the card.
function stopToggle(event: { preventDefault: () => void; stopPropagation: () => void }): void {
@@ -174,7 +174,7 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
return (
-
+ setExpanded(event.currentTarget.open)}>
{t(locale, "fw.sectionLabel")}
@@ -190,8 +190,20 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
- {status.name}{displayText(locale, status.firmware.join(" · "))}
+ {rows.map((row, index) => (
+
+
+
+ {row.device === "mouse" ? status.name : t(locale, "hw.receiver")}
+ {row.info?.currentVersion ? {displayText(locale, `v${row.info.currentVersion}`)} : null}
+
+ {rowBadge(visible[index] ?? null)}
+
+ {deviceDetails(visible[index] ?? null, row.info?.currentVersion ?? null)}
+ {partList(row)}
+
+ ))}
{error ? (
{t(locale, "fw.failed")}
) : !manifest ? (
@@ -200,16 +212,6 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
) : (
<>
- {rows.map((row, index) => (
-
-
-
{row.device === "mouse" ? status.name : t(locale, "hw.receiver")}
- {rowBadge(visible[index] ?? null)}
-
- {deviceDetails(visible[index] ?? null, row.info?.currentVersion ?? null)}
- {partList(row)}
-
- ))}
{receiverMcus.length > 0 ? (
diff --git a/src/styles/areas/advanced.css b/src/styles/areas/advanced.css
index 6a507236..4fc2da20 100644
--- a/src/styles/areas/advanced.css
+++ b/src/styles/areas/advanced.css
@@ -98,12 +98,12 @@
line-height: 1.3;
}
#firmware-update .fw-badge-available { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
-.fw-current { display: grid; gap: 6px; padding-top: 20px; color: var(--text-3); font-size: var(--fs-meta); }
-.fw-current strong { color: var(--text-1); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fw-collapse > .setting-note { padding: 0 18px 18px; }
.fw-device { border-top: 1px solid var(--line-1); padding: 12px 18px; }
.fw-device .setting-heading { gap: 10px; min-height: 24px; }
.fw-device .setting-heading > div > :is(span, p) { color: var(--text-2); font-size: var(--fs-body); font-weight: 550; }
+.fw-device .setting-heading > div > small { margin-inline-start: 8px; color: var(--text-3); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
+.fw-device > .fw-history { margin-top: 8px; }
.fw-details { margin-top: 8px; color: var(--text-2); font-size: var(--fs-meta); }
.fw-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; list-style: none; cursor: pointer; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fw-details > summary:hover { color: var(--text-1); }
From 9eeb8e8ad1a3f1858eb8b620c2f1f28eecd6c4bc Mon Sep 17 00:00:00 2001
From: kennedy <854543+kennedy@users.noreply.github.com>
Date: Sat, 5 Dec 2026 03:11:30 -0500
Subject: [PATCH 18/18] fix: address review on the Angry Miao PR
- Firmware card:
- "Up to date" only when every section is known and current; an unknown or dismissed section shows Unknown.
- A package whose version is unknown but has a part behind that part's latest shows "Update available" with "Latest v{latest}" (new key fw.latestOnly in every locale).
- Later only dismisses sections that have an update.
- Lighting: pending edits and their preview are keyed by zone name, so a receiver edit stays on the receiver when the mouse comes back before Apply.
- Hardware test: the write-check skip names its cause (receiver only, Attack Shark X11 through Bridge, read-only driver, or settings not read).
- AM30 converter: a table without packages is refused, so the generator keeps the previous entries.
- Generator: `--only` refreshes the selected sources and keeps every other entry; a vendor download counts toward the write guard only in `--only` runs.
- Receiver-only availability test covers debounce and processing in both states.
---
scripts/generate-firmware-manifest.mjs | 21 ++++++++++-
src/device/angry-miao/firmware.test.ts | 16 +++++++-
src/device/angry-miao/firmware.ts | 2 +
src/device/controller.ts | 8 ++--
src/device/firmware-updates.test.ts | 8 +++-
src/device/firmware-updates.ts | 7 +++-
src/features/devices/cards/FirmwareCard.tsx | 13 ++++---
src/features/devices/cards/LightingCard.tsx | 2 +-
.../devices/cards/availability.test.ts | 37 +++++++++++--------
.../hardware-test/HardwareTestPage.tsx | 11 +++++-
src/i18n/index.ts | 1 +
src/i18n/locales/ar.ts | 1 +
src/i18n/locales/de.ts | 1 +
src/i18n/locales/es.ts | 1 +
src/i18n/locales/fr.ts | 1 +
src/i18n/locales/ja.ts | 1 +
src/i18n/locales/ko.ts | 1 +
src/i18n/locales/pt.ts | 1 +
src/i18n/locales/ru.ts | 1 +
src/i18n/locales/tr.ts | 1 +
src/i18n/locales/vi.ts | 1 +
src/i18n/locales/zh.ts | 1 +
src/styles/areas/advanced.css | 3 +-
23 files changed, 107 insertions(+), 33 deletions(-)
diff --git a/scripts/generate-firmware-manifest.mjs b/scripts/generate-firmware-manifest.mjs
index 7ad02e09..fbdce643 100644
--- a/scripts/generate-firmware-manifest.mjs
+++ b/scripts/generate-firmware-manifest.mjs
@@ -144,6 +144,7 @@ const devices = [];
const warnings = [];
const seen = new Set();
let depotOkCount = 0;
+let vendorOkCount = 0;
for (const entry of seed) {
if (onlyFilter && !entry.name.toLowerCase().includes(onlyFilter.toLowerCase())) continue;
@@ -201,6 +202,7 @@ for (const source of VENDOR_TABLES) {
try {
const entries = await fetchVendorEntries(source);
devices.push(...entries);
+ vendorOkCount += 1;
console.log(`ok ${source.id} (${entries.length} entries)`);
} catch (error) {
const kept = (previousManifest?.devices ?? []).filter((device) => device.id.startsWith(source.id));
@@ -223,6 +225,18 @@ try {
warnings.push('extra entries unreadable: ' + (error instanceof Error ? error.message : String(error)));
}
+// `--only` refreshes the selected sources and keeps every other entry of the previous manifest.
+if (onlyFilter && previousManifest) {
+ const filter = onlyFilter.toLowerCase();
+ const selected = (entry) =>
+ (typeof entry.depot === "string" && entry.depot.toLowerCase().includes(filter))
+ || VENDOR_TABLES.some((source) => source.id.includes(filter) && entry.id.startsWith(source.id));
+ const fresh = new Set(devices.map((d) => d.id));
+ for (const entry of previousManifest.devices ?? []) {
+ if (!fresh.has(entry.id) && !selected(entry)) devices.push(entry);
+ }
+}
+
// Version history: carry forward the previous manifest (if this run
// overwrites a real one) so each entry accumulates [{version, date}]
// whenever its version moves. First sightings start empty — history is
@@ -245,11 +259,14 @@ devices.sort((a, b) => a.id.localeCompare(b.id));
// A run that resolved nothing must never overwrite a good manifest: exit
// non-zero and leave the previous file (and its version history) in place.
-const okCount = depotOkCount;
+// A full run needs the depots; a `--only` run needs one selected source.
+const okCount = onlyFilter ? depotOkCount + vendorOkCount : depotOkCount;
if (okCount <= 0) {
console.log(`\nwrote 0 entries to ${outputPath}`);
for (const warning of warnings) console.log(`warn: ${warning}`);
- console.error("error: no depots resolved; refusing to overwrite the manifest");
+ console.error(onlyFilter
+ ? `error: no source matching "${onlyFilter}" resolved; refusing to overwrite the manifest`
+ : "error: no depots resolved; refusing to overwrite the manifest");
process.exit(1);
}
diff --git a/src/device/angry-miao/firmware.test.ts b/src/device/angry-miao/firmware.test.ts
index 820903fd..2cdc9dc7 100644
--- a/src/device/angry-miao/firmware.test.ts
+++ b/src/device/angry-miao/firmware.test.ts
@@ -61,10 +61,19 @@ test("the mouse package needs both mouse parts, so only the cable names it", ()
assert.equal(mouse?.info?.dfuAvailable, true);
const [overReceiver] = rows(["Mouse SoC 0x0318", ...RECEIVER]);
- assert.equal(overReceiver?.info, null);
assert.deepEqual(overReceiver?.parts, [{ element: "Mouse SoC 0x0318", name: "Mouse SoC", version: "1.1.1" }]);
});
+test("a part behind its own latest marks its package for update even when the package is unknown", () => {
+ const [behind] = rows(["Mouse SoC 0x0318", ...RECEIVER]);
+ assert.equal(behind?.info?.currentVersion, null);
+ assert.equal(behind?.info?.latestVersion, "1.9");
+ assert.equal(behind?.info?.dfuAvailable, true);
+
+ const [current] = rows(["Mouse SoC 0x0321", ...RECEIVER]);
+ assert.equal(current?.info, null);
+});
+
test("the receiver package is compared with the vendor's latest receiver package", () => {
const receiver = rows(["Mouse SoC 0x0318", ...RECEIVER]).find((row) => row.device === "receiver");
assert.equal(receiver?.info?.currentVersion, "1.6");
@@ -110,3 +119,8 @@ test("a response without a table is refused", () => {
assert.throws(() => am30ManifestEntries({ ok: false }));
assert.throws(() => am30ManifestEntries(""));
});
+
+test("a table without usable packages is refused", () => {
+ assert.throws(() => am30ManifestEntries({ ok: true, table: {} }));
+ assert.throws(() => am30ManifestEntries({ ...VERSION_MAP, showVer: null }));
+});
diff --git a/src/device/angry-miao/firmware.ts b/src/device/angry-miao/firmware.ts
index 7fec986f..9f7da086 100644
--- a/src/device/angry-miao/firmware.ts
+++ b/src/device/angry-miao/firmware.ts
@@ -82,5 +82,7 @@ export function am30ManifestEntries(body: unknown): FirmwareManifestEntry[] {
latestVersion,
});
}
+ // Throwing lets the generator keep the previous entries instead of writing none.
+ if (!entries.some((entry) => entry.packageOf)) throw new Error("the version table has no usable packages");
return entries;
}
diff --git a/src/device/controller.ts b/src/device/controller.ts
index 61a88646..688ea24c 100644
--- a/src/device/controller.ts
+++ b/src/device/controller.ts
@@ -7298,13 +7298,15 @@ export function applyLighting(
return;
}
stageChange({
- key: `lighting-${zoneIndex}`,
+ // Keyed by zone name: the zone list can change under a staged edit (a receiver whose mouse comes back).
+ key: `lighting-${staged.zone}`,
label: `${staged.zone} lighting ${staged.mode.toLowerCase()}`,
command: `Set ${staged.zone} lighting to ${describeLighting(staged)}`,
progress: `Setting ${staged.mode.toLowerCase()} lighting…`,
preview: (status) => {
- if (status.lightingZones?.[zoneIndex]) status.lightingZones[zoneIndex] = { ...staged };
- if (zoneIndex === 0 && status.lighting) status.lighting = { ...status.lighting, ...staged } as MouseLighting;
+ const at = status.lightingZones?.findIndex((zone) => zone.zone === staged.zone) ?? -1;
+ if (at >= 0) status.lightingZones![at] = { ...staged };
+ if (status.lighting?.zone === staged.zone) status.lighting = { ...status.lighting, ...staged } as MouseLighting;
},
apply: async () => {
await requireClientMethod("setLighting", "the lighting").setLighting(staged as MouseLighting & GloriousLighting);
diff --git a/src/device/firmware-updates.test.ts b/src/device/firmware-updates.test.ts
index bae945ff..2388eddd 100644
--- a/src/device/firmware-updates.test.ts
+++ b/src/device/firmware-updates.test.ts
@@ -314,9 +314,15 @@ test("describeFirmware names a package from the versions of all its parts", () =
assert.equal(row?.info?.dfuAvailable, true);
assert.deepEqual(row?.parts, [{ element: "Main 0x0002", name: "Main", version: "2.0" }, { element: "Radio 0x10", name: "Radio", version: "1.0" }]);
- const [partial] = describeFirmware(codedRef(["Main 0x0002"]), coded);
+ const [partial] = describeFirmware(codedRef(["Main 0x0003"]), coded);
assert.equal(partial?.info, null);
assert.equal(partial?.parts.length, 1);
+
+ // A missing part leaves the package version unknown, but a part behind its own latest is still an update.
+ const [partialBehind] = describeFirmware(codedRef(["Main 0x0002"]), coded);
+ assert.equal(partialBehind?.info?.currentVersion, null);
+ assert.equal(partialBehind?.info?.latestVersion, "1.2");
+ assert.equal(partialBehind?.info?.dfuAvailable, true);
});
test("package entries are never a device-level match", () => {
diff --git a/src/device/firmware-updates.ts b/src/device/firmware-updates.ts
index 5b838f37..65cb9e79 100644
--- a/src/device/firmware-updates.ts
+++ b/src/device/firmware-updates.ts
@@ -292,6 +292,7 @@ export interface FirmwareRow {
function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device: FirmwareDeviceRef, manifest: FirmwareManifest): FirmwareRow | null {
const parts: FirmwareRow["parts"] = [];
const versions: Array
= [];
+ let partBehind = false;
for (const name of pkg.parts) {
const prefix = name.toLowerCase();
const element = device.firmware.find((item) => item.toLowerCase().startsWith(prefix));
@@ -300,12 +301,14 @@ function packageRow(entry: FirmwareManifestEntry, pkg: FirmwarePackage, device:
);
const version = element && partEntry ? elementVersion(partEntry, element) : null;
if (element) parts.push({ element, name, version });
+ if (version && partEntry && compareVersions(version, partEntry.latestVersion) < 0) partBehind = true;
versions.push(version);
}
if (parts.length === 0) return null;
const current = versions.every((version) => version !== null) ? pkg.versions[versions.join(",")] ?? null : null;
- if (!current) return { device: pkg.device, info: null, parts };
- const available = compareVersions(current, entry.latestVersion) < 0;
+ // Without every part the package version is unknown, but a part behind its own latest still means an update.
+ if (!current && !partBehind) return { device: pkg.device, info: null, parts };
+ const available = current ? compareVersions(current, entry.latestVersion) < 0 : true;
return {
device: pkg.device,
info: {
diff --git a/src/features/devices/cards/FirmwareCard.tsx b/src/features/devices/cards/FirmwareCard.tsx
index 6f0f510d..c0fa826b 100644
--- a/src/features/devices/cards/FirmwareCard.tsx
+++ b/src/features/devices/cards/FirmwareCard.tsx
@@ -106,7 +106,8 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
pill = t(locale, "fw.checking");
} else if (available.length > 0) {
pill = t(locale, "fw.available");
- } else if (visible.some((info) => info !== null)) {
+ } else if (visible.length > 0 && visible.every((info) => info !== null)) {
+ // Every section known and current; an unknown or dismissed section keeps the pill at Unknown.
pill = t(locale, "fw.upToDate");
} else {
pill = t(locale, "fw.unknown");
@@ -116,7 +117,7 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
function dismissAll(): void {
rows.forEach((row, index) => {
const info = visible[index];
- if (info) dismissDfuVersion(rowKey(row), info.latestVersion);
+ if (info?.dfuAvailable) dismissDfuVersion(rowKey(row), info.latestVersion);
});
setDismissTick((n) => n + 1);
}
@@ -145,9 +146,11 @@ export function FirmwareCard({ snapshot }: { snapshot: ControlSnapshot }): React
return (
- {displayText(locale, info.dfuAvailable
- ? tp(locale, "fw.versions", { current: current ?? "?", latest: info.latestVersion })
- : t(locale, "fw.history"))}
+ {displayText(locale, !info.dfuAvailable
+ ? t(locale, "fw.history")
+ : current
+ ? tp(locale, "fw.versions", { current, latest: info.latestVersion })
+ : tp(locale, "fw.latestOnly", { latest: info.latestVersion }))}
{notes ? (<>{t(locale, "fw.changelog")}{displayText(locale, notes)}
>) : null}
{past.length > 0 ? (
diff --git a/src/features/devices/cards/LightingCard.tsx b/src/features/devices/cards/LightingCard.tsx
index 0b0161c4..d1f2acfb 100644
--- a/src/features/devices/cards/LightingCard.tsx
+++ b/src/features/devices/cards/LightingCard.tsx
@@ -37,7 +37,7 @@ export function LightingCard({
const usesSpeed = mode !== null && lighting.reactiveModes.includes(mode);
const brightnessLevels = !lighting.brightnessModes || (mode !== null && lighting.brightnessModes.includes(mode))
? lighting.brightnessLevels ?? [] : [];
- const pendingKey = `lighting-${activeZoneIndex}`;
+ const pendingKey = `lighting-${lighting.zone}`;
const staged = snapshot.pending.keys.includes(pendingKey);
const sliderSpeeds = lighting.speeds.length > 8;
diff --git a/src/features/devices/cards/availability.test.ts b/src/features/devices/cards/availability.test.ts
index 2a23ddf6..10e498b8 100644
--- a/src/features/devices/cards/availability.test.ts
+++ b/src/features/devices/cards/availability.test.ts
@@ -883,24 +883,29 @@ test("a receiver whose mouse is away keeps only the receiver's own cards", () =>
zone: "Receiver", modes: ["Off", "Static"], mode: "Static", color: "#ffffff", color2: null,
colorModes: ["Static"], dualColorModes: [], reactiveModes: [], speeds: [], speed: null,
} as const;
- const has = cardAvailability(snapshot({
- settingsPending: true,
- status: {
- brand: "Angry Miao",
- name: "Angry Miao Receiver",
- ui: { family: "angry-miao", settingsReady: false, receiverOnly: true, separateLightingZones: true },
- dpi: 0,
- pollingRateHz: 0,
- batteryPercent: null,
- lightingZones: [receiverLight],
- buttonMappings: { Left: "Left Click" },
- buttonOptions: ["Left Click"],
- profileCount: 2,
- activeProfile: 1,
- },
- }));
+ const status: Partial = {
+ brand: "Angry Miao",
+ name: "Angry Miao Receiver",
+ ui: { family: "angry-miao", settingsReady: false, receiverOnly: true, separateLightingZones: true },
+ dpi: 0,
+ pollingRateHz: 0,
+ batteryPercent: null,
+ debounceMs: 10,
+ motionSync: false,
+ lightingZones: [receiverLight],
+ buttonMappings: { Left: "Left Click" },
+ buttonOptions: ["Left Click"],
+ profileCount: 2,
+ activeProfile: 1,
+ };
+ const has = cardAvailability(snapshot({ settingsPending: true, status }));
assert.equal(has.lighting, true);
for (const card of ["dpi", "polling", "sleep", "debounce", "processing", "buttonMapping", "onboardProfiles"] as const) {
assert.equal(has[card], false, card);
}
+ // The same status with the mouse answering keeps those cards, so the receiver-only guard is what hides them.
+ const withMouse = cardAvailability(snapshot({ settingsPending: true, status: { ...status, ui: { ...status.ui, receiverOnly: false } } }));
+ for (const card of ["sleep", "debounce", "processing", "buttonMapping", "onboardProfiles"] as const) {
+ assert.equal(withMouse[card], true, card);
+ }
});
diff --git a/src/features/hardware-test/HardwareTestPage.tsx b/src/features/hardware-test/HardwareTestPage.tsx
index a60d4990..90943e22 100644
--- a/src/features/hardware-test/HardwareTestPage.tsx
+++ b/src/features/hardware-test/HardwareTestPage.tsx
@@ -314,7 +314,16 @@ export function HardwareTestPage({ snapshot }: { snapshot: ControlSnapshot }): R
} else if (live.pending.count > 0 || live.gameProfileDraft) {
flashResult = flashWriteResult({ skipped: true, skippedReason: "you have staged, unapplied changes — apply or revert them first." });
} else if (live.settingsPending) {
- flashResult = flashWriteResult({ skipped: true, skippedReason: "driver is set to read-only; it needs more testing before writes can be checked." });
+ // Writes stay blocked whenever settings are pending; only the reason depends on why.
+ const ui = liveStatus.ui;
+ const skippedReason = ui?.receiverOnly
+ ? "receiver cannot detect mouse, so there is no mouse to write to."
+ : control.isNativeAttackSharkX11(liveStatus)
+ ? "this mouse's settings are written through OpenMouse Bridge, so writes are not checked here."
+ : ui?.valuesVerified
+ ? "driver is set to read-only; it needs more testing before writes can be checked."
+ : "settings could not be read from the device, so writes are not checked.";
+ flashResult = flashWriteResult({ skipped: true, skippedReason });
} else {
const legs: FlashSettingRoundTrip[] = [];
const settings = verifiedDeviceSettings(liveStatus);
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 20b23d18..77190bff 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -288,6 +288,7 @@ const en = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Latest v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts
index fadc371e..fd0af895 100644
--- a/src/i18n/locales/ar.ts
+++ b/src/i18n/locales/ar.ts
@@ -224,6 +224,7 @@ export const ar: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "الأحدث v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts
index ac9cecb8..0f4866f7 100644
--- a/src/i18n/locales/de.ts
+++ b/src/i18n/locales/de.ts
@@ -224,6 +224,7 @@ export const de: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Neueste v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts
index 9444b200..2de7a7e0 100644
--- a/src/i18n/locales/es.ts
+++ b/src/i18n/locales/es.ts
@@ -224,6 +224,7 @@ export const es: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Última v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts
index 5361ff9d..0c4bbff9 100644
--- a/src/i18n/locales/fr.ts
+++ b/src/i18n/locales/fr.ts
@@ -224,6 +224,7 @@ export const fr: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Dernière v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts
index a6d17b7d..23cc85e4 100644
--- a/src/i18n/locales/ja.ts
+++ b/src/i18n/locales/ja.ts
@@ -224,6 +224,7 @@ export const ja: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "最新 v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts
index e73a3db3..675ad3d6 100644
--- a/src/i18n/locales/ko.ts
+++ b/src/i18n/locales/ko.ts
@@ -224,6 +224,7 @@ export const ko: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "최신 v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/pt.ts b/src/i18n/locales/pt.ts
index a65d0035..8677308b 100644
--- a/src/i18n/locales/pt.ts
+++ b/src/i18n/locales/pt.ts
@@ -224,6 +224,7 @@ export const pt: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Mais recente v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts
index 91c732f6..6a587030 100644
--- a/src/i18n/locales/ru.ts
+++ b/src/i18n/locales/ru.ts
@@ -224,6 +224,7 @@ export const ru: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Последняя v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/tr.ts b/src/i18n/locales/tr.ts
index 1880435a..d758c1ba 100644
--- a/src/i18n/locales/tr.ts
+++ b/src/i18n/locales/tr.ts
@@ -224,6 +224,7 @@ export const tr: Record = {
"fw.failed": "Kontrol başarısız.",
"fw.current": "Mevcut v{version}",
"fw.versions": "v{current} → v{latest}",
+ "fw.latestOnly": "En yeni v{latest}",
"fw.comingSoon": "Uygulama içinden aygıt yazılımı yükleme henüz desteklenmiyor. Şimdilik üreticinin indirme bağlantısını kullanın.",
"fw.changelog": "Değişiklik günlüğü",
"fw.history": "Sürüm geçmişi",
diff --git a/src/i18n/locales/vi.ts b/src/i18n/locales/vi.ts
index 9d4ab6c0..176bfe61 100644
--- a/src/i18n/locales/vi.ts
+++ b/src/i18n/locales/vi.ts
@@ -224,6 +224,7 @@ export const vi: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "Mới nhất v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts
index 3fc74faa..110165f8 100644
--- a/src/i18n/locales/zh.ts
+++ b/src/i18n/locales/zh.ts
@@ -224,6 +224,7 @@ export const zh: Record = {
"fw.failed": "Check failed.",
"fw.current": "Current v{version}",
"fw.versions": "v{current} \u2192 v{latest}",
+ "fw.latestOnly": "最新 v{latest}",
"fw.comingSoon": "In-app flashing is not supported yet \u2014 use the vendor download for now.",
"fw.changelog": "Changelog",
"fw.history": "Version history",
diff --git a/src/styles/areas/advanced.css b/src/styles/areas/advanced.css
index 4fc2da20..5a591418 100644
--- a/src/styles/areas/advanced.css
+++ b/src/styles/areas/advanced.css
@@ -102,7 +102,8 @@
.fw-device { border-top: 1px solid var(--line-1); padding: 12px 18px; }
.fw-device .setting-heading { gap: 10px; min-height: 24px; }
.fw-device .setting-heading > div > :is(span, p) { color: var(--text-2); font-size: var(--fs-body); font-weight: 550; }
-.fw-device .setting-heading > div > small { margin-inline-start: 8px; color: var(--text-3); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
+.fw-device .setting-heading > div { display: flex; align-items: baseline; gap: 8px; }
+.fw-device .setting-heading > div > small { color: var(--text-3); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.fw-device > .fw-history { margin-top: 8px; }
.fw-details { margin-top: 8px; color: var(--text-2); font-size: var(--fs-meta); }
.fw-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; list-style: none; cursor: pointer; color: var(--text-2); font-variant-numeric: tabular-nums; }