Skip to content

Conversation

@paynezhuang
Copy link
Contributor

@paynezhuang paynezhuang commented Dec 3, 2025

  1. 支持混合布局菜单联动点击(可选项). 支持 左侧混合-顶部优先, 顶部混合-侧边优先, 顶部混合-顶部优先
  2. 修复 左侧混合-顶部优先 布局,tab 选中后无法激活左侧菜单

#855

IINA 2025-12-03 22 58 44

Copilot AI review requested due to automatic review settings December 3, 2025 14:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an auto-select feature for hybrid layout modes that automatically navigates to the deepest child menu when a first-level menu is clicked. The feature supports three hybrid layout modes: vertical-hybrid-header-first, top-hybrid-sidebar-first, and top-hybrid-header-first. Additionally, it fixes an issue where tabs in the vertical-hybrid-header-first layout were not properly activating the left sidebar menu.

Key Changes:

  • Added new autoSelectFirstMenu boolean setting with localization support in English and Chinese
  • Implemented deepest menu selection logic that recursively finds and navigates to the first child at the deepest level
  • Updated layout components to use the new auto-selection behavior with appropriate fallbacks when disabled

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/typings/app.d.ts Added type definitions for the new autoSelectFirstMenu setting and its localization keys
src/theme/settings.ts Added default value (false) for the new autoSelectFirstMenu setting
src/locales/langs/zh-cn.ts Added Chinese translations for the auto-select menu feature
src/locales/langs/en-us.ts Added English translations for the auto-select menu feature
src/layouts/modules/theme-drawer/modules/layout/modules/sider-settings.vue Added UI toggle for the auto-select setting, visible only in hybrid layout modes
src/layouts/modules/global-menu/modules/vertical-hybrid-header-first.vue Implemented conditional logic to handle menu selection based on the auto-select setting
src/layouts/modules/global-menu/modules/top-hybrid-sidebar-first.vue Integrated auto-select functionality for sidebar-first hybrid layout
src/layouts/modules/global-menu/modules/top-hybrid-header-first.vue Integrated auto-select functionality for header-first hybrid layout
src/layouts/modules/global-menu/context/index.ts Core implementation of deepest menu detection and navigation logic, plus watch handler fix for child menu activation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

() => {
getActiveFirstLevelMenuKey();
// if there are child level menus, get the active second level menu key
if (hasChildLevelMenus) {
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasChildLevelMenus is a computed ref but is being used without .value. This should be hasChildLevelMenus.value to properly access the boolean value.

Suggested change
if (hasChildLevelMenus) {
if (hasChildLevelMenus.value) {

Copilot uses AI. Check for mistakes.
mixChildMenuWidth: 'Mix Child Menu Width',
autoSelectFirstMenu: 'Auto Select First Submenu',
autoSelectFirstMenuTip:
'When the first level menu is clicked, the first submenu is automatically selected and navigated to the deepest level'
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue: "the first level menu is clicked" should be "a first-level menu is clicked" for better clarity and consistency with naming conventions.

Suggested change
'When the first level menu is clicked, the first submenu is automatically selected and navigated to the deepest level'
'When a first-level menu is clicked, the first submenu is automatically selected and navigated to the deepest level'

Copilot uses AI. Check for mistakes.
@paynezhuang paynezhuang closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant