fiftyone icon indicating copy to clipboard operation
fiftyone copied to clipboard

fix adaptive menu hidden items

Open kaixi-wang opened this issue 4 months ago • 1 comments

What changes are proposed in this pull request?

Fix error from lastVisibleItem not existing: Pasted Graphic

Also handle duplicate ids in the indexing that can cause the buttons rendered to not match the number of items... not sure how this happens though and it prob should be handled earlier Pasted Graphic 1

How is this patch tested? If it is not, please explain why.

  • run locally image

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • [ ] No. You can skip the rest of this section.
  • [ ] Yes. Give a description of this change to be included in the release notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • [ ] App: FiftyOne application changes
  • [ ] Build: Build and test infrastructure changes
  • [ ] Core: Core fiftyone Python library changes
  • [ ] Documentation: FiftyOne documentation changes
  • [ ] Other

Summary by CodeRabbit

  • New Features

    • Enhanced the AdaptiveMenu component to handle duplicate item IDs, ensuring uniqueness and preventing errors.
    • Improved logic for item movement based on priority, refining user interactions.
    • Updated visibility calculations for menu items to enhance user experience.
  • Bug Fixes

    • Resolved potential issues with item visibility and movement logic.

kaixi-wang avatar Oct 23 '24 01:10 kaixi-wang