複数 txt ファイルの読み込み・並び替え機能を追加#4
Merged
Merged
Conversation
複数ファイルの生テキストを配列で保持し、改行で連結して 1 本の台本として 扱う。連結・並び替え・削除は src/lib/loadedFiles.ts の純粋関数に集約。 サマリにファイル一覧(▲▼ で並び替え・✕ 削除・追加読み込み)を追加し、 印刷時は非表示にした。並び替え・削除は id がずれるためボイス不要を リセット、追加読み込みは id が不変なので維持する。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying script-printer with
|
| Latest commit: |
ea03712
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://785403d9.scriptprinter.pages.dev |
| Branch Preview URL: | https://feature-multi-file-load.scriptprinter.pages.dev |
各ファイル行を draggable にし、上半分・下半分の判定で挿入位置のラインを 表示してドロップで並び替える。純粋関数は隣接交換の moveFile から任意位置 移動の reorderFiles に差し替え。スマホ非対応のため ▲▼ ボタンは撤去し、 削除と追加のみ残した。 Co-Authored-By: Claude Opus 4.8 (1M context) <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.
概要
複数の txt ファイルを読み込み、その全体を 1 本の台本として仮想的に扱う機能を追加しました。各ファイルの生テキストを改行で連結し、既存の
parseScriptにそのまま渡すことで、キャラ抽出・件数集計・連番・txt 書き出し・印刷はすべて従来どおり機能します。機能
multiple)並び替え(HTML5 ドラッグ)
draggableにし、ブラウザ標準のドラッグで並び替える(追加依存なし)onDragOverでポインタが行の上半分か下半分かを判定し、挿入位置に 2px のラインを表示。掴んでいる行は薄く表示するreorderFiles(id, insertBefore)に集約設計のポイント
src/lib/loadedFiles.tsの純粋関数(combineContents/deriveTitle/reorderFiles/removeFile)に集約し、Vitest でカバーdialogues/characters/warningsはfilesからuseMemoで導出する派生状態に変更確認
pnpm typecheck/pnpm lint/pnpm test:run(61 passed)/pnpm buildすべて green🤖 Generated with Claude Code