Open
Conversation
…ll button; fix credit button notification to work under new implementation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Implements enhanced notification features by refactoring the FuxNotification component, introducing step navigation and dismiss-all functionality, and migrating existing coach marks to use the new component.
- Changed
getFuxNotificationDatato use a strong enum type and addedgetStepInfoto drive step indicators. - Introduced
onFirstSuccessfulAutoTrainingJobhelper for auto-training notifications and updated corresponding imports and components. - Updated UI components (
fux-notification.component.tsx,annotate-interactively-notification.component.tsx,dataset-tab-panel.component.tsx) to use the new notification logic and features.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web_ui/src/shared/components/fux-notification/utils.ts | Switched ID type for notifications and added getStepInfo helper for step counts. |
| web_ui/src/shared/components/fux-notification/notifications/utils.ts | Added onFirstSuccessfulAutoTrainingJob to emit a callback on first finished job. |
| web_ui/src/shared/components/fux-notification/notifications/utils.test.ts | Updated import paths after directory refactor. |
| web_ui/src/shared/components/fux-notification/notifications/annotate-interactively-notification.component.tsx | Refactored to wrap the old coach mark in the new FuxNotification component. |
| web_ui/src/shared/components/fux-notification/fux-notification.component.tsx | Enhanced popover UI: header, step navigation, learn-more links, and dismiss-all menu. |
| web_ui/src/shared/components/coach-mark/utils.ts | Removed duplicate notification helpers and cleaned up imports. |
| web_ui/src/shared/components/coach-mark/fux-notifications/successfully-auto-trained-notification.component.tsx | Switched to using the refactored auto-training helper import. |
| web_ui/src/pages/project-details/components/project-dataset/dataset-tab-panel.component.tsx | Replaced old CoachMark usage with the new AnnotateInteractivelyNotification. |
Comments suppressed due to low confidence (3)
web_ui/src/shared/components/fux-notification/fux-notification.component.tsx:115
- The
closefunction is not defined in this scope; this will cause a reference error. You should callstate.close()and invokeonCloseif provided, similar to the earlier implementation.
<CustomPopover
web_ui/src/shared/components/fux-notification/fux-notification.component.tsx:109
- [nitpick] Static IDs like
'next-button-id'and'dismiss-button-id'may collide across different notifications. Consider prefixing them withsettingsKey(e.g.,${settingsKey}-next-button-id) for uniqueness.
previousStepId && changeTutorial(settingsKey, previousStepId);
web_ui/src/shared/components/fux-notification/utils.ts:117
- The new
getStepInfofunction is not covered by tests. Consider adding unit tests to verify that the correctstepNumberandtotalCountare returned for each notification key.
export const getStepInfo = (fuxNotificationId: FUX_NOTIFICATION_KEYS) => {
| const prevFuxEnabled = usePrevious(isFuxNotificationEnabled); | ||
|
|
||
| useEffect(() => { | ||
| if (isFuxNotificationEnabled && prevFuxEnabled !== isFuxNotificationEnabled) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (isFuxNotificationEnabled && prevFuxEnabled !== isFuxNotificationEnabled) { | |
| if (prevFuxEnabled !== isFuxNotificationEnabled) { | |
| isFuxNotificationEnabled? state.open(): state.close() | |
| } |
| export const onFirstSuccessfulAutoTrainingJob = | ||
| (settings: UseSettings<UserGlobalSettings>, callback: (modelId: string) => void) => | ||
| ({ pages }: InfiniteData<JobsResponse>) => { | ||
| if (!pages[0]) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (!pages[0]) { | |
| if (isEmpty(pages[0])) { |
Contributor
|
@romanowska Will unit or component tests be added later, or will they be handled in a separate issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Improved FuxNotification to with more complex features like next/previous step, header, dismiss all.
Changed implementation of Annotate Interactively Notification to use FuxNotification instead of CoachMark.
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: