Repository navigation
fix: header auto mode issue - #7096
Conversation
|
π WalkthroughWalkthroughFixed header auto-hide behavior in the layout component by introducing a zone-based trigger system that prevents unintended header visibility when the mouse is near the top of the page, resolving an issue where the header would shift form elements unexpectedly. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 inconclusive)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
π§Ή Nitpick comments (1)
packages/@core/ui-kit/layout-ui/src/vben-layout.vue (1)
405-428: Effective fix for the header auto-hide interaction issue.The zone-based approach correctly addresses the reported problem:
- The 12px trigger zone at the very top prevents accidental header shows when hovering near forms.
- Once visible,
isInHeaderZoneallows interaction while the mouse stays within the header area.A few minor observations:
- The self-referential watch (watching
headerIsHidden.valuewhile also setting it) is intentional and stable here since the state converges quickly, but a brief comment explaining this pattern would help future maintainers.- Consider documenting why
12was chosen forHEADER_TRIGGER_DISTANCE(e.g., balances discoverability vs. accidental triggers).π‘ Optional: Add a brief comment explaining the constant
{ - const HEADER_TRIGGER_DISTANCE = 12; + // Small trigger zone at the very top to prevent accidental header shows + // when interacting with content near the top edge (e.g., search forms) + const HEADER_TRIGGER_DISTANCE = 12;
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: post-update (ubuntu-latest)
- GitHub Check: post-update (windows-latest)
- GitHub Check: Check (ubuntu-latest)
- GitHub Check: Test (windows-latest)
- GitHub Check: Check (windows-latest)
- GitHub Check: Lint (windows-latest)
Description
Fixed an issue where the content search component could not be used when the header is in auto mode.
Close #7091
Type of change
Please delete options that are not relevant.
pnpm-lock.yamlunless you introduce a new test example.Checklist
pnpm run docs:devcommand.pnpm test.feat:,fix:,perf:,docs:, orchore:.Summary by CodeRabbit
βοΈ Tip: You can customize this high-level summary in your review settings.