Skip to content

Commit 79ed005

Browse files
committed
docs: DocGen preview editing — editable @prompt: textarea, @step: inputs, image upload, model readiness
1 parent cce3dce commit 79ed005

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
| **Desktop** | Native app via Neutralino.js with system tray and offline support |
3535
| **Code Execution** | 6 languages in-browser: Bash ([just-bash](https://justbash.dev/)), Math (Nerdamer), Python ([Pyodide](https://pyodide.org/)), HTML (sandboxed iframe, `html-autorun` for widgets/quizzes), JavaScript (sandboxed iframe), SQL ([sql.js](https://sql.js.org/) SQLite) · 25+ compiled languages via [Judge0 CE](https://ce.judge0.com): C, C++, Rust, Go, Java, TypeScript, Kotlin, Scala, Ruby, Swift, Haskell, Dart, C#, and more |
3636
| **Security** | Content Security Policy (CSP), SRI integrity hashes, XSS sanitization (DOMPurify), ReDoS protection, Firestore write-token ownership, API keys via HTTP headers, postMessage origin validation, 8-char passphrase minimum, sandboxed code execution |
37-
| **AI Document Tags** | `{{@AI:}}` text generation, `{{@Think:}}` deep reasoning, `{{@Image:}}` image generation (Gemini Imagen) — `@` prefix syntax on all tag types + metadata fields (`@name`, `@use`, `@think`, `@search`, `@prompt`, `@step`); per-card model selector, concurrent block operations |
37+
| **AI Document Tags** | `{{@AI:}}` text generation, `{{@Think:}}` deep reasoning, `{{@Image:}}` image generation (Gemini Imagen) — `@` prefix syntax on all tag types + metadata fields (`@name`, `@use`, `@think`, `@search`, `@prompt`, `@step`, `@upload`); editable `@prompt:` textarea and `@step:` inputs in preview cards; description/prompt separation (bare text = label, `@prompt:` = AI instruction); 📎 image upload for multimodal vision analysis; per-card model selector, concurrent block operations |
3838
| **🔌 API Calls** | `{{API:}}` REST API integration — GET/POST/PUT/DELETE methods, custom headers, JSON body, response stored in `$(api_varName)` variables; inline review panel; toolbar GET/POST buttons |
3939
| **🔗 Agent Flow** | `{{Agent:}}` multi-step pipeline — define Step 1/2/3, chain outputs, per-card model + search provider selector, live step status indicators (⏳/✅/❌), review combined output |
4040
| **🔍 Web Search** | Toggle web search for AI — DuckDuckGo (free), Brave Search, Serper.dev; search results injected into LLM context; source citations in responses; per-agent-card search provider selector |
@@ -443,6 +443,7 @@ TextAgent has undergone significant evolution since its inception. What started
443443

444444
| Date | Commits | Feature / Update |
445445
|------|---------|-----------------|
446+
| **2026-03-11** || 🏷️ **DocGen Preview Editing** — editable `@prompt:` textarea in AI/Image preview cards (bare text = static description label, `@prompt:` = actual AI instruction sent to model); editable `@step:` inputs in Agent Flow cards with debounced sync back to editor; 📎 image upload button on AI/Image/Agent cards with `@upload: filename` editor sync and thumbnail preview; `ensureModelReady()` helper prevents "AI model not ready" error (handles local download consent + cloud API key prompt); Image card model selector now includes vision/multimodal models with separator; description/prompt separation in parser (`block.description` vs `block.prompt`) |
446447
| **2026-03-11** || 🎤 **Speech-to-Text Enhancements** — dual-engine voice dictation (Web Speech API + Moonshine Base ONNX) with consensus scoring; auto-punctuation enabled by default (AI refinement with 5s timeout + built-in capitalize/period fallback); 50+ voice commands with natural ASR-friendly aliases ("heading one"/"title" for H1, "undo"/"take that back", "add table"/"add link", "strikethrough…end strike", "ellipsis"/"open quote"); stronger hallucination filter (100-word max, non-ASCII rejection); streaming partial result display; improved model loading progress [1/4][4/4] with file sizes; experimental Moonshine Medium ONNX worker (kept as reference) |
447448
| **2026-03-10** || 📈 **Stock Dashboard** — new Finance template category (3 templates: Stock Watchlist, Crypto Tracker, Market Overview) with live TradingView Advanced Chart widgets and 52-period EMA overlay; dynamic `data-var-prefix` grid engine expands one `stock-card` per non-empty variable; configurable `chartRange`, `chartInterval`, `emaPeriod` via `@variables` table; interactive 1M/1Y/3Y range + 52D/52W/52M EMA toggle buttons; `@variables` block persists after ⚡ Vars for re-editing; JS code block dynamically reads `$(cname*)` variables to generate grid HTML; `data-range`, `data-interval`, `data-ema` forwarded through DOMPurify; 179 Playwright tests pass |
448449
| **2026-03-10** || 🛡️ **CSP Fix for Badges** — added `https://img.shields.io` to the `img-src` directive in `index.html` and `nginx.conf` Content-Security-Policy to allow GitHub license and version badges to render correctly; updated legacy domain to `textagent.github.io`. |
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# CHANGELOG — DocGen Preview Editing & Upload
2+
3+
## Summary
4+
5+
Enhanced DocGen tag preview cards with interactive editing, image uploads, and model readiness checks.
6+
7+
## Changes
8+
9+
### Image Upload (`@upload:` directive)
10+
- Added 📎 upload button to AI, Image, and Agent preview cards
11+
- File picker stores image data (base64, mimeType, name) in memory (`blockUploads` Map)
12+
- Uploaded images display as thumbnails with ✕ remove button
13+
- Inserting/removing uploads syncs `@upload: filename` lines in editor tag text
14+
- `parseDocgenBlocks()` extracts `@upload:` lines from tag text
15+
16+
### Editable Prompt Box (`@prompt:` textarea)
17+
- When `@prompt:` field is present in a tag, the preview card shows an editable `<textarea>`
18+
- Bare text (without `@prompt:`) displays as static italic description — NOT sent to AI
19+
- `@prompt:` content is the actual AI instruction sent to the model
20+
- Debounced sync (300ms) writes edits back to the `@prompt:` line in the editor
21+
- Suppresses re-render during sync to preserve textarea focus
22+
- Light/dark theme support with teal (AI) and purple (Image) focus accents
23+
24+
### Description vs Prompt Separation
25+
- Parser now stores `block.description` (bare text label) and `block.prompt` (`@prompt:` content) separately
26+
- `block.hasPromptField` flag controls textarea vs static text rendering
27+
- `buildPrompt()` only sends `@prompt:` content to the AI model
28+
- Description shows as static italic label above the textarea
29+
30+
### Editable Agent Steps
31+
- Agent step descriptions changed from `<span>` to `<input>` for inline editing
32+
- `updateBlockStepText()` syncs edits to `@step N:` lines in the editor
33+
- Amber accent styling on focus/hover, transparent when idle
34+
35+
### Model Readiness Check (`ensureModelReady()`)
36+
- New helper prevents cryptic "AI model not ready" error
37+
- Handles local model download consent flow
38+
- Handles cloud model API key prompt
39+
- Called before `generateAndReview()` and `generateAgentFlow()`
40+
41+
### Image Card Model Selector
42+
- Image card dropdown now includes both image generation models AND vision/multimodal models
43+
- Separated by `──── Vision ────` divider
44+
45+
## Files Modified
46+
- `js/ai-docgen.js` — parser, card rendering, field sync handlers
47+
- `js/ai-docgen-generate.js``ensureModelReady()`, attachments
48+
- `css/ai-docgen.css` — textarea, step input, upload thumbnail styles

0 commit comments

Comments
 (0)