Skip to content

Allow adding help pages even if same sourceUrl#13503

Open
bricestacey wants to merge 1 commit into
mainfrom
12773/help-allow-same-source-url
Open

Allow adding help pages even if same sourceUrl#13503
bricestacey wants to merge 1 commit into
mainfrom
12773/help-allow-same-source-url

Conversation

@bricestacey
Copy link
Copy Markdown
Contributor

@bricestacey bricestacey commented May 12, 2026

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:

??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 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

  • N/A

Bug Fixes

  • R: Subsequent calls with ?? should now work

Validation Steps

Run two of the commands back to back with different packages:

??base
??cowsay

Other things to consider are whether history is preserved with the back arrows, etc.

@:help

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:help

readme  valid tags

@juliasilge
Copy link
Copy Markdown
Contributor

We should evaluate whether we are addressing #4484 here.

@jennybc
Copy link
Copy Markdown
Member

jennybc commented May 12, 2026

Will this fix #10286? I went down that hole and notice that #8087 was basically this exact same change and got closed without merging because it's problematic.

@bricestacey
Copy link
Copy Markdown
Contributor Author

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 [revision 1, revision 2, ...] and if you navigate back, you'll see the stale data. The video in #8087 toggles between two different help entries, but it should be reproducible using just the one.

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 sourceUrl is the same. That would avoid duplicates of the same HelpEntry on top of each other, but any stale HelpEntry deeper in the stack might still be there. They could be ignored, removed, or updated for completeness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants