From 9ce07c860b7a30e8bdb6fecd24ca7f40fdb2e27b Mon Sep 17 00:00:00 2001 From: Rbanh Date: Wed, 18 Feb 2026 21:01:22 -0500 Subject: [PATCH] Add CI workflow, render snapshots, and keyboard apply shortcuts --- .gitea/workflows/ci.yml | 34 +++++++++++++++++++++++++++++++++ README.md | 9 +++++++++ frontend/app.js | 22 +++++++++++++++++++++ frontend/index.html | 20 +++++++++---------- tests/render-regression.test.js | 19 ++++++++++++++++++ 5 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 .gitea/workflows/ci.yml create mode 100644 tests/render-regression.test.js diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..addcfa9 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: "npm" + + - name: Install deps + run: npm ci --ignore-scripts + + - name: Static syntax checks + run: | + node --check src/server.js + node --check src/mcp-server.js + node --check src/layout.js + node --check src/compile.js + node --check frontend/app.js + + - name: Run tests + run: npm test diff --git a/README.md b/README.md index 5f4e3eb..ac5520d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ Docs: - `docs/release-checklist.md` - `docs/operations-runbook.md` +CI: +- `.gitea/workflows/ci.yml` runs syntax checks + full test suite on push/PR. + ## REST API ### `POST /compile` @@ -157,3 +160,9 @@ Tools: - Selected panel editors for component properties, full pin properties, full symbol body/pin editing, and net connect/disconnect operations - Click diagnostics to jump/flash focused net/component/pin - Auto Layout and Auto Tidy actions +- Keyboard shortcuts: + - `Ctrl/Cmd+Z` undo + - `Ctrl/Cmd+Shift+Z` or `Ctrl/Cmd+Y` redo + - `Space` rotate selected components (or pan when no selection) + - `Alt+Enter` apply current selection editor (component/pin/net) + - `Alt+C` connect selected pin to chosen net diff --git a/frontend/app.js b/frontend/app.js index 6d62d02..885fd22 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -2990,6 +2990,28 @@ function setupEvents() { el.canvasViewport.classList.add("dragging"); evt.preventDefault(); } + + if (evt.altKey && evt.key === "Enter") { + evt.preventDefault(); + if (state.selectedPin) { + el.applyPinPropsBtn.click(); + return; + } + if (state.selectedNet) { + el.updateNetBtn.click(); + return; + } + if (state.selectedRefs.length === 1 && state.selectedRef) { + el.updatePlacementBtn.click(); + return; + } + } + + if (evt.altKey && evt.key.toLowerCase() === "c" && state.selectedPin) { + evt.preventDefault(); + el.connectPinBtn.click(); + return; + } }); window.addEventListener("keyup", (evt) => { diff --git a/frontend/index.html b/frontend/index.html index 28c952c..7170f70 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -13,12 +13,12 @@

AI-Native Schematic Workspace

- - - - - - + + + + + +