lukaszlenart opened a new issue, #117:
URL: https://github.com/apache/struts-intellij-plugin/issues/117

   ## Context
   
   The struts.xml **Diagram** tab is a custom Swing panel 
(`Struts2DiagramComponent`) hosted by `PerspectiveFileEditor`. The model layer 
(`StrutsConfigDiagramModel`, nodes/edges) and presentation helpers were 
intentionally kept toolkit-neutral so rendering can move to the platform 
Diagrams API later.
   
   Related UX follow-ups on the current host (#96 merged multi-file, #98 
selection sync, #99 Structure tool window, #100 zoom/pan) would largely come 
“for free” (or be simpler) on the IDE diagram chrome.
   
   ## Proposal
   
   Replace only the `diagram.ui` and `diagram.fileEditor` packages with a 
`com.intellij.diagram.Provider` (or current Diagrams API equivalent) that:
   
   1. Consumes the snapshot from `StrutsConfigDiagramModel.build()`
   2. Reuses `StrutsDiagramPresentation` for tooltips and navigation
   3. Depends on `com.intellij.diagram` (Ultimate Diagrams; optional or bundled 
as appropriate for this plugin)
   
   Keep DOM traversal and the toolkit-neutral model unchanged.
   
   ## Non-goals (for this issue)
   
   - Fixing the blank Diagram tab on 262 via lifecycle/sizing of the current 
Swing host (tracked separately in design 
`docs/superpowers/specs/2026-07-25-diagram-blank-262-design.md`)
   - Rewriting model building or Struts DOM converters
   
   ## Acceptance criteria
   
   - [ ] Diagram for file-set `struts.xml` is provided via Diagrams API (editor 
and/or Show Diagram entry as designed)
   - [ ] Packages, actions, results, and edges match current model semantics 
(including chain/redirect action→action edges)
   - [ ] Tooltips and double-click / navigate-to-XML still work via existing 
presentation helpers
   - [ ] Auto-refresh on DOM changes (or equivalent Diagrams refresh) while the 
diagram is visible
   - [ ] Plugin declares the correct `com.intellij.diagram` dependency; builds 
and tests against IU
   - [ ] Custom Swing diagram UI / `PerspectiveFileEditor` path removed or 
reduced to a thin adapter
   - [ ] Changelog documents the migration
   
   ## Risks / notes
   
   - Diagrams API is Ultimate-oriented and poorly documented publicly; expect 
learn-by-examples (e.g. JetBrains plugin implementations of 
`com.intellij.diagram.Provider`).
   - Prefer a dedicated design + plan before implementation; do not couple this 
migration to short-term blank-tab regression fixes.
   
   ## References
   
   - `com.intellij.struts2.diagram.model` package-info — migration boundary
   - `docs/superpowers/specs/2026-07-25-diagram-blank-262-design.md` — Future 
work section
   - Follow-ups that may simplify after migration: #96, #98, #99, #100


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to