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)} />