Add shared source-preserving DirectBinding inspector
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Shared Model and binding-target discovery
|
||||
|
||||
This is the first stage-4 implementation slice: a read-only binding browser shared by standalone and IntelliJ. Binding declaration edits, Converter selection, generated metadata and the complete inspector remain subsequent work.
|
||||
This is the first stage-4 implementation slice: a read-only binding browser shared by standalone and IntelliJ. The [DirectBinding inspector](direct-binding-inspector.md) now uses discovered targets to start editable declarations. Converter discovery, generated metadata and the complete inspector remain subsequent work.
|
||||
|
||||
## Use
|
||||
|
||||
Build and Refresh a fixture, expand **Bindings — discovery** below the designer, and select **Discover bindings**. Select a Model path and direction (`view`, `model`, `both`); compatible targets appear first, followed by unresolved targets and mismatches with explanations. Discovery leaves the authoritative FXML and undo history untouched. Errors leave source editing available.
|
||||
Build and Refresh a fixture, expand **Bindings**, open **Discover targets**, and select **Discover bindings**. Select a Model path and direction (`view`, `model`, `both`); compatible targets appear first, followed by unresolved targets and mismatches with explanations. Discovery leaves the authoritative FXML and undo history untouched. Errors leave source editing available.
|
||||
|
||||
The document explicitly declares its Model in `<?neitzel-model fixture.model.Person?>`. A missing declaration prompts for it; an example Model is not silently substituted. Fixtures now declare Person for Person/Full Views and Address for their Component resources.
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Shared DirectBinding inspector
|
||||
|
||||
The first editable stage-4 slice runs in the shared Kit UI in standalone and IntelliJ. Open **Bindings → Direct bindings**, select a declaration or choose **New binding**, then **Apply binding** or **Remove binding**. Fields cover control fx:id, property, Model path, direction and optional Converter class. **Discover targets → Use selected target** prepares a new form from discovery without changing source until Apply. Selecting a declaration selects its target on the canvas; selecting a bound control selects its declaration.
|
||||
|
||||
## Source and history contract
|
||||
|
||||
Each create, change, remove or explicit replacement becomes one revision-checked host document command. Normal host Undo/Redo restores the exact prior/new source. Saving uses the authoritative document. The form refuses stale source and read-only documents; a source change resets its active selection so a previous range cannot be reused accidentally.
|
||||
|
||||
A secure DOM identifies declarations; a lexical range index edits only the relevant source spans. Existing quote styles, imports, Model processing instructions, comments, unrelated whitespace and unfamiliar declarations remain intact. New declarations use fully qualified names, avoiding import changes. Missing root fx:define/BindingList containers and namespace declarations are added as needed, including self-closing containers and alternate FXML prefixes. Explicit BindingList elements wrappers are supported. Removing a binding leaves its surrounding comments and whitespace.
|
||||
|
||||
Existing DirectBindings written with attributes are editable. Declarations using nested property elements remain visible and can be explicitly removed, but must be changed in Source. This does not flatten or guess unsupported syntax. Short class names require the library import; conflicting explicit imports are not treated as library declarations.
|
||||
|
||||
A target occupied by another DirectBinding or ComputedBinding requires **Replace conflicting bindings**. Replacement removes those conflicting declarations and adds/changes the chosen binding in one undo command. ComputedBinding authoring is not included.
|
||||
|
||||
## Validation boundary
|
||||
|
||||
Structural diagnostics cover duplicate targets, missing/ambiguous fx:id, empty property, malformed/missing Model path and invalid direction. These known errors block a new canvas/interactive preview request while allowing save and source repair. Type compatibility remains the separate discovery result; the editor does not yet prove path existence, Converter compatibility or runtime property availability. A syntactically valid but incompatible declaration can therefore still fail in the target runtime.
|
||||
|
||||
Converter names are preserved/editable text, not a discovered or verified Converter chooser. Generated/custom ViewModel metadata, Computed/Repeat/Table authoring, complete semantic diagnostics and identifier rename/copy/subtree-delete reference repair remain later stage-4 work.
|
||||
|
||||
## Automated qualification
|
||||
|
||||
Lexical unit checks cover creation of containers/namespaces, attribute-only changes and escaping, unknown content/comment preservation, paired-tag removal, duplicate replacement, explicit elements wrappers, unsupported nested syntax and secure parsing.
|
||||
|
||||
The same live shared-UI scenario runs in standalone and the registered IntelliJ editor against classpath and module-path fixtures. It creates, changes, removes and explicitly replaces bindings; checks exact source after one Undo/Redo per operation; saves; loads the edited document through the real target runtime; and saves an invalid path while checking that preview is blocked. Existing projection, sizing, discovery, session and shutdown checks remain enabled. No human test is required for this slice. Previously skipped manual checks remain skipped, not retroactively passed.
|
||||
|
||||
Run the normal `scripts/check-bootstrap.py` gate and `scripts/check-ide-host.py` with the pinned host/target JDKs and IntelliJ installation described in the README. Qualification on 2026-11-13 passed: 75 Maven tests, 7 IntelliJ adapter tests, 34 target processes with 424 assertions, 48 worker lifecycle cycles, connected workflows and live shared UI in standalone and registered IntelliJ for classpath and module-path applications. Native isolation and worker shutdown passed with no new crash report. The live run also caught and fixed a canvas/list selection feedback loop; final logs contain no uncaught selection errors. The IDE companion checks use public UI and XML assertions across its separate plugin class loader. Local evidence: `/tmp/direct-binding-bootstrap.log` and `/tmp/direct-binding-registered-ide.log`.
|
||||
@@ -104,4 +104,4 @@ Manual review disposition (2026-11-13): the user accepted proceeding after the r
|
||||
|
||||
## Shared discovery: first stage-4 slice
|
||||
|
||||
Implemented the [read-only binding browser](binding-discovery.md) in the shared Kit UI: target-side Person Attribute/path and collection-element discovery, Component Model declarations and direction-aware binding-target compatibility. Real classpath and module-path fixtures qualify both hosts. Binding creation/editing and the remaining metadata categories retain their subsequent work packages.
|
||||
Implemented the [read-only binding browser](binding-discovery.md) in the shared Kit UI: target-side Person Attribute/path and collection-element discovery, Component Model declarations and direction-aware binding-target compatibility. Real classpath and module-path fixtures qualify both hosts. The [first editable DirectBinding inspector](direct-binding-inspector.md) adds creation, changing, removal and explicit conflict replacement through one source-preserving host undo command per operation. Remaining metadata categories and broader binding authoring retain their subsequent work packages.
|
||||
|
||||
Reference in New Issue
Block a user