...which describes a bug in deleting a single mention surface (a runtime exception was thrown, therefore the subsequent code for removing the visual representation of the surface from the UI was not executed). Also, some improvements of the UI's representation of the selected items inside the popup menus was made (see below).
381
The error was quite simple: In EntityTreeModel's entityEvent() method, incoming entity events are matched and executed. In case of a Remove event for a single mention surface (of a composite mention), the existing code tried to handle the event's targets as full entity nodes. There was a null-check, but one line accessing the CATreeNode reference (which is null in case of a single surface) was just outside the respective conditional:
The functionality of this line doesn't depend on the line before. So moving it into the conditional was a safe operation. Deleting a single mention surface now works as expected.
Further improvements in the context of the above bug
As mentioned in the comments to #381, the labeling of mentions, surfaces and entities that are (or aren't) target of an in-text operation via the right-click popup menu were a little misleading. I tried to improve this situation by making the following changes:
disable the purely decorative menu item used as a heading in the sub-menu for a specific mention
expand the textual representation of the mentions inside the popup menu (see below)
As these "cosmetical" improvements don't play a direct role in the bug mentioned in #381, I am very happy to remove them from this PR if they're not wanted (it is possible that I misunderstood those labels 🙄).
This PR (mainly) fixes #381
...which describes a bug in deleting a single mention surface (a runtime exception was thrown, therefore the subsequent code for removing the visual representation of the surface from the UI was not executed). Also, some improvements of the UI's representation of the selected items inside the popup menus was made (see below).
381
The error was quite simple: In
EntityTreeModel
'sentityEvent()
method, incoming entity events are matched and executed. In case of aRemove
event for a single mention surface (of a composite mention), the existing code tried to handle the event's targets as full entity nodes. There was anull
-check, but one line accessing theCATreeNode
reference (which isnull
in case of a single surface) was just outside the respective conditional:The functionality of this line doesn't depend on the line before. So moving it into the conditional was a safe operation. Deleting a single mention surface now works as expected.
Further improvements in the context of the above bug
As mentioned in the comments to #381, the labeling of mentions, surfaces and entities that are (or aren't) target of an in-text operation via the right-click popup menu were a little misleading. I tried to improve this situation by making the following changes:
As these "cosmetical" improvements don't play a direct role in the bug mentioned in #381, I am very happy to remove them from this PR if they're not wanted (it is possible that I misunderstood those labels 🙄).
Preview of the changes