Add help button to the packages pane#13499
Conversation
|
E2E Tests 🚀 |
217950a to
1e6a6da
Compare
jennybc
left a comment
There was a problem hiding this comment.
With the caveat that I'm just reacting to the screenshot (I haven't test driven this), I think R folks expect to be taken to a package's help index, as opposed to the package-level help topic. I think this PR is going to the latter (?). Probably the clearest way to see what I mean is to do the equivalent move in RStudio.
You're correct. This uses the Positron help service, which most closely resembles the behavior for Option 1:
Option 2:
|
|
My guess is that opening the help index is a pretty high priority for R users. It turns out most of us Update: I just assumed I am agnostic whether to solve in this PR or a subsequent one. |
|
Somewhat related to #9062 |
107ef99 to
de7d3b4
Compare
I went ahead and did this, but it feels weird to me. Here is an example when I do
One bug I ran into was that we would ignore any new help pages if they had the same URL as the current page, so I fixed that in de7d3b4 |
|
Sorry I went along with something you said without checking it myself and ended up misleading you. If people want help for dplyr, they probably want this: |
Yes, there's no requirement that a package have such a help topic and many don't. Or have something so minimal as to be practically useless. |
de7d3b4 to
1d5a46a
Compare
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.
| } | ||
|
|
||
| .packages-list-item:hover .packages-list-item-help { | ||
| opacity: 0.85; |
There was a problem hiding this comment.
This reads a little light on my machine. Perhaps just make it fully opaque?
There was a problem hiding this comment.
I don't think we want fully opaque because we want a contrast in brightness and therefore emphasis, but you're right the existing opacity was a bit light. Here is at least a justification, but if you try it out I think you'll find it's fine.
Bumped idle opacity from 0.5 → 0.7. Why not fully opaque (softwarenerd's suggestion): WCAG 2.1 SC 1.4.11 requires only 3:1 contrast for non-text UI components. VS Code's default foreground/background contrast is comfortably above 7:1 across stock themes, so 0.7 stays well over the 3:1 floor while preserving the visual hierarchy that lets the package name remain the focal point of each row. Progressive reveal is preserved: idle 0.7 → row hover 0.85 → button hover 1.
| > | ||
| <svg fill='currentColor' height='11' viewBox='0 0 16 16' width='11'> | ||
| <path d='M2 2.5A.5.5 0 012.5 2H5c1.1 0 2.1.4 2.9 1.1.7-.7 1.8-1.1 2.9-1.1h2.5a.5.5 0 01.5.5v10a.5.5 0 01-.5.5H11c-1 0-1.9.4-2.5 1.1-.6-.7-1.5-1.1-2.5-1.1H2.5a.5.5 0 01-.5-.5v-10zM7.5 4.1C6.9 3.4 6 3 5 3H3v9h3c.7 0 1.4.2 2 .5.6-.3 1.2-.5 2-.5h2V3h-2c-1 0-1.9.4-2.5 1.1z' /> | ||
| </svg> |
There was a problem hiding this comment.
Perhaps this should be a codicon? @paul-dicristina can help with generating it.
There was a problem hiding this comment.
I just used the codicon, which already exists, but resized it.
Adds a help button on each row in the Packages pane (rendered only for attached packages) that opens the package's help topic in the Help pane via IPositronHelpService.showHelpTopic. Also bumps row horizontal padding to 12px and switches the row to border-box sizing so its padding sits inside react-window's assigned width, eliminating the horizontal scroll the row was producing. See #12773
`??name` does a fuzzy search across every installed package; what we actually want from the Packages-pane button is the package's help index. `help(package = "name", help_type = "html")` is the canonical entry point -- printing the result triggers ark's browseURL hook, which surfaces the index in the help pane. See #12773
Swap the inline SVG for the existing codicon-book glyph, and raise the idle opacity from 0.5 to 0.7 so the help button meets WCAG 1.4.11's 3:1 non-text contrast minimum across stock themes.
4d2f67a to
4215b6f
Compare
|
Rebased this so it now includes the new PositronList |

See #12773
This adds a help button next to each item in the packages pane. Currently, it only supports attached packages. In the case of the packages pane, these are items with a green dot next to them.
Release Notes
New Features
Bug Fixes
Validation Steps
First, you must attach a package to the runtime using your usual
import cowsayorlibrary(cowsay)You'll then need to refresh the packages list.
Finally, the button should appear.
@:help @:packages-pane