Repository navigation
Add a dedicated Lighting tab with an in-app colour picker, plus Razer Viper Mini art - #61
Merged
Merged
Conversation
Contributor
Author
Video.Project.15.1.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related changes landed on the fork's
devbranch:lightingworkspace tab (#lighting-settings) with its own lighting card that uses the new in-app colour picker. The original lighting card under Advanced is kept exactly as it was, so both tabs render the device lighting independently.<input type="color">with an in-app SV panel + hue bar picker (canvas-drawn picker, draggable thumb, live hex field and swatch) in the new Lighting tab. Colours are staged through the existing pending-change flow and applied on write, so the panel no longer closes mid-drag.1532:008ato top-down product artwork in the persistent device panel.Details
Lighting tab
#lighting-settingsas a new workspace host and thelightingtab to the workspace tab order/content.#lighting-tab-card(ids prefixed#lighting-tab-*), so it does not collide with the original card.#lighting-cardstays under the Advanced tab unchanged — same markup (native colour inputs,RECEIVERlabel), same CSS, same event bindings, and it remains in theadvancedtab content list.renderLightingnow renders into both cards via a sharedrenderLightingCard(prefix)helper;renderStagedMarkersand the delegated control handlers cover both cards, and only the card in the active tab is visible.Colour picker
src/ui/color-picker.ts:initColorPickers()binds pointer events,syncColorPickers()mirrors the hidden#lighting-tab-color/#lighting-tab-color2inputs into the picker UI after every re-render.hsl/cache on the element, and usessetPointerCapturefor smooth drags. Releasing the pointer commits the chosen value via the hidden input'schangeevent, exactly like the native control.{mode}patch under the sharedlightingkey, sowithPendingChangesrevertedmodeto the device's cachednullon re-render — which hid the colour row and closed the picker the moment you released the cursor.Razer Viper Mini art
public/devices/razer-viper-mini.webp(1024×1024) and maps1532:008ainsrc/ui/device-images.ts.public/devices/README.mdnotes that WebP is accepted and records the artwork's Discord source for licensing review.Testing
npm run buildpasses (tsc + vite).npm run sizepasses (JS budget raised to 429 kB for the second lighting card).npm testpasses (32 tests).Commits
c96cb85lighting: add custom colour picker in its own tab3546112razer: show viper mini device art35c2ec7build: raise bundle budget for the colour picker8c0a5b8lighting: keep the advanced-tab card and add a separate tab