Skip to content

Conversation

@dantovska
Copy link
Contributor

@dantovska dantovska commented Dec 3, 2025

What

Fix custom tutorials UX issues and button alignment:

  • Remove WelcomeMyTutorials component and show form directly when empty
  • Hide + button when no custom tutorials exist (form shows directly)
  • Add border and padding to form using styled component with theme values
  • Fix button alignment (+, delete icons) with accordion chevron
  • Move onboarding tour to "Add new tutorial" title
  • Auto-open form when onboarding tour is triggered (if form is hidden)
  • 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)
  • Darken form border to match accordion border (neutral600)
  • Extract group header button styles to styled component with theme-based colors
  • Apply import pattern rule (import * as S) for styled components
  • Use theme spacing (space300) for button dimensions instead of hardcoded values

Testing

  1. Open tutorials panel → My Tutorials section (empty)
  2. Verify form shows directly (no welcome screen, no + button)
  3. Upload a tutorial, verify + button appears and aligns with chevron
  4. Verify delete button aligns with chevron
  5. Click + button when tutorials exist, verify form opens with Cancel button
  6. Delete all tutorials, verify form appears again (no + button)
  7. Complete onboarding flow, verify it targets "Add new tutorial" title
  8. When onboarding is triggered with tutorials loaded, verify form auto-opens
  9. Test form submission and cancel functionality
  10. Verify button hover states work correctly
  11. Verify form border matches accordion border color
  12. Verify button dimensions use theme spacing values

Onboarding tooltip

Before After
image image

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.

  • Frontend – Enablement Area (Custom Tutorials):
    • Show UploadTutorialForm directly when no tutorials; hide + action accordingly and gate it on hasChildren.
    • Align header action buttons with accordion chevron using S.GroupHeaderButton; use theme spacing/colors.
    • Move onboarding tour to the "Add new tutorial" title; auto-open form during onboarding when hidden.
    • Restore Cancel button with proper spacing via Row; prevent event propagation on delete popover trigger.
    • Remove WelcomeMyTutorials component and related styles/tests.
  • Styling/Refactor:
    • Add GroupHeaderButton and UploadTutorialForm.Wrapper styled components; apply theme-based border, radius, padding.
    • Remove legacy SCSS button styles and SCSS wrapper padding/background.
    • Apply local import * as S pattern and re-export styles where needed.
  • Tests:
    • Update EnablementArea.spec.tsx to reflect direct form rendering and telemetry; remove WelcomeMyTutorials tests.
  • Docs/Rules:
    • Clarify allowed branch types and FE import pattern (import * as S reserved for local styles).

Written by Cursor Bugbot for commit 526618b. This will update automatically on new commits. Configure here.

preventPropagation
>
<RiTooltip content="Upload Tutorial">
<div
Copy link
Contributor

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

- 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
@dantovska dantovska force-pushed the fe/bugfix/RI-7767/custom-tutorials-buttons-alignment branch from cf991f3 to 63f1d9b Compare December 4, 2025 14:16
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.82% 21057/25425
🟡 Branches 67.96% 8849/13021
🟡 Functions 77.98% 5774/7404
🟢 Lines 83.22% 20623/24782

Test suite run success

5465 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
- 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
KrumTy
KrumTy previously approved these changes Dec 4, 2025
…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])
Copy link

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.

Fix in Cursor Fix in Web

- 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>,
Copy link
Member

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;
Copy link
Member

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.

@dantovska dantovska merged commit e9ea682 into main Dec 5, 2025
19 checks passed
@dantovska dantovska deleted the fe/bugfix/RI-7767/custom-tutorials-buttons-alignment branch December 5, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants