# PR Title Implement shared compact split and unified tool-call diff layout --- Fixes #268 # PR Description ## Summary This PR makes tool-call diffs more compact in both `Unified` and `Split` views by reducing wasted horizontal space in line-number gutters and content indentation. ## What changed - introduced a shared compact-diff framework for tool-call diffs - kept mobile-specific policy limited to: - forcing unified mode below the breakpoint - enabling wrap only in mobile unified mode - added mode-specific compact applicators in the diff viewer: - unified applicator - split applicator - reduced gutter width waste by measuring rendered line-number text and tightening column width around it - removed unnecessary right-side content padding - aligned `+` / `-` markers closer to the left edge across both views - simplified cleanup after gatekeeper review by removing extra plumbing and residue ## Screenshots ### Before <img width="581" height="341" alt="image" src="https://github.com/user-attachments/assets/ec47b256-749a-4afc-8879-aaf33f0b46b6" /> ### After <img width="470" height="586" alt="image" src="https://github.com/user-attachments/assets/7258a5a2-47c4-408d-84bc-1b497761c7ad" /> ## Architectural approach This change intentionally uses: - shared policy in `packages/ui/src/components/tool-call/diff-render.tsx` - shared helper/measurement logic in `packages/ui/src/components/diff-viewer.tsx` - mode-specific applicators where unified and split DOM differ - CSS for shared visual spacing and alignment cleanup The goal was to keep the implementation architecturally clean and avoid building separate duplicated compact-diff features for: - mobile vs desktop - unified vs split Instead, the feature shares one compact-diff concept and only diverges where the upstream diff DOM requires separate handling. ## Files changed - `packages/ui/src/components/tool-call/diff-render.tsx` - `packages/ui/src/components/diff-viewer.tsx` - `packages/ui/src/styles/messaging/tool-call.css` - `packages/ui/src/types/message.ts` ## Validation Manual validation was performed in the running UI. Verified manually: - compact unified gutters on mobile - compact unified gutters on desktop - compact split gutters on desktop - tighter operator alignment in both modes Also verified: - `npm run typecheck` passes ## Notes - This PR is intended to address the compact diff layout problem described in the related issue. - Diff-specific CSS still lives in `tool-call.css`; future extraction into a smaller dedicated stylesheet is possible but not required for this change. --------- Co-authored-by: Shantur Rathore <i@shantur.com>
138 lines
7.2 KiB
TypeScript
138 lines
7.2 KiB
TypeScript
export const toolCallMessages = {
|
|
"toolCall.pending.waitingToRun": "実行待ち...",
|
|
"toolCall.error.label": "エラー:",
|
|
|
|
"toolCall.header.copyTitle": "Copy tool call title",
|
|
"toolCall.header.copyAriaLabel": "Copy tool call title",
|
|
|
|
"toolCall.header.showInputTitle": "Show Tool Arguments",
|
|
"toolCall.header.showInputAriaLabel": "Show Tool Arguments",
|
|
"toolCall.header.hideInputTitle": "Hide Tool Arguments",
|
|
"toolCall.header.hideInputAriaLabel": "Hide Tool Arguments",
|
|
|
|
"toolCall.io.input": "Tool Input",
|
|
"toolCall.io.output": "Tool Output",
|
|
|
|
"toolCall.diff.label": "Diff",
|
|
"toolCall.diff.label.withPath": "Diff · {path}",
|
|
"toolCall.diff.viewMode.ariaLabel": "diff 表示モード",
|
|
"toolCall.diff.viewMode.split": "分割",
|
|
"toolCall.diff.viewMode.unified": "ユニファイド",
|
|
"toolCall.diff.switchToSplit": "分割表示に切り替え",
|
|
"toolCall.diff.switchToUnified": "ユニファイド表示に切り替え",
|
|
"toolCall.diff.enableWordWrap": "折り返しを有効化",
|
|
"toolCall.diff.disableWordWrap": "折り返しを無効化",
|
|
"toolCall.diff.copyPatch": "パッチをコピー",
|
|
|
|
"toolCall.diagnostics.title": "診断",
|
|
"toolCall.diagnostics.ariaLabel": "診断",
|
|
"toolCall.diagnostics.ariaLabel.withLabel": "診断 {label}",
|
|
"toolCall.diagnostics.severity.error.short": "エラー",
|
|
"toolCall.diagnostics.severity.warning.short": "警告",
|
|
"toolCall.diagnostics.severity.info.short": "情報",
|
|
|
|
"toolCall.renderer.toolName.shell": "シェル",
|
|
"toolCall.renderer.toolName.fetch": "フェッチ",
|
|
"toolCall.renderer.toolName.invalid": "無効",
|
|
"toolCall.renderer.toolName.plan": "計画",
|
|
"toolCall.renderer.toolName.applyPatch": "パッチを適用",
|
|
|
|
"toolCall.renderer.action.working": "処理中...",
|
|
"toolCall.renderer.action.writingCommand": "コマンド作成中...",
|
|
"toolCall.renderer.action.preparingEdit": "編集を準備中...",
|
|
"toolCall.renderer.action.readingFile": "ファイルを読み込み中...",
|
|
"toolCall.renderer.action.preparingWrite": "書き込みを準備中...",
|
|
"toolCall.renderer.action.preparingPatch": "パッチを準備中...",
|
|
"toolCall.renderer.action.planning": "計画中...",
|
|
"toolCall.renderer.action.fetchingFromWeb": "Web から取得中...",
|
|
"toolCall.renderer.action.findingFiles": "ファイルを検索中...",
|
|
"toolCall.renderer.action.searchingContent": "内容を検索中...",
|
|
"toolCall.renderer.action.listingDirectory": "ディレクトリ一覧を取得中...",
|
|
|
|
"toolCall.renderer.bash.title.timeout": "タイムアウト: {timeout}",
|
|
"toolCall.renderer.read.detail.offset": "オフセット: {offset}",
|
|
"toolCall.renderer.read.detail.limit": "上限: {limit}",
|
|
|
|
"toolCall.renderer.todo.empty": "まだ項目がありません。",
|
|
"toolCall.renderer.todo.status.pending": "保留",
|
|
"toolCall.renderer.todo.status.inProgress": "進行中",
|
|
"toolCall.renderer.todo.status.completed": "完了",
|
|
"toolCall.renderer.todo.status.cancelled": "キャンセル",
|
|
"toolCall.renderer.todo.title.plan": "計画",
|
|
"toolCall.renderer.todo.title.creating": "計画を作成中",
|
|
"toolCall.renderer.todo.title.completing": "計画を完了中",
|
|
"toolCall.renderer.todo.title.updating": "計画を更新中",
|
|
|
|
"toolCall.permission.status.required": "許可が必要です",
|
|
"toolCall.permission.status.queued": "許可待ち",
|
|
"toolCall.permission.requestedDiff.label": "要求された diff",
|
|
"toolCall.permission.requestedDiff.withPath": "要求された diff · {path}",
|
|
"toolCall.permission.queuedText": "先行する許可への回答を待機中です。",
|
|
"toolCall.permission.actions.allowOnce": "一度だけ許可",
|
|
"toolCall.permission.actions.alwaysAllow": "常に許可",
|
|
"toolCall.permission.actions.deny": "拒否",
|
|
"toolCall.permission.shortcuts.allowOnce": "一度だけ許可",
|
|
"toolCall.permission.shortcuts.alwaysAllow": "常に許可",
|
|
"toolCall.permission.shortcuts.deny": "拒否",
|
|
"toolCall.permission.errors.unableToUpdate": "許可を更新できません",
|
|
|
|
"permissionApproval.title": "リクエスト",
|
|
"permissionApproval.empty": "保留中のリクエストはありません。",
|
|
"permissionApproval.kind.permission": "許可",
|
|
"permissionApproval.kind.question": "質問",
|
|
"permissionApproval.questionCount.one": "{count} 件の質問",
|
|
"permissionApproval.questionCount.other": "{count} 件の質問",
|
|
"permissionApproval.status.active": "有効",
|
|
"permissionApproval.actions.closeAriaLabel": "閉じる",
|
|
"permissionApproval.actions.goToSession": "セッションへ移動",
|
|
"permissionApproval.actions.loadingSession": "読み込み中…",
|
|
"permissionApproval.actions.loadSession": "セッションを読み込む",
|
|
"permissionApproval.actions.allowOnce": "一度だけ許可",
|
|
"permissionApproval.actions.alwaysAllow": "常に許可",
|
|
"permissionApproval.actions.deny": "拒否",
|
|
"permissionApproval.fallbackHint": "詳しい情報を見るにはセッションを読み込んでください。",
|
|
"permissionApproval.errors.unableToUpdatePermission": "許可を更新できません",
|
|
|
|
"toolCall.question.status.required": "質問が必要です",
|
|
"toolCall.question.status.queued": "質問待ち",
|
|
"toolCall.question.status.questions": "質問",
|
|
"toolCall.question.action.awaitingAnswers": "回答待ち...",
|
|
"toolCall.question.title.questions": "質問",
|
|
"toolCall.question.title.askingQuestions": "質問中",
|
|
"toolCall.question.type.one": "質問",
|
|
"toolCall.question.type.other": "質問",
|
|
"toolCall.question.number": "Q{number}:",
|
|
"toolCall.question.multiple": "複数",
|
|
"toolCall.question.custom.title": "カスタム回答を入力",
|
|
"toolCall.question.custom.label": "カスタム回答",
|
|
"toolCall.question.custom.placeholder": "回答を入力",
|
|
"toolCall.question.actions.submit": "送信",
|
|
"toolCall.question.actions.dismiss": "閉じる",
|
|
"toolCall.question.shortcuts.submit": "送信",
|
|
"toolCall.question.shortcuts.dismiss": "閉じる",
|
|
"toolCall.question.queuedText": "先行する回答を待機中です。",
|
|
"toolCall.question.validation.answerAll": "送信する前にすべての質問に回答してください。",
|
|
"toolCall.question.errors.unableToReply": "回答できません",
|
|
"toolCall.question.errors.unableToDismiss": "閉じられません",
|
|
|
|
"toolCall.task.action.delegating": "委任中...",
|
|
"toolCall.task.sections.prompt": "プロンプト",
|
|
"toolCall.task.sections.steps": "手順",
|
|
"toolCall.task.sections.output": "出力",
|
|
"toolCall.task.steps.count": "{count} 手順",
|
|
"toolCall.task.meta.agentModel": "エージェント: {agent} • モデル: {model}",
|
|
"toolCall.task.meta.agent": "エージェント: {agent}",
|
|
"toolCall.task.meta.model": "モデル: {model}",
|
|
|
|
"toolCall.status.pending": "保留",
|
|
"toolCall.status.running": "実行中",
|
|
"toolCall.status.completed": "完了",
|
|
"toolCall.status.error": "エラー",
|
|
"toolCall.status.unknown": "不明",
|
|
|
|
"toolCall.applyPatch.action.preparing": "apply_patch を準備中...",
|
|
"toolCall.applyPatch.title.withFileCount.one": "{tool} ({count} 件のファイル)",
|
|
"toolCall.applyPatch.title.withFileCount.other": "{tool} ({count} 件のファイル)",
|
|
"toolCall.applyPatch.fileFallback": "ファイル {number}",
|
|
} as const
|