Skip to content

Auto-enter/exit paint mode from color picker (mouse hover + touch support)#322

Closed
tracygardner wants to merge 2 commits intomainfrom
codex/implement-color-picker-paint-mode
Closed

Auto-enter/exit paint mode from color picker (mouse hover + touch support)#322
tracygardner wants to merge 2 commits intomainfrom
codex/implement-color-picker-paint-mode

Conversation

@tracygardner
Copy link
Contributor

Motivation

  • Improve the color picker workflow so users can paint objects without extra clicks by auto-entering/exiting paint mode based on pointer interaction and provide explicit activation for touch devices.
  • Provide a persistent visual indicator on the paint tool when paint mode is active and ensure paint mode is cleaned up when the picker closes.

Description

  • Added paint-mode session state and pointer-type tracking in ui/gizmos.js to manage automatic transitions and explicit activation for coarse pointers.
  • Implemented hover-driven behavior for mouse users that activatePaintMode() on pointerleave of the picker content and deactivatePaintMode() on pointerenter, and bound handlers dynamically via bindPickerHoverHandlers() / detachPickerHoverHandlers().
  • Hooked the color picker's paint button (.color-picker-use) into the picker API by adding an onPaintButtonClick callback in ui/colourpicker.js, changed the button to trigger paint mode (instead of confirming/closing), and added updatePaintModeButtonVisual() to show/remove the colored border while active.
  • Added CSS .color-picker-use.paint-mode-active in ui/colourpicker.css to render a border/glow that matches the currently selected color via --paint-mode-color.

Testing

  • Built the project with npm run build and the build completed successfully.
  • Started the dev server with npm run dev and verified the app served locally.
  • Ran an automated Playwright check that opened the app, opened the color picker and clicked the paint button, producing a screenshot at browser:/tmp/codex_browser_invocations/787b221ccc7c4722/artifacts/artifacts/color-picker-paint-mode.png which demonstrates the active paint-button visual.
  • Confirmed the new paint behavior applies the selected color to meshes when clicking the canvas while paint mode is active (validated via the Playwright flow above).

Codex Task

@tracygardner tracygardner deleted the codex/implement-color-picker-paint-mode branch February 26, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant