{"summary":"스위치, 체크박스, 라디오 버튼, 세그먼트 컨트롤, 셀렉트 박스, 드롭다운 메뉴가 각각 어떤 상황에 맞는지 다룹니다.","notes":"<p>이 컨트롤들은 생김새가 비슷해 자주 혼용됩니다. 예를 들어 설정 페이지에서 스위치를 켰는데 아래에 저장 버튼이 또 있어서, 사용자가 페이지를 떠나면 설정이 적용되지 않습니다. 아래에서 네 묶음으로 나눠 차이를 설명합니다.</p>\n        <ol>\n        <li><strong>스위치와 체크박스</strong>: 차이는 언제 적용되느냐에 있습니다. 스위치는 켜고 끄는 즉시 적용되므로 설정 페이지처럼 자동 저장되는 곳에 적합하며, 옆에 저장 버튼을 두지 않습니다. 체크박스는 폼과 함께 제출되므로 제출 버튼과 함께 씁니다. 한 가지 일의 켜기와 끄기는 스위치 하나로 나타내고, ‘켜기 / 끄기’ 라디오 버튼 두 개로 만들지 않습니다.</li>\n        <li><strong>셀렉트 박스와 드롭다운 메뉴</strong>: 셀렉트 박스에는 값이 들어 있어, 고르면 언어처럼 상자 안에 표시됩니다. 드롭다운 메뉴에는 동작이 들어 있어, 누르면 바로 실행되고 버튼 글자는 바뀌지 않으며, 도구 막대나 페이지 상단의 버튼을 모아 둘 때 자주 씁니다. 가장 자주 쓰는 동작은 주 버튼으로 만들고, 옆의 아이콘 버튼으로 나머지 동작을 펼칠 수 있습니다. 예를 들어 ‘보내기’ 옆의 ‘예약 전송’, ‘임시 저장’입니다.</li>\n        <li><strong>세그먼트 컨트롤과 셀렉트 박스</strong>: 둘 다 하나만 고를 때 씁니다. 짧은 선택지 2–5개는 세그먼트 컨트롤로 한눈에 보여 주고, 항목마다 한 줄 설명이 필요하면 세로로 늘어놓은 라디오 버튼으로 바꿉니다. 선택지가 더 많거나, 글이 길거나, 바뀌는 경우(사람 이름, 날짜, 사용자가 추가한 항목)에는 화면이 튀지 않도록 셀렉트 박스를 씁니다. 수백 개에 이르면(시간대, 국가) 목록 맨 위에 검색창을 두고, 결과가 없을 때의 안내도 마련합니다.</li>\n        <li><strong>라디오 버튼과 체크박스</strong>: 라디오 버튼은 설문처럼 모든 선택지를 다 읽고 하나를 고르는 질문에 적합합니다. 고른 뒤에는 취소할 수 없으므로 ‘아직 모르겠음’ 같은 선택지를 제공합니다. 여러 개를 고를 수 있으면 체크박스를 씁니다. 셀렉트 박스 안에서도 같습니다. 하나만 고를 때는 선택한 항목 뒤에 체크 표시를 하고 라디오 버튼 동그라미는 그리지 않으며, 여러 개를 고를 때는 각 항목 앞에 체크박스를 둡니다.</li>\n        </ol>\n        <p>또한 모든 컨트롤의 결과는 바로 보여야 합니다. 데스크톱 알림을 켜면 곧바로 알림을 하나 띄우고, 드롭다운 메뉴에서 ‘데이터 내보내기’를 실행하면 Toast로 결과를 알립니다.</p>\n        <h2>매개변수</h2>\n        <dl class=\"params\">\n        <dt>선택지 수</dt><dd>짧은 선택지 2–5개는 세그먼트 컨트롤, 설명이 필요한 2–5개는 라디오 버튼, 6개 이상은 셀렉트 박스, 수백 개는 검색이 있는 셀렉트 박스</dd>\n        <dt>스위치</dt><dd>40×24px, 모서리 반경 8px, 손잡이 18px, 전환 220ms, cubic-bezier(.32, .72, 0, 1)</dd>\n        <dt>세그먼트 컨트롤</dt><dd>높이 36px, 안쪽 여백 4px, 손잡이 높이 28px, 모서리 반경 8px, 전환 280ms</dd>\n        <dt>선택지 목록</dt><dd>항목 높이 36px, 모서리 반경 14px, 열기 180ms, 닫기 120ms</dd>\n        <dt>라디오 버튼과 체크박스</dt><dd>18px, 라디오 버튼은 원형, 체크박스는 모서리 반경 5px</dd>\n        </dl>\n        <p>함께 제공하는 Prompt는 먼저 제품의 모든 선택 컨트롤을 찾아 하나씩 올바르게 쓰였는지, 어떤 것으로 바꿔야 하는지 판단하고 표로 정리해 결정을 맡깁니다. 확인한 뒤 규칙에 따라 하나씩 개선합니다.</p>","prompt":"Review the choice controls in my product, and decide for each one whether it is the right control: switches, checkboxes, radio buttons, segmented controls, tabs, selects and dropdown menus. Then, if I want it, change the ones I approve. This is about judgment first: diagnose and recommend, and change only what I approve.\n\nThis is a change to my product, not a demo. Work inside my code, on my stack, with my components, tokens and copy style. Do not add a dependency or a new visual pattern without asking. When a control I need is missing (a segmented control, a select with search), say so and propose one from my component library or the platform before building it.\n\n0. Read the product first\n- Find every place a person picks something, turns something on or off, or runs an action from a list: settings and preferences, forms and dialogs, sign-up and onboarding questions, filters and toolbars, page headers, row menus.\n- For each control, note:\n  - what it sets, or what it does;\n  - the options: how many, how long their labels are, and whether each needs a line of explanation;\n  - how many can be picked, and whether picking none is a valid answer;\n  - when a change takes effect: at once, or on Save or Submit;\n  - where it sits: a settings list, a form, a survey, a toolbar or page header;\n  - what it shows after a pick.\n- Find the shared components behind them (switch, checkbox, radio group, segmented control, tabs, select, combobox, menu).\n- Tell me in a few lines what you found before going on.\n\n1. How to choose\nSettle each control by these pairs. Each pair differs in one thing.\n\na. Switch or checkbox: when the change takes effect.\n- Switch: it takes effect the moment it is flipped, like a light switch. Use it in settings and preferences that save on their own, with no Save button nearby. The effect should show at once, or be easy to see (a notification turned on, a panel shown).\n- Checkbox: it is one answer in a form, and takes effect when the form is submitted (Make it private, in a New project dialog; Email me a copy, before Send).\n- One thing on or off is never two radio buttons (On / Off): the reader has to read both to know the state, and it looks like a bigger choice than it is.\n- The test: if the opposite of the option is just \"not\", it is one thing on or off. If both sides have names of their own (Light / Dark, Monthly / Yearly), it is a choice of one: go to (c).\n- Wrong: a switch in a form with a Save button (people flip it, leave, and nothing was saved); a checkbox in a list that saves on its own (people look for a Save button).\n\nb. Select or dropdown menu: a value or an action.\n- Select: it holds a value. After a pick the field shows the new value, and a setting takes effect at once (pick a language and the page is in that language). In its list the picked option has a tick.\n- Dropdown menu: it holds actions (Export data, Duplicate, Delete). A pick runs the action, the button keeps its own name (More, a \"…\" icon, Export), and the result is shown elsewhere (a toast, a new page, a download). Menus belong in page headers, toolbars and at the end of rows, not among a form's fields.\n- Split button: a main action with an icon beside it that opens a dropdown menu of the actions that go with it (Send, and beside it Send tomorrow at 9:00, Send a test to me, Save as draft). Each item runs as it is picked, and the main button keeps its name. Use it when one action is used far more often than the others that go with it.\n- Wrong: a menu whose button turns into the picked item; a select whose options are verbs, or that sits on \"Actions\" and stays on the action just run; a value whose current setting can't be seen without opening the list.\n- Tabs and segmented controls differ the same way: tabs switch to a different page of content and set nothing; a segmented control sets a value, or switches the view of the same content (List / Board / Calendar).\n\nc. One of several: by how many options there are.\n- 2 to 5 short options: a segmented control. One press picks, and every option stays in view.\n- 2 to 5 options that each need a line: radio buttons, one under another, each with its line under its label. Put the group under the setting's label, on the same left edge, rather than squeezed into the control column.\n- 6 or more: a select.\n- Options whose labels change or whose number can grow (names, counts, dates, items people add): a select, even when there are only a few today, so a longer label or a new option never pushes the layout around.\n- Hundreds (time zones, countries, people): a select with a search field at the top of its list; typing narrows the list, and when nothing matches, the list says so (No time zones match \"xyz\") rather than going blank.\n- Wrong: three short options hidden in a select (two presses, and only one option in view); a long list laid out in a row that runs off its end or wraps.\n\nd. Radio button or checkbox: how many can be picked.\n- Radio buttons: exactly one, with every option shown. Use them where all the options must be read before answering: a survey or onboarding question, a plan in a form, options that need explaining (see c). A radio can't be cleared once picked, so when \"none\" is a fair answer, add it as an option (Not sure yet, None of these), or make it a checkbox list.\n- Checkboxes: any number, none included. Stack them, one under another.\n- Inside a select it is the same: one value gets a tick on the picked option, never radio circles; several values get a checkbox before each option, and the field shows what is picked as chips, or as a count when there are many.\n\n2. Rules for every control\n- Each control says what it sets, in its label, not only in its options.\n- The current value is always visible without opening anything.\n- A control that takes effect at once shows the effect; a form shows nothing has happened until it is submitted.\n- Defaults are the safe and common choice; nothing is pre-ticked that signs the person up for something.\n- When a control is unavailable, say why, rather than only greying it out.\n- Keyboard and screen readers: a switch is role=\"switch\" with aria-checked; radio buttons are one radiogroup moved with the arrow keys; a select opens with Enter or Space and moves with the arrows; a menu is role=\"menu\" and closes with Escape. Touch targets are at least 44 by 44.\n\n3. Report before changing anything\nGive me a table first, and do not change code yet. One row per control:\n- Where: the screen, and the setting or question.\n- What it sets or does, in a phrase: its options, how many can be picked, when it takes effect.\n- Now: the control in use.\n- Should be: the control it should be, or \"right as it is\".\n- Why: one line that points to the rule in section 1.\n- Change: what changes besides the control, if anything: a Save button added or removed, a \"none\" option added, an action moved out of the form into a menu.\nGroup the rows by the pairs in section 1. Mark the ones that are already right. When a case could go either way, say what decides it and ask me. Call out every change that alters behaviour (a switch that becomes a checkbox now waits for Save; an action that leaves a form moves to the page header). Then ask me which rows to change, and wait.\n\n4. Change what I approve\n- List the files you will touch and wait for my go-ahead.\n- Change one control at a time and keep what it sets and does, unless I agreed to change that too. Keep the value people already saved.\n- Use my own components where they exist; follow the platform's own controls where they don't:\n  - Web: a native select or a listbox with a search field (combobox); role=\"switch\" for switches; a radiogroup for radios; a menu button for menus.\n  - iOS: Toggle, Picker with the .segmented or .menu style, Menu, and a searchable list for long ones.\n  - Android: Switch, Checkbox, RadioButton, SegmentedButton, ExposedDropdownMenu for values and DropdownMenu for actions.\n  - Flutter: Switch, Checkbox, Radio, SegmentedButton, DropdownMenu with search for values, and MenuAnchor for actions.\n\n5. Check\n- Every switch takes effect at once, and every checkbox only on submit.\n- Every select shows its value after a pick; every menu button keeps its name after an action.\n- No radio pair stands for on and off, and every radio question that allows none has a way to say so.\n- Long lists can be searched, and say so when nothing matches; short ones are laid out.\n- Keyboard, screen reader, phone and desktop layouts, light and dark; existing tests still pass.","skill":"/skills/kubai-choice-controls/SKILL.md","skillText":"# 选择控件的诊断与改造\n\n《999 个小技巧，让你 Vibe 的产品更有质感》第 020 期 · @kubai087\n\n在用户的项目里按下面的要求改造。要求以用户的口吻写成：文中的 I、me、my 指用户；写着要先问的地方，先停下来问用户再继续。\n\n## 改造要求\n\nReview the choice controls in my product, and decide for each one whether it is the right control: switches, checkboxes, radio buttons, segmented controls, tabs, selects and dropdown menus. Then, if I want it, change the ones I approve. This is about judgment first: diagnose and recommend, and change only what I approve.\n\nThis is a change to my product, not a demo. Work inside my code, on my stack, with my components, tokens and copy style. Do not add a dependency or a new visual pattern without asking. When a control I need is missing (a segmented control, a select with search), say so and propose one from my component library or the platform before building it.\n\n0. Read the product first\n- Find every place a person picks something, turns something on or off, or runs an action from a list: settings and preferences, forms and dialogs, sign-up and onboarding questions, filters and toolbars, page headers, row menus.\n- For each control, note:\n  - what it sets, or what it does;\n  - the options: how many, how long their labels are, and whether each needs a line of explanation;\n  - how many can be picked, and whether picking none is a valid answer;\n  - when a change takes effect: at once, or on Save or Submit;\n  - where it sits: a settings list, a form, a survey, a toolbar or page header;\n  - what it shows after a pick.\n- Find the shared components behind them (switch, checkbox, radio group, segmented control, tabs, select, combobox, menu).\n- Tell me in a few lines what you found before going on.\n\n1. How to choose\nSettle each control by these pairs. Each pair differs in one thing.\n\na. Switch or checkbox: when the change takes effect.\n- Switch: it takes effect the moment it is flipped, like a light switch. Use it in settings and preferences that save on their own, with no Save button nearby. The effect should show at once, or be easy to see (a notification turned on, a panel shown).\n- Checkbox: it is one answer in a form, and takes effect when the form is submitted (Make it private, in a New project dialog; Email me a copy, before Send).\n- One thing on or off is never two radio buttons (On / Off): the reader has to read both to know the state, and it looks like a bigger choice than it is.\n- The test: if the opposite of the option is just \"not\", it is one thing on or off. If both sides have names of their own (Light / Dark, Monthly / Yearly), it is a choice of one: go to (c).\n- Wrong: a switch in a form with a Save button (people flip it, leave, and nothing was saved); a checkbox in a list that saves on its own (people look for a Save button).\n\nb. Select or dropdown menu: a value or an action.\n- Select: it holds a value. After a pick the field shows the new value, and a setting takes effect at once (pick a language and the page is in that language). In its list the picked option has a tick.\n- Dropdown menu: it holds actions (Export data, Duplicate, Delete). A pick runs the action, the button keeps its own name (More, a \"…\" icon, Export), and the result is shown elsewhere (a toast, a new page, a download). Menus belong in page headers, toolbars and at the end of rows, not among a form's fields.\n- Split button: a main action with an icon beside it that opens a dropdown menu of the actions that go with it (Send, and beside it Send tomorrow at 9:00, Send a test to me, Save as draft). Each item runs as it is picked, and the main button keeps its name. Use it when one action is used far more often than the others that go with it.\n- Wrong: a menu whose button turns into the picked item; a select whose options are verbs, or that sits on \"Actions\" and stays on the action just run; a value whose current setting can't be seen without opening the list.\n- Tabs and segmented controls differ the same way: tabs switch to a different page of content and set nothing; a segmented control sets a value, or switches the view of the same content (List / Board / Calendar).\n\nc. One of several: by how many options there are.\n- 2 to 5 short options: a segmented control. One press picks, and every option stays in view.\n- 2 to 5 options that each need a line: radio buttons, one under another, each with its line under its label. Put the group under the setting's label, on the same left edge, rather than squeezed into the control column.\n- 6 or more: a select.\n- Options whose labels change or whose number can grow (names, counts, dates, items people add): a select, even when there are only a few today, so a longer label or a new option never pushes the layout around.\n- Hundreds (time zones, countries, people): a select with a search field at the top of its list; typing narrows the list, and when nothing matches, the list says so (No time zones match \"xyz\") rather than going blank.\n- Wrong: three short options hidden in a select (two presses, and only one option in view); a long list laid out in a row that runs off its end or wraps.\n\nd. Radio button or checkbox: how many can be picked.\n- Radio buttons: exactly one, with every option shown. Use them where all the options must be read before answering: a survey or onboarding question, a plan in a form, options that need explaining (see c). A radio can't be cleared once picked, so when \"none\" is a fair answer, add it as an option (Not sure yet, None of these), or make it a checkbox list.\n- Checkboxes: any number, none included. Stack them, one under another.\n- Inside a select it is the same: one value gets a tick on the picked option, never radio circles; several values get a checkbox before each option, and the field shows what is picked as chips, or as a count when there are many.\n\n2. Rules for every control\n- Each control says what it sets, in its label, not only in its options.\n- The current value is always visible without opening anything.\n- A control that takes effect at once shows the effect; a form shows nothing has happened until it is submitted.\n- Defaults are the safe and common choice; nothing is pre-ticked that signs the person up for something.\n- When a control is unavailable, say why, rather than only greying it out.\n- Keyboard and screen readers: a switch is role=\"switch\" with aria-checked; radio buttons are one radiogroup moved with the arrow keys; a select opens with Enter or Space and moves with the arrows; a menu is role=\"menu\" and closes with Escape. Touch targets are at least 44 by 44.\n\n3. Report before changing anything\nGive me a table first, and do not change code yet. One row per control:\n- Where: the screen, and the setting or question.\n- What it sets or does, in a phrase: its options, how many can be picked, when it takes effect.\n- Now: the control in use.\n- Should be: the control it should be, or \"right as it is\".\n- Why: one line that points to the rule in section 1.\n- Change: what changes besides the control, if anything: a Save button added or removed, a \"none\" option added, an action moved out of the form into a menu.\nGroup the rows by the pairs in section 1. Mark the ones that are already right. When a case could go either way, say what decides it and ask me. Call out every change that alters behaviour (a switch that becomes a checkbox now waits for Save; an action that leaves a form moves to the page header). Then ask me which rows to change, and wait.\n\n4. Change what I approve\n- List the files you will touch and wait for my go-ahead.\n- Change one control at a time and keep what it sets and does, unless I agreed to change that too. Keep the value people already saved.\n- Use my own components where they exist; follow the platform's own controls where they don't:\n  - Web: a native select or a listbox with a search field (combobox); role=\"switch\" for switches; a radiogroup for radios; a menu button for menus.\n  - iOS: Toggle, Picker with the .segmented or .menu style, Menu, and a searchable list for long ones.\n  - Android: Switch, Checkbox, RadioButton, SegmentedButton, ExposedDropdownMenu for values and DropdownMenu for actions.\n  - Flutter: Switch, Checkbox, Radio, SegmentedButton, DropdownMenu with search for values, and MenuAnchor for actions.\n\n5. Check\n- Every switch takes effect at once, and every checkbox only on submit.\n- Every select shows its value after a pick; every menu button keeps its name after an action.\n- No radio pair stands for on and off, and every radio question that allows none has a way to say so.\n- Long lists can be searched, and say so when nothing matches; short ones are laid out.\n- Keyboard, screen reader, phone and desktop layouts, light and dark; existing tests still pass.\n"}