Skip to content

feat: ファイル機能強化(移動・タイムスタンプ・コピー)#282

Merged
Kewton merged 2 commits intodevelopfrom
feature/162-worktree
Feb 15, 2026
Merged

feat: ファイル機能強化(移動・タイムスタンプ・コピー)#282
Kewton merged 2 commits intodevelopfrom
feature/162-worktree

Conversation

@Kewton
Copy link
Owner

@Kewton Kewton commented Feb 15, 2026

Summary

  • ファイル/ディレクトリの移動機能を追加(MoveDialogによるディレクトリツリー選択、5層セキュリティ)
  • ファイルツリーにファイル作成時刻(birthtime)の相対表示を追加
  • FileViewerにテキストファイル全文コピーボタンを追加

Changes

ファイル移動機能

  • moveFileOrDirectory()file-operations.ts に追加(SEC-005〜009の5層セキュリティ)
  • PATCH /api/worktrees/[id]/files/[...path]action: "move" を追加
  • MoveDialog.tsx ディレクトリツリーブラウザダイアログ
  • useFileOperations.ts ファイル操作状態管理フック
  • ContextMenu.tsx に「移動」メニュー項目追加

ファイル作成時刻表示

  • TreeItembirthtime フィールド追加
  • readDirectory()stat().birthtime を取得
  • date-utils.tsformatRelativeTime() でロケール対応の相対時刻表示
  • FileTreeView.tsx に時刻表示を追加

ファイル内容コピー

  • FileViewer.tsx にコピーボタン追加(Copy → Check アイコン切替フィードバック)
  • 既存の copyToClipboard() を活用
  • 画像ファイルは非表示

その他

  • i18n対応(en/ja)
  • ユニットテスト45件追加(全3,387テスト合格)
  • ドキュメント更新(CLAUDE.md, README.md)

Test plan

  • 全ユニットテスト合格(3,387/3,387)
  • 新規テスト45件合格
  • 受入テスト8シナリオ全合格
  • TypeScript型チェック(0 errors)
  • ESLint(0 errors, 0 warnings)
  • セキュリティチェック(SEC-005〜009)全パス

Closes #162

🤖 Generated with Claude Code

Kewton and others added 2 commits February 15, 2026 10:38
Apply refactoring to improve overall code maintainability
and robustness of Issue #162 file enhancement features.

Improvements:
- [DRY-003] Extract mapFsError() helper in file-operations.ts to
  eliminate 6 duplicated Node.js error-to-result mapping blocks
- [SRP] Extract findNodeByPath() from MoveDialog inline function
- Edge case: formatRelativeTime() now handles invalid date strings
  gracefully (returns empty string instead of throwing)
- [PERF] Add useMemo for canCopy in FileViewer to avoid
  recalculation on every render
- Enrich JSDoc across all target files (date-utils, file-operations,
  MoveDialog, useFileOperations, FileViewer, FileTreeView)
- Add 2 new edge-case tests for invalid date handling

Quality Metrics:
- Tests: 3387 passed (3385 -> 3387, +2 edge case tests)
- ESLint errors: 0
- TypeScript errors: 0

Refs #162

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add moveFileOrDirectory() with 5 security layers (SEC-005~009)
- Add MoveDialog directory tree browser and useFileOperations hook
- Add birthtime display in FileTreeView with locale-aware formatting
- Add copy button in FileViewer with icon toggle feedback
- Add i18n support (en/ja) for all new UI elements
- Add 45 unit tests for new functionality
- Update documentation (CLAUDE.md, README.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Kewton Kewton merged commit 61b746f into develop Feb 15, 2026
5 checks passed
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 participant