Skip to content

Comments

Add RmgCircularSlider component#9

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-circular-slider-component
Open

Add RmgCircularSlider component#9
Copilot wants to merge 3 commits intomainfrom
copilot/add-circular-slider-component

Conversation

Copy link

Copilot AI commented Feb 1, 2026

Adds a circular dial input component for angle/rotation selection with snap alignment support.

Features

  • 0° at top, clockwise to 360°
  • Configurable range (min/max, default 0-359)
  • Snap alignment at intervals (default 45°) within threshold (default ±3°)
  • Disabled values support
  • Mouse drag, touch, and keyboard navigation
  • Visual feedback: blue pointer, red when snapped
  • Center displays current value
  • Pointer extends from r/2 to r (half radius to edge)
  • Light red tick marks on outer ring only

Usage

<RmgCircularSlider
  defaultValue={45}
  min={0}
  max={359}
  snapStep={45}
  snapThreshold={3}
  disabledValues={[180]}
  size={200}
  onChange={setValue}
/>

Screenshot

Original prompt

This section details on the original issue you should resolve

<issue_title>Circular slider</issue_title>
<issue_description>Image

参考这张圆形表盘的输入和现有的代码规范,给项目添加一个从最上方开始是0度,顺时针绕一圈回来是360度的圆形输入组件
需求是开始和结束值可以自定义,默认是0和359。最小的单位是1并且可被自定义。还要求能自定义对齐的步长,默认是每45度,仅在正负3度的时候对齐到每45度,其他时候自由对齐到整数。另外允许设置禁用的值,比如180被禁用。

不需要有特别的色彩,参考目前的颜色克制地使用默认蓝和红表示指针和对齐到的刻度即可
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add circular slider input component with customizable values Add RmgCircularSlider component Feb 1, 2026
Copilot AI requested a review from thekingofcity February 1, 2026 12:56
@wongchito wongchito marked this pull request as ready for review February 1, 2026 15:30
@wongchito wongchito self-requested a review February 1, 2026 15:30
@thekingofcity
Copy link
Member

@copilot

  1. 平行于y轴的上方应该是起始点,当前是平行于x轴的右侧为起始点
  2. 鼠标点击指针时指针会跳到delta >0的一个位置,并且拖动的话也有偏差,确保点击时指针的位置就在鼠标的位置
  3. 当前的对齐刻度太长,应该为淡红色且仅在外圈展示,同时,灰色圆环也太窄了,要再宽点
  4. 圆心展示当前数值,相对应的指针在r/2到r展示即可

…, center value display, lighter outer-only tick marks, wider track

Co-authored-by: thekingofcity <[email protected]>
Copy link
Author

Copilot AI commented Feb 3, 2026

@copilot

  1. 平行于y轴的上方应该是起始点,当前是平行于x轴的右侧为起始点
  2. 鼠标点击指针时指针会跳到delta >0的一个位置,并且拖动的话也有偏差,...

Fixed in commit b8e609e:

  1. Starting point is now at the top (y-axis) - 0° at 12 o'clock position
  2. Fixed mouse positioning by using proper angle-to-radians conversion
  3. Tick marks now only on outer ring with light red color (red.200)
  4. Track circle widened from 4px to 8px stroke width
  5. Center now displays the current value, pointer shows from r/2 to r

Updated Circular Slider

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.chakra-ui.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/rmg-components/rmg-components/node_modules/.bin/storybook dev -p 6006 (dns block)
  • storybook.js.org
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/rmg-components/rmg-components/node_modules/.bin/storybook dev -p 6006 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Member

@thekingofcity thekingofcity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

Circular slider

3 participants