fix(personalization): 移除滑动跳模块并调整用量区留白

This commit is contained in:
JOJO 2026-04-11 17:02:17 +08:00
parent 55feb36091
commit 0ba2763696

View File

@ -51,11 +51,7 @@
</button>
</nav>
<div class="personalization-content-shell" data-tutorial="personal-content-shell">
<div
class="personalization-content"
@touchstart.passive="handleSwipeStart"
@touchend.passive="handleSwipeEnd"
>
<div class="personalization-content">
<transition name="personal-page-vertical" mode="out-in">
<section
v-if="activeTab === 'preferences'"
@ -1434,7 +1430,6 @@ const personalTabs = computed(() => {
});
const activeTab = ref<PersonalTab>('preferences');
const swipeState = ref<{ startY: number; active: boolean }>({ startY: 0, active: false });
type RunModeValue = 'fast' | 'thinking' | 'deep' | null;
type PermissionModeValue = 'readonly' | 'approval' | 'unrestricted';
@ -1739,46 +1734,6 @@ const startTutorial = () => {
}, 320);
};
const shiftTab = (direction: 1 | -1) => {
const tabs = personalTabs.value;
const currentIndex = tabs.findIndex((tab) => tab.id === activeTab.value);
if (currentIndex === -1) {
return;
}
const nextIndex = currentIndex + direction;
if (nextIndex < 0 || nextIndex >= tabs.length) {
return;
}
activeTab.value = tabs[nextIndex].id as PersonalTab;
};
const handleSwipeStart = (event: TouchEvent) => {
//
if (window.innerWidth <= 768) {
return;
}
if (!event.touches.length) {
return;
}
swipeState.value = { startY: event.touches[0].clientY, active: true };
};
const handleSwipeEnd = (event: TouchEvent) => {
//
if (window.innerWidth <= 768) {
return;
}
if (!swipeState.value.active || !event.changedTouches.length) {
return;
}
const deltaY = event.changedTouches[0].clientY - swipeState.value.startY;
swipeState.value.active = false;
if (Math.abs(deltaY) < 60) {
return;
}
shiftTab(deltaY < 0 ? 1 : -1);
};
const applyThinkingPreset = (value: number) => {
personalization.setThinkingInterval(value);
};
@ -2016,14 +1971,14 @@ const applyThemeOption = (theme: ThemeKey) => {
display: flex;
flex-direction: column;
align-items: stretch;
padding: 12px 0 24px;
padding: 12px 4px 24px;
height: 100%;
}
.usage-summary-card {
width: 100%;
max-width: 720px;
padding: 0;
padding: 0 8px;
min-height: 320px;
display: flex;
flex-direction: column;