Skip to content

Conversation

@ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Nov 5, 2025

☑️ Resolves

⚠️ Why not NcCheckboxRadioSwitch

  • The design is quite different — I do not want to introduce the 3rd structure to a super component
  • Much can be reused with NcFormBoxButton
  • Switch toggle is a straightforward UI element, it doesn't need everything we have for checkboxes, radio, shift+click features as well as being in a group

🖼️ Screenshots

image

Accessible input position:

image

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

@ShGKme ShGKme self-assigned this Nov 5, 2025
@ShGKme ShGKme added enhancement New feature or request 3. to review Waiting for reviews labels Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.57%. Comparing base (b0a5563) to head (b4d47e1).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7781   +/-   ##
=======================================
  Coverage   51.57%   51.57%           
=======================================
  Files          96       96           
  Lines        3143     3143           
  Branches      863      863           
=======================================
  Hits         1621     1621           
  Misses       1274     1274           
  Partials      248      248           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ShGKme ShGKme changed the title feat: add NcFormboxSwitch feat: add NcFormBoxSwitch Nov 5, 2025
Copy link
Contributor

@GVodyanov GVodyanov left a comment

Choose a reason for hiding this comment

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

Tested and the code looks good!

@ShGKme ShGKme force-pushed the feat/NcFormBoxButton branch from f77a4d4 to 8f194c1 Compare November 6, 2025 08:07
Base automatically changed from feat/NcFormBoxButton to main November 6, 2025 08:11
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme force-pushed the feat/NcFormBoxSwitch branch from 22717cb to b4d47e1 Compare November 6, 2025 08:23
@ShGKme ShGKme marked this pull request as ready for review November 6, 2025 08:23
@ShGKme
Copy link
Contributor Author

ShGKme commented Nov 6, 2025

Rebased after merging the base component

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Code looks good, I do not think we need duplicated events but 🤷

Copy link
Member

@kra-mo kra-mo left a comment

Choose a reason for hiding this comment

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

Looks good, but quickly toggling it causes the text to be selected.

Could we somehow disable the double-click to select text behavior? Or more generally, disable text selection for FormBoxButton and co. maybe?

Edit: Actually yes, it seems to not happen with FormBoxButton despite the text still being selectable there too. So I'm guessing this should receive the same treatment?

@ShGKme
Copy link
Contributor Author

ShGKme commented Nov 6, 2025

@kra-mo user selection is disabled in both components. What web-browser you are testing with?

@kra-mo
Copy link
Member

kra-mo commented Nov 6, 2025

@kra-mo user selection is disabled in both components. What web-browser you are testing with?

Interesting because it does work for one but not the other. macOS Safari.

@susnux susnux merged commit 6447850 into main Nov 6, 2025
28 of 29 checks passed
@susnux susnux deleted the feat/NcFormBoxSwitch branch November 6, 2025 16:30
@ShGKme
Copy link
Contributor Author

ShGKme commented Nov 6, 2025

I was just about to push removing the event you didn't want to have, split them into a separated PR =\

@ShGKme
Copy link
Contributor Author

ShGKme commented Nov 6, 2025

I'll consider your merge as "I like the events" then 👀

@ShGKme
Copy link
Contributor Author

ShGKme commented Nov 6, 2025

/backport to stable8

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

Labels

3. to review Waiting for reviews enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance <NcCheckboxRadioSwitch> with new layout and description

7 participants