Show Variables Overridden From Higher-Level Keyscopes
Posted: Sun Jul 24, 2022 5:08 pm
In the OASIS DITA 1.3 specification, a variable definition in a parent keyscope always overrides a definition in a lower-level keyscope.
Consider the following scenario, where I have three books and I want to define "Product" differently in each book via keyscope, but I forget to apply a keyscope to book C:
Because bookC.ditamap is accidentally in the top-level keyscope, the "Product C" definition wins and is pushed into Book A and Book B too. But the DITA Maps Manager shows the local (not used!) definitions in Book A and Book B, resulting in writer confusion.
Keyscope behaviors are confusing, especially for nontechnical users. To help writers understand what is happening, the DITA Maps Manager could apply strikethrough to lower-level variable definitions that are overridden by a higher-level definition (red is used only to show additions):
In addition, the existing tooltip could be extended to indicate where the overriding definition comes from.
This enhancement would be useful both to verify expected overriding behaviors, and to catch/debug unexpected overriding behaviors.
A testcase is included:
Also, note that in the DITA Maps Manager, the bookA.ditamap title shows the overridden value ("Book for ProductC"), but the topicA.dita title does not ("My Topic for ProductA"). This is an inconsistency with the published output that adds further confusion to debugging. A separate bug issue should probably be filed for this.
Although this scenario is simple, we encountered this issue in a WebHelp map that included included 50+ books, each included via submap with keyscopes, grouped into topicgroups, with some top-level support topics that also define their own keys. Our book keys were being overridden from a submap that was accidentally not keyscoped, but it was difficult for us to debug the source of the issue.
Consider the following scenario, where I have three books and I want to define "Product" differently in each book via keyscope, but I forget to apply a keyscope to book C:
Because bookC.ditamap is accidentally in the top-level keyscope, the "Product C" definition wins and is pushed into Book A and Book B too. But the DITA Maps Manager shows the local (not used!) definitions in Book A and Book B, resulting in writer confusion.
Keyscope behaviors are confusing, especially for nontechnical users. To help writers understand what is happening, the DITA Maps Manager could apply strikethrough to lower-level variable definitions that are overridden by a higher-level definition (red is used only to show additions):
In addition, the existing tooltip could be extended to indicate where the overriding definition comes from.
This enhancement would be useful both to verify expected overriding behaviors, and to catch/debug unexpected overriding behaviors.
A testcase is included:
Also, note that in the DITA Maps Manager, the bookA.ditamap title shows the overridden value ("Book for ProductC"), but the topicA.dita title does not ("My Topic for ProductA"). This is an inconsistency with the published output that adds further confusion to debugging. A separate bug issue should probably be filed for this.
Although this scenario is simple, we encountered this issue in a WebHelp map that included included 50+ books, each included via submap with keyscopes, grouped into topicgroups, with some top-level support topics that also define their own keys. Our book keys were being overridden from a submap that was accidentally not keyscoped, but it was difficult for us to debug the source of the issue.