From dbc297ec00bcbc9277eb539dfb31ebc1d1f496a1 Mon Sep 17 00:00:00 2001 From: realth000 Date: Fri, 4 Oct 2024 08:48:32 +0800 Subject: [PATCH] feat(history): add local only history hint --- CHANGELOG.md | 1 + .../view/thread_visit_history_page.dart | 46 ++++++++++++++----- lib/i18n/strings.i18n.json | 3 +- lib/i18n/strings_zh-CN.i18n.json | 3 +- lib/i18n/strings_zh-TW.i18n.json | 3 +- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92770e32..30c4293d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - app:修复一些情况下,网络连接报错但UI没有更新的问题。 - app:修复部分图片无法加载的问题。 - app:修复突发图片加载失败时一直重复加载的问题。 +- app:修复在macOS上无法联网的问题。 - 翻译:修复部分错误翻译。 - 帖子:修复部分签名档存在样式溢出的用户的所在楼层无法回复和评分的问题。 - 帖子:修复帖子评分中头像无法加载时不显示且不断重试的问题。 diff --git a/lib/features/thread_visit_history/view/thread_visit_history_page.dart b/lib/features/thread_visit_history/view/thread_visit_history_page.dart index 4069fc53..b5f6fe11 100644 --- a/lib/features/thread_visit_history/view/thread_visit_history_page.dart +++ b/lib/features/thread_visit_history/view/thread_visit_history_page.dart @@ -30,7 +30,17 @@ class _ThreadVisitHistoryPageState extends State { final body = switch (state.status) { ThreadVisitHistoryStatus.initial || ThreadVisitHistoryStatus.loadingData => - const CircularProgressIndicator(), + Column( + children: [ + ListTile( + leading: const Icon(Icons.info_outline), + title: Text(tr.localOnlyTip), + ), + const Expanded( + child: Center(child: CircularProgressIndicator()), + ), + ], + ), ThreadVisitHistoryStatus.savingData || ThreadVisitHistoryStatus.success => _Body(state.history), @@ -46,7 +56,10 @@ class _ThreadVisitHistoryPageState extends State { appBar: AppBar( title: Text(tr.title), ), - body: body, + body: AnimatedSwitcher( + duration: duration200, + child: body, + ), ); }, ), @@ -81,6 +94,7 @@ class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { + final tr = context.t.threadVisitHistoryPage; return EasyRefresh.builder( controller: _refreshController, scrollController: _scrollController, @@ -89,15 +103,25 @@ class _BodyState extends State<_Body> { .read() .add(const ThreadVisitHistoryFetchAllRequested()), childBuilder: (context, physics) { - return ListView.separated( - controller: _scrollController, - physics: physics, - padding: edgeInsetsL12R12, - itemCount: widget.models.length, - itemBuilder: (context, index) { - return ThreadVisitHistoryCard(widget.models[index]); - }, - separatorBuilder: (_, __) => sizedBoxW4H4, + return Column( + children: [ + ListTile( + leading: const Icon(Icons.info_outline), + title: Text(tr.localOnlyTip), + ), + Expanded( + child: ListView.separated( + controller: _scrollController, + physics: physics, + padding: edgeInsetsL12R12, + itemCount: widget.models.length, + itemBuilder: (context, index) { + return ThreadVisitHistoryCard(widget.models[index]); + }, + separatorBuilder: (_, __) => sizedBoxW4H4, + ), + ), + ], ); }, ); diff --git a/lib/i18n/strings.i18n.json b/lib/i18n/strings.i18n.json index cc13d58a..cc1b7d26 100644 --- a/lib/i18n/strings.i18n.json +++ b/lib/i18n/strings.i18n.json @@ -636,6 +636,7 @@ }, "threadVisitHistoryPage": { "entryTooltip": "Thread browsing history", - "title": "Thread browsing history" + "title": "Thread browsing history", + "localOnlyTip": "Only local browsing history was recorded, may be different on web side or other machines" } } diff --git a/lib/i18n/strings_zh-CN.i18n.json b/lib/i18n/strings_zh-CN.i18n.json index 59ac23e6..1c551f25 100644 --- a/lib/i18n/strings_zh-CN.i18n.json +++ b/lib/i18n/strings_zh-CN.i18n.json @@ -636,6 +636,7 @@ }, "threadVisitHistoryPage": { "entryTooltip": "帖子浏览记录", - "title": "帖子浏览记录" + "title": "帖子浏览记录", + "localOnlyTip": "仅记录本机的浏览记录,在网页端或其他机器上可能会有所不同" } } diff --git a/lib/i18n/strings_zh-TW.i18n.json b/lib/i18n/strings_zh-TW.i18n.json index 6e48a8f1..f03130f0 100644 --- a/lib/i18n/strings_zh-TW.i18n.json +++ b/lib/i18n/strings_zh-TW.i18n.json @@ -636,6 +636,7 @@ }, "threadVisitHistoryPage": { "entryTooltip": "貼文瀏覽紀錄", - "title": "貼文瀏覽紀錄" + "title": "貼文瀏覽紀錄", + "localOnlyTip": "僅記錄本機的瀏覽記錄,在網頁端或其他機器上可能會有所不同" } }