Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

タイムラインにアニメーションを追加 #279

Closed

Conversation

poppingmoon
Copy link
Contributor

@poppingmoon poppingmoon commented Aug 29, 2023

MisskeyTimelineをCustomScrollViewで書き直すことで新しいノートがなめらかに追加されるようにしました

  • CustomScrollView はcenterを指定することで前後のリストを逆向きに並べることができます
  • 上側にSliverAnimatedList, 下側にSliverListを, 中央からインデックスが大きくなるように使っています
  • ストリーミングで新しいノートが来たときはnewerNotesの最後に追加され, APIで古いノートを取ってきたときはolderNotesの最後に追加していきます(これまでと同じ)
    • newerNotesの要素数が変化したときにSliverAnimatedListがアニメーションするようにしています
  • 一番上にいるときは一定時間ごとにジャンプすることで先頭を表示し続けます
  • pull-to-refreshができるようにしました

これに伴ってTimelineRepository周りを書き換えました

Close #270
Close #210
Close #523

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2023

Codecov Report

Attention: 239 lines in your changes are missing coverage. Please review.

Comparison is base (07e6895) 37.56% compared to head (42c0863) 36.96%.

Files Patch % Lines
lib/view/timeline_page/timeline_page.dart 63.78% 67 Missing ⚠️
...tifier/timeline_page/timeline_page_controller.dart 9.09% 50 Missing ⚠️
lib/repository/timeline_repository.dart 71.60% 46 Missing ⚠️
lib/repository/note_repository.dart 0.00% 39 Missing ⚠️
...te_notifier/timeline_page/timeline_controller.dart 59.45% 15 Missing ⚠️
lib/view/timeline_page/misskey_timeline.dart 78.57% 9 Missing ⚠️
lib/extensions/note_extension.dart 0.00% 4 Missing ⚠️
lib/view/timeline_page/note_wrapper.dart 85.18% 4 Missing ⚠️
lib/model/timeline_state.dart 60.00% 2 Missing ⚠️
lib/view/login_page/api_key_login.dart 0.00% 1 Missing ⚠️
... and 2 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #279      +/-   ##
===========================================
- Coverage    37.56%   36.96%   -0.61%     
===========================================
  Files          251      247       -4     
  Lines        13282    12928     -354     
===========================================
- Hits          4990     4779     -211     
+ Misses        8292     8149     -143     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poppingmoon poppingmoon marked this pull request as draft September 2, 2023 20:51
@poppingmoon
Copy link
Contributor Author

poppingmoon commented Sep 2, 2023

  • olderNotesの画像が新しいノートが来るたびに描画されなおして点滅する
    • 同じタイミングで開いていた閲覧注意が閉じる
    • buildのたびにUniqueKeyが作られていたため
      • Providerで持つようにして修正した
  • subNoteがうまくいっていない
    • タイムラインの上にくっついているとsubscribedListの要素数が増え続ける
      • 単純リノートのunsubができていないため
        • 参照数をカウントすることで適切にunsubができるようにした

@poppingmoon poppingmoon marked this pull request as ready for review September 3, 2023 04:50
@poppingmoon poppingmoon force-pushed the animate-timeline branch 3 times, most recently from 80a19c2 to 261c3d8 Compare September 30, 2023 03:14
@poppingmoon poppingmoon force-pushed the animate-timeline branch 2 times, most recently from a829733 to 863c55c Compare October 30, 2023 20:05
@poppingmoon poppingmoon force-pushed the animate-timeline branch 4 times, most recently from 0861fe3 to 8404e0b Compare November 7, 2023 09:09
@poppingmoon poppingmoon force-pushed the animate-timeline branch 4 times, most recently from 0b9142e to a6b1408 Compare November 18, 2023 12:59
@poppingmoon poppingmoon force-pushed the animate-timeline branch 2 times, most recently from 6251546 to 6ca1864 Compare November 26, 2023 22:37
@poppingmoon poppingmoon force-pushed the animate-timeline branch 2 times, most recently from 63208a0 to 4a82780 Compare December 4, 2023 22:08
@poppingmoon poppingmoon force-pushed the animate-timeline branch 5 times, most recently from 1b05102 to 897d883 Compare December 22, 2023 14:45
@poppingmoon poppingmoon force-pushed the animate-timeline branch 4 times, most recently from 9ba8d66 to 0720377 Compare January 2, 2024 06:57
@poppingmoon poppingmoon force-pushed the animate-timeline branch 3 times, most recently from 2d1674d to 647c8cb Compare January 7, 2024 01:13
@shiosyakeyakini-info
Copy link
Owner

これも入れないことにします… 

@poppingmoon poppingmoon deleted the animate-timeline branch June 22, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants