Skip to content

fix(thread): hide and show the app bar after the list travelled some way - #250

Merged
Carinoasd merged 1 commit into
masterfrom
fix/thread-header-threshold
Oct 27, 2026
Merged

Carinoasd merged 1 commit into
masterfrom
fix/thread-header-threshold

Conversation

@Carinoasd

Copy link
Copy Markdown
Owner

問題

朋友回報(Telegram):帖子頁往下捲時頂欄收進去、往上捲時彈出來,手機觸控有點斷觸時就反覆抽搐——現在只要有一點上翻的跡象就彈出。

原因

AppBarCollapser 照每次拖曳開始時的方向(UserScrollNotification.direction)立刻收或展,靈敏度等於 0 px。

修正

  • 改看捲動距離:自上次轉向以來,列表往同一方向走滿 56 px(約一條頂欄高)才收(往下)或展(往上);轉向就重新計。
  • 其餘不變:捲到列表頂端立刻顯示;列表長度不超過頂欄高時不收;只算列表本身(depth 0、垂直),樓層裡的表格橫向捲不影響;設定「捲動時收起頂欄」關閉時一律顯示。

測試

  • 新增 test/regression/test_265_app_bar_scroll_threshold_test.dart(9 項):拖曳方向不再觸發、門檻前後、來回幾 px 不動、轉向重計、頂端必顯示、短列表保留、橫向不算、關閉設定。
  • test_239_ux_small_fixes_test.dart(含原本 L5 收展測試)61 項全過。

CHANGELOG 照慣例發版時再補。

🤖 Generated with Claude Code

The app bar of the thread page followed the direction every drag started
in, so a touch screen that loses and finds the finger again a few pixels
away (or a wobbling thumb) pulled the bar out and in at every turn.

Now the list has to travel 56 logical pixels in one direction since it
last turned before the bar hides (down the list) or shows (up); a turn
starts the travel over. The top of the list still shows the bar at once,
a list that scrolls no farther than the bar still keeps it, and only the
list itself (depth 0, vertical) counts, as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Carinoasd
Carinoasd merged commit 96f889e into master Oct 27, 2026
4 of 5 checks passed
@Carinoasd
Carinoasd deleted the fix/thread-header-threshold branch October 27, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant