From b0540cfdf31a23b90772d88ce294d13fb9fb7785 Mon Sep 17 00:00:00 2001 From: Dias Kabdualiyev Date: Wed, 26 Nov 2025 15:37:42 +0500 Subject: [PATCH 1/2] Feat: Add command input to Chart tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ConsoleInput component at bottom of Chart view for quick command sending without switching to Console tab. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/App.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 71c777c..b1c278a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,6 +15,7 @@ import { captureElementPng, downloadDataUrlPng } from './utils/screenshot' import PlotToolsOverlay from './components/PlotToolsOverlay' import TabNav from './components/TabNav' import SerialConsole from './components/SerialConsole' +import ConsoleInput from './components/ConsoleInput' import Footer from './components/Footer' import { exportChartData, type ChartExportOptions } from './utils/chartExport' import { driver } from 'driver.js' @@ -275,6 +276,10 @@ function App() { onClose={() => setShowSettingsPanel(false)} /> + ) : (
From 3c0eeb21489808125bf2e5f54c7a94ed6756cbd7 Mon Sep 17 00:00:00 2001 From: Dias Kabdualiyev Date: Thu, 27 Nov 2025 19:30:07 +0500 Subject: [PATCH 2/2] Fix: Log outgoing messages from Chart tab input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Messages sent from Chart tab ConsoleInput now properly logged to console store, matching SerialConsole behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/App.tsx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index b1c278a..9459f1f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -90,6 +90,25 @@ function App() { const dataConnection = useDataConnection(handleIncomingLine) + const handleSendMessage = useCallback(async (message: string) => { + try { + const isControlChar = message.length === 1 && message.charCodeAt(0) < 32 + const messageToSend = isControlChar ? message : (message.endsWith('\n') ? message : message + '\n') + + if (isControlChar) { + const code = message.charCodeAt(0) + const ctrlName = code === 3 ? '^C (ETX)' : code === 4 ? '^D (EOT)' : `^${String.fromCharCode(64 + code)}` + consoleStore.addOutgoing(ctrlName) + } else { + consoleStore.addOutgoing(message) + } + + await dataConnection.write(messageToSend) + } catch (error) { + consoleStore.addOutgoing(`Error: ${error instanceof Error ? error.message : 'Failed to send'}`, 'error') + } + }, [dataConnection, consoleStore]) + const canvasRef = useRef(null) const containerRef = useRef(null) const plotContainerRef = useRef(null) @@ -277,7 +296,7 @@ function App() { />