Skip to content

feat: text annotations + polished templates#27

Merged
exitzerolabs-admin merged 7 commits into
mainfrom
feat/polish-templates
Mar 3, 2026
Merged

feat: text annotations + polished templates#27
exitzerolabs-admin merged 7 commits into
mainfrom
feat/polish-templates

Conversation

@exitzerolabs-admin

Copy link
Copy Markdown
Contributor

Summary

  • Text annotation element: New text element type for placing labels, callouts, and descriptions on the DFD canvas. Non-connectable, excluded from STRIDE analysis, with font size/weight controls.
  • Template revamp: Rewrote 3 existing templates and added 3 new ones (6 total) with proper component types, colored trust boundaries, pre-populated threats, and professional layouts.
  • Edge label rendering: Fixed edge labels to render above connectors with proper vertical layout spacing.

Key changes

  • New textAnnotation ReactFlow node type (borderless, no handles, inline edit)
  • font_size and font_weight optional fields on Element (backward-compatible)
  • "none" STRIDE category for annotation elements (skipped in analysis)
  • Text-specific properties panel, palette entry, and context menu behavior
  • AI prompts, MCP server, and all docs updated with text element support
  • 6 show-stopper-level templates with 12-13 elements each
  • 8 new frontend tests, 4 new Rust tests

Test plan

  • npx vitest --run — 416/416 pass
  • cargo test — 59/59 pass
  • cargo clippy -- -D warnings — clean
  • npx biome check . — clean
  • npx tsc --noEmit — clean
  • Manual: drag text from palette, edit inline, verify no connection handles
  • Manual: verify text element excluded from STRIDE analysis
  • Manual: right-click text node — no "View Threats" option
  • Manual: open each template, verify rendering

🤖 Generated with Claude Code

exitzerolabs-admin and others added 6 commits March 3, 2026 13:20
Completely rewrote and expanded template system from 3 basic templates to
6 professional, information-dense templates with proper component library
types, colored trust boundaries, and pre-populated STRIDE threats.

Templates: E-Commerce Platform, Cloud Microservices, Mobile Banking,
SaaS Platform, IoT Smart Building, Healthcare Data Platform.

Each template now includes 12-13 elements (proper shapes: hexagons,
database barrels, rectangles), 12-13 data flows with protocols and
auth indicators, 3 colored trust boundaries, and 5 STRIDE threats
with mitigations.

Updated empty state UI to 2x3 grid with per-template Lucide icons
and accent colors. Added Playwright screenshot script for visual
validation. Added screenshots/ to .gitignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Widen column gaps to ~400px across all 6 templates
- Trim all flow data arrays to 1 item for shorter edge labels
- Add explicit handle overrides on congested nodes (API Server,
  FHIR Gateway, API Gateway) to fan out connectors
- Fix mismatched element positions for IoT and Healthcare templates
- Adjust boundary sizes to match new node positions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add z-index to edge label renderer so labels appear above connector
  lines instead of behind them
- Change label layout from horizontal to vertical (flex-col), stacking
  flow number, protocol, and data on separate lines for better readability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Shift Col1 to x=180 so nodes clear the left sidebar
- Widen all multi-node boundaries from 220px to 280px (node names no
  longer clipped)
- Increase column gaps to 340-380px for better label clearance
- Add label_offset on 23 congested flows to prevent label overlap
- Cap total template width at ~1300px so fitView keeps readable zoom

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new "text" element type for placing annotation labels, callouts,
and descriptions directly on the DFD canvas. Text elements are
non-connectable and excluded from STRIDE analysis.

Implementation:
- New `textAnnotation` ReactFlow node type (borderless, no handles)
- `font_size` and `font_weight` fields on Element (Rust + TS)
- "text" ShapeCategory + "none" StrideCategory in component library
- STRIDE engine skips elements with "none" category (TS + Rust)
- Text-specific properties panel (hide irrelevant fields, add font controls)
- "Text" added to palette generic items
- Connection validation rejects text nodes as source/target
- Context menu hides "View Threats" for text annotations
- AI prompts and MCP server updated with "text" element type
- 8 new tests (component library, STRIDE engine, context menu, Rust)
- Docs updated with accurate component counts and text annotation refs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threat-forge Ready Ready Preview, Comment Mar 3, 2026 10:45pm

Request Review

Keep text element feature plan section that was added on this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@exitzerolabs-admin exitzerolabs-admin merged commit 904faca into main Mar 3, 2026
4 checks passed
@exitzerolabs-admin exitzerolabs-admin deleted the feat/polish-templates branch March 3, 2026 22:47
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