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

ノートを畳む条件をclientHeightにする #13287

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

FineArchs
Copy link
Contributor

@FineArchs FineArchs commented Feb 13, 2024

#13266 がまとまっていませんが試作が出来たのでdraftで置いておきます。

What

現在は特定のMFM断片の検知や文字数カウントなどによってノートを畳む条件を決めていますが、
それを「ノートのclientHeightが一定値を超える」という条件一つに変更します。

Why

各種偽陰・偽陽を解消できると思います。

Additional info (optional)

具体的な手順としては、

  • ノートの畳むべき領域を<div ref="collapsibleArea">で囲っておく
  • 初期状態ではノートは畳まれているが「もっと見る」ボタンは表示されないようにしておく
  • onMountedイベントでcollapsibleArea.value.clientHeightを計測し、一定値を上回るなら「もっと見る」を表示、下回るなら畳み状態を解除

という感じになります。
コンポーネントが一度レンダリングされるまで大きさが分からない以上どうしてもチラつき覚悟の処理になりますが、この手順で違和感を最小限に抑えられると思います。

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.77%. Comparing base (f8261a1) to head (2e48608).
Report is 553 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #13287      +/-   ##
===========================================
- Coverage    79.95%   77.77%   -2.18%     
===========================================
  Files          956      183     -773     
  Lines       108864    25353   -83511     
  Branches      8413      487    -7926     
===========================================
- Hits         87045    19719   -67326     
+ Misses       21819     5627   -16192     
- Partials         0        7       +7     

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

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
Development

Successfully merging this pull request may close these issues.

1 participant