-
Notifications
You must be signed in to change notification settings - Fork 552
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 video tooltip #4916
Fix video tooltip #4916
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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 and nitpick comments (2)
app/packages/core/src/components/Modal/use-looker.ts (2)
106-108
: LGTM: State management hooks added correctlyThe new Recoil state setter
setModalLooker
and the context hooksetActiveLookerRef
are correctly implemented. They follow React and Recoil best practices for state management.Consider adding a blank line between these two declarations for improved readability:
const setModalLooker = useSetRecoilState(fos.modalLooker); + const { setActiveLookerRef } = useModalContext();
114-118
: LGTM with suggestion: Effect for updating activeLookerRefThis effect correctly updates the activeLookerRef when the looker is defined. The null check is a good practice.
Consider improving type safety by replacing the type assertion with a type guard:
useEffect(() => { if (looker && 'isLooker' in looker) { setActiveLookerRef(looker); } }, [looker, setActiveLookerRef]);This assumes there's an 'isLooker' property or method on the Lookers type. If not, consider adding one or using a different type guard that fits your specific Looker type.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- app/packages/core/src/components/Modal/ModalLooker.tsx (2 hunks)
- app/packages/core/src/components/Modal/use-looker.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/packages/core/src/components/Modal/ModalLooker.tsx (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.app/packages/core/src/components/Modal/use-looker.ts (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.
🔇 Additional comments (5)
app/packages/core/src/components/Modal/ModalLooker.tsx (2)
4-5
: Improved import statementsThe changes in the import statements reflect a simplification of the component's logic. Removing unused hooks and adding
useMemo
suggests an optimization in the code, which aligns with React best practices.
30-30
: Simplified ModalLookerNoTimeline componentThe ModalLookerNoTimeline component has been significantly simplified by removing useEffect hooks and state management logic. This change aligns with React best practices by making the component more focused and potentially moving state management to a more appropriate location.
However, it's important to ensure that the functionality previously handled by the removed code is now managed correctly elsewhere in the application.
To verify that the removed functionality is handled elsewhere, please run the following script:
app/packages/core/src/components/Modal/use-looker.ts (3)
4-4
: LGTM: Import statements updated correctlyThe new imports for
useSetRecoilState
from Recoil anduseModalContext
from the local hooks file are correctly added. These additions align with the new state management functionality introduced in the hook.Also applies to: 7-7
110-112
: LGTM: Effect for updating modalLooker stateThis effect correctly updates the modalLooker state using the setModalLooker function whenever the looker changes. The dependencies array is properly set, including both looker and setModalLooker.
106-118
: Overall changes enhance modal looker state managementThe additions to the
useLooker
hook improve the integration of the looker with the modal's state management and context. These changes align well with the PR objective of fixing the video tooltip.Key improvements:
- Synchronization of the looker state with Recoil state
- Integration with the modal context
These enhancements should lead to better state consistency and improved tooltip functionality for video lookers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
0803d9b
to
1198eb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now with more lint!
There was a problem hiding this 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 and nitpick comments (1)
app/packages/looker/src/state.ts (1)
344-344
: LGTM! Consider adding a comment for clarity.The addition of the
buffers
property to theVideoState
interface is a good enhancement for managing multiple buffer ranges in video playback. The use ofReadonly
ensures immutability, which is excellent for state management.Consider adding a brief comment to explain the purpose of the
buffers
property:/** * Represents the buffered ranges of the video. * Each buffer range is a tuple of [start, end] in seconds. */ buffers: Buffers;This comment would provide clarity for other developers working with this interface in the future.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- app/packages/looker/src/lookers/video.ts (6 hunks)
- app/packages/looker/src/state.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/packages/looker/src/lookers/video.ts
🧰 Additional context used
📓 Path-based instructions (1)
app/packages/looker/src/state.ts (1)
Pattern
**/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
() => foq.subscribe((_, { set }) => set(activeColorEntry, null)), | ||
[] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Those are label tags. None of these labels have tags |
What changes are proposed in this pull request?
Adds the tooltip back to the modal video looker. Also fixes changing the color scheme for video lookers. See recording for current issue
Screen.Recording.2024-10-11.at.9.59.48.AM.mov
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
ModalLookerNoTimeline
component, removing unused imports and unnecessary state management.ColorFooter
component.Documentation