AI Code Report - 2025-09-21 19:10:31 UTC
Summary
Reworked the RDF export plugin’s CSV path wiring to patch
DiagramFormatPanel.addOptionsso the field lives alongside existing diagram option toggles.Enhanced the CSV path input to register localized resources, avoid duplicate insertion, and synchronize with the graph model via format panel lifecycle hooks.
Regenerated the published
rdfexport.jsbundle from the TypeScript source and refreshed the Bun-based integration test suite to cover the new hook and DOM contract.
Implementation Details
CSV Path Format Panel Hook
Switched the plugin bootstrap from
addDocumentPropertiestoaddOptions, matching the placement of connection arrows, points, and guides in the UI.Added localized label registration (
mxResources.parse/get) with graceful fallbacks and stored a per-container guard to prevent duplicate widgets on re-init.Styled the field container to align with Format panel spacing, including gap, padding, and width adjustments for better alignment with draw.io controls.
Normalized user input with trimming, null-empty coercion, and synchronized updates when the graph model mutates elsewhere.
Event Lifecycle & Cleanup
Reused the format panel’s
listenerscollection to register a removal hook that detaches the model listener during teardown.Preserved existing begin/end update semantics when mutating the graph to respect batched transactions.
Testing & Tooling
Rebuilt
src/main/webapp/plugins/rdfexport.jswithbun buildto ensure runtime parity with the TypeScript changes.Updated the Bun test harness to:
Stub
DiagramFormatPanel.addOptionsand mxResources parsing.Assert the generated bundle references
addOptions, the CSV field marker attribute, and the container guard.Exercise the DOM stub through the new hook to verify persistence, trimming, external model updates, and listener teardown.
Ran
bun installinside the plugin workspace to restore dependencies and executed the targeted Bun test suite.
Testing
bun install(withinsrc/main/webapp/plugins/rdfexport).bun test tests/rdfexport.test.ts.