feat(cli-stream): add search functionality and improve validation in CLI Stream Viewer

This commit is contained in:
catlog22
2025-12-28 22:52:32 +08:00
parent 32cea006b9
commit e2f4241b2e
6 changed files with 411 additions and 11 deletions

View File

@@ -17,10 +17,23 @@ function initCliStreamViewer() {
// Initialize keyboard shortcuts
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && isCliStreamViewerOpen) {
toggleCliStreamViewer();
if (searchFilter) {
clearSearch();
} else {
toggleCliStreamViewer();
}
}
// Ctrl+F to focus search when viewer is open
if ((e.ctrlKey || e.metaKey) && e.key === 'f' && isCliStreamViewerOpen) {
e.preventDefault();
const searchInput = document.getElementById('cliStreamSearchInput');
if (searchInput) {
searchInput.focus();
searchInput.select();
}
}
});
// Initialize scroll detection for auto-scroll
const content = document.getElementById('cliStreamContent');
if (content) {
@@ -491,7 +504,9 @@ function _streamT(key) {
'cliStream.autoScroll': 'Auto-scroll',
'cliStream.close': 'Close',
'cliStream.cannotCloseRunning': 'Cannot close running execution',
'cliStream.lines': 'lines'
'cliStream.lines': 'lines',
'cliStream.searchPlaceholder': 'Search output...',
'cliStream.filterResults': 'results'
};
return fallbacks[key] || key;
}

View File

@@ -55,6 +55,8 @@ const i18n = {
'cliStream.close': 'Close',
'cliStream.cannotCloseRunning': 'Cannot close running execution',
'cliStream.lines': 'lines',
'cliStream.searchPlaceholder': 'Search output...',
'cliStream.filterResults': 'results',
// Sidebar - Project section
'nav.project': 'Project',
@@ -1975,6 +1977,8 @@ const i18n = {
'cliStream.close': '关闭',
'cliStream.cannotCloseRunning': '无法关闭运行中的执行',
'cliStream.lines': '行',
'cliStream.searchPlaceholder': '搜索输出...',
'cliStream.filterResults': '条结果',
// Sidebar - Project section
'nav.project': '项目',