Skip to content

Conversation

@StDensity
Copy link
Contributor

@StDensity StDensity commented Jan 12, 2025

Update keyboard shortcut documentation to use 'id' instead of 'key' for better accessibility and updated radui package to v0.028

This pr fixes #761

Summary by CodeRabbit

  • Documentation

    • Updated documentation components for Accordion, AspectRatio, Avatar, and VisuallyHidden
    • Standardized column and data array structures by replacing key with id
    • Added unique identifiers to data entries for improved referencing
  • Dependency Update

    • Upgraded @radui/ui package from version 0.0.27 to 0.0.28

…or better accessibility and updated radui package to v0.028
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/app/docs/components/accordion/docs/codeUsage.js

Oops! Something went wrong! :(

ESLint: 8.56.0

ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct.

The config "next/core-web-vitals" was referenced from the config file in "/docs/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Walkthrough

The pull request introduces consistent changes across multiple documentation files for various components. The primary modification involves replacing the key property with an id property in both columns and data arrays across different component documentation pages. Additionally, the project's package.json has been updated to upgrade the @radui/ui package to version ^0.0.28. These changes appear to be part of a broader effort to standardize the documentation structure and align with a new table API.

Changes

File Change Summary
docs/app/docs/components/accordion/docs/codeUsage.js Updated keyboardShortcuts object with id properties for columns and data entries
docs/app/docs/components/aspect-ratio/page.js Replaced key with id in columns and added id to data entries
docs/app/docs/components/avatar/page.js Changed key to id in columns and added id to data entries
docs/app/docs/components/visually-hidden/page.js Modified columns to use id instead of key
docs/package.json Updated @radui/ui package version from ^0.0.27 to ^0.0.28

Assessment against linked issues

Objective Addressed Explanation
Update docs with new table API [#761]

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • kotAPI

Poem

🐰 Hop, hop, through the code we go,
Changing keys to ids with a glow,
Documentation neat and bright,
Radiant UI shining light,
A rabbit's dance of clean delight! 🌟

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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)
docs/app/docs/components/visually-hidden/page.js (1)

21-21: Consider enhancing the prop description for clarity.

The addition of the 'id' field is good, but the description "renders the children in desired element" could be more specific.

Consider updating the description to be more descriptive, for example:

-{prop: 'asChild', type: 'boolean', default: 'false', description: 'renders the children in desired element', id: 'asChild'},
+{prop: 'asChild', type: 'boolean', default: 'false', description: 'When true, allows rendering the hidden content within a custom element instead of the default span', id: 'asChild'},
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c08d06 and df75415.

⛔ Files ignored due to path filters (1)
  • docs/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • docs/app/docs/components/accordion/docs/codeUsage.js (2 hunks)
  • docs/app/docs/components/aspect-ratio/page.js (1 hunks)
  • docs/app/docs/components/avatar/page.js (1 hunks)
  • docs/app/docs/components/visually-hidden/page.js (1 hunks)
  • docs/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (6)
docs/app/docs/components/aspect-ratio/page.js (1)

13-16: LGTM! Changes align with accessibility improvements

The replacement of 'key' with 'id' in both columns and data arrays is consistent with the PR objectives and improves accessibility.

Also applies to: 20-20

docs/app/docs/components/avatar/page.js (1)

14-17: LGTM! Consistent implementation of accessibility improvements

The changes follow the same pattern of replacing 'key' with 'id', maintaining consistency across the documentation.

Also applies to: 21-22

docs/app/docs/components/accordion/docs/codeUsage.js (2)

29-33: LGTM! Keyboard shortcuts columns updated correctly

The column structure has been updated to use 'id' instead of 'key', improving accessibility.


94-95: Address TODO comments in keyboard shortcuts

The Home and End keyboard shortcuts are marked with [TODO]. These implementations should be completed for full keyboard navigation support.

Would you like me to help implement the Home and End keyboard shortcut functionality?

Also applies to: 101-102

docs/package.json (1)

13-13: Verify @radui/ui package version

The package has been updated to version ^0.0.28. Let's verify this is the latest stable version.

✅ Verification successful

@radui/ui package version is up to date

The package version ^0.0.28 specified in package.json matches the latest version available in the npm registry.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check latest version of @radui/ui package
# Note: Using npm view as it's more reliable for scoped packages

npm view @radui/ui versions --json | jq -r '.[-1]'

Length of output: 59

docs/app/docs/components/visually-hidden/page.js (1)

14-17: LGTM! Column structure follows the new accessibility standards.

The change from 'key' to 'id' in column definitions aligns with the PR objectives to enhance accessibility.

Comment on lines +14 to +21
{name: 'Prop', id: 'prop'},
{name: 'Type', id: 'type'},
{name: 'Default', id: 'default'},
{name: 'Description', id: 'description'},
];

const data = [
{prop: 'asChild', type: 'boolean', default: 'false', description: 'renders the children in desired element'},
{prop: 'asChild', type: 'boolean', default: 'false', description: 'renders the children in desired element', id: 'asChild'},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistencies found in component documentation structure

Found inconsistencies that should be addressed:

  • The avatar-group component uses key instead of id in column definitions, while other components use id
  • Data entries have inconsistent field presence:
    • Some components include id field (visually-hidden, avatar, aspect-ratio)
    • avatar-group lacks id field but includes additional values field

Consider standardizing these patterns across all component documentation files for better maintainability.

🔗 Analysis chain

Verify consistent implementation across other component docs.

Let's ensure this pattern is consistently applied across other component documentation files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for consistency in column definitions across component docs
echo "Checking column definitions in component documentation files..."
rg -U --multiline 'const\s+columns\s*=\s*\[\s*{[^}]*}\s*\]' docs/app/docs/components/*/page.js

# Check for proper id usage in data arrays
echo "Checking data array structures..."
rg -U --multiline 'const\s+data\s*=\s*\[\s*{[^}]*}\s*\]' docs/app/docs/components/*/page.js

Length of output: 3360


Script:

#!/bin/bash
# Check column definitions with fixed regex and context
echo "Checking column definitions..."
rg -U --multiline -B1 -A3 'const columns = \[' docs/app/docs/components/*/page.js

echo -e "\nChecking data array structures..."
rg -U --multiline -B1 -A3 'const data = \[' docs/app/docs/components/*/page.js

Length of output: 6235

@kotAPI kotAPI added the automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met label Jan 13, 2025
@kotAPI kotAPI merged commit d137421 into rad-ui:main Jan 13, 2025
5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge A tag that tells kodiak bot to automerge PRs for us when tests and approval conditions are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Update docs with the new table API

2 participants