From ac31162d3b660411d1b8463a96267b3db1b01a2c Mon Sep 17 00:00:00 2001 From: Amit Haridas Date: Mon, 14 Sep 2026 22:37:02 +0530 Subject: [PATCH] fix(ascii-art): wire Box/Templates mode + correct standalone ; v4.9.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/ascii-generator.html line 7: ../fonts.css -> fonts.css (src/-relative; fixes silent stylesheet miss — same class as the v4.9.0->v4.9.1 script-tag fix) - src/renderer/ascii-controller.js: wire all 3 mode tabs, 18 template buttons, and the 3 box form fields. setMode() toggles .active on tabs and matching .mode-section. Templates route through the orchestrator's template: font namespace. Box mode renders text with single/double/ rounded/bold/ascii borders via a pure renderBox() helper. All 11 T9 behaviours preserved. - tests/ascii-controller.test.js: 6 tests covering stylesheet path, pure box renderer, mode-tab switching, and template button wiring. - package.json 4.9.1 -> 4.9.2; README + UPDATES updated. Amit Haridas --- README.md | 2 +- UPDATES.md | 13 +++ package.json | 2 +- src/ascii-generator.html | 2 +- src/renderer/ascii-controller.js | 191 +++++++++++++++++++++++++++++++ tests/ascii-controller.test.js | 147 ++++++++++++++++++++++++ 6 files changed, 354 insertions(+), 3 deletions(-) create mode 100644 tests/ascii-controller.test.js diff --git a/README.md b/README.md index 040e92b..287d407 100644 --- a/README.md +++ b/README.md @@ -257,4 +257,4 @@ Amit Haridas (amit.wh@gmail.com) ## Version -v4.9.1 +v4.9.2 diff --git a/UPDATES.md b/UPDATES.md index 8767dc1..7325694 100644 --- a/UPDATES.md +++ b/UPDATES.md @@ -1,5 +1,18 @@ # PanConverter - Updates & Changelog +## Version 4.9.2 (2026-09-14) + +### Fixes +- **Standalone ASCII Art Generator — broken stylesheet path**: `src/ascii-generator.html:7` linked ``. The HTML loads via `BrowserWindow.loadFile(path.join(__dirname, 'ascii-generator.html'))` where `__dirname` is `src/`, so `../fonts.css` escaped the `src/` directory and resolved to a non-existent `/fonts.css`. Changed to `fonts.css` (same file, src/-relative — mirrors `src/index.html:29`). The window rendered without its font rules, leaving the header in the fallback system stack. +- **Standalone ASCII Art Generator — dead Box/Templates UI**: the controller (`src/renderer/ascii-controller.js`) shipped three mode tabs (`Text Banner` / `Box-Frame` / `Templates`), 18 `.template-btn[data-template]` buttons, and a Box form (`#box-text` / `#box-style` / `#box-padding`) but wired none of them. Clicking any tab or button was a no-op. Wired all of them: + - `setMode(mode)` toggles `.active` on the right `.mode-tab` and the matching `.mode-section` (`text-mode` / `box-mode` / `templates-mode`). + - Template buttons call `api.generate({ text: '', font: 'template:' })` so the orchestrator owns template content; preview updates and the button gets `.active`. + - Box mode renders the user text with a border using the chosen style (`single` / `double` / `rounded` / `bold` / `ascii`) and padding, exposed as a pure `window.ASCIIBoxRenderer.renderBox(text, style, padding)` helper. + - All 11 brief-required behaviours (text-input / font-picker / font-search / insert / copy / save / generate, last-font persistence, debounced preview) remain intact. + +### Tests +- New `tests/ascii-controller.test.js` — 6 tests covering the stylesheet path (no `..` escape), pure box renderer (single + ascii styles), mode-tab switching (Box and Templates), and template button → preview wiring. + ## Version 4.9.1 (2026-09-14) ### Fixes diff --git a/package.json b/package.json index 552a1b6..55679fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-converter", - "version": "4.9.1", + "version": "4.9.2", "description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting", "main": "src/main.js", "scripts": { diff --git a/src/ascii-generator.html b/src/ascii-generator.html index ec7d7d5..90c473c 100644 --- a/src/ascii-generator.html +++ b/src/ascii-generator.html @@ -4,7 +4,7 @@ ASCII Art Generator - MarkdownConverter - +