Resolve "Fix file tree browser popover interaction behavior to match adjusted design requirements"
What does this MR do and why?
This MR fixes the file tree browser popover interaction behavior to match the adjusted design requirements from issue #569265 (closed). The original implementation in !202647 (merged) did not fully align with the specified interaction patterns.
Key changes:
- Removes hover trigger: The popover no longer appears on hover, preserving the existing tooltip functionality
- Adds page load trigger: The popover now appears automatically on page load with a 500ms delay for first-time users
- Implements proper dismissal: The popover is dismissed when users click either the close button or the file tree toggle button
- Separates popover from tooltip: The tooltip and popover now work independently as intended
Technical Implementation
- Added
showPopoverdata property to control popover visibility separately fromshouldShowPopover - Implemented
mounted()lifecycle hook with 500ms delay to show popover on page load - Added
triggers=""prop to disable hover/focus triggers on the popover - Enhanced
onClickToggle()method to dismiss popover when toggle button is clicked - Added dedicated
onPopoverClose()method for close button handling - Updated tests to use fake timers and validate the new timing-based behavior
References
Closes #569265 (closed) Related to #560578 (closed) (original feature implementation) Follow-up to !202647 (merged)
Screenshots or screen recordings
| Popover appears on page load with delay, tooltip works independently |
How to set up and validate locally
Prerequisites
-
Enable the file tree browser feature flag:
- In your local GitLab instance, go to Admin Area → Feature Flags
- Enable the
repository_file_tree_browserfeature flag - Or via Rails console:
Feature.enable(:repository_file_tree_browser)
-
Clear browser localStorage:
- Open browser Developer Tools (F12)
- Go to Application/Storage tab → Local Storage
- Find your GitLab instance URL and delete the
ftb-popover-visiblekey - Or clear all localStorage:
localStorage.clear() - Alternatively, use an incognito/private browsing window
Testing Steps
- Navigate to any repository file or directory page (e.g.,
/gitlab-org/gitlab/-/tree/master) -
Verify popover behavior:
- Popover should appear automatically after ~500ms delay (not on hover)
- Popover should contain "File tree navigation" title and description
-
Verify tooltip independence:
- Hover over the file tree toggle button
- Tooltip should appear independently of the popover
-
Test dismissal methods:
- Click the close button (×) on the popover → popover should disappear
- OR click the file tree toggle button → popover should disappear and file tree should expand/collapse
-
Verify persistence:
- Refresh the page → popover should NOT appear again
- Check localStorage:
ftb-popover-visibleshould be set to"false"
Additional Validation
- Test in different browsers to ensure consistent behavior
- Verify the popover doesn't interfere with existing file tree functionality
- Confirm the 500ms delay timing feels natural and noticeable
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Joseph Fletcher