Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table): group action of children of table row #3546

Conversation

awesome-pro
Copy link
Contributor

@awesome-pro awesome-pro commented Jul 24, 2024

Closes #3544

📝 Description

Fixed the group action of all the children of table row

⛳️ Current behavior (updates)

group-toggle-issue.mov

🚀 New behavior

Screen.Recording.2024-07-24.at.11.12.07.AM.mov

💣 Is this a breaking change (Yes/No): No

📝 Additional Information

Summary by CodeRabbit

  • Bug Fixes

    • Resolved navbar height issues for improved rendering and layout stability.
    • Enhanced the functionality of actions within table rows, ensuring expected behavior when interacting with child elements.
  • Style

    • Adjusted class definitions for table headers and rows to improve visual hierarchy and accessibility.

@awesome-pro awesome-pro requested a review from jrgarciadev as a code owner July 24, 2024 05:54
Copy link

changeset-bot bot commented Jul 24, 2024

🦋 Changeset detected

Latest commit: 551e880

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@nextui-org/theme Patch
@nextui-org/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 24, 2024

@abhinandan-verma is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Jul 24, 2024

Walkthrough

This commit enhances the @nextui-org/theme package by addressing two key issues: the height of the navbar when using the h-full class and the behavior of checkboxes in selectable tables, particularly focusing on disabled and readonly states. Additionally, it improves the functionality of table components by modifying the toggle behavior for child elements within table rows, ensuring a better user experience.

Changes

File Change Summary
.changeset/brown-days-applaud.md Introduced navbar height fix and improved toggle behavior for checkboxes in table rows.
packages/core/theme/src/components/table.ts Removed the "group" class from the th and tr elements' class lists in the table component, impacting styling.
.changeset/stale-tomatoes-compete.md Addressed group action behavior for child elements within table rows to enhance functionality.

Assessment against linked issues

Objective Addressed Explanation
Checkboxes in selectable table respect disabled state (#3544)
Navbar height issue when h-full class is applied

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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: 0

Outside diff range, codebase verification and nitpick comments (2)
.changeset/stale-tomatoes-compete.md (2)

1-3: Clarify the changeset description.

The current description is minimal. Consider adding more details about the changes and their impact.

---
"@nextui-org/theme": patch
---

+ This patch addresses the issue where disabled or read-only checkboxes in a selectable table incorrectly change their state when a user clicks on the corresponding table row. The update ensures that the group action for all children of a table row behaves correctly, maintaining the state of these checkboxes.

5-5: Improve the commit message.

The commit message should be more descriptive and follow conventional commit guidelines.

- fixed the auto toggle of toggle elements in table row([#3544](https://github.com/nextui-org/nextui/issues/3544))
+ fix(table): prevent state change of disabled/read-only checkboxes in table row ([#3544](https://github.com/nextui-org/nextui/issues/3544))
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b806ca4 and c1c94c4.

Files selected for processing (3)
  • .changeset/brown-days-applaud.md (1 hunks)
  • .changeset/stale-tomatoes-compete.md (1 hunks)
  • packages/core/theme/src/components/table.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • .changeset/brown-days-applaud.md
Additional comments not posted (1)
packages/core/theme/src/components/table.ts (1)

Line range hint 42-42:
Ensure the removal of the "group" class does not affect functionality.

The removal of the "group" class from the th element's class list might impact the styling and behavior of the table headers. Verify that this change does not introduce any unintended side effects.

Verification successful

The removal of the "group" class from the th element's class list does not affect functionality.

The search results indicate that the "group" class is not used in any th elements across the codebase, confirming that its removal does not introduce any unintended side effects.

  • No instances of "group" class usage in th elements were found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing the "group" class from the `th` element's class list.

# Test: Search for the usage of the "group" class in the codebase to identify any dependencies.
rg --type js --type ts --type tsx -A 5 $'className={th()}'

Length of output: 169


Script:

#!/bin/bash
# Description: Verify the impact of removing the "group" class from the `th` element's class list.

# Test: Search for the usage of the "group" class in the codebase to identify any dependencies.
rg --type js --type ts --type tsx 'className=.*group.*'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify the impact of removing the "group" class from the `th` element's class list.

# Test: Search for the usage of the "group" class in the codebase to identify any dependencies.
rg --type js --type ts 'className=.*group.*'

Length of output: 6772

@awesome-pro
Copy link
Contributor Author

@wingkwong sir review ?

@awesome-pro
Copy link
Contributor Author

@wingkwong I am sorry, perhaps it was due small mistake

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c1c94c4 and b1f8cf4.

Files selected for processing (1)
  • packages/core/theme/src/components/table.ts (1 hunks)
Additional context used
GitHub Check: ESLint
packages/core/theme/src/components/table.ts

[warning] 59-59:
Delete ·

Additional comments not posted (1)
packages/core/theme/src/components/table.ts (1)

59-59: Verify the impact of removing the "group" class.

Removing the "group" class from the tr element may affect the styling and behavior of table rows. Ensure that this change does not introduce any unintended side effects, especially related to group interactions and visual hierarchy.

Tools
GitHub Check: ESLint

[warning] 59-59:
Delete ·

packages/core/theme/src/components/table.ts Outdated Show resolved Hide resolved
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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b1f8cf4 and bdae538.

Files selected for processing (1)
  • packages/core/theme/src/components/table.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/core/theme/src/components/table.ts

Copy link

vercel bot commented Aug 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 4:28pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 4:28pm

@wingkwong wingkwong self-assigned this Aug 7, 2024
@wingkwong wingkwong self-requested a review August 7, 2024 16:23
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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bdae538 and 551e880.

Files selected for processing (1)
  • .changeset/stale-tomatoes-compete.md (1 hunks)
Files skipped from review due to trivial changes (1)
  • .changeset/stale-tomatoes-compete.md

Copy link
Member

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

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

By removing group, you will break all group-* styles. For example, isStriped styles will be removed because the parent is not defined.

@wingkwong
Copy link
Member

as discussed with Abhinandan, this pr will be closed and I'll take over it.

@wingkwong wingkwong closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Disabled checkboxes in selectable table do not behaves as expected
3 participants