Skip to content

Conversation

@aditya-cherukuru
Copy link
Contributor

Summary

Fixes #16852

This PR unifies the behavior of the "+" button in the table header with the "Options > Fields > Hidden Fields" dropdown.

Problem

The "+" button in the record table header only showed fields without an existing ViewField (i.e., fields that would require creation of a new ViewField). However, the "Hidden Fields" dropdown showed all non-visible fields, including those with existing ViewFields where isVisible: false.

Example: A field like "felix" might have a ViewField with isVisible: false, while "deletedAt" has no ViewField at all. The "+" button only showed "deletedAt", but should show both.

Solution

Changed RecordTableHeaderPlusButtonContent.tsx to use currentRecordFieldsComponentState to access all record fields, then filter to identify visible fields (isVisible === true) and exclude them from the dropdown. This ensures the "+" button displays all hidden fields (including those with existing ViewFields where isVisible: false), matching the pattern used in ViewFieldsHiddenDropdownSection.tsx.

Changes

  • Added import for currentRecordFieldsComponentState and useRecoilComponentValue
  • Modified filtering logic to show all hidden fields, not just fields without ViewFields

Testing

  • Manual testing of "+" button and "Hidden Fields" dropdown to verify they show the same list of fields
  • Verified that hiding a visible field makes it appear in both dropdowns
  • Verified that showing a hidden field from the "+" button works correctly

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@github-actions
Copy link
Contributor

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against 4cbdb0f

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@github-actions
Copy link
Contributor

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:64264

This environment will automatically shut down when the PR is closed or after 5 hours.

@charlesBochet
Copy link
Member

Hi @aditya-cherukuru I cannot reproduce the bug anymore and I don't really get your fix, closing this PR :)

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.

Unify viewField creation/update design

2 participants