Skip to content

Conversation

@James-9696
Copy link
Collaborator

@James-9696 James-9696 commented Dec 29, 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

  • Accessibility Improvements

    • Dialogs now expose proper ARIA roles, labels, and descriptions to improve screen reader support and overall accessibility.
  • Tests

    • Dialog tests updated to scope selectors to demo containers and refined timing checks for more reliable behavior.

✏️ 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 Dec 29, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 29, 2025

Walkthrough

Tests were scoped to demo containers; dialog component gains semantic ARIA attributes and renderless state now generates stable titleId and contentId identifiers.

Changes

Cohort / File(s) Summary
Test Selector Scoping
examples/sites/demos/pc/app/dialog-box/basic-usage.spec.ts
Replaced page-level selectors with demo-scoped queries for all dialog trigger interactions (Dialog, Confirm, Cancel, Close, overlay click, ESC).
Dialog Locator & Timing Update
examples/sites/demos/pc/app/dialog-box/form-in-dialog.spec.ts
Changed dialogBox locator to query within the demo container; removed an unconditional 200ms wait after interacting with tiny-select__tags-group.
Accessibility Attributes (Vue)
packages/vue/src/dialog-box/src/pc.vue
Added role="dialog", aria-modal="true", aria-labelledby and aria-describedby bound to state IDs; title slot set as role="heading" with id, body given id.
Renderless State IDs & Imports
packages/renderless/src/dialog-box/vue.ts, packages/renderless/types/dialog-box.type.ts
Added titleId: string and contentId: string to IDialogBoxState; introduced nanoid usage (import) to generate unique IDs in initial state; updated type definitions accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in light, a tiny cheer,
IDs for titles now appear,
Dialogs speak clear for ears to hear,
Tests snug in demos, drawing near,
A little rabbit clap — bravo, my dear!

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 change: adding ARIA attributes (aria-modal, aria-labelledby, aria-describedby, role) to the dialog-box component for accessibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

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

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78a8eb0 and 1e21983.

📒 Files selected for processing (3)
  • examples/sites/demos/pc/app/dialog-box/basic-usage.spec.ts
  • examples/sites/demos/pc/app/dialog-box/form-in-dialog.spec.ts
  • packages/vue/src/dialog-box/src/pc.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/dialog-box/form-in-dialog.spec.ts (1)

7-7: LGTM! Selector scoping improves test isolation.

Scoping the dialogBox locator to the demo container instead of the entire page is a good practice that prevents conflicts when multiple demos exist on the same page.

examples/sites/demos/pc/app/dialog-box/basic-usage.spec.ts (1)

8-24: LGTM! Consistent selector scoping across all interactions.

All button interactions are now properly scoped to the demo container, which improves test isolation and prevents conflicts when multiple demos exist on the same page. The test logic and assertions remain unchanged.

role="dialog"
:aria-modal="true"
aria-labelledby="tiny_dialog_unique_0"
aria-describedby="tiny_dialog_unique_1"
Copy link
Member

Choose a reason for hiding this comment

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

这里的id也会导致重复,看下是否可以使用动态id

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

🤖 Fix all issues with AI Agents
In @packages/renderless/src/dialog-box/vue.ts:
- Line 87: The new dragStyle: null property in dialog-box/vue.ts is unrelated to
the ARIA changes and should either be removed or justified: if it was
accidentally mixed in, delete the line and revert any corresponding type
additions; if it’s intentional, add a short inline comment explaining its
purpose, update the component’s props/type definitions (e.g., the dialog
component’s props/interface) to include dragStyle, and mention it in the PR
description so reviewers know it’s a deliberate change. Ensure consistency
between the implementation, types, and PR text.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e21983 and c66e890.

📒 Files selected for processing (3)
  • packages/renderless/src/dialog-box/vue.ts
  • packages/renderless/types/dialog-box.type.ts
  • packages/vue/src/dialog-box/src/pc.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue/src/dialog-box/src/pc.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 (3)
packages/renderless/types/dialog-box.type.ts (1)

64-65: LGTM! Type definitions for ARIA identifiers.

The addition of titleId and contentId to the state interface is appropriate for supporting ARIA attributes (aria-labelledby and aria-describedby) in the dialog component.

packages/renderless/src/dialog-box/vue.ts (2)

88-89: Good: Unique IDs generated for ARIA attributes.

The titleId and contentId generation with unique identifiers and descriptive prefixes is appropriate for ARIA attribute support. The 8-character nanoid length should provide sufficient uniqueness for dialog instances on a page.

However, please verify the nanoid usage pattern nanoid.api.nanoid(8) is correct (see comment on line 34).


34-34: The nanoid import and usage pattern is correct. The @opentiny/utils package exports nanoid as a namespace module containing an api object with the nanoid function, making nanoid.api.nanoid(8) the proper way to access it. No changes needed.

Likely an incorrect or invalid review comment.

animationName: computed(() => api.computedAnimationName()),
current,
dragStyle: null
dragStyle: null,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify the unrelated dragStyle property addition.

The addition of dragStyle: null appears unrelated to the PR objective of adding ARIA attributes. This property is not mentioned in the PR description, AI summary, or type definitions changes. Please confirm whether this is:

  • An intentional fix that should be documented
  • Part of another feature that got mixed in
  • A necessary property that was previously missing
🤖 Prompt for AI Agents
In @packages/renderless/src/dialog-box/vue.ts at line 87, The new dragStyle:
null property in dialog-box/vue.ts is unrelated to the ARIA changes and should
either be removed or justified: if it was accidentally mixed in, delete the line
and revert any corresponding type additions; if it’s intentional, add a short
inline comment explaining its purpose, update the component’s props/type
definitions (e.g., the dialog component’s props/interface) to include dragStyle,
and mention it in the PR description so reviewers know it’s a deliberate change.
Ensure consistency between the implementation, types, and PR text.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants