Skip to content

feat(devices): map Zaopin Z1 PRO artwork - #1842

Open
huyhandes wants to merge 1 commit into
OpenMouse-Project:mainfrom
huyhandes:feat/zaopin-z1-pro-artwork
Open

huyhandes wants to merge 1 commit into
OpenMouse-Project:mainfrom
huyhandes:feat/zaopin-z1-pro-artwork

Conversation

@huyhandes

@huyhandes huyhandes commented Dec 5, 2026 •

Copy link
Copy Markdown

Summary

Maps the Zaopin Z1 PRO to zaopin-z1-pro.png and records a suggested source image for the upload, following public/devices/README.md ("Contributing artwork"). The mapping lands first and the image follows.

 computeDeviceImageFilename(displayName)
   ...
   /\blamzu\s+maya$/          → lamzu-maya.png
+  /\bzaopin\s+z1\s+pro$/     → zaopin-z1-pro.png

The Zaopin line shares 3554:f524 (receiver) and 3554:f526 (cable), so the match is by name, not product id. The driver names the model from its handshake (OpenMouse-Project/mouse-protocol#322). The rule matches only a name ending in "Zaopin Z1 PRO", so "Zaopin Z1 PRO MAX" keeps the placeholder.

For the maintainer upload (also in the README note): suggested source is the white Z1 PRO 4K render from the Mechkeys listing:

https://cdn.shopify.com/s/files/1/0631/9590/6271/files/zaopin-z1-pro-three-mode-4k-paw3395-mouse-mechkeysshop-z1-pro-4k-white-845944.png?v=1769525596

It is an 800×800 straight top-down PNG on an opaque light-grey backdrop, with the dongle and a "Z1 PRO" / Nordic 4K badge beside the mouse. It needs the mouse cropped out and the backdrop keyed to transparent. This is reseller-hosted vendor art with no stated licence, so it is a request pending licensing review.

Evidence

  • Before: deviceImage(null, "Zaopin Z1 PRO") → unknown-device.png
    After: deviceImage(null, "Zaopin Z1 PRO") → zaopin-z1-pro.png; "Zaopin Z1 PRO MAX" → unknown-device.png
  • src/shared/device-images.test.ts: 63 of 63 pass.
  • npm run check: typecheck and build pass. Tests: 807 pass, 0 fail, 6 cancelled. The 6 are the existing discord-card / feedback tests, which are also cancelled on main.

Until the file is uploaded, the name resolves to a missing file and falls back at image-load time, like other pending art.

Merge Danger

Door: two-way

Blast Radius: narrow

One name rule, two test assertions and one README note. No device, protocol, string or UI changes.

🤖 Generated with Claude Code

Note

Add Zaopin Z1 PRO device image mapping

Adds a case-insensitive check in computeDeviceImageFilename for display names ending in "Zaopin Z1 PRO". The end-of-string anchor keeps "Zaopin Z1 PRO MAX" and other longer model names from matching; those keep the unknown-device placeholder.

  • Adds tests asserting both the Z1 PRO image URL and the Z1 PRO MAX fallback in device-images.test.ts
  • Documents the asset source, cropping/transparency notes, and licensing review need in README.md

Macroscope summarized a2a36cd.

Summary by CodeRabbit

  • New Features
    • Added device artwork mapping for Zaopin Z1 PRO.
  • Documentation
    • Added licensing and image-preparation notes for the Zaopin Z1 PRO artwork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The device image mapping now selects zaopin-z1-pro.png for Zaopin Z1 Pro. Tests cover this mapping and confirm Zaopin Z1 PRO MAX still uses the unknown-device placeholder. The README records the mapping and artwork preparation notes.

Changes: Zaopin Z1 PRO artwork

Layer / File(s) Summary
Map and verify the device artwork
src/shared/device-images.ts, src/shared/device-images.test.ts, public/devices/README.md
The name-based mapping selects zaopin-z1-pro.png for Zaopin Z1 Pro. Tests check the mapping and confirm Z1 PRO MAX remains unmatched. The README records the mapping and notes that the image needs maintainer upload, preparation, and licensing review.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: macroscopeapp, snekxs

Merge Risk: Minimal · up to a2a36 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(devices): map Zaopin Z1 PRO artwork" matches the main change. The PR adds a name-based mapping from "Zaopin Z1 PRO" to zaopin-z1-pro.png in device-images.ts, with tests and a README no…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(devices): map Zaopin Z1 PRO artwork" matches the main change. The PR adds a name-based mapping from "Zaopin Z1 PRO" to zaopin-z1-pro.png in device-images.ts, with tests and a README note. The title names the device, the artwork mapping, and the scope. It is concise and specific. It does not mention that the image file is missing from the PR, but the title does not need to cover that detail.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8b3e938 and a2a36cd.

Files ignored due to path filters: 1

  • tsconfig.tsbuildinfo is excluded by !**/*.tsbuildinfo
Files selected for processing: 3

  • public/devices/README.md
  • src/shared/device-images.test.ts
  • src/shared/device-images.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@macroscopeapp

macroscopeapp Bot commented Dec 5, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at a2a36cd

Macroscope's review found this PR approvable — Maps Zaopin Z1 PRO to its artwork filename while keeping PRO MAX on the placeholder. Existing image fallbacks limit missing-art impact; the proposed artwork is not published by this change.

Notes:

  • Your repo's Minimum Blocking Severity is Off, so correctness findings do not automatically block approval.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant