-
Notifications
You must be signed in to change notification settings - Fork 421
RI-7767: custom tutorials form alignment #5300
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
RI-7767: custom tutorials form alignment #5300
Conversation
...nents/side-panels/panels/enablement-area/EnablementArea/components/Navigation/Navigation.tsx
Show resolved
Hide resolved
| preventPropagation | ||
| > | ||
| <RiTooltip content="Upload Tutorial"> | ||
| <div |
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.
This could become styled-component
...s/panels/enablement-area/EnablementArea/components/UploadTutorialForm/UploadTutorialForm.tsx
Outdated
Show resolved
Hide resolved
- Remove WelcomeMyTutorials component and show form directly when empty - Add border and padding to form using styled component with theme values - Fix button alignment (+, delete icons) with accordion chevron - Move onboarding tour to + icon - Restore Cancel button with proper spacing using Row component - Remove unnecessary create-btn and delete-btn styles - Update form styling (remove padding/background, add border with radius) References: #RI-7767
- Add branch name to PR plan - Update references from feature to bug fix - Mark ticket as Bug Fix in header References: #RI-7767
Remove implementation plan document as it's not needed in the repository. References: #RI-7767
Update branch naming rules to specify that bug fixes affecting only the redisinsight/ui/ folder should use fe/bugfix/ prefix instead of bugfix/ prefix. References: #RI-7767
- Create Group.styles.ts with GroupHeaderButton styled component - Replace className-based styles with styled component in Group and DeleteTutorialButton - Use theme-based colors instead of CSS variables - Apply import pattern rule (import * as S) for styled components
cf991f3 to
63f1d9b
Compare
Code Coverage - Frontend unit tests
Test suite run success5465 tests passing in 702 suites. Report generated by 🧪jest coverage report action from 526618b |
… component - Update UploadTutorialForm to use import * as S pattern - Revert Theme import to use uiSrc/components/base/theme/types
...nents/side-panels/panels/enablement-area/EnablementArea/components/Navigation/Navigation.tsx
Show resolved
Hide resolved
...omponents/side-panels/panels/enablement-area/EnablementArea/components/Group/Group.styles.ts
Outdated
Show resolved
Hide resolved
...nels/enablement-area/EnablementArea/components/DeleteTutorialButton/DeleteTutorialButton.tsx
Outdated
Show resolved
Hide resolved
- Create DeleteTutorialButton.styles.ts that re-exports GroupHeaderButton - Update DeleteTutorialButton to import from local styles file - Reserve import * as S pattern for local styles only
- Clarify that import * as S should only be used for local ComponentName.styles.ts files - Add guidance for re-exporting external styled components through local styles file
.../src/components/side-panels/panels/enablement-area/EnablementArea/components/Group/Group.tsx
Show resolved
Hide resolved
…title - Remove OnboardingTour from Group component + button - Add OnboardingTour wrapper around Add new tutorial title in UploadTutorialForm - Pass isPageOpened prop to UploadTutorialForm for proper onboarding visibility
- Replace hardcoded 24px width/height with theme.core.space.space300
- Open upload form automatically when custom tutorials onboarding step is active - Ensures form is visible when onboarding targets 'Add new tutorial' title - Only opens form when tutorials exist and form is currently closed
| ) { | ||
| setIsCreateOpen(true) | ||
| } | ||
| }, [isCustomTutorialsOnboarding, customTutorials?.length, isCreateOpen]) |
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.
Bug: Cancel button doesn't work during onboarding due to useEffect
The useEffect has isCreateOpen in its dependency array, which causes the Cancel button to be non-functional during onboarding. When a user clicks Cancel (setting isCreateOpen to false), the effect immediately re-runs because isCreateOpen changed. Since isCustomTutorialsOnboarding && customTutorials?.length > 0 && !isCreateOpen is now true again, it sets isCreateOpen back to true, immediately reopening the form. The isCreateOpen dependency creates an infinite loop that prevents closing the form during onboarding.
- Prevent event propagation when the delete button is clicked, because it causes the section element behind it to expand/collapse
|
|
||
| const handleClickDelete = () => { | ||
| const handleClickDelete = ( | ||
| e: React.MouseEvent<HTMLButtonElement, MouseEvent>, |
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.
Minor enhancement to prevent expland/collapse of the section behind when clicking the delete button.
Screen.Recording.2025-12-05.at.9.10.27.mov
| export const GroupHeaderButton = styled.div< | ||
| React.HTMLAttributes<HTMLDivElement> | ||
| >` | ||
| display: flex; |
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.
nit: We can use our layout components Row/Col/FlexGroup instead of a regular div and pass align/justify instead of declaring them here.
What
Fix custom tutorials UX issues and button alignment:
Testing
Onboarding tooltip
Before:
Screen.Recording.2025-12-04.at.16.25.06.mov
After:
Screen.Recording.2025-12-04.at.16.23.29.mov
Closes #RI-7767
Note
Streamlines the custom tutorials flow by showing the form when empty, aligning action buttons, migrating styles to styled-components, removing the welcome component, and updating docs/rules.
UploadTutorialFormdirectly when no tutorials; hide+action accordingly and gate it onhasChildren.S.GroupHeaderButton; use theme spacing/colors.Cancelbutton with proper spacing viaRow; prevent event propagation on delete popover trigger.WelcomeMyTutorialscomponent and related styles/tests.GroupHeaderButtonandUploadTutorialForm.Wrapperstyled components; apply theme-based border, radius, padding.import * as Spattern and re-export styles where needed.EnablementArea.spec.tsxto reflect direct form rendering and telemetry; removeWelcomeMyTutorialstests.import * as Sreserved for local styles).Written by Cursor Bugbot for commit 526618b. This will update automatically on new commits. Configure here.