Hi devs (and everyone),
This is a discussion about what design choice to make to try to solve Loading....
In short, when there’s a wanted link that doesn’t follow the page naming strategy, clicking on the ?
link to create the page fails (rightly so) since the reference doesn’t validate.
Let me list a few options I can think of, to kickstart the discussion about how we should handle this. Some of the options below are orthogonal (and thus not mutually exclusive).
Option 1: Just improve the message
We consider that the current behavior is valid, because:
- The Admin has configured the wiki to not allow some page names
- Someone is trying to create a link with a forbidden name through a wanted link
- Thus, when someone clicks the
?
link to create the wanted page, a dialog box opens and explains that the target reference doesn’t validate and that the page needs to be edited to modify the link reference to match the strategy in place.
Notes:
- We should improve the error message to indicate the rules that page names must conform with since right now, a user might not know them and would need to know them in order to change the wanted link reference.
- If the user creating the wanted page doesn’t have edit rights on the source page, he/she will need to ask someone with edit rights to perform the reference change.
Option 2: Refactoring operation
Add an optional refactoring operation when the validation fails (whether it’s called in the context of a wanted link or not, both use cases exist). The refactoring operation would modify the link reference in the source page.
There are 3 cons with this strategy IMO:
- The current user needs to have edit rights on the source page
- It’s costly
- If the page naming strategy is for example a UUID strategy (references are replaced by a UUID), then the user creating the original link reference would need to generate UUIDs to create valid references to avoid future refactoring operations and that’s not great, or put some random reference since it’ll get replaced (which is also not great)
Option 3: Display invalid wanted links differently
The idea is to modify the rendering of wanted links when they point to a reference that doesn’t pass validation, i.e. instead of displaying a question mark link (?
), display the broken link differently, with some red ?
for example, that is not clickable and with a text explaining why it’s not clickable.
One cons is that it could make page rendering slower, although I don’t think that would be the case if the page strategy implementation is fast. There could also be caches to work around the performance issue if any.
Option 4: Modify the WYSIWYG link dialog
The idea is to modify the WYSIWYG link dialog so that any link reference entered goes through the page name strategy to normalize it (as we do when creating a new page in the Create Page dialog).
Note that there’s one con but we could maybe live with it:
- We wouldn’t be able to create 2 wanted links pointing to the same reference (the issue is only when using page naming strategy that has randomness in it, like the UUID one).
Option 5: Add the concept of validation to the wiki editor
I’m listing it to be complete but I don’t feel it’s a good option. The idea is that upon clicking “Save” in the wiki editor, validate the content so that if there’s some link reference not matching the page naming strategy, the page is not saved.
Cons:
- Hard to parse since generating the XDOM would mean executing macros to be fully correct
- Not great to fail to save a page when in the wiki editor, as user would expect to be able to enter anything they want in text mode.
An alternative to this one is the wiki editor would recognize when typing a link reference and perform validation but that’s too hard to implement IMO since it would need to work with any markup.
My opinion
+1 for option 1 (for the improved message part)
-1 for option 2
+1 for option 3 (IMO we need it to solve the issue with the wiki editor use case - that a user can enter any link reference they want using the wiki editor)
+1 for option 4
-1 for option 5
And we don’t support the ability to create 2 wanted links pointing to the same reference when using a page naming strategy with randomness in it.
IMO the best would be to implement the following options: 3, 4
The second best is to implement 1 and 3.
WDYT? Do you see any other option that I have missed?
Thanks