Skip to content

Commit

Permalink
feat(history): add local only history hint
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Oct 4, 2024
1 parent fb8e91d commit dbc297e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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上无法联网的问题。
- 翻译:修复部分错误翻译。
- 帖子:修复部分签名档存在样式溢出的用户的所在楼层无法回复和评分的问题。
- 帖子:修复帖子评分中头像无法加载时不显示且不断重试的问题。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ class _ThreadVisitHistoryPageState extends State<ThreadVisitHistoryPage> {
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),
Expand All @@ -46,7 +56,10 @@ class _ThreadVisitHistoryPageState extends State<ThreadVisitHistoryPage> {
appBar: AppBar(
title: Text(tr.title),
),
body: body,
body: AnimatedSwitcher(
duration: duration200,
child: body,
),
);
},
),
Expand Down Expand Up @@ -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,
Expand All @@ -89,15 +103,25 @@ class _BodyState extends State<_Body> {
.read<ThreadVisitHistoryBloc>()
.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,
),
),
],
);
},
);
Expand Down
3 changes: 2 additions & 1 deletion lib/i18n/strings.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 2 additions & 1 deletion lib/i18n/strings_zh-CN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@
},
"threadVisitHistoryPage": {
"entryTooltip": "帖子浏览记录",
"title": "帖子浏览记录"
"title": "帖子浏览记录",
"localOnlyTip": "仅记录本机的浏览记录,在网页端或其他机器上可能会有所不同"
}
}
3 changes: 2 additions & 1 deletion lib/i18n/strings_zh-TW.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@
},
"threadVisitHistoryPage": {
"entryTooltip": "貼文瀏覽紀錄",
"title": "貼文瀏覽紀錄"
"title": "貼文瀏覽紀錄",
"localOnlyTip": "僅記錄本機的瀏覽記錄,在網頁端或其他機器上可能會有所不同"
}
}

0 comments on commit dbc297e

Please sign in to comment.