Skip to content

ヘッダーをタップすることによる Scroll to Top に対応しました#81

Merged
totegamma merged 1 commit into
mainfrom
scroll-to-top
May 12, 2026
Merged

ヘッダーをタップすることによる Scroll to Top に対応しました#81
totegamma merged 1 commit into
mainfrom
scroll-to-top

Conversation

@inugamine
Copy link
Copy Markdown
Contributor

@inugamine inugamine commented May 12, 2026

resolve #78

概要

ヘッダーのタイトル部分をタップすると、タイムラインが一番上にスムーズスクロールで戻る機能を追加しました。app版・web版の両方に対応しています。

変更内容

Header コンポーネント

  • onTitleTap プロパティを追加
  • タイトル部分(中央エリア)に onClick ハンドラを設定
  • onTitleTap が渡されている場合のみ cursor: pointer を適用

対応画面

画面 スクロール対象
Home RealtimeTimeline(useImperativeHandle 経由)
Timeline RealtimeTimeline(同上)
Notifications NotificationTimeline(同上)
Explorer overflow div(直接 scrollTo

変更ファイル(10ファイル)

  • app/src/ui/Header.tsx
  • web/src/ui/Header.tsx
  • app/src/views/Home.tsx
  • web/src/views/Home.tsx
  • app/src/views/Timeline.tsx
  • web/src/views/Timeline.tsx
  • app/src/views/Notifications.tsx
  • web/src/views/Notifications.tsx
  • app/src/views/Explorer.tsx
  • web/src/views/Explorer.tsx

設計メモ

  • RealtimeTimeline / NotificationTimeline は既に useImperativeHandlescrollToTop() を公開しているため、各ビューからは ref を渡して呼ぶだけで済んでいます
  • HomeViewMainView からのタブ再タップ→scrollToTop にも対応しており、ローカル ref を作成した上で useImperativeHandleprops.ref へ転送することで既存の動作を維持しています
  • Explorer はタイムラインコンポーネントではなく overflowY: auto の div なので、直接 scrollTo を呼んでいます

対象外

  • Contacts: AcknowledgeList が内部でスクロールコンテナを管理しており、外から ref を取れない構造のため
  • Profile: Header コンポーネントを使わず CCWallpaper が独自ヘッダーとなっているため

これらは必要に応じて別 Issue です。

Copy link
Copy Markdown
Member

@totegamma totegamma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!!!!!

@totegamma totegamma merged commit ad9f8e5 into main May 12, 2026
1 check passed
@totegamma totegamma deleted the scroll-to-top branch May 12, 2026 15:58
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番上に戻る

2 participants