feat: 优化手机端UI布局和样式

- 手机端对话内容左右边距减小,AI消息更贴近屏幕边缘
- 修复工具intent文本溢出显示省略号,保持箭头和图标位置不变
- 重构手机端左上角菜单为纵向下拉样式,新增"新建对话"选项
- 统一菜单图标大小和线条粗细,支持亮色/暗色主题自动适配
- 修复个人空间弹窗顶部被状态栏遮挡问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
JOJO 2026-03-09 00:20:47 +08:00
parent 43409c523e
commit 77b96623ac
3 changed files with 136 additions and 14 deletions

View File

@ -376,31 +376,53 @@
</div> </div>
</div> </div>
<transition name="mobile-panel-menu"> <transition name="mobile-panel-menu">
<div v-if="mobileOverlayMenuOpen" class="mobile-panel-menu"> <div v-if="mobileOverlayMenuOpen" class="mobile-panel-menu mobile-panel-menu--dropdown">
<button <button
type="button" type="button"
class="mobile-menu-btn mobile-menu-btn--conversation" class="dropdown-item mobile-menu-item"
aria-label="对话记录" aria-label="对话记录"
@click="openMobileOverlay('conversation')" @click="openMobileOverlay('conversation')"
> >
<svg class="mobile-menu-svg" viewBox="0 0 28 28" fill="none" aria-hidden="true"> <svg class="mobile-menu-icon" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path <path
d="M5 6.5c0-1.38 1.12-2.5 2.5-2.5h13c1.38 0 2.5 1.12 2.5 2.5v8.5c0 1.38-1.12 2.5-2.5 2.5h-5.6l-3.4 3.2.6-3.2H7.5c-1.38 0-2.5-1.12-2.5-2.5V6.5z" d="M4 5.5c0-1.38 1.12-2.5 2.5-2.5h11c1.38 0 2.5 1.12 2.5 2.5v7.5c0 1.38-1.12 2.5-2.5 2.5h-4.8l-2.9 2.7.5-2.7H6.5c-1.38 0-2.5-1.12-2.5-2.5V5.5z"
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
stroke-width="1.9" stroke-width="1.7"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
/> />
<path d="M9 9.5h10" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" /> <path d="M8 8.5h8" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
<path d="M9 13h6" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" /> <path d="M8 11.5h5" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
</svg> </svg>
<div class="item-label">对话记录</div>
</button> </button>
<button type="button" class="mobile-menu-btn" aria-label="工作台" @click="openMobileOverlay('workspace')"> <button
<img :src="mobileMenuIcons.workspace" alt="" aria-hidden="true" /> type="button"
class="dropdown-item mobile-menu-item"
aria-label="工作文件"
@click="openMobileOverlay('workspace')"
>
<img class="mobile-menu-icon" :src="mobileMenuIcons.workspace" alt="" aria-hidden="true" />
<div class="item-label">工作文件</div>
</button> </button>
<button type="button" class="mobile-menu-btn" aria-label="个人空间" @click="handleMobilePersonalClick"> <button
<img :src="mobileMenuIcons.personal" alt="" aria-hidden="true" /> type="button"
class="dropdown-item mobile-menu-item"
aria-label="个人空间"
@click="handleMobilePersonalClick"
>
<img class="mobile-menu-icon" :src="mobileMenuIcons.personal" alt="" aria-hidden="true" />
<div class="item-label">个人空间</div>
</button>
<button
type="button"
class="dropdown-item mobile-menu-item"
aria-label="新建对话"
@click="createNewConversation"
>
<img class="mobile-menu-icon" :src="mobileMenuIcons.newChat" alt="" aria-hidden="true" />
<div class="item-label">新建对话</div>
</button> </button>
</div> </div>
</transition> </transition>
@ -514,7 +536,8 @@ import VideoPicker from './components/overlay/VideoPicker.vue';
const mobilePanelIcon = new URL('../icons/align-left.svg', import.meta.url).href; const mobilePanelIcon = new URL('../icons/align-left.svg', import.meta.url).href;
const mobileMenuIcons = { const mobileMenuIcons = {
workspace: new URL('../icons/folder.svg', import.meta.url).href, workspace: new URL('../icons/folder.svg', import.meta.url).href,
personal: new URL('../icons/user.svg', import.meta.url).href personal: new URL('../icons/user.svg', import.meta.url).href,
newChat: new URL('../icons/pencil.svg', import.meta.url).href
}; };
defineOptions(appOptions); defineOptions(appOptions);

View File

@ -140,11 +140,25 @@
.messages-area { .messages-area {
padding-top: 8px; padding-top: 8px;
padding-left: 12px !important;
padding-right: 12px !important;
} }
.message-block:first-child { .message-block:first-child {
margin-top: 0; margin-top: 0;
} }
.assistant-message .message-text {
padding: 16px 8px !important;
}
}
/* 额外的手机端样式,不依赖 mobile 类 */
@media (max-width: 768px) {
.messages-flow {
padding-left: 0;
padding-right: 0;
}
} }
.conversation-ribbon__selector { .conversation-ribbon__selector {
@ -747,7 +761,7 @@ body[data-theme='dark'] .more-icon {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
flex-shrink: 1; flex: 1;
min-width: 0; min-width: 0;
} }

View File

@ -370,6 +370,7 @@
max-height: none; max-height: none;
border-radius: 0; border-radius: 0;
padding: 16px; padding: 16px;
padding-top: 60px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
@ -1515,6 +1516,70 @@
align-self: flex-start; align-self: flex-start;
} }
/* 新的下拉菜单样式 */
.mobile-panel-menu--dropdown {
position: fixed;
top: 52px;
left: 12px;
display: flex;
flex-direction: column;
gap: 6px;
padding: 12px;
border-radius: 14px;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
backdrop-filter: blur(8px);
min-width: 200px;
z-index: 1600;
}
.mobile-menu-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: 12px;
background: transparent;
border: 1px solid transparent;
cursor: pointer;
transition: all 0.18s ease;
color: #0f172a;
text-align: left;
}
.mobile-menu-item:hover {
background: #f6f7fb;
}
.mobile-menu-item .item-label {
font-size: 14px;
font-weight: 500;
flex: 1;
}
/* 统一所有图标容器宽度为 30px确保文字左对齐 */
.mobile-menu-icon {
width: 24px !important;
height: 24px !important;
min-width: 30px;
max-width: 30px;
flex-shrink: 0;
display: block;
}
/* 对话记录图标特殊尺寸,但容器宽度保持 30px */
.mobile-menu-item:nth-child(1) svg.mobile-menu-icon {
width: 30px !important;
height: 30px !important;
margin-top: 2px;
}
/* 个人空间图标稍大一点 */
.mobile-menu-item:nth-child(3) img.mobile-menu-icon {
width: 26px !important;
height: 26px !important;
}
.mobile-topbar-title { .mobile-topbar-title {
flex: 1; flex: 1;
font-size: 14px; font-size: 14px;
@ -1661,6 +1726,7 @@
border-radius: 0; border-radius: 0;
box-shadow: none; box-shadow: none;
padding: 0; padding: 0;
padding-top: 44px;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -1695,7 +1761,7 @@
margin-top: 0; margin-top: 0;
flex: 1; flex: 1;
width: 100%; width: 100%;
height: 100%; height: calc(100% - 44px);
overflow: hidden; overflow: hidden;
} }
@ -2941,6 +3007,25 @@ body[data-theme='dark'] {
background: #000000 !important; background: #000000 !important;
} }
/* 新的下拉菜单样式 - 暗色主题 */
.mobile-panel-menu--dropdown {
background: #2a2a2a !important;
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5) !important;
}
.mobile-menu-item {
color: #ffffff !important;
}
.mobile-menu-item:hover {
background: #3a3a3a !important;
}
/* 图标颜色反转为白色 */
.mobile-menu-icon {
filter: brightness(0) invert(1) !important;
}
/* 手机端菜单按钮 - SVG 白色 */ /* 手机端菜单按钮 - SVG 白色 */
.mobile-menu-btn { .mobile-menu-btn {
color: #ffffff !important; color: #ffffff !important;