From 81a70137a9c661b748d9e1811b06c24a6d08f5c7 Mon Sep 17 00:00:00 2001 From: mikemoi Date: Tue, 23 Jun 2026 00:51:32 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=91=E5=B8=83=20v0.3.0=20=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E7=AD=94=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++-- app/[locale]/globals.css | 21 ++++ app/[locale]/layout.tsx | 7 ++ components/Navbar.tsx | 2 +- .../questionnaire/test/QuestionnaireTest.tsx | 4 +- .../questionnaire/test/public/Navigation.tsx | 8 +- .../questionnaire/test/public/ProgressBar.tsx | 2 +- .../test/public/ProgressPanel.tsx | 117 +++++++++++------- .../questionnaire/test/public/Question.tsx | 14 ++- components/records/ProfilePicker.tsx | 6 +- package.json | 2 +- 11 files changed, 134 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 594b7fa..11b9238 100644 --- a/README.md +++ b/README.md @@ -6,24 +6,24 @@ ## 当前版本 -**v0.2.0**,发布于 2026-06-23。 +**v0.3.0**,发布于 2026-06-23。 -本次版本从单次浏览器测评升级为可长期使用的本地测评档案: +本次版本专门优化 iPhone、Android 手机和 iPad 的答题体验,桌面端功能保持不变: -- 新增多人档案,可分别保存自己、家人或朋友的测评 -- 使用 IndexedDB 保存全部历史,同一量表重复测评不会覆盖旧记录 -- 新增 PHQ-9、GAD-7、WHO-5、DASS-21、PSS-10、BDI-II、SDS 和 ISI 趋势追踪 -- 新增 Big Five、HEXACO、RIASEC 和 Schwartz 统一画像 -- 新增单次 MD、个人完整 MD、全量 JSON 导出与恢复 -- 新增基于 PBKDF2 和 AES-GCM 的密码加密备份 -- 新增重测周期提示和一键清除本地数据 -- 新增 Vitest 自动测试,覆盖计分临界值、反向计分和加密备份 -- 结果答案继续保留在浏览器本地,不写入 URL,也不发送给 AI 或第三方分析服务 +- 中文题目在手机端使用 17px 字号和更宽松行高 +- 选项整行可点击,触控高度不低于 48px +- 手机和平板使用固定底部翻页栏,并适配 iOS 底部安全区 +- 题号导航在窄屏下默认折叠,减少对正文的遮挡 +- 档案选择框使用 16px 字号,避免 iPhone Safari 自动放大 +- 页面使用动态视口高度并适配刘海屏左右安全区 +- 保留双指缩放和系统字体回退,改善中文阅读与无障碍体验 +- 已验证 320px、390px、768px 和 1280px 视口无横向溢出 ### 版本记录 | 版本 | 日期 | 主要变化 | | --- | --- | --- | +| v0.3.0 | 2026-06-23 | iOS、手机和平板答题阅读、触控、折叠导航和安全区优化 | | v0.2.0 | 2026-06-23 | 多人档案、完整历史、趋势、统一画像、MD/JSON 导出、加密备份及自动测试 | | v0.1.0 | 2026-06-22 | 中文量表列表、浏览器答题、本地计分、草稿保存和单次结果导出 | diff --git a/app/[locale]/globals.css b/app/[locale]/globals.css index dc98be7..d99634c 100644 --- a/app/[locale]/globals.css +++ b/app/[locale]/globals.css @@ -113,10 +113,31 @@ } @layer base { + html { + min-height: 100%; + -webkit-text-size-adjust: 100%; + text-size-adjust: 100%; + } * { @apply border-border outline-ring/50; } body { @apply bg-background text-foreground; + min-height: 100dvh; + font-family: var(--font-geist-sans), -apple-system, BlinkMacSystemFont, + "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; + } + button, + select, + input, + textarea { + touch-action: manipulation; + } +} + +@layer utilities { + .safe-x { + padding-left: max(1rem, env(safe-area-inset-left)); + padding-right: max(1rem, env(safe-area-inset-right)); } } diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 64b11a8..14b2740 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -3,6 +3,13 @@ import './globals.css'; import { Navbar } from '@/components/Navbar'; import { I18nProviderClient } from '@/locales/client'; import { Toaster } from '@/components/ui/sonner'; +import type { Viewport } from 'next'; + +export const viewport: Viewport = { + width: 'device-width', + initialScale: 1, + viewportFit: 'cover', +}; const geistSans = Geist({ variable: '--font-geist-sans', diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 6df582a..85d9db9 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -11,7 +11,7 @@ export function Navbar() { return (
-
+
diff --git a/components/questionnaire/test/QuestionnaireTest.tsx b/components/questionnaire/test/QuestionnaireTest.tsx index a307445..da7c106 100644 --- a/components/questionnaire/test/QuestionnaireTest.tsx +++ b/components/questionnaire/test/QuestionnaireTest.tsx @@ -228,8 +228,8 @@ export function Questionnaire({ }; return ( -
-

{questionnaire.title}

+
+

{questionnaire.title}

diff --git a/components/questionnaire/test/public/Navigation.tsx b/components/questionnaire/test/public/Navigation.tsx index ba51f9b..de75589 100644 --- a/components/questionnaire/test/public/Navigation.tsx +++ b/components/questionnaire/test/public/Navigation.tsx @@ -19,23 +19,25 @@ export function Navigation({ }: NavigationProps) { const t = useScopedI18n('component.questionnaire.test.public.navigation'); return ( -
+
- + {t('pageInfo', { currentPage, totalPages })} {isLastPage ? ( - + ) : ( + ); + })} +
+ ); + return ( <> +
+ + {showMobileQuestions && ( +
{questionGrid}
+ )} +
+