Skip to content

feat(video-thumbnail)動画にサムネイルを設定、プレビューサイズを変更 - #5454

Open
aruaru624 wants to merge 3 commits into
masterfrom
feat/movie-thumnail
Open

aruaru624 wants to merge 3 commits into
masterfrom
feat/movie-thumnail

Conversation

@aruaru624

@aruaru624 aruaru624 commented Oct 27, 2026 •

Copy link
Copy Markdown

概要

動画ファイルに生成済サムネイル画像を設定する

なぜこの PR を入れたいのか

バックエンド側でアップロード動画のサムネイル生成を実装したため

動作確認の手順

・動画ファイルをアップロードする
・再生する

UI 変更部分のスクリーンショット

Before After
image image

PR を出す前の確認事項

  • (機能の追加なら)追加することの合意がチームで取れている
    • 取れていない場合はチェックを外して PR にすれば OK
  • 動作確認ができている
  • 自分で一度コードを眺めて自分的に問題はなさそう

見てほしいところ・聞きたいことなど

現状サムネの表示サイズは既存の画像(イラストなど)の表示設定と合わせています。
再生ボタンを押したタイミングで、フル画質の動画が再生できるようになっていますが、再生の挙動として拡大表示されるのみなのは少し違和感かも、、と思っています。

Summary by CodeRabbit

  • 改善
    • 動画ファイルにサムネイル画像を表示し、再生開始後に動画表示へ切り替わるようになりました。
    • 動画の表示幅を通常時は最大600px、サムネイル表示時は最大360pxに調整しました。
    • サムネイルがない場合は、従来どおり動画ファイルを表示に使用します。

@github-actions

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

useFileThumbnailが画像サムネイルのパスを返すよう変更しました。動画一覧とファイルモーダルは、そのパスを動画のposter属性に設定します。動画一覧では再生状態に応じたクラスと表示幅も変更します。

Changes: 動画サムネイル表示

Layer / File(s) Summary
サムネイルパスの取得
src/composables/files/useFileThumbnail.ts
画像サムネイルのパスをimageThumbnailPathとして分離しました。返却値にfileMeta、fileRawPath、fileThumbnail、imageThumbnailPathを追加し、fileThumbnailPathは画像サムネイルがない場合にfileRawPathへフォールバックします。
動画要素へのサムネイル適用
src/components/Main/MainView/MessageElement/Embeddings/MessageFileListVideo.vue, src/components/Modal/FileModal/FileModalVideo.vue
動画一覧とファイルモーダルが、useFileThumbnailから取得したパスを動画のposterに設定します。動画一覧では再生・ロード状態に応じてクラスを切り替え、表示幅とobject-fitを設定します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: uni-kakurenbo

Merge Risk: Minimal · up to 0f402

This change shows generated thumbnails as video posters and adjusts the preview width. It is a small, reversible UI change with no concrete merge-blocking risk found. Only the visual layout for unusual aspect ratios remains unchecked.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed タイトルは、動画にサムネイルを設定する変更と、プレビューサイズを変更する変更を示しています。raw_summary の内容(useFileThumbnail による動画サムネイル取得、poster 設定、動画の最大幅変更)と一致します。タイトルは変更内容の主な部分をカバーしています。
Description check Passed 説明文は概要、なぜこの PR を入れたいのか、動作確認の手順、UI 変更のスクリーンショット、確認事項、見てほしいところを含みます。テンプレートの「What」「Why」「Verification」に概ね対応しています。「References」セクションはありませんが、任意の項目です。「Why」の issue 番号(close: #0000 など)の記載がないため、補足があると望ましいです。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/Main/MainView/MessageElement/Embeddings/MessageFileListVideo.vue

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/components/Modal/FileModal/FileModalVideo.vue

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

src/composables/files/useFileThumbnail.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3739ff51-1009-4f9d-b198-677735d3b104
Commits

Reviewing files that changed from the base of the PR and between b109995 and 0f40202.

Files selected for processing: 3

  • src/components/Main/MainView/MessageElement/Embeddings/MessageFileListVideo.vue
  • src/components/Modal/FileModal/FileModalVideo.vue
  • src/composables/files/useFileThumbnail.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.68%. Comparing base (1896ee0) to head (0f40202).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5454   +/-   ##
=======================================
  Coverage   65.68%   65.68%           
=======================================
  Files         228      228           
  Lines        4671     4671           
  Branches      969      969           
=======================================
  Hits         3068     3068           
  Misses       1398     1398           
  Partials      205      205           

☔ View full report in Codecov by Harness.
📢 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.

@uni-kakurenbo uni-kakurenbo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

数件だけコメントしたので確認してもらえると助かります :pray-nya:

.thumbnail {
box-sizing: content-box;
max-width: min(360px, calc(100% - 4px));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should
.thumbnail を content-box に変更する一方で .unload には min-width: min(300px, 100%) が残っているので親要素の幅が 250px の状況ではこっちが max-width: calc(100% - 4px) より優先されて左右の border を足して外枠が 254px になってしまっていそうです。

border-box に統一するか、あるいは最小幅・最大幅の両方で border を考慮してほしいです...!

? buildFileThumbnailPath(fileMeta.value.id)
: undefined
)
const fileType = computed(() =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggest
個々の処理は既存の useFileThumbnail とほぼ重複していて、共通のファイル情報を扱う useFileMeta に、動画側の filePosterPath が置かれているのは若干よくなさそうです。

画像サムネイルの情報と URL を共通処理として取り出したうえで、動画側でそれを poster に使う構成にするとスッキリすると思います。

@aruaru624
aruaru624 requested a review from a team as a code owner November 19, 2026 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

Development

Successfully merging this pull request may close these issues.

2 participants