-
-
Notifications
You must be signed in to change notification settings - Fork 180
Description
Description
During drafting, I often use abbreviations or temporary names for characters and places to avoid breaking writing flow (for example, referencing a housemaid as HM). Once the scene is complete, I later research and assign the final character name and update the corresponding tag.
In this workflow, renaming an existing tag that is already referenced elsewhere causes all existing references to silently break. The application then reports a missing reference and suggests rebuilding the index, which does not resolve the issue because the original tag name no longer exists.
This makes iterative drafting and later refinement risky, as there is no warning, no automatic update, and no reliable way to detect or repair orphaned references created by renaming tags.
What the bug is
When a tag defined using @tag: is renamed after it has already been referenced elsewhere (for example via @char: in scene files), all existing references to the old tag name become invalid.
Clicking the broken reference shows an error dialog stating that the reference cannot be found and suggests rebuilding the index (F9). However, rebuilding the index does not resolve the issue because the original tag name no longer exists.
This results in orphaned references with no in-app way to detect, repair, or update them, and the recovery guidance provided by the error dialog is ineffective in this scenario.
Steps to reproduce
- Create a Character note under a Character root folder.
- Inside the character note, define a tag, for example:
@tag:HM
- In a scene file, reference the character using:
@char:HM
- Later, rename the tag in the character note to a final name, for example:
@tag:Sushila Devi
- Return to the scene and click the existing reference
@char:HM.
Rebuild the index using Tools → Rebuild Index or by pressing F9.
Expected behaviour
One of the following (or similar) would be expected:
- Existing references update automatically when a tag is renamed, or
- A warning is shown when renaming a tag that is already referenced, or
- Orphaned references are detectable and repairable, or
- The error dialog does not suggest index rebuilding when the underlying issue is a renamed or missing tag
- At minimum, the application should not imply that rebuilding the index will fix the problem when it cannot.
Actual behaviour
- Clicking the reference opens an error dialog.
- Rebuilding the index (F9) does not resolve the issue.
- The reference remains broken because the original tag name no longer exists.
- The only workaround is manually searching for and updating all references.
Error dialog message
Could not find the reference for tag 'HM'. It either doesn't exist, or the index is out of date.
The index can be updated from the Tools menu, or by pressing F9.
Possible improvement / design suggestion (inspired by Footnotes)
A potential way to avoid this class of breakage could be to internally reference tags by a unique key rather than the visible tag name, similar to how footnotes work.
For example:
@tag[xyz123]:Character Name
Scene references would then bind to the unique key (xyz123) rather than the display name. Renaming the tag text would not break references, since the key remains unchanged.
This is conceptually similar to the existing Footnotes system, where:
- Keys are unique
- Display text can change
- References remain stable
Such an approach would support iterative drafting workflows where temporary names are later refined, without risking silent reference breakage.
Environment:
Operating system: Linux – Zorin OS 17.x
novelWriter version: 2.8.2
Installation method: AppImage