Skip to content

fix: scroll position restoration in the drive page and "Files" tab on the user page#17497

Open
nekochanfood wants to merge 15 commits into
misskey-dev:developfrom
nekochanfood:fix/scroll-position-restoration
Open

fix: scroll position restoration in the drive page and "Files" tab on the user page#17497
nekochanfood wants to merge 15 commits into
misskey-dev:developfrom
nekochanfood:fix/scroll-position-restoration

Conversation

@nekochanfood
Copy link
Copy Markdown

@nekochanfood nekochanfood commented May 26, 2026

What

ドライブページ (/my/drive) とユーザーページの"Files"タブでアイテムをクリックして詳細画面へ推移してブラウザバックすると、クリックしたアイテムのIDと同じIDを持つ要素の中でのインデックス番号(ユーザーページの"Files"タブ限定)を基にしてスクロール位置を復元するようになります。

Why

#17496 の fix です

Additional info (optional)

  • 詳細画面へ推移してブラウザバックするとスクロール位置が保持されることを確認する
  • すでにスクロール位置の保持が使用できた箇所で問題が発生していないことを確認する (e.g., タイムライン等)
  • 同一ファイルIDを持つアイテムが"Files"タブの一覧に複数存在するとき、先頭以外のアイテムをクリックしてページ遷移し、ブラウザバックしたときに正しいアイテムへスクロール位置が復元されるか確認する

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

Comment thread CHANGELOG.md Outdated
kakkokari-gtyih

This comment was marked as outdated.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.26%. Comparing base (1cd6c9e) to head (5944aa1).

Files with missing lines Patch % Lines
...tend/src/composables/use-scroll-position-keeper.ts 0.00% 17 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #17497      +/-   ##
===========================================
- Coverage    15.27%   15.26%   -0.02%     
===========================================
  Files          247      247              
  Lines        12338    12347       +9     
  Branches      4178     4184       +6     
===========================================
  Hits          1885     1885              
- Misses        8188     8195       +7     
- Partials      2265     2267       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/frontend/src/components/MkNoteMediaGrid.vue
nekochanfood and others added 3 commits May 26, 2026 18:27
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
min-height による空白領域にビューポート中央が入るケースで anchorId が更新
されず、復元が古い位置に飛んでしまう問題を修正した。
アンカー選択条件を「中央を跨ぐ要素のみ」から「上端が中央以下の最も下の要素」
に変更することで、空白領域スクロール時も最後のアイテムを正しくキャプチャできる。
@nekochanfood
Copy link
Copy Markdown
Author

Files Tab Test:

2026-05-26.20-42-05.mp4

Drive Page Test:

2026-05-26.20-43-38.mp4

@nekochanfood nekochanfood marked this pull request as ready for review May 26, 2026 12:16
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 26, 2026
Comment thread packages/frontend/src/composables/use-scroll-position-keeper.ts Outdated
Comment thread compose.yml Outdated
@nekochanfood nekochanfood force-pushed the fix/scroll-position-restoration branch from d644a9f to 5944aa1 Compare May 27, 2026 02:22
@github-project-automation github-project-automation Bot moved this from Todo to Approved in [実験中] 管理用 May 27, 2026
@kakkokari-gtyih kakkokari-gtyih requested a review from syuilo May 28, 2026 02:21
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 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

ユーザーのファイル一覧/ドライブの一覧でページ移動して戻ったときにスクロール位置が保持されない

2 participants