Skip to content

Commit 169cbba

Browse files
committed
feat: add double-click test page for output panel handlers
1 parent c29e322 commit 169cbba

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

client/src/pages/arduino-simulator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,8 @@ export default function ArduinoSimulator() {
11801180
onGoToLine={(line) => {
11811181
logger.debug(`Go to line: ${line}`);
11821182
}}
1183+
onInsertSuggestion={handleInsertSuggestion}
1184+
hideHeader={true}
11831185
/>
11841186
</div>
11851187
)}

test-double-click.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Double Click Test</title>
5+
</head>
6+
<body>
7+
<style>
8+
button { padding: 10px; margin: 5px; font-size: 16px; }
9+
.logs { margin-top: 20px; border: 1px solid black; padding: 10px; max-height: 200px; overflow: auto; }
10+
.log-entry { font-family: monospace; font-size: 12px; }
11+
</style>
12+
13+
<h1>Test Output Panel Double-Click Handlers</h1>
14+
15+
<div>
16+
<button id="compiler-btn" data-tab="compiler">Compiler</button>
17+
<button id="messages-btn" data-tab="messages">Messages</button>
18+
<button id="registry-btn" data-tab="registry">I/O Registry</button>
19+
<button id="debug-btn" data-tab="debug">Debug</button>
20+
</div>
21+
22+
<div class="logs" id="logs"></div>
23+
24+
<script>
25+
const logsDiv = document.getElementById('logs');
26+
27+
function log(message) {
28+
const entry = document.createElement('div');
29+
entry.className = 'log-entry';
30+
entry.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
31+
logsDiv.appendChild(entry);
32+
logsDiv.scrollTop = logsDiv.scrollHeight;
33+
}
34+
35+
// Simulating the output-panel structure
36+
const handlers = {
37+
'compiler': () => log('openOutputPanel("compiler") called'),
38+
'messages': () => log('openOutputPanel("messages") called'),
39+
'registry': () => log('openOutputPanel("registry") called'),
40+
'debug': () => log('openOutputPanel("debug") called'),
41+
};
42+
43+
document.querySelectorAll('[data-tab]').forEach(btn => {
44+
btn.addEventListener('click', () => {
45+
const tab = btn.dataset.tab;
46+
log(`>>> Single Click: ${tab}`);
47+
});
48+
49+
btn.addEventListener('dblclick', (e) => {
50+
e.preventDefault();
51+
const tab = btn.dataset.tab;
52+
log(`>>> Double Click: ${tab}`);
53+
handlers[tab]();
54+
});
55+
});
56+
57+
log('Test page loaded');
58+
</script>
59+
</body>
60+
</html>

0 commit comments

Comments
 (0)