From 0d2055dd01cc9fb12af12a295b821234d6e2b200 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 23 Oct 2025 23:05:21 -0500 Subject: [PATCH] Remove Electron menu --- electron/FEATURES.md | 3 ++- electron/README.md | 10 ++++++++++ electron/REAL_TERMINAL.md | 18 ++++++++++++++++++ electron/main.js | 5 ++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/electron/FEATURES.md b/electron/FEATURES.md index 072c0e5b..9532bb30 100644 --- a/electron/FEATURES.md +++ b/electron/FEATURES.md @@ -65,8 +65,9 @@ See [REAL_TERMINAL.md](./REAL_TERMINAL.md) for details. ## Native Window Management - **Resizable windows** with native OS controls +- **Clean interface** - No default menu bar (File/Edit/View/etc.) +- **Frameless app** - Shakespeare UI fills the entire window - **Multiple windows** support (planned) -- **Native menus** and keyboard shortcuts - **System tray integration** (planned) - **OS notifications** (planned) diff --git a/electron/README.md b/electron/README.md index c1b5271f..ee79208f 100644 --- a/electron/README.md +++ b/electron/README.md @@ -38,6 +38,16 @@ electron/ └── README.md # This file ``` +## UI Configuration + +The Electron build has been configured for a clean, minimal interface: + +- **No default menu bar**: The standard File/Edit/View/Window/Help menu is removed +- **Frameless app**: Shakespeare's UI is the entire window +- **Native window controls**: Standard minimize/maximize/close buttons remain + +This provides a more app-like experience focused on the Shakespeare interface. + ## Development Run Shakespeare in Electron development mode: diff --git a/electron/REAL_TERMINAL.md b/electron/REAL_TERMINAL.md index 4d62ae9e..94c04dd5 100644 --- a/electron/REAL_TERMINAL.md +++ b/electron/REAL_TERMINAL.md @@ -101,6 +101,24 @@ await shellTool.execute({ }); ``` +### ANSI Code Stripping + +Output from real shell commands is automatically cleaned for AI consumption: +- **ANSI color codes** are stripped (e.g., `\u001b[31m` for red text) +- **Cursor control sequences** are removed +- **Text formatting codes** are stripped (bold, italic, etc.) +- **Newlines and whitespace** are preserved + +This ensures AI receives clean, parseable text without terminal formatting noise. + +**Example:** +``` +Input: \u001b[1m\u001b[32madded 142 packages\u001b[39m\u001b[22m in 3s +Output: added 142 packages in 3s +``` + +The Terminal UI still displays colored output for users - only AI tool output is stripped. + ## Differences from Browser Mode | Feature | Browser Mode | Electron Mode | diff --git a/electron/main.js b/electron/main.js index cbd491ec..b39a9e65 100644 --- a/electron/main.js +++ b/electron/main.js @@ -1,4 +1,4 @@ -import { app, BrowserWindow, ipcMain, shell } from 'electron'; +import { app, BrowserWindow, ipcMain, shell, Menu } from 'electron'; import { spawn } from 'child_process'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -15,6 +15,9 @@ const SHAKESPEARE_ROOT = path.join(os.homedir(), 'shakespeare'); let mainWindow; function createWindow() { + // Remove the default menu (File, Edit, View, etc.) + Menu.setApplicationMenu(null); + // Create the browser window. mainWindow = new BrowserWindow({ width: 1400,