Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/app/cards/availability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,27 @@ test("a driver still reading hides the settings grid but not the rest", () => {
assert.equal(has.logitechDetails, true);
});

test("the Finalmouse Starlight X has no polling card; the Ultralight X keeps it", () => {
// SLX runs PerfectPolling (a fixed pipeline) and reports a rate it will not
// let the user change, so the selector is dropped and PerfectPollingCard
// stands in. Only `finalmouseIsSlx` distinguishes the two dongles.
const slx = cardAvailability(snapshot({ status: {
brand: "Finalmouse",
name: "Finalmouse Starlight X",
ui: { family: "finalmouse-slx" },
finalmouseIsSlx: true,
} as Partial<MouseStatus> }));
assert.equal(slx.polling, false);

const ulx = cardAvailability(snapshot({ status: {
brand: "Finalmouse",
name: "Finalmouse UltralightX",
ui: { family: "finalmouse-ulx" },
finalmouseIsSlx: false,
} as Partial<MouseStatus> }));
assert.equal(ulx.polling, true);
});

test("the sensor card goes when the mouse reports neither surface nor lift-off", () => {
assert.equal(cardAvailability(snapshot({
status: { supportedLiftOffDistances: [] },
Expand Down
8 changes: 6 additions & 2 deletions src/app/cards/availability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ function computeCardAvailability(snapshot: ControlSnapshot): CardAvailability {
// The Attack Shark X11's settings channel is native-only (settingsReady
// stays false), but its polling rate is still controllable through
// OpenMouse Bridge — see isNativeAttackSharkX11 in device/controller.ts.
polling: ready || (
//
// The Finalmouse Starlight X reports a polling rate but has no adjustable
// one: PerfectPolling runs a fixed pipeline (see PerfectPollingCard), so
// there is nothing to pick. Ultralight X keeps the selector.
polling: !isSlxStatus(status) && (ready || (
status.brand === "Attack Shark"
&& status.name === "Attack Shark X11"
&& status.ui?.settingsReady === false
),
)),
sensor: sensor && ready,
lightforce: Boolean(status.lightforceSwitchMode),
superstrike: traits.logitech && status.analogButtonTuning?.buttons.length === 2,
Expand Down
Loading