feat: add mobile responsiveness support

- Hamburger menu + drawer sidebar for mobile navigation
- Auto-collapse chat session list on mobile
- Responsive grids, modals, forms, and settings
- Touch-friendly nav items (44px targets)
- Skills page sidebar toggle on mobile
- Memory sections stack vertically on mobile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-15 09:12:54 +08:00
parent 29f19ddb30
commit 9556db2f90
24 changed files with 273 additions and 43 deletions
+6 -1
View File
@@ -89,11 +89,16 @@ async function handleLogin() {
.login-card {
width: 480px;
padding: 56px 56px;
max-width: calc(100vw - 32px);
padding: 56px;
border: 1px solid $border-color;
border-radius: $radius-lg;
background: $bg-card;
text-align: center;
@media (max-width: $breakpoint-mobile) {
padding: 32px 24px;
}
}
.login-logo {
+3 -3
View File
@@ -93,21 +93,21 @@ onMounted(async () => {
v-model:value="selectedLog"
:options="logOptions"
size="small"
style="width: 200px"
class="input-md"
@update:value="loadLogs"
/>
<NSelect
:value="levelFilter"
:options="levelOptions"
size="small"
style="width: 110px"
class="input-sm"
@update:value="(v: string) => { levelFilter = v; loadLogs() }"
/>
<NSelect
:value="lineCount"
:options="lineOptions"
size="small"
style="width: 80px"
class="input-sm"
@update:value="(v: number) => { lineCount = v; loadLogs() }"
/>
<input
+4
View File
@@ -215,6 +215,10 @@ const displayUser = computed(() => (data.value?.user || '').replace(/§/g, '\n\n
gap: 16px;
flex: 1;
min-height: 0;
@media (max-width: $breakpoint-mobile) {
flex-direction: column;
}
}
.memory-section {
+4 -4
View File
@@ -63,7 +63,7 @@ async function saveApiServer(values: Record<string, any>) {
<SettingRow :label="t('settings.apiServer.host')" :hint="t('settings.apiServer.hostHint')">
<NInput
:value="settingsStore.platforms?.api_server?.host || ''"
size="small" style="width: 200px"
size="small" class="input-md"
@update:value="v => saveApiServer({ host: v })"
/>
</SettingRow>
@@ -71,7 +71,7 @@ async function saveApiServer(values: Record<string, any>) {
<NInputNumber
:value="settingsStore.platforms?.api_server?.port"
:min="1024" :max="65535"
size="small" style="width: 120px"
size="small" class="input-sm"
@update:value="v => v != null && saveApiServer({ port: v })"
/>
</SettingRow>
@@ -79,14 +79,14 @@ async function saveApiServer(values: Record<string, any>) {
<NInput
:value="settingsStore.platforms?.api_server?.key || ''"
type="password" show-password-on="click"
size="small" style="width: 200px"
size="small" class="input-md"
@update:value="v => saveApiServer({ key: v })"
/>
</SettingRow>
<SettingRow :label="t('settings.apiServer.cors')" :hint="t('settings.apiServer.corsHint')">
<NInput
:value="settingsStore.platforms?.api_server?.cors_origins || ''"
size="small" style="width: 200px"
size="small" class="input-md"
@update:value="v => saveApiServer({ cors_origins: v })"
/>
</SettingRow>
+64 -4
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue'
import { NInput } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import SkillList from '@/components/skills/SkillList.vue'
@@ -12,8 +12,23 @@ const loading = ref(false)
const selectedCategory = ref('')
const selectedSkill = ref('')
const searchQuery = ref('')
const showSidebar = ref(true)
let mobileQuery: MediaQueryList | null = null
onMounted(loadSkills)
function handleMobileChange(e: MediaQueryListEvent | MediaQueryList) {
showSidebar.value = !e.matches
}
onMounted(() => {
mobileQuery = window.matchMedia('(max-width: 768px)')
handleMobileChange(mobileQuery)
mobileQuery.addEventListener('change', handleMobileChange)
loadSkills()
})
onUnmounted(() => {
mobileQuery?.removeEventListener('change', handleMobileChange)
})
async function loadSkills() {
loading.value = true
@@ -35,7 +50,12 @@ function handleSelect(category: string, skill: string) {
<template>
<div class="skills-view">
<header class="page-header">
<h2 class="header-title">{{ t('skills.title') }}</h2>
<div style="display: flex; align-items: center; gap: 8px;">
<h2 class="header-title">{{ t('skills.title') }}</h2>
<button v-if="!showSidebar" class="sidebar-toggle" @click="showSidebar = true">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
</button>
</div>
<NInput
v-model:value="searchQuery"
:placeholder="t('skills.searchPlaceholder')"
@@ -48,7 +68,7 @@ function handleSelect(category: string, skill: string) {
<div class="skills-content">
<div v-if="loading && categories.length === 0" class="skills-loading">Loading...</div>
<div v-else class="skills-layout">
<div class="skills-sidebar">
<div v-if="showSidebar" class="skills-sidebar">
<SkillList
:categories="categories"
:selected-skill="selectedCategory && selectedSkill ? `${selectedCategory}/${selectedSkill}` : null"
@@ -87,6 +107,10 @@ function handleSelect(category: string, skill: string) {
.search-input {
width: 220px;
@media (max-width: $breakpoint-mobile) {
width: 100%;
}
}
.skills-content {
@@ -123,6 +147,42 @@ function handleSelect(category: string, skill: string) {
overflow-y: auto;
padding: 16px 20px;
min-width: 0;
}
.sidebar-toggle {
display: none;
border: none;
background: none;
cursor: pointer;
color: $text-secondary;
padding: 4px;
border-radius: $radius-sm;
&:hover {
background: rgba($accent-primary, 0.06);
}
}
@media (max-width: $breakpoint-mobile) {
.sidebar-toggle {
display: flex;
}
.skills-sidebar {
position: absolute;
left: 0;
top: 0;
height: 100%;
z-index: 10;
background: $bg-card;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}
.skills-layout {
position: relative;
}
}
min-width: 0;
min-height: 0;
}