Skip to content

v0.1.102: diagram tool — flow/ER/system from a text DSL, AI-assisted - #14

Merged
singhpratech merged 1 commit into
mainfrom
feature/diagram-tool
May 26, 2026
Merged

singhpratech merged 1 commit into
mainfrom
feature/diagram-tool

Conversation

@singhpratech

Copy link
Copy Markdown
Owner

New first-class diagram tool (Full flavor): the .npd text DSL is the source of truth, the canvas is a live projection. Create via AI Generate (describe → review → insert), Flow/ER/System templates, or by writing .npd; Import Mermaid too. Toolbar button next to Noter + in-tool Help.

Also fixes a latent CMAKE_AUTORCC gap — .qrc resources (vega inline charts, icons, the diagram layer) now actually bundle in Full builds.

Verification (local)

  • Lite: 48/48 ctest, 0 WebEngine deps, boots clean
  • Full: 50/50 ctest, diagram renders 10/10 (offscreen WebEngine export), boots clean
  • stale-text-check green; bare-binary stat updated 9.7 → ~11.5 MB (diagram authoring UI lands in Lite too)

This PR exists to get the cross-platform Full build (macOS/Windows) green before merge — that's the path I can't verify locally.

🤖 Generated with Claude Code

… browser-native export

A new first-class diagramming surface (Full flavor): the .npd text DSL is the
source of truth and the canvas is a live projection of it. Create via AI Generate
(describe it in English -> review the generated .npd -> Insert), Flow/ER/System
templates, or by writing .npd directly; Import Mermaid too. Opens from a toolbar
button next to Noter, with an in-tool Help cheat-sheet.

Added
-----
* src/diagram/{npd_parser,mermaid_import,diagram_view,diagram_editor,diagram_ai_dialog}.{h,cpp} — pure .npd parser + Mermaid translator, WebEngine canvas host (+ Lite stub), split editor tab, AI generate dialog with review-before-insert
* resources/diagram/ — dagre auto-layout render layer + diagram.html + 12 icons (qrc-bundled, Full)
* src/mainwindow.cpp, src/tool_colors.cpp — Diagram toolbar button (next to Noter), indigo accent, painted flowchart glyph
* npd_render.cpp — offscreen .npd -> image CLI; samples/diagram_showcase.npd
* test_npd_parser (61) / test_mermaid_import (25) / test_diagram_view (10)

Fixed
-----
* CMakeLists.txt — set(CMAKE_AUTORCC ON); .qrc files in target sources (vega.qrc inline charts, icons.qrc, diagram.qrc) now actually compile into the binary

Docs
----
* docs/docs.html, docs/index.html, README.md — detailed diagram docs, prominent feature card + flagship v0.1.102 version card; bare-binary stat 9.7 MB -> ~11.5 MB (the diagram authoring UI lands in Lite too; only the WebEngine renderer is Full-only)
* scripts/stale-text-check.sh — pattern-based historical-row exclusion (replaces a hardcoded line range that drifted when the v0.1.102 row landed)

Lite 48/48 + Full 50/50 ctest, both flavors boot clean, diagram renders 10/10.
Stale-text-check clean across every surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@singhpratech
singhpratech merged commit 84f4028 into main May 26, 2026
7 checks passed
@singhpratech
singhpratech deleted the feature/diagram-tool branch May 26, 2026 05:29
singhpratech pushed a commit that referenced this pull request Jun 7, 2026
…-noter-segfault)

The v0.1.113 Noter A-grade test additions drive static/constructed QMessageBox
modals that SIGSEGV inside Qt's "offscreen" QPA plugin on Windows — confirmed
by CI run 27084261134: test_notes_panels #13 at the static QMessageBox::warning
(notes.cpp:3517, backend-down) and test_notes_panel_widget #14 §22b at the
static QMessageBox::information (notes.cpp:3676, switched-note), the latter on a
stack with zero network/teardown state — so it is the static helper's own modal
loop the offscreen plugin chokes on, not a UAF. By Qt internals QMessageBox::
warning/information() themselves build a stack QMessageBox and exec() it, so the
constructed-instance form is the same crash class; the real fault line is
QMessageBox(any) vs plain QDialog::exec() (the §22 NoterSweepDialog passes).

Both tests pass on Linux Debug, Debug+ASan (no memory error) AND Release — the
crash is exclusive to QT_QPA_PLATFORM=offscreen on Windows, a CI-harness-only
configuration. The SHIPPED binary uses the real Windows platform plugin where
these confirmations render fine (used throughout Notepatra, shipped for many
releases) — so this is never a user crash; the binary is unchanged.

Add winOffscreenModalUnsafe() (Q_OS_WIN && platformName()=="offscreen") and gate
every QMessageBox modal DRIVE behind it with a loud [SKIP] (never silent): #13
backend-down, and §22b/§29/§29b/§50/§54/§57 in the widget test. The refusal /
confirm BEHAVIOURS are platform-independent logic and stay fully covered on
Linux Debug/ASan/Release. Guards are no-ops off Windows — full local suite still
54/54 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
singhpratech pushed a commit that referenced this pull request Jun 7, 2026
…ter-segfault follow-up)

With the QMessageBox segfault guards in place, test_notes_panel_widget runs past
§22b on Windows for the first time — exposing 3 sections (§27 failed-save hint,
§28b unreadable-file state, §36 failed-rename) that INDUCE a failure via
QFile::setPermissions() read-only. Windows ignores the read-only attribute on
directories and an admin owner (the CI runner) bypasses file ACLs, so the
save/read/rename SUCCEEDS and the failure-handling assertions become vacuous —
all 12 of these EXPECTs failed on the PR #20 Windows run (the segfaults
themselves are now GONE: #13 passes, #14 ran to completion).

These never ran on Windows before (the binary crashed at §22b), so this is a
latent POSIX-only test limitation, not a product or regression bug — on Windows
the save genuinely succeeds and the product correctly shows "auto-saved".

Add winReadOnlyUnenforced() (Q_OS_WIN) and gate the injection behind it with a
loud [SKIP]: §27 (whole), §28 part (b) only (the missing-file case (a) still
runs on Windows), §36 (whole). The failure-handling BEHAVIOURS stay fully
covered on Linux Debug/ASan/Release. Guards are no-ops off Windows — full local
suite still 54/54 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant