Compare commits

..

3 Commits

Author SHA1 Message Date
Dxeee
1e83a23c5c feat: "Selected Comments" status displayed (#1857)
* Add support for UpSelection in reply display and controller

* update

---------

Co-authored-by: dom <githubaccount56556@proton.me>
2026-03-08 00:26:58 +08:00
dom
2d69c05f33 tweak
Signed-off-by: dom <githubaccount56556@proton.me>
2026-03-08 00:24:18 +08:00
dom
7a2dbe68c7 build
Signed-off-by: dom <githubaccount56556@proton.me>
2026-03-08 00:24:10 +08:00
5 changed files with 11 additions and 10 deletions

View File

@@ -106,11 +106,6 @@ jobs:
- name: Flutter Build Dev Apk - name: Flutter Build Dev Apk
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
run: | run: |
echo "${{ secrets.SIGN_KEYSTORE_BASE64_DEV }}" | base64 --decode > android/app/dev.jks
echo storeFile='dev.jks' >> android/key.properties
echo storePassword='${{ secrets.KEYSTORE_PASSWORD_DEV }}' >> android/key.properties
echo keyAlias='${{ secrets.KEY_ALIAS_DEV }}' >> android/key.properties
echo keyPassword='${{ secrets.KEY_PASSWORD_DEV }}' >> android/key.properties
flutter build apk --release --split-per-abi --android-project-arg dev=1 --pub flutter build apk --release --split-per-abi --android-project-arg dev=1 --pub
- name: Rename - name: Rename

View File

@@ -1,6 +1,7 @@
enum ReplySortType { enum ReplySortType {
time('最新评论', '最新'), time('最新评论', '最新'),
hot('最热评论', '最热') hot('最热评论', '最热'),
select('精选评论', '精选')
; ;
final String title; final String title;

View File

@@ -80,13 +80,13 @@ abstract class CommonPageState<T extends StatefulWidget> extends State<T> {
0.0, 0.0,
StyleString.topBarHeight, StyleString.topBarHeight,
); );
final offset = newValue - value; final offset = value - newValue;
if (offset != 0) { if (offset != 0) {
_barOffset!.value = newValue; _barOffset!.value = newValue;
if (pixel < 0.0 && scrollDelta < 0.0 && value > 0.0) { if (pixel < 0.0 && scrollDelta < 0.0 && value > 0.0) {
return false; return false;
} }
Scrollable.of(notification.context!).position.correctBy(-offset); Scrollable.of(notification.context!).position.correctBy(offset);
} }
} else { } else {
_updateOffset(scrollDelta); _updateOffset(scrollDelta);

View File

@@ -71,6 +71,9 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
if (data.hasUpTop()) { if (data.hasUpTop()) {
data.replies.insert(0, data.upTop); data.replies.insert(0, data.upTop);
} }
if (subjectControl?.title == ReplySortType.select.title) {
sortType.value = .select;
}
} }
isEnd = data.cursor.isEnd; isEnd = data.cursor.isEnd;
return false; return false;
@@ -87,7 +90,6 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
// 排序搜索评论 // 排序搜索评论
void queryBySort() { void queryBySort() {
if (isLoading) return; if (isLoading) return;
feedBack();
switch (sortType.value) { switch (sortType.value) {
case ReplySortType.time: case ReplySortType.time:
sortType.value = ReplySortType.hot; sortType.value = ReplySortType.hot;
@@ -97,7 +99,10 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
sortType.value = ReplySortType.time; sortType.value = ReplySortType.time;
mode.value = Mode.MAIN_LIST_TIME; mode.value = Mode.MAIN_LIST_TIME;
break; break;
case ReplySortType.select:
return;
} }
feedBack();
onReload(); onReload();
} }

View File

@@ -1111,7 +1111,7 @@ Future<void> _showReplySortDialog(
builder: (context) => SelectDialog<ReplySortType>( builder: (context) => SelectDialog<ReplySortType>(
title: '评论展示', title: '评论展示',
value: Pref.replySortType, value: Pref.replySortType,
values: ReplySortType.values.map((e) => (e, e.title)).toList(), values: ReplySortType.values.take(2).map((e) => (e, e.title)).toList(),
), ),
); );
if (res != null) { if (res != null) {