Merged
Conversation
- Add video-extensions.ts config (isVideoExtension, getMimeTypeByVideoExtension, ftyp magic bytes) - Add mp4 validator to uploadable-extensions.ts (15MB limit, ftyp magic bytes at offset 4) - Add isVideo flag to FileContent interface in models.ts - Add video file GET handling in files API route (Base64 data URI) - Create VideoViewer component with loading indicator and HTML5 video controls - Update FileViewer to render VideoViewer for video files, hide copy button - Update FileViewerPage (page.tsx) to use shared FileContent type and video/image viewers - Update CSP to include media-src 'self' data: for video playback - Increase bodySizeLimit to 16mb for video upload support - Optimize upload route: move file.size check before arrayBuffer() for memory efficiency - Add 22 unit tests for video-extensions, 10 mp4 tests for uploadable-extensions - Add 2 integration tests for video file GET API Resolves #302 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mage pattern - Add validateVideoMagicBytes() and validateVideoContent() to video-extensions.ts - Apply magic bytes validation to GET route for video files (closes security gap) - Remove redundant <source> element from VideoViewer - Expand video-extensions unit tests from 22 to 33 cases - Update CLAUDE.md with new video-related modules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Design policy document for mp4 upload feature - Multi-stage issue review results (Stage 1-8) - Multi-stage design review results (Stage 1-2) - TDD implementation context and results - Acceptance test results (9/9 passed) - Refactoring results - Progress report - Work plan Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<video>タグ、ローディングインジケーター付き)page.tsxのローカルFileContent型をmodels.tsから import に統一(DRY原則)Closes #302
Changes
New Files
src/config/video-extensions.ts- 動画拡張子定義・バリデーション(image-extensions.tsパターン準拠)src/components/worktree/VideoViewer.tsx- 動画再生コンポーネント(ローディング・エラーUI付き)tests/unit/config/video-extensions.test.ts- ユニットテスト(33件)Modified Files
src/config/uploadable-extensions.ts- mp4バリデータ追加(15MB、ftyp magic bytes)src/types/models.ts-FileContentにisVideo?: boolean追加src/app/api/worktrees/[id]/files/[...path]/route.ts- 動画ファイル判定・Base64返却・magic bytes検証src/app/api/worktrees/[id]/upload/[...path]/route.ts- サイズ検証順序最適化(メモリ効率改善)src/app/worktrees/[id]/files/[...path]/page.tsx- 型統一、VideoViewer/ImageViewer統合src/components/worktree/FileViewer.tsx- 動画分岐追加、canCopyロジック修正next.config.js- bodySizeLimit 16mb、CSP media-src追加tests/unit/config/uploadable-extensions.test.ts- mp4テスト追加(10件)tests/integration/api-file-operations.test.ts- 動画GETテスト追加(2件)Test plan
npm run lint- エラー0件npx tsc --noEmit- 型エラー0件npm run test:unit- 既存テスト影響なし、新規45件パスnpm run build- ビルド成功🤖 Generated with Claude Code