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: Remove Local State from Bookmark Menu #5181

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

danny-avila
Copy link
Owner

Summary

I fixed the statefulness issue in the BookmarkMenu component by removing local state and eliminated redundant schema definitions.

  • Removed local tags state from BookmarkMenu.tsx, relying on conversation.tags instead.
  • Updated code to handle optional tags, adding checks for undefined values to prevent errors.
  • Added keyPrefix prop to DropdownPopup component to ensure unique keys in menu items.
  • Replaced tPresetUpdateSchema with tConvoUpdateSchema in HeaderOptions.tsx and Panel.tsx to remove redundancy.
  • Deleted redundant tPresetUpdateSchema definition from schemas.ts.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

I tested the BookmarkMenu component to ensure that bookmarks are displayed and updated correctly without using local state. I verified that adding, removing, and editing bookmarks work as expected. I also confirmed that removing the redundant schema does not affect application functionality by running existing unit tests and ensuring all tests pass.

Test Configuration

  • Operating System: macOS Monterey 12.6
  • Node.js Version: 14.17.0
  • Browser: Chrome 93.0

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 766657d into main Jan 4, 2025
2 checks passed
@danny-avila danny-avila deleted the fix/bookmark-menu-ui branch January 4, 2025 17:01
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.

1 participant