diff --git a/frontend/public/components-metadata.json b/frontend/public/components-metadata.json index 5ac834c1..e175f37f 100644 --- a/frontend/public/components-metadata.json +++ b/frontend/public/components-metadata.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "generatedAt": "2026-03-06T02:57:38.515Z", + "generatedAt": "2026-03-06T13:12:51.254Z", "components": [ { "id": "arduino-mega", diff --git a/frontend/src/components/editor/EditorToolbar.tsx b/frontend/src/components/editor/EditorToolbar.tsx index bfea953d..b0e28871 100644 --- a/frontend/src/components/editor/EditorToolbar.tsx +++ b/frontend/src/components/editor/EditorToolbar.tsx @@ -136,7 +136,7 @@ export const EditorToolbar = ({ consoleOpen, setConsoleOpen, compileLogs: _compi className="tb-btn tb-btn-stop" title="Stop" > - + @@ -195,7 +195,7 @@ export const EditorToolbar = ({ consoleOpen, setConsoleOpen, compileLogs: _compi className={`tb-btn tb-btn-output${consoleOpen ? ' tb-btn-output-active' : ''}`} title="Toggle Output Console" > - + diff --git a/frontend/src/components/editor/FileExplorer.css b/frontend/src/components/editor/FileExplorer.css index 9d7f3a56..312a95f6 100644 --- a/frontend/src/components/editor/FileExplorer.css +++ b/frontend/src/components/editor/FileExplorer.css @@ -14,7 +14,8 @@ display: flex; align-items: center; justify-content: space-between; - padding: 7px 10px 6px; + padding: 0 10px; + height: 46px; color: #9d9d9d; font-size: 11px; font-weight: 600; @@ -23,20 +24,24 @@ flex-shrink: 0; } +.file-explorer-header-actions { + display: flex; + align-items: center; + gap: 2px; +} + .file-explorer-new-btn { background: none; border: none; color: #9d9d9d; - font-size: 18px; - line-height: 1; cursor: pointer; - padding: 0 3px; + padding: 2px; border-radius: 3px; display: flex; align-items: center; justify-content: center; - width: 22px; - height: 22px; + width: 26px; + height: 26px; } .file-explorer-new-btn:hover { @@ -44,6 +49,25 @@ color: #fff; } +.file-explorer-save-btn { + background: none; + border: none; + color: #9d9d9d; + cursor: pointer; + padding: 2px; + border-radius: 3px; + display: flex; + align-items: center; + justify-content: center; + width: 26px; + height: 26px; +} + +.file-explorer-save-btn:hover { + background: rgba(255, 255, 255, 0.08); + color: #4fc3f7; +} + .file-explorer-list { flex: 1; overflow-y: auto; @@ -92,8 +116,10 @@ } .file-explorer-dot { - color: #e8a87c; - font-size: 9px; + width: 7px; + height: 7px; + border-radius: 50%; + background: #e8a87c; flex-shrink: 0; } diff --git a/frontend/src/components/editor/FileExplorer.tsx b/frontend/src/components/editor/FileExplorer.tsx index 65ef4891..a9577d4d 100644 --- a/frontend/src/components/editor/FileExplorer.tsx +++ b/frontend/src/components/editor/FileExplorer.tsx @@ -2,13 +2,44 @@ import React, { useState, useRef, useEffect, useCallback } from 'react'; import { useEditorStore } from '../../store/useEditorStore'; import './FileExplorer.css'; -function getFileIcon(name: string): string { +// SVG icons — same style as EditorToolbar (stroke-based, 16x16) +const IcoFile = () => ( + + + + +); + +const IcoHeader = () => ( + + + + + + +); + +const IcoNewFile = () => ( + + + + + + +); + +const IcoSave = () => ( + + + + + +); + +function FileIcon({ name }: { name: string }) { const ext = name.split('.').pop()?.toLowerCase() ?? ''; - if (ext === 'ino') return '⚡'; - if (['cpp', 'c', 'cc'].includes(ext)) return '📄'; - if (['h', 'hpp'].includes(ext)) return '📋'; - if (ext === 'json') return '{}'; - return '📝'; + if (['h', 'hpp'].includes(ext)) return ; + return ; } interface ContextMenu { @@ -17,7 +48,11 @@ interface ContextMenu { y: number; } -export const FileExplorer: React.FC = () => { +interface FileExplorerProps { + onSaveClick: () => void; +} + +export const FileExplorer: React.FC = ({ onSaveClick }) => { const { files, activeFileId, openFile, createFile, deleteFile, renameFile } = useEditorStore(); const [contextMenu, setContextMenu] = useState(null); @@ -94,13 +129,22 @@ export const FileExplorer: React.FC = () => {
WORKSPACE - +
+ + +
@@ -113,7 +157,9 @@ export const FileExplorer: React.FC = () => { onDoubleClick={() => startRename(file.id)} title={`${file.name}${file.modified ? ' (unsaved)' : ''}`} > - {getFileIcon(file.name)} + + + {renamingId === file.id ? ( { )} {file.modified && ( - - ● - + )}
))} {creatingFile && (
- ⚡ + + + { onClick={() => setActiveFile(file.id)} title={file.name} > - {file.modified && ●} + {file.modified && } {file.name} - - {/* Save button */} - - {/* Auth UI */} {user ? (
diff --git a/frontend/src/components/simulator/SimulatorCanvas.css b/frontend/src/components/simulator/SimulatorCanvas.css index 88663d54..58140b78 100644 --- a/frontend/src/components/simulator/SimulatorCanvas.css +++ b/frontend/src/components/simulator/SimulatorCanvas.css @@ -85,6 +85,35 @@ cursor: not-allowed; } +/* ── Serial Monitor button ───────────────────────── */ +.canvas-serial-btn { + display: flex; + align-items: center; + gap: 5px; + padding: 0 10px; + height: 32px; + background: transparent; + border: 1px solid #3a4a5a; + border-radius: 5px; + color: #9d9d9d; + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: border-color 0.15s, background 0.15s, color 0.15s; + white-space: nowrap; +} + +.canvas-serial-btn:hover { + border-color: #007acc; + color: #ccc; +} + +.canvas-serial-btn-active { + background: #0e3a5a; + border-color: #007acc; + color: #4fc3f7; +} + /* ── Component count ─────────────────────────────── */ .component-count { display: flex; diff --git a/frontend/src/components/simulator/SimulatorCanvas.tsx b/frontend/src/components/simulator/SimulatorCanvas.tsx index 7ea96323..469ffa59 100644 --- a/frontend/src/components/simulator/SimulatorCanvas.tsx +++ b/frontend/src/components/simulator/SimulatorCanvas.tsx @@ -27,6 +27,8 @@ export const SimulatorCanvas = () => { addComponent, removeComponent, updateComponent, + serialMonitorOpen, + toggleSerialMonitor, } = useSimulatorStore(); // Wire management from store @@ -400,6 +402,19 @@ export const SimulatorCanvas = () => { ))} + + {/* Serial Monitor toggle */} +
@@ -419,7 +434,7 @@ export const SimulatorCanvas = () => { title="Add Component" disabled={running} > - + diff --git a/frontend/src/pages/EditorPage.tsx b/frontend/src/pages/EditorPage.tsx index 0ea9969b..3b161556 100644 --- a/frontend/src/pages/EditorPage.tsx +++ b/frontend/src/pages/EditorPage.tsx @@ -112,7 +112,7 @@ export const EditorPage: React.FC = () => { return (
- +
{/* ── Editor side ── */} @@ -121,7 +121,7 @@ export const EditorPage: React.FC = () => { style={{ width: `${editorWidthPct}%`, display: 'flex', flexDirection: 'row' }} > {/* File explorer sidebar */} - {explorerOpen && } + {explorerOpen && } {/* Editor main area */}