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

refactor: pagination/date-separated-list系処理を良い感じに? #8209

Merged
merged 119 commits into from Jan 13, 2023

Conversation

tamaina
Copy link
Member

@tamaina tamaina commented Jan 27, 2022

Fix #6001

#8850 のつづき

What

「うまく動くように」するようにしたらなんか大変なことになった

  • pagination/date-separated-list系処理でreversed: trueのとき、配列を反転するのではなくflexでcolumn-reverseで並べ替えるように
  • pagination/date-separated-list系処理でreversedのときスクロールをうまい具合に処理するように
    • 初回読み込みと「もっと見る」の時に「もっと見る」が連続して動作しないように
    • 「もっと見る」でアイテムが追加されたとき、スクロールが動かないように
    • もっと見るでアイテムが追加されたときにmoveトランジションが作動しないように(deny-move-transition系処理)
  • scripts/scroll.tsを書き換えてみた
    • 主にisBottom( => isBottomVisible)でデフォルトUIでコンテンツ高さ < ウィジェット高さの場合でもうまく動くように
    • 不要っぽい処理を消したりなどした
  • date-separated-listで、アイテムが削除したときアニメーションするように(アニメーション有効時)
  • pagination.vueで先頭かどうかの検出はIntersectionObserverを使用するように
  • pagination/date-separated-list系処理で使う「エンティティ共通」の型 (MisskeyEntity)を追加
  • pagination.vueのqueue
    • 順番をitemsと揃える
    • キューをitemsに移行するとき一つずつ処理せず配列ごと処理するように

Additional info (optional)

p1.a9z.devに適用中

@tamaina tamaina marked this pull request as ready for review January 27, 2022 21:24
@syuilo
Copy link
Member

syuilo commented Jan 28, 2022

p1.a9z.dev訪れるとやばいことになる
タイムラインが横向きにレンダリングされて無限にTLが遡られていく

@tamaina
Copy link
Member Author

tamaina commented Jan 28, 2022

flexのcolumn-reverseが効いていないのだろうけどなんでそうなるかがわからない(

@tamaina
Copy link
Member Author

tamaina commented Jan 28, 2022

デフォルト表示でウィジェットがコンテンツより長くてスクロールになる場合にisBottomの評価ができなくなる

以下解決策の案

  1. XListで表示されている最新の投稿にIntersectionObserverを仕込んでisBottom/onScrollBottomの代用にする
  2. ウィジェットをstickyではなく固定窓にしてスクロールを独立させちゃう

@tamaina
Copy link
Member Author

tamaina commented Jan 29, 2022

タイムラインが横向きにレンダリングされて無限にTLが遡られていく

image

Chrome OS 96で再現した

@tamaina
Copy link
Member Author

tamaina commented Jan 29, 2022

data-derection/data-reversedがなぜか付加されないらしい

@tamaina
Copy link
Member Author

tamaina commented Jan 29, 2022

なるほどアニメーションオフだと付加されないということだった

@tamaina
Copy link
Member Author

tamaina commented Jan 29, 2022

なおった

@tamaina tamaina closed this Jan 29, 2022
@tamaina tamaina reopened this Jan 29, 2022
@tamaina tamaina marked this pull request as draft January 29, 2022 15:19
@tamaina
Copy link
Member Author

tamaina commented Dec 9, 2022

message-roomがなんか変なことになってたのを修正

@tamaina
Copy link
Member Author

tamaina commented Dec 9, 2022

もっと見るでアイテムが追加されたときにmoveトランジションが作動しないように(deny-move-transition系処理)

修正できていない場合がある…

@tamaina
Copy link
Member Author

tamaina commented Dec 19, 2022

コンフリクト解消

@tamaina
Copy link
Member Author

tamaina commented Dec 19, 2022

(何か間違っている気がするけど元のコードがこうだったので元のコードに合わせた)

@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Merging #8209 (86f13a4) into develop (b52fd72) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #8209      +/-   ##
===========================================
- Coverage    22.32%   22.31%   -0.01%     
===========================================
  Files          724      724              
  Lines        67154    67170      +16     
  Branches      2171     2171              
===========================================
  Hits         14991    14991              
- Misses       52163    52179      +16     
Impacted Files Coverage Δ
packages/backend/src/server/api/endpoints/stats.ts 0.00% <0.00%> (ø)
...ckages/backend/src/server/NodeinfoServerService.ts 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tamaina
Copy link
Member Author

tamaina commented Dec 27, 2022

deny-move-transitionあたりの動作が間違ってそう

@Johann150 Johann150 removed their request for review December 27, 2022 21:25
@syuilo
Copy link
Member

syuilo commented Jan 10, 2023

今wip?

@tamaina
Copy link
Member Author

tamaina commented Jan 10, 2023

超wip

@tamaina
Copy link
Member Author

tamaina commented Jan 10, 2023

どうせならCSS Moduleにしようと

@tamaina tamaina marked this pull request as draft January 10, 2023 10:51
@tamaina tamaina marked this pull request as ready for review January 10, 2023 11:18
@tamaina
Copy link
Member Author

tamaina commented Jan 10, 2023

CSS Module化できた(はず)

@syuilo syuilo merged commit d2204fd into develop Jan 13, 2023
@syuilo syuilo deleted the fix-msg-room branch January 13, 2023 09:25
@syuilo
Copy link
Member

syuilo commented Jan 13, 2023

🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

チャットの入力欄がスクロールしてしまう
5 participants