mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-10 23:09:50 +00:00
Click on file container to open it
This commit is contained in:
@@ -540,6 +540,17 @@ const styles = `
|
|||||||
border: 1px solid var(--vscode-panel-border);
|
border: 1px solid var(--vscode-panel-border);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-file-path:hover {
|
||||||
|
background-color: var(--vscode-list-hoverBackground);
|
||||||
|
border-color: var(--vscode-focusBorder);
|
||||||
|
}
|
||||||
|
|
||||||
|
.diff-file-path:active {
|
||||||
|
transform: translateY(1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-path-short,
|
.file-path-short,
|
||||||
|
|||||||
@@ -803,7 +803,7 @@ const html = `<!DOCTYPE html>
|
|||||||
// Special handling for Read tool with file_path
|
// Special handling for Read tool with file_path
|
||||||
if (input.file_path && Object.keys(input).length === 1) {
|
if (input.file_path && Object.keys(input).length === 1) {
|
||||||
const formattedPath = formatFilePath(input.file_path);
|
const formattedPath = formatFilePath(input.file_path);
|
||||||
return '<div class="diff-file-path">' + formattedPath + '</div>';
|
return '<div class="diff-file-path" onclick="openFileInEditor(\\\'' + escapeHtml(input.file_path) + '\\\')">' + formattedPath + '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = '';
|
let result = '';
|
||||||
@@ -817,7 +817,7 @@ const html = `<!DOCTYPE html>
|
|||||||
// Special formatting for file_path in Read tool context
|
// Special formatting for file_path in Read tool context
|
||||||
if (key === 'file_path') {
|
if (key === 'file_path') {
|
||||||
const formattedPath = formatFilePath(valueStr);
|
const formattedPath = formatFilePath(valueStr);
|
||||||
result += '<div class="diff-file-path">' + formattedPath + '</div>';
|
result += '<div class="diff-file-path" onclick="openFileInEditor(\\\'' + escapeHtml(valueStr) + '\\\')">' + formattedPath + '</div>';
|
||||||
} else if (valueStr.length > 100) {
|
} else if (valueStr.length > 100) {
|
||||||
const truncated = valueStr.substring(0, 97) + '...';
|
const truncated = valueStr.substring(0, 97) + '...';
|
||||||
const escapedValue = valueStr.replace(/"/g, '"').replace(/'/g, ''');
|
const escapedValue = valueStr.replace(/"/g, '"').replace(/'/g, ''');
|
||||||
@@ -841,7 +841,7 @@ const html = `<!DOCTYPE html>
|
|||||||
|
|
||||||
// Format file path with better display
|
// Format file path with better display
|
||||||
const formattedPath = formatFilePath(input.file_path);
|
const formattedPath = formatFilePath(input.file_path);
|
||||||
let result = '<div class="diff-file-path">' + formattedPath + '</div>\\n';
|
let result = '<div class="diff-file-path" onclick="openFileInEditor(\\\'' + escapeHtml(input.file_path) + '\\\')">' + formattedPath + '</div>\\n';
|
||||||
|
|
||||||
// Create diff view
|
// Create diff view
|
||||||
const oldLines = input.old_string.split('\\n');
|
const oldLines = input.old_string.split('\\n');
|
||||||
@@ -918,7 +918,7 @@ const html = `<!DOCTYPE html>
|
|||||||
const parts = filePath.split('/');
|
const parts = filePath.split('/');
|
||||||
const fileName = parts[parts.length - 1];
|
const fileName = parts[parts.length - 1];
|
||||||
|
|
||||||
return '<span class="file-path-truncated" title="' + escapeHtml(filePath) + '" onclick="openFileInEditor(\\\'' + escapeHtml(filePath) + '\\\')">' +
|
return '<span class="file-path-truncated" title="' + escapeHtml(filePath) + '" data-file-path="' + escapeHtml(filePath) + '">' +
|
||||||
'<span class="file-icon">📄</span>' + escapeHtml(fileName) + '</span>';
|
'<span class="file-icon">📄</span>' + escapeHtml(fileName) + '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user