# TikZRefinery TikZRefinery is a Stevens Senior Design project developing a desktop editor for graphically refining TikZ diagrams while preserving editable TikZ source. It aims to make precise layout changes easier, including corrections to diagrams that begin as AI-generated code. The project uses C++17 and Qt Widgets. ## Current capabilities The Alpha supports a conservative subset of explicit-coordinate TikZ: - Display rectangles, straight lines and default arrows in centimetres. - Load rectangle presentation, selection, movement and resizing from a separate native shape plugin through the Qt Core SDK. - Move supported shapes and resize rectangles using corner handles. - Flip rectangles when corners cross, retain thin minimum dimensions, and stop edits at the furthest valid position inside a declared editing boundary. - Collapse/reopen a Shapes/Files sidebar, retain its page/width during the session, inspect rectangle-provider status and open files through the existing unsaved-work guard. - Fit the canvas to its pane, preview gestures, cancel edits, and save/reopen source while preserving unrelated bytes and checking observed external changes. Session undo/redo restores exact source for completed moves/resizes; Save retains history and successful Open clears it. History has no automatic eviction yet. Broader TikZ syntax, label and endpoint editing, provider management, manual zoom controls, and integrated LaTeX compilation/PDF viewing remain unfinished. Existing test evidence covers the bounded subset; it does not establish full product acceptance. See [the code overview](code/README.md) for details. ## Build and run Use the matching Qt 6/MinGW kit, CMake and Ninja described in [code/README.md](code/README.md). That guide provides the verified Windows setup, build/test commands, startup examples and portable package procedure. For an already configured environment, from the repository root: ```powershell cmake --build code/build --parallel 4 ctest --test-dir code/build --output-on-failure ``` The development executable needs the Qt/compiler runtime environment. A deployed Windows package includes those dependencies; keep its executable with its runtime files. Preserve user-edited examples when refreshing a package. ## Repository structure ```text TikZRefinery/ |-- README.md Project introduction and getting started |-- CHANGELOG.md Notable changes by version |-- AGENTS.md Instructions for AI-assisted work |-- HANDOFF.md Current unfinished-work checkpoint |-- documents/ | |-- TikZRefinery.pdf Submission edition of the architectural report | |-- TikZRefinery-Developers-Edition.pdf | |-- latex/ Authoritative report sources | |-- assets/ Editable diagrams and retained evidence | `-- template/ Original course materials `-- code/ |-- src/ Application source |-- tests/ Automated checks and evidence |-- examples/ Supported TikZ samples `-- resources/ Application resources ``` ## Architecture and documentation - [Changelog](CHANGELOG.md), distinguishing delivered behavior from planned design - [Submission report](documents/TikZRefinery.pdf) - [Developer's edition](documents/TikZRefinery-Developers-Edition.pdf), including the internal AI directives, operating guide and assistance log - [Coding conventions](code/CODING_GUIDE.md) The authored TeX and editable TikZ diagrams are the documentation sources. [Diagram index](documents/DIAGRAM_INDEX.md) locates every active figure, source, reviewed status and page in both report editions. After its contents, the report provides generated Lists of Tables and Figures with linked page locations. Builds refresh the index from the [manifest](documents/diagram-manifest.json) and final LaTeX records using standard-library Python. Classify new figures in the manifest. Broader design changes still require whole-document review. Build both report editions using the existing shared TinyTeX installation: ```powershell ./documents/build-report.ps1 ``` The script completes the bibliography/index sequence and writes PDFs, a versioned submission ZIP and build results under `work/`. After a material report change, check diagnostics, layout and navigation before replacing the published PDFs. Version policy and revision history are maintained in [Document History](documents/latex/tkrDocumentHistory.tex); the application build reads its architectural baseline from the report metadata. Feature-based numbering and the frozen-package exception are controlled in Document History; rectangle extraction is implemented in `code/packages/0.1.2-alpha/`; the frozen 0.10.3 demonstration package is preserved. The [reviewed plugin contract](documents/latex/tkrPluginDesign.tex) separates the current rectangle extraction and later palette/creation and update features. Its requirements, UML views and planned checks are linked from the report. The [sidebar and creation design](documents/latex/tkrSidebarDesign.tex) now includes an implemented shell in `code/packages/0.1.3-alpha/`. Creation is disabled and folder browsing is a placeholder; catalogue/creation and shared service ownership remain planned. Seven suites pass in Debug and Release. [Shell evidence](code/tests/evidence/sidebar-shell-2026-11-23/README.md) records the scope and native review. Earlier packages remain unchanged; Qt standard icons are used. Demo materials remain local under `documents/slides/demo3/`. The report and application now share **0.1.4-alpha**, implementing bounded session undo/redo for completed coordinate edits. Generic transactions remain planned. Demo 3 now presents **0.1.4-alpha**, with the live showcase immediately after progress. Earlier slides/reports remain preserved. Submit the slide PDF for Demo 3 and the canonical submission report for Milestone 3; neither has been uploaded by the agent. The complete Document History is now Appendix A, linked from its distinct front-matter version page. ## Working on the project For the frozen 0.1.4-alpha input to the separate DevOps demonstration, see [snapshot and build guidance](DEVOPS_SNAPSHOT.md). Its source checkpoint does not relabel the preserved packages or establish a cloud-build result. AI agents start with [AGENTS.md](AGENTS.md). For continuation of unfinished work, consult [HANDOFF.md](HANDOFF.md) and verify it against current sources and Git state. One chat may cover design, implementation and review across several work items; starting another chat is optional. The handoff is a dated checkpoint, while requirements and architectural decisions remain in the report. ## License No project-wide license has been selected. Original project work remains under the applicable default copyright rules. Third-party and course-provided materials retain their own terms and notices.