pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Add vertical scroll bar to "Articles" tab

Open TylerSagendorf opened this issue 1 year ago • 5 comments

When there are too many vignettes & articles in an R package, the display size may completely hide some of the options in the "Articles" tab drop-down menu. Issue visible here: https://motrpac.github.io/MotrpacRatTraining6moWATData/index.html. Suggest displaying only 10 options at once and including a scroll bar to view the rest.

TylerSagendorf avatar Jul 12 '24 15:07 TylerSagendorf

May be a simple fix with some CSS.

.dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
}

FWIW on my mobile device your long dropdown does have a scroll bar.

jayhesselberth avatar Jul 12 '24 22:07 jayhesselberth

It's a a little hard to test these changes with the pkgdown website. Could you install this branch and rebuild your site locally?

pak::pak("r-lib/pkgdown@issue-2712")

jayhesselberth avatar Jul 12 '24 22:07 jayhesselberth

IMO this already looks ok, and the real solution is to add some hierarchy to your articles.

hadley avatar Jul 13 '24 19:07 hadley

It's a a little hard to test these changes with the pkgdown website. Could you install this branch and rebuild your site locally?

pak::pak("r-lib/pkgdown@issue-2712")

It doesn't seem to have added a scroll bar. Was the .dropdown-menu class used for the articles dropdown? It seems like it was only defined.

TylerSagendorf avatar Jul 15 '24 19:07 TylerSagendorf

IMO this already looks ok, and the real solution is to add some hierarchy to your articles.

Hierarchy = combining related articles? In hindsight, it probably would have been better to organize the articles by manuscript figure. Unfortunately, with the manuscript being published, I do not currently have the time or resources to spend on making major changes to the package (especially since no one else appears to be using it...). I will at least ensure that future R packages like it will not repeat the same mistakes.

TylerSagendorf avatar Jul 15 '24 19:07 TylerSagendorf