Skip to content

Commit 02ac575

Browse files
committed
feat: 移动端增加“我的“页面,更清晰的同步、活跃度面板
1 parent d0b4d76 commit 02ac575

19 files changed

Lines changed: 1037 additions & 139 deletions

messages/en.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,7 @@
20052005
"record": "Record",
20062006
"quickRecord": "Quick Record",
20072007
"write": "Write",
2008+
"me": "My",
20082009
"search": "Search",
20092010
"githubImageHosting": "Github Image Hosting",
20102011
"login": "Login",
@@ -2509,6 +2510,48 @@
25092510
}
25102511
},
25112512
"mobile": {
2513+
"me": {
2514+
"profile": {
2515+
"deviceName": "Sync Platform",
2516+
"deviceSubtitle": "Sync your records and settings",
2517+
"syncPlatform": "Sync Platform",
2518+
"gitSubtitle": "Connected to {provider} to sync your records and settings",
2519+
"storageSubtitle": "Currently using {provider} to sync your records and settings",
2520+
"unconfiguredSubtitle": "Sync is not configured yet. Your data is currently stored locally only",
2521+
"streak": "Active for {count} days in a row"
2522+
},
2523+
"activity": {
2524+
"tip": "Tap any day in the heatmap to open its activity timeline.",
2525+
"range": "Last {count} weeks",
2526+
"rangePlaceholder": "Last 16 weeks",
2527+
"drawerEmpty": "Choose a day to inspect its activity details.",
2528+
"drawerSummary": "{total} activities that day, including {record} records, {writing} writing events, and {chat} chats."
2529+
},
2530+
"sync": {
2531+
"title": "Sync",
2532+
"configured": "Connected",
2533+
"unconfigured": "Not configured",
2534+
"localOnly": "Local only"
2535+
},
2536+
"stats": {
2537+
"weekly": "This Week",
2538+
"weeklyHint": "Total activities this week",
2539+
"streak": "Current Streak",
2540+
"streakHint": "Consecutive active days"
2541+
},
2542+
"status": {
2543+
"title": "Current Setup",
2544+
"sync": "Backup Method",
2545+
"model": "Default Model",
2546+
"configured": "Connected",
2547+
"unconfigured": "Not configured",
2548+
"modelFallback": "No default model"
2549+
},
2550+
"settings": {
2551+
"title": "Settings",
2552+
"description": "Open each feature setting directly from here."
2553+
}
2554+
},
25122555
"chat": {
25132556
"drawer": {
25142557
"settings": {

messages/ja.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,7 @@
19071907
"record": "記録",
19081908
"quickRecord": "クイック記録",
19091909
"write": "執筆",
1910+
"me": "マイ",
19101911
"search": "検索",
19111912
"githubImageHosting": "Github 画像ホスティング",
19121913
"login": "ログイン",
@@ -2501,6 +2502,40 @@
25012502
}
25022503
},
25032504
"mobile": {
2505+
"me": {
2506+
"profile": {
2507+
"deviceName": "同期プラットフォーム",
2508+
"deviceSubtitle": "記録と設定を同期",
2509+
"syncPlatform": "同期プラットフォーム",
2510+
"gitSubtitle": "{provider} に接続して記録と設定を同期しています",
2511+
"storageSubtitle": "現在は {provider} を使って記録と設定を同期しています",
2512+
"unconfiguredSubtitle": "同期はまだ設定されていません。現在のデータはローカルのみに保存されています",
2513+
"streak": "{count}日連続でアクティブ"
2514+
},
2515+
"activity": {
2516+
"tip": "ヒートマップの日付をタップすると、その日のタイムラインを表示します。",
2517+
"range": "直近 {count} 週間",
2518+
"rangePlaceholder": "直近 16 週間",
2519+
"drawerEmpty": "日付を選択すると、その日の活動詳細を確認できます。",
2520+
"drawerSummary": "この日は合計 {total} 件の活動があり、記録 {record} 件、執筆 {writing} 件、対話 {chat} 件です。"
2521+
},
2522+
"sync": {
2523+
"title": "同期",
2524+
"configured": "接続済み",
2525+
"unconfigured": "未設定",
2526+
"localOnly": "ローカルのみ"
2527+
},
2528+
"stats": {
2529+
"weekly": "今週の活動",
2530+
"weeklyHint": "今週の累計活動回数",
2531+
"streak": "連続日数",
2532+
"streakHint": "連続して活動した日数"
2533+
},
2534+
"settings": {
2535+
"title": "設定",
2536+
"description": "ここから各機能の設定画面へ直接移動できます。"
2537+
}
2538+
},
25042539
"chat": {
25052540
"drawer": {
25062541
"settings": {

messages/pt-BR.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,7 @@
19591959
"record": "Registro",
19601960
"quickRecord": "Registro Rápido",
19611961
"write": "Escrever",
1962+
"me": "Meu",
19621963
"search": "Pesquisar",
19631964
"githubImageHosting": "Hospedagem de Imagens Github",
19641965
"login": "Entrar",
@@ -2449,6 +2450,40 @@
24492450
}
24502451
},
24512452
"mobile": {
2453+
"me": {
2454+
"profile": {
2455+
"deviceName": "Plataforma de Sincronização",
2456+
"deviceSubtitle": "Sincronize seus registros e configurações",
2457+
"syncPlatform": "Plataforma de Sincronização",
2458+
"gitSubtitle": "Conectado ao {provider} para sincronizar seus registros e configurações",
2459+
"storageSubtitle": "No momento usando {provider} para sincronizar seus registros e configurações",
2460+
"unconfiguredSubtitle": "A sincronização ainda não foi configurada. Seus dados estão salvos apenas localmente",
2461+
"streak": "Ativo por {count} dias seguidos"
2462+
},
2463+
"activity": {
2464+
"tip": "Toque em um dia do mapa de calor para abrir a linha do tempo daquele dia.",
2465+
"range": "Últimas {count} semanas",
2466+
"rangePlaceholder": "Últimas 16 semanas",
2467+
"drawerEmpty": "Escolha um dia para ver os detalhes da atividade.",
2468+
"drawerSummary": "Houve {total} atividades nesse dia, incluindo {record} registros, {writing} escritas e {chat} conversas."
2469+
},
2470+
"sync": {
2471+
"title": "Sincronização",
2472+
"configured": "Conectado",
2473+
"unconfigured": "Não configurado",
2474+
"localOnly": "Apenas local"
2475+
},
2476+
"stats": {
2477+
"weekly": "Esta Semana",
2478+
"weeklyHint": "Total de atividades nesta semana",
2479+
"streak": "Sequência Atual",
2480+
"streakHint": "Dias consecutivos com atividade"
2481+
},
2482+
"settings": {
2483+
"title": "Configurações",
2484+
"description": "Abra diretamente daqui as configurações de cada recurso."
2485+
}
2486+
},
24522487
"chat": {
24532488
"drawer": {
24542489
"settings": {

messages/zh-TW.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,7 @@
19171917
"record": "記錄",
19181918
"quickRecord": "快捷記錄",
19191919
"write": "寫作",
1920+
"me": "我的",
19201921
"search": "搜索",
19211922
"githubImageHosting": "Github 圖床",
19221923
"login": "登錄",
@@ -2368,6 +2369,40 @@
23682369
}
23692370
},
23702371
"mobile": {
2372+
"me": {
2373+
"profile": {
2374+
"deviceName": "同步平台",
2375+
"deviceSubtitle": "同步你的記錄與設定",
2376+
"syncPlatform": "同步平台",
2377+
"gitSubtitle": "已連接 {provider},可同步你的記錄與設定",
2378+
"storageSubtitle": "目前透過 {provider} 同步你的記錄與設定",
2379+
"unconfiguredSubtitle": "尚未設定同步,目前資料僅保存在本地",
2380+
"streak": "已連續活躍 {count} 天"
2381+
},
2382+
"activity": {
2383+
"tip": "點擊熱力圖中的日期,查看當天的活動時間軸。",
2384+
"range": "最近 {count} 週",
2385+
"rangePlaceholder": "最近 16 週",
2386+
"drawerEmpty": "選擇一個日期查看當天的活動詳情。",
2387+
"drawerSummary": "當天共 {total} 條活動,含 {record} 條記錄、{writing} 條寫作、{chat} 條對話。"
2388+
},
2389+
"sync": {
2390+
"title": "同步",
2391+
"configured": "已連線",
2392+
"unconfigured": "未設定",
2393+
"localOnly": "僅本地"
2394+
},
2395+
"stats": {
2396+
"weekly": "本週活躍",
2397+
"weeklyHint": "本週累計活動次數",
2398+
"streak": "連續活躍",
2399+
"streakHint": "連續活躍天數"
2400+
},
2401+
"settings": {
2402+
"title": "設定",
2403+
"description": "直接在這裡進入各項功能設定。"
2404+
}
2405+
},
23712406
"chat": {
23722407
"drawer": {
23732408
"settings": {

messages/zh.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,7 @@
19481948
"record": "记录",
19491949
"quickRecord": "快捷记录",
19501950
"write": "写作",
1951+
"me": "我的",
19511952
"search": "搜索",
19521953
"githubImageHosting": "Github 图床",
19531954
"login": "登录",
@@ -2411,6 +2412,48 @@
24112412
}
24122413
},
24132414
"mobile": {
2415+
"me": {
2416+
"profile": {
2417+
"deviceName": "同步平台",
2418+
"deviceSubtitle": "同步你的记录与设置",
2419+
"syncPlatform": "同步平台",
2420+
"gitSubtitle": "已连接 {provider},可以同步你的记录与设置",
2421+
"storageSubtitle": "当前通过 {provider} 同步你的记录与设置",
2422+
"unconfiguredSubtitle": "还没有配置同步,当前数据仅保存在本地",
2423+
"streak": "已连续活跃 {count} 天"
2424+
},
2425+
"activity": {
2426+
"tip": "点击热力图中的日期,查看当天的活动时间轴。",
2427+
"range": "最近 {count} 周",
2428+
"rangePlaceholder": "最近 16 周",
2429+
"drawerEmpty": "选择一个日期查看当天的活动详情。",
2430+
"drawerSummary": "当天共 {total} 条活动,含 {record} 条记录、{writing} 条写作、{chat} 条对话。"
2431+
},
2432+
"sync": {
2433+
"title": "同步",
2434+
"configured": "已连接",
2435+
"unconfigured": "未配置",
2436+
"localOnly": "本地存储"
2437+
},
2438+
"stats": {
2439+
"weekly": "本周活跃",
2440+
"weeklyHint": "本周累计活动次数",
2441+
"streak": "连续活跃",
2442+
"streakHint": "连续活跃天数"
2443+
},
2444+
"status": {
2445+
"title": "当前配置",
2446+
"sync": "备份方案",
2447+
"model": "默认模型",
2448+
"configured": "已连接",
2449+
"unconfigured": "未配置",
2450+
"modelFallback": "未设置默认模型"
2451+
},
2452+
"settings": {
2453+
"title": "设置",
2454+
"description": "直接在这里进入各项功能设置。"
2455+
}
2456+
},
24142457
"chat": {
24152458
"drawer": {
24162459
"settings": {

src/app/mobile/layout.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { ThemeProvider } from "@/components/theme-provider"
44
import useSettingStore from "@/stores/setting"
55
import { useEffect } from "react"
6+
import { usePathname } from "next/navigation"
67
import { applyThemeColors } from "@/lib/theme-utils"
78
import { initAllDatabases } from "@/db"
89
import dayjs from "dayjs"
@@ -30,6 +31,7 @@ export default function RootLayout({
3031
}: Readonly<{
3132
children: React.ReactNode;
3233
}>) {
34+
const pathname = usePathname()
3335
const { initSettingData, customThemeColors } = useSettingStore()
3436
const { initMainHosting } = useImageStore()
3537
const { currentLocale } = useI18n()
@@ -67,6 +69,8 @@ export default function RootLayout({
6769
applyThemeColors(customThemeColors)
6870
}, [customThemeColors])
6971

72+
const hideFootbar = pathname.startsWith('/mobile/setting/pages')
73+
7074
return (
7175
<ThemeProvider
7276
attribute="class"
@@ -81,7 +85,7 @@ export default function RootLayout({
8185
<main className="flex flex-1 w-full overflow-hidden">
8286
{children}
8387
</main>
84-
<AppFootbar />
88+
{!hideFootbar ? <AppFootbar /> : null}
8589
</div>
8690
{/* 隐藏的记录工具组件,用于监听事件 */}
8791
<div className="absolute opacity-0 pointer-events-none -z-50">

src/app/mobile/record/mobile-record-stream.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export function MobileRecordStream() {
327327
}
328328

329329
return (
330-
<div className="flex h-full flex-col">
330+
<div className="flex h-full min-h-0 flex-col">
331331
{!trashState && (
332332
<div className="sticky top-0 z-10 border-b bg-background px-3 pb-2 pt-2">
333333
<div className="flex items-center gap-2 overflow-x-auto">
@@ -413,7 +413,7 @@ export function MobileRecordStream() {
413413
</div>
414414
)}
415415

416-
<div className="flex-1 overflow-y-auto px-3 py-2">
416+
<div className="flex-1 min-h-0 overflow-y-auto px-3 py-2">
417417
{!trashState && queues.length > 0 && (
418418
<div className="mb-3 space-y-2">
419419
{queues.map((queue) => (

src/app/mobile/record/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MobileRecordStream } from './mobile-record-stream'
44

55
export default function Record() {
66
return (
7-
<div id="mobile-record" className="flex flex-col h-full w-full bg-background">
7+
<div id="mobile-record" className="flex h-full min-h-0 w-full flex-col bg-background">
88
<MobileMarkHeader />
99
<MobileRecordStream />
1010
</div>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use client'
2+
3+
import { ActivityDayDetail } from '@/components/activity/activity-day-detail'
4+
import {
5+
Drawer,
6+
DrawerContent,
7+
DrawerDescription,
8+
DrawerHeader,
9+
DrawerTitle,
10+
} from '@/components/ui/drawer'
11+
import type { ActivityDaySummary } from '@/lib/activity/types'
12+
13+
interface MobileMeActivityDrawerProps {
14+
day?: ActivityDaySummary
15+
open: boolean
16+
onOpenChange: (open: boolean) => void
17+
summaryText: string
18+
labels: {
19+
title: string
20+
description: string
21+
empty: string
22+
records: string
23+
writing: string
24+
chats: string
25+
}
26+
}
27+
28+
export function MobileMeActivityDrawer({
29+
day,
30+
open,
31+
onOpenChange,
32+
summaryText,
33+
labels,
34+
}: MobileMeActivityDrawerProps) {
35+
return (
36+
<Drawer open={open} onOpenChange={onOpenChange}>
37+
<DrawerContent className="max-h-[82vh] rounded-t-[24px]">
38+
<DrawerHeader className="pb-3 text-left">
39+
<DrawerTitle>{day?.day || labels.title}</DrawerTitle>
40+
<DrawerDescription>{day ? summaryText : labels.description}</DrawerDescription>
41+
</DrawerHeader>
42+
<div className="overflow-y-auto px-4 pb-6">
43+
<ActivityDayDetail
44+
day={day}
45+
compact
46+
labels={{
47+
empty: labels.empty,
48+
records: labels.records,
49+
writing: labels.writing,
50+
chats: labels.chats,
51+
}}
52+
/>
53+
</div>
54+
</DrawerContent>
55+
</Drawer>
56+
)
57+
}

0 commit comments

Comments
 (0)