Skip to content

fix: 修复右键菜单被主内容区域遮挡的问题#50

Open
Afeng01 wants to merge 2 commits intoErlichLiu:mainfrom
Afeng01:fix/context-menu-z-index
Open

fix: 修复右键菜单被主内容区域遮挡的问题#50
Afeng01 wants to merge 2 commits intoErlichLiu:mainfrom
Afeng01:fix/context-menu-z-index

Conversation

@Afeng01
Copy link
Contributor

@Afeng01 Afeng01 commented Feb 26, 2026

问题描述

在左侧对话列表中右键点击对话项时,如果鼠标位置靠近右侧边缘,弹出的右键菜单会被右侧的主内容区域遮挡,导致菜单不可见或部分不可见。

根本原因

应用布局中存在 z-index 层级冲突:

  • 右键菜单(ContextMenu):z-50(z-index: 50)
  • 主内容区域:z-[60](z-index: 60)

由于主内容区域的 z-index 更高,导致右键菜单被遮挡。

解决方案

将 ContextMenu 组件的 z-index 从 50 提升到 70,确保右键菜单始终显示在主内容区域之上。

修改文件apps/electron/src/renderer/components/ui/context-menu.tsx

修改内容

  • ContextMenuSubContentz-50z-[70]
  • ContextMenuContentz-50z-[70]

层级关系

修复后的层级关系:

  • 右键菜单:z-[70](z-index: 70)
  • 主内容区域:z-[60](z-index: 60)
  • 拖动区域:z-50(z-index: 50)

测试方法

  1. 运行应用
  2. 在左侧对话列表中,尽量靠右侧的位置右键点击对话项
  3. 确认右键菜单完整显示,不被右侧内容区域遮挡

其他

邮箱:fkufeng01@gmail.com
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Afeng01 and others added 2 commits February 26, 2026 11:47
将 ContextMenu 的 z-index 从 50 提升到 70,确保右键菜单始终显示在主内容区域(z-index: 60)之上。

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 添加 globalZoomLevel 字段到应用设置,与 messageAreaZoomLevel 独立存储
- 新增 IPC 通道(SET_ZOOM_FACTOR、GET_ZOOM_FACTOR)支持 Electron 原生缩放
- 全局界面模式使用 webContents.setZoomFactor() 避免滚动条问题
- 消息区域模式继续使用 CSS zoom 只缩放聊天区域
- 修复并排模式的缩放支持
- 更新设置界面根据当前模式显示对应的缩放级别
- 自定义缩放菜单项,统一通过 IPC 事件处理

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ErlichLiu
Copy link
Owner

@Afeng01 这个我们换个方案吧,都采用类似顶部的这种暴露出来编辑图标、删除图标、置顶图标的这个方式吧,采用一样的一致的 icon 选择。另外再给 Agent 模式也提交一个置顶对话的功能吧,要区分开不同的 workspace,这个作为个新的 PR,怎么样呀?

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.

2 participants