Allow adding help pages even if same sourceUrl#13503
Conversation
I assume this was added as a performance enhancement, but it introduces bugs with the Ark implementation of help. The search help pages are all served from the same URL. So if a user entered: ``` ??base ??cowsay ``` The help pane would open to the search results for `base` but not `cowsay`. The user can resolve this by manually navigating away from the page and re-executing `??cowsay` as the `sourceUrls` would never previously match between pages. This bug came out of #13499 but we chose a different implementation where this fix was no longer needed.
|
E2E Tests 🚀 |
|
We should evaluate whether we are addressing #4484 here. |
|
Removing this guard resolves two problems (the help pages with same sourceUrl, but different content) and the edit->view->repeat loop in #8087, but introduces at least one I didn't immediately notice: One problem with this solution is that these likely identical pages can now stack. So for the edit doc loop, you would then have a help history of This stale behavior is because the Help component keeps a list of HelpEntry item and each HelpEntry has its own WebViewOverlay. When navigating forward and backward, we simply replace which one is shown. It's kind of like switching tabs, and it's atypical for that to automatically cause the page to refresh automatically. This shortcoming of stale help pages not automatically refreshing is very minor. As described above, Help pages intentionally avoid refreshing. Also, editing help pages is a infrequent task performed by relatively few people compared to the much larger audience of readers. So I'd argue the stale state is acceptable. One solution to the new repeated entry issue I described is to replace instead of adding a new HelpEntry on the stack when the |
The help service will not add a new help page if it has the same URL. I assume this was added for performance or to handle potential edge cases (e.g. infinite reload), but it introduces bugs with the Ark implementation of help.
The search help pages (e.g. when running ??package from an R console) are all served from the same URL. So if a user entered:
The help pane would open to the search results for
basebut notcowsay. The user can resolve this by manually navigating away from the page and re-executing??cowsayas thesourceUrlswould never match between pages.This bug came out of #13499 but we chose a different implementation where this fix was no longer needed. I am not sure this is the best approach or if there are other considerations to be made, so I figured I'd open a PR separately. There is no associated ticket.
Release Notes
New Features
Bug Fixes
??should now workValidation Steps
Run two of the commands back to back with different packages:
Other things to consider are whether history is preserved with the back arrows, etc.
@:help