Repository navigation
feat: 差分ビュー・ライブ変更レビュー・Git 履歴・リンクチェックを追加 - #33
Conversation
- テキスト差分エンジン (Myers, 単語単位ハイライト, unified patch) と差分ビュー (左右/統合表示, 変更箇所ナビ, 空白無視, 行ジャンプ, パッチのコピー/保存, Secret Safe 対応, ファイル変更時の自動再比較) - 開いた後に外部で変更されたファイルに「変更あり +N −M」チップを表示し、 開いた時点との差分を確認・確認済みにできるようにする (D キー) - Git 履歴 API (/api/git/status, /api/git/log, /api/git/show) を追加し、 HEAD・過去コミットとの比較、ファイルツリーの変更バッジと「Git: 変更のみ」絞り込みに対応 - Markdown のリンク切れ検出 API (/api/links/check) とレポート画面、 TOC パネルの文書別リンク切れ表示を追加 - ファイルツリーの右クリックメニューに比較・履歴・リンクチェックの導線を追加 - 単体テスト (差分エンジン, Git/リンクチェック API) と E2E テストを追加 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4uUUgYQkS1qRWZ3odMQPM
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bbedd440b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (isSecretSafeModeEnabled()) { | ||
| oldText = maskSecrets(oldText); | ||
| newText = maskSecrets(newText); |
There was a problem hiding this comment.
Apply format-aware secret masking before comparing files
With Secret Safe enabled, comparing CSV files containing an apiKey column or YAML files containing block-valued passwords exposes secrets in both the diff and exported patches. The generic maskSecrets() leaves CSV values untouched and only masks the | marker in password: |, leaving the actual block content visible. The main viewer already protects these cases using maskCsvSecrets() and maskYamlSecrets() in src/main.ts; apply equivalent format-aware masking to each diff source before computing the result.
Useful? React with 👍 / 👎.
| const out: DiffOp[] = []; | ||
| let dels: DiffOp[] = []; | ||
| let ins: DiffOp[] = []; | ||
| const flush = () => { out.push(...dels, ...ins); dels = []; ins = []; }; |
There was a problem hiding this comment.
Avoid spreading large change blocks into push arguments
When a comparison contains a sufficiently large insertion or deletion, spreading the entire block into push() exceeds the JavaScript argument limit. For example, diffLines('', 'x\n'.repeat(150000)) throws RangeError: Maximum call stack size exceeded, despite the input being only 300 KB and therefore below the diff view's 4 MB limit. This also affects live-change tracking because updateLiveChangeChip() invokes the same function while loading files. Append operations iteratively so the approximate-diff fallback can handle large changes without throwing.
Useful? React with 👍 / 👎.
| /** Extract { raw, dest, kind, index } for every inline, image, reference and wiki link. */ | ||
| function extractMarkdownLinks(text) { | ||
| const links = []; | ||
| const inline = /(!?)\[(?:[^\]\\]|\\.)*\]\(\s*(<[^>\n]*>|[^\s)]+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*\)/g; |
There was a problem hiding this comment.
Preserve balanced parentheses in Markdown link destinations
For a valid Markdown link such as [guide](guide/a(b).md), this expression stops at the first closing parenthesis and extracts guide/a(b instead of guide/a(b).md. Consequently, the checker reports a broken link even when the file exists and the viewer opens it correctly; conversely, an existing truncated path can hide a genuinely missing target. Parse balanced or escaped parentheses according to the viewer's Markdown rules rather than treating the first ) as the destination terminator.
Useful? React with 👍 / 👎.
概要
「何が変わったか」を確認する機能と、Markdown のリンク切れ検出を追加します。
n/p)、空白無視、省略行の展開、行番号から該当行へ移動、パッチのコピー/.patch保存、ファイル変更時の自動再比較、Secret Safe 対応Dキー)。「確認済みにする」で基準を更新/api/git/log・/api/git/showを追加し、HEAD や直近 30 コミットとの比較に対応。/api/git/statusでファイルツリーに M/A/U バッジと「Git: 変更のみ」絞り込みを追加/api/links/checkで通常リンク・画像・参照定義・wiki リンクのリンク切れを、ビューアと同じ規則で検出。同名ファイルを修正候補として提示。TOC パネルに文書別の結果を表示し、フォルダ/ルートの右クリックからレポート(Markdown チェックリストとしてコピー可)を開けるDキー。ヘルプ・README・CHANGELOG・CLAUDE.md も更新セキュリティ
execFileで実行(status/log/showのみ)。リビジョンはHEAD・HEAD~N・コミットハッシュに限定し、タイムアウトと出力上限を設定、fsmonitor とフックは無効化safePathを通す(ルート外・シンボリックリンク経由の脱出は 403)。git showの応答はCSP: sandboxテスト
tests/text-diff.test.mjs(9 件): 乱数データでの再構成照合、GNUpatchでの適用確認を含むtests/history-links.test.mjs(8 件): Git API(サブフォルダをルートにした場合を含む)、不正リビジョン・パス、リンクチェックtests/diff-linkcheck.spec.ts(E2E 8 件)tscstrict・build・コントラストチェック成功既知の制約
file.md#section)の存在チェックと外部 URL のチェックは対象外Generated by Claude Code