style(mobile): 优化审批面板移动端样式

- 移除顶部灰色块,内容直接顶头显示
- 移除关闭按钮圆形外框,只保留×符号
- 统一配色与电脑端一致
This commit is contained in:
JOJO 2026-04-12 13:42:39 +08:00
parent 0eeec08320
commit 3a9b5388f9
2 changed files with 45 additions and 3 deletions

View File

@ -4,9 +4,9 @@
:class="{ collapsed }"
:style="{ width: collapsed ? '0px' : width + 'px' }"
>
<div class="sidebar-header">
<div class="sidebar-header" :class="{ 'mobile-header': isMobileViewport }">
<h3 class="icon-label">工具审批 ({{ approvals.length }})</h3>
<button type="button" class="approval-close-btn" aria-label="关闭审批面板" @click="$emit('close')">
<button type="button" class="approval-close-btn" aria-label="关闭审批面板" @click="handleCloseClick">
×
</button>
</div>
@ -109,6 +109,8 @@
</template>
<script setup lang="ts">
import { onMounted, computed } from 'vue';
defineOptions({ name: 'ToolApprovalPanel' });
const props = defineProps<{
@ -118,13 +120,41 @@ const props = defineProps<{
decidingApprovalIds?: string[];
}>();
defineEmits<{
const emit = defineEmits<{
(event: 'approve', approvalId: string): void;
(event: 'reject', approvalId: string): void;
(event: 'switch-unrestricted', approvalId: string): void;
(event: 'close'): void;
}>();
const handleCloseClick = () => {
console.log('[sidebarDEBUG] ToolApprovalPanel close button clicked');
emit('close');
};
// - 使
const isMobileViewport = computed(() => {
const isMobile = typeof window !== 'undefined' && window.innerWidth <= 768;
console.log('[sidebarDEBUG] isMobileViewport computed:', isMobile, 'windowWidth:', window?.innerWidth);
return isMobile;
});
onMounted(() => {
console.log('[sidebarDEBUG] ToolApprovalPanel mounted');
console.log('[sidebarDEBUG] window.innerWidth:', window.innerWidth);
console.log('[sidebarDEBUG] isMobileViewport:', isMobileViewport.value);
console.log('[sidebarDEBUG] body[data-theme]:', document.body.getAttribute('data-theme'));
//
const aside = document.querySelector('.tool-approval-panel');
const sidebarHeader = document.querySelector('.tool-approval-panel .sidebar-header');
if (sidebarHeader) {
const computedStyle = window.getComputedStyle(sidebarHeader);
console.log('[sidebarDEBUG] sidebar-header computed background:', computedStyle.backgroundColor);
console.log('[sidebarDEBUG] sidebar-header computed padding:', computedStyle.paddingTop, computedStyle.paddingBottom);
}
});
const isEditPreview = (item: any) => item?.tool_name === 'edit_file' && item?.preview?.edit_context;
const isCommandPreview = (item: any) =>
['run_command', 'terminal_input', 'run_python', 'runpython'].includes(item?.tool_name);

View File

@ -1766,6 +1766,7 @@
background: var(--claude-panel);
width: min(460px, 92vw);
max-width: 92vw;
padding-top: 0;
}
.mobile-panel-sheet--focus {
@ -3461,6 +3462,17 @@ body[data-theme='dark'] {
background: #1a1a1a;
}
/* 移动端审批面板 - 移除所有背景让内容顶头 */
.mobile-panel-sheet--approval .sidebar.right-sidebar {
background: transparent !important;
}
.mobile-panel-sheet--approval .sidebar-header,
.mobile-panel-sheet--approval .sidebar .sidebar-header {
background: transparent !important;
padding: 0 16px !important;
}
.sidebar-manage-btn {
background: #2a2a2a;
border-color: rgba(255, 255, 255, 0.1);