Skip to content

v0.1.8

Choose a tag to compare

@github-actions github-actions released this 09 Apr 22:35

Notepatra v0.1.8 — ComparePlus-style diff + AI Fix actually works + chat-bubble UI

A big iteration release. The main themes:

  1. Compare panel rewritten as a true ComparePlus-style side-by-side diff with paired modified rows, character-level highlighting, custom per-row line numbers, symbol margin markers, and softer "soothing-to-eyes" colors. Plus a new Plugins → ComparePlus menu entry alongside Compare (inbuilt).
  2. AI Fix in JSON Tools actually works for thinking models like Qwen3 and DeepSeek-R1 — think:false + defensive <think> strip + leading-prose trim + strict minimal-change prompt that preserves your original line order.
  3. Show Diff button works for ANY action — Format / Minify / Fix+Format / AI Fix all populate the same diff state.
  4. AI Assistant rewritten as a proper chat-bubble UI with input bar at the bottom, wider 420px panel, 📎 attach support for images / PDF / DOCX / PPTX / text, Show thinking toggle, Clear chat button.
  5. Session log with smart change descriptions — every action logs +2 commas, +1 brace, −4 single→double so you see exactly what each operation changed.

Fixed

🎨 Compare panel: ComparePlus-style side-by-side diff

Inspired by Pavel Nedev's ComparePlus plugin for Notepad++. The Notepatra implementation is a fresh Qt + Rust port — different codebase — but the visual conventions are credit to Pavel and the ComparePlus contributors.

What changed:

  • Modified rows are paired at the same visual line. When the diff produces N consecutive deletes followed by M consecutive adds, they're merged into min(N,M) paired modified rows. Both sides show the same row index with - content on the left and + content on the right.
  • Character-level highlighting within modified rows — common-prefix + common-suffix detection finds the EXACT changed bytes. Only those characters get colored (red box on left, green box on right). The rest of the line stays plain. For a missing comma like "name": "alice""name": "alice",, only the trailing , gets the green highlight.
  • Pale yellow background (#FFFBE6) on modified rows so the character-level red/green indicators stand out without overpowering the line.
  • Soft mint green (#D4F4D4) for added lines, soft salmon (#F4D4D4) for deleted, light blue (#E8F0F8) placeholder background on the empty side.
  • Symbol margin (18px wide) with per-row icons: pink ~ Circle marker for modified, green + Plus marker for added, red Minus marker for deleted. Like ComparePlus's per-row indicator stripe.
  • Custom per-row line numbers via TextMargin so the LEFT panel shows the original LEFT-source line numbers and the RIGHT panel shows the original RIGHT-source line numbers — they diverge cleanly when there are insertions/deletions. Empty placeholder rows show a green + instead of a number.
  • No syntax highlighting on context lines — soft #606060 mid-gray text everywhere so the diff markers are the only thing that draws the eye. Soothing visual style.
  • Soft #A0A0A0 line numbers on #F8F8F8 margin background.
  • Both vertical AND horizontal scrollbars synced — drag either and both panels move together. Was missing horizontal sync before.

New menu entry: Plugins → ComparePlus alongside Compare (inbuilt). Both share the same picker code and the same CompareWidget — just different tab labels so you can have multiple compare tabs open and tell them apart in the tab bar.

🤖 AI Fix in JSON Tools — works for Qwen3, DeepSeek-R1, and any thinking model

Three-layer fix:

  1. OllamaClient::generate() now passes "think": false in the /api/generate request. Modern Ollama honors this and skips thinking entirely. Older Ollama and non-thinking models (llama3.2, mistral, codellama, phi) ignore the field harmlessly.
  2. System prompt also appends /no_think as a belt-and-braces signal — some models honor that slash command instead of the API field.
  3. Defensive <think>...</think> regex strip in the JSON Tools cleanup pipeline catches any thinking that leaks through despite (1) + (2).
  4. Leading-prose trim — finds the first { or [ in the response and discards anything before it, so models that prefix with "Here is the fixed JSON:" still produce parseable output.

Verified end-to-end on Linux GUI before shipping: xdotool drove the JSON Tools panel against real local Ollama (qwen3.5:9b). Status banner went ✓ 86 chars formatted on openAsking qwen3.5:9b to fix the JSON...✓ AI fix complete — 98 chars (was 60, +38), 8 lines (was 2). Panel content went from broken JSON to fixed JSON with quotes around age, comma between "reading"/"hiking", and the array reformatted to one element per line.

🤖 AI Fix availability check no longer races

v0.1.7 used OllamaStatus::isAvailable() which returned a stale cached value because the constructor's async /api/tags fetch hadn't completed yet. v0.1.8 uses OllamaClient::isAvailable() which is synchronous (3-second QEventLoop + QTimer) and returns the actual current state.

Added

📊 "Show Diff" button in JSON Tools

Disabled until an AI Fix completes. Click it to open a side-by-side Compare tab showing the original (broken) JSON on the left and the AI-fixed JSON on the right. Built on the existing CompareWidget so colors + diff navigation work the same as the regular Compare plugin. Answers "what was changed?"

📋 Session log in every formatter panel

A new Session log strip below the Scintilla output panel records every action taken during the session with action name, before/after char counts, and a delta:

[14:22:31] Format: 60 → 86 chars (+26)         (teal)
[14:22:45] AI Fix (Ollama): 60 → 98 chars (+38)  [8 lines]   (teal)
[14:23:02] Minify: 98 → 60 chars (-38)         (amber)

Color-coded: teal for "added/fixed", amber for "shrunk/minified", gray for no-op. Capped at 50 entries, scrollable.

✅ "Show thinking" checkbox in JSON Tools and AI Assistant

Default OFF for both. Toggle ON to see the model's reasoning blocks (Qwen3 / DeepSeek-R1). For JSON Tools, leaving it OFF is recommended because thinking content breaks the JSON parser. For AI Assistant, ON is useful for Explain or Find Bugs actions where you want to see how the model reasoned.

💬 AI Assistant rewritten as a proper chat-bubble UI

You said "ai assistant ui should be proper chat with strip of line common — change the ui for that". Here it is:

  • User prompts → right-aligned blue bubbles with YOU header
  • Assistant responses → left-aligned gray bubbles with the model name as header (qwen3.5:9b) and a teal left border
  • Streaming tokens flow into the active assistant bubble in real time
  • Clear chat button to wipe history
  • Show thinking toggle in the same row
  • Auto-scroll to bottom on new tokens
  • Errors render as red error bubbles
  • Multi-turn chat — bubbles persist across multiple sends so you can have a real conversation

🧪 test_aifix.cpp — new end-to-end test

Hits a real local Ollama daemon, runs the EXACT same cleanup pipeline the JSON Tools button triggers, and verifies the result is valid JSON. Skipped (exit 0) if Ollama isn't running so CI stays green on runners without it.

🛠 scripts/bump_version.sh — table-aware

The version-history table insertion now requires a | Version | Date | Highlights | header match before inserting into the next |---|---|---| separator, so it can no longer accidentally clobber the keyboard shortcuts table (which is also 3 columns wide).

Verifying this release

Same as previous releases:

  • SHA-256 checksums in SHA256SUMS
  • Cosign keyless signatures (Sigstore + Rekor transparency log)
  • SLSA build provenance attestations cryptographically linking each binary to this commit

See SECURITY.md for verification one-liners.

Downloads

Platform Asset Notes
🐧 Linux x64 notepatra-linux-x64.tar.gz Bare binary
🍎 macOS Apple Silicon notepatra-macos-arm64.dmg Drag to Applications
🪟 Windows x64 (installer) notepatra-setup-0.1.8.exe Registers in Installed apps
🪟 Windows x64 (portable) notepatra-windows-x64.zip Unzip and run, no registry
All SHA256SUMS Verify checksums

Full changelog: https://github.com/singhpratech/notepatra/blob/main/CHANGELOG.md