Skip to content

Conversation

@IKEYCY
Copy link
Contributor

@IKEYCY IKEYCY commented Nov 21, 2025

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added two disabled-checkbox demos (Composition API and Options API) demonstrating a pre-checked, disabled checkbox with reactive binding.
  • Documentation

    • Registered the disabled demo in the checkbox demo list with localized titles and descriptions.
  • Tests

    • Added end-to-end tests confirming disabled appearance, styling classes, interaction prevention, checked state persistence, and no page errors.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added the bug Something isn't working label Nov 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

Adds two disabled-checkbox demo components (Options API and Composition API), a Playwright test that verifies disabled behavior and styling, and a webdoc demo entry registering the disabled demo.

Changes

Cohort / File(s) Summary
Demo Components
examples/sites/demos/pc/app/checkbox/checkbox-disabled.vue, examples/sites/demos/pc/app/checkbox/checkbox-disabled-composition-api.vue
New Vue demos (Options API and Composition API) rendering a TinyCheckbox with v-model bound to a checked state initialized to true, and with the disabled attribute set.
End-to-end Test
examples/sites/demos/pc/app/checkbox/checkbox-disabled.spec.ts
New Playwright test that navigates to the disabled demo, asserts is-disabled class and disabled styling on inner elements, attempts a click (via safe evaluation), verifies the checkbox remains checked, and asserts no page errors.
Documentation Configuration
examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js
Added a demo entry with demoId: 'disabled', localized names/descriptions, and codeFiles: ['checkbox-disabled.vue'] to the demos array.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Tester as Test Runner
  participant Browser as Browser Page
  participant Demo as Checkbox Demo (TinyCheckbox)

  Tester->>Browser: goto('/checkbox/disabled')
  Browser->>Demo: render(TinyCheckbox disabled, checked=true)
  Note right of Demo: initial state — disabled + checked

  Tester->>Browser: query DOM and inspect classes/styles
  Browser->>Demo: return is-disabled, color/border classes

  Tester->>Browser: attempt click on checkbox element
  Browser->>Demo: click delivered (ignored due to disabled)
  Demo-->>Browser: state unchanged (remains checked, is-disabled)

  Tester->>Browser: listen for page errors
  Browser-->>Tester: no page errors emitted
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify Playwright selectors and color/class tokens match rendered DOM and CSS variables.
  • Confirm checkbox-disabled-composition-api.vue uses script setup and imports TinyCheckbox correctly.
  • Ensure webdoc entry filename and demoId align with demo build expectations.

Poem

🐰
In code-sprung fields a checkbox lies,
Disabled, checked beneath bright skies.
Two demos whisper what not to click,
A test taps softly — nothing flicks.
The rabbit nods: "Docs and tests — tick!" ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding disabled state demos and an e2e test for the checkbox component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7aec6a and 092134e.

📒 Files selected for processing (1)
  • examples/sites/demos/pc/app/checkbox/checkbox-disabled.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js (1)

19-31: Documentation entry looks good.

The disabled checkbox demo is properly configured with appropriate descriptions in both languages.

Minor observation: The codeFiles array only references checkbox-disabled.vue but not checkbox-disabled-composition-api.vue. If the composition API variant should also be shown in the documentation, consider adding it:

-      codeFiles: ['checkbox-disabled.vue']
+      codeFiles: ['checkbox-disabled.vue', 'checkbox-disabled-composition-api.vue']

However, if the documentation system only shows one variant per demo, the current configuration is fine.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2eafe0c and 0a1cb99.

📒 Files selected for processing (4)
  • examples/sites/demos/pc/app/checkbox/checkbox-disabled-composition-api.vue (1 hunks)
  • examples/sites/demos/pc/app/checkbox/checkbox-disabled.spec.ts (1 hunks)
  • examples/sites/demos/pc/app/checkbox/checkbox-disabled.vue (1 hunks)
  • examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-25T03:43:05.285Z
Learnt from: Davont
Repo: opentiny/tiny-vue PR: 2513
File: packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue:33-36
Timestamp: 2024-11-25T03:43:05.285Z
Learning: 在 Tiny Vue 代码库中,使用 `chart-core` 中的 `huiChartOption` 的组件,不应在其 `data` 中定义 `huiChartOption` 或 `option`,而是应该依赖 `chart-core` 提供的 `huiChartOption`。

Applied to files:

  • examples/sites/demos/pc/app/checkbox/checkbox-disabled.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (2)
examples/sites/demos/pc/app/checkbox/checkbox-disabled-composition-api.vue (1)

1-10: LGTM! Clean composition API demo.

The component correctly demonstrates a disabled checkbox using Vue 3's Composition API with proper reactive state management.

examples/sites/demos/pc/app/checkbox/checkbox-disabled.vue (1)

1-18: LGTM! Consistent Options API implementation.

The component correctly demonstrates a disabled checkbox using Vue's Options API and is consistent with the Composition API variant. Both demos properly initialize the checkbox in a checked and disabled state.

zzcr
zzcr previously approved these changes Nov 24, 2025
@zzcr
Copy link
Member

zzcr commented Nov 24, 2025

你好,e2e测试用例没过哈,麻烦看下怎么回事?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Hello, I didn’t pass the e2e test case. Could you please check what’s going on?

@IKEYCY
Copy link
Contributor Author

IKEYCY commented Nov 24, 2025 via email

@IKEYCY IKEYCY changed the title fix(vue-renderless/checkbox): [checkbox] fix disabled state style issue test(checkbox): add disabled state demos and e2e test Nov 27, 2025
@github-actions github-actions bot removed the bug Something isn't working label Nov 27, 2025
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.

3 participants