mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 23:19:43 +02:00
feat(ui): add help modal and copy terminal button
- Add floating help button (?) with keyboard shortcuts modal - Add Ctrl+? shortcut to open help modal - Add copy terminal button to copy output to clipboard - Style kbd elements for keyboard shortcut display - Update Escape key to close all modals Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -158,6 +158,13 @@ class ClaudemanApp {
|
||||
// Escape to close modals
|
||||
if (e.key === 'Escape') {
|
||||
this.closeCaseSelector();
|
||||
this.closeHelp();
|
||||
}
|
||||
|
||||
// Ctrl/Cmd + ? to show help
|
||||
if ((e.ctrlKey || e.metaKey) && (e.key === '?' || e.key === '/')) {
|
||||
e.preventDefault();
|
||||
this.showHelp();
|
||||
}
|
||||
|
||||
// Ctrl/Cmd + Enter to quick start (when not in terminal)
|
||||
@@ -726,6 +733,15 @@ class ClaudemanApp {
|
||||
document.getElementById('caseSelectorModal').classList.remove('active');
|
||||
}
|
||||
|
||||
// Help modal
|
||||
showHelp() {
|
||||
document.getElementById('helpModal').classList.add('active');
|
||||
}
|
||||
|
||||
closeHelp() {
|
||||
document.getElementById('helpModal').classList.remove('active');
|
||||
}
|
||||
|
||||
// Actions
|
||||
async startRun() {
|
||||
const prompt = document.getElementById('promptInput').value.trim();
|
||||
@@ -971,6 +987,29 @@ class ClaudemanApp {
|
||||
this.terminal.writeln('\x1b[90mTerminal cleared\x1b[0m');
|
||||
}
|
||||
|
||||
// Copy terminal contents to clipboard
|
||||
async copyTerminal() {
|
||||
try {
|
||||
// Get all text from terminal
|
||||
const buffer = this.terminal.buffer.active;
|
||||
let text = '';
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
const line = buffer.getLine(i);
|
||||
if (line) {
|
||||
text += line.translateToString(true) + '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Strip trailing empty lines
|
||||
text = text.replace(/\n+$/, '\n');
|
||||
|
||||
await navigator.clipboard.writeText(text);
|
||||
this.showToast('Terminal output copied to clipboard', 'success');
|
||||
} catch (err) {
|
||||
this.showToast('Failed to copy: ' + err.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// Font size controls
|
||||
increaseFontSize() {
|
||||
const current = this.terminal.options.fontSize || 14;
|
||||
|
||||
Reference in New Issue
Block a user