Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #2536 move location of admiraldiscovery link and re-add presentation archive link #2564

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

manciniedoardo
Copy link
Collaborator

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to the tidyverse style guide. Run styler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - See Unit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow the deprecation guidance?
  • Review the Cheat Sheet. Make any required updates to it by editing the file inst/cheatsheet/admiral_cheatsheet.pptx and re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.)
  • Update to all relevant roxygen headers and examples, including keywords and families. Refer to the categorization of functions to tag appropriate keyword/family.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Address any updates needed for vignettes and/or templates
  • Update NEWS.md under the header # admiral (development version) if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers). A Developer Notes section is available in NEWS.md for tracking developer-facing issues.
  • Build admiral site pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Address or fix all lintr warnings and errors - lintr::lint_package()
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@manciniedoardo
Copy link
Collaborator Author

manciniedoardo commented Nov 14, 2024

reviewers - this is what the website looks like. Any risk in using the emoji? I know we've had trouble in the past but not sure it extends to _pkgdown.yml.

image

@manciniedoardo
Copy link
Collaborator Author

If we like this, should we add to every extension package @bms63 ?

Copy link

github-actions bot commented Nov 14, 2024

Code Coverage

Package Line Rate Health
admiral 97%
Summary 97% (5064 / 5226)

@bms63
Copy link
Collaborator

bms63 commented Nov 14, 2024

What about just "Find my function"? Then it can be generic for other extension packages?

Can we give it a tooltip explaining where/what it is taking you to?

That nav bar is pretty busy now. Should we get rid of the bug button and the version history (not sure if that is going to be available)

@manciniedoardo
Copy link
Collaborator Author

My vote would be to keep the bug button and version history (for the latter, I think @cicdguy was going to help us with restoring it this month?). I can definitely update to Find my function and add a tooltip.

@manciniedoardo
Copy link
Collaborator Author

Possible tooltip text: "Click here to travel to our admiraldiscovery portal, where you can search for an ADaM variable or parameter and identify which functions from the {admiral} ecosystem helps you derive it." But how do you add one? The title option doesn;t do it for me...

@ddsjoberg
Copy link
Collaborator

FWIW I would suggest removing the bug button, because there is a link to "Report a bug" an inch from the bug icon

@manciniedoardo
Copy link
Collaborator Author

FWIW I would suggest removing the bug button, because there is a link to "Report a bug" an inch from the bug icon

hmm yes but only if you are on the front page

@bundfussr
Copy link
Collaborator

FWIW I would suggest removing the bug button, because there is a link to "Report a bug" an inch from the bug icon

hmm yes but only if you are on the front page

And the bug button doesn't require much space. Thus I would keep it.

@bms63
Copy link
Collaborator

bms63 commented Nov 15, 2024

Possible tooltip text: "Click here to travel to our admiraldiscovery portal, where you can search for an ADaM variable or parameter and identify which functions from the {admiral} ecosystem helps you derive it." But how do you add one? The title option doesn;t do it for me...

I don't know - Maybe post an issue on the pkgdown site asking for advice on tooltips for the navbar.

I still think the bug button should go!! As we have limited real estate at top and it is duplication since we link to github right next to it. But...I'm not very passionate about this topic so if it stays then all good for me!!

@bundfussr
Copy link
Collaborator

Possible tooltip text: "Click here to travel to our admiraldiscovery portal, where you can search for an ADaM variable or parameter and identify which functions from the {admiral} ecosystem helps you derive it." But how do you add one? The title option doesn;t do it for me...

I've asked RocheChat and it responed the following:

To add a tooltip to a button in the navigation bar of a website generated by pkgdown, you can modify the custom CSS or JavaScript files. Here’s a step-by-step approach:

  1. Locate or create the custom CSS or JavaScript file:

If you don't already have a custom CSS or JavaScript file, you can create one. Typically, these files would be placed under the pkgdown directory of your package.

  1. Edit _pkgdown.yml to include your custom files:

Update your _pkgdown.yml to include references to your custom CSS or JavaScript files.

template:
 bootstrap:
   components:
     - navigation
extra:
 css:
   - custom.css
 before:
   - custom.js
  1. Add the tooltip in the custom JavaScript file:

Use JavaScript to add the tooltip functionality. Below is an example using jQuery:

//custom.js
$(document).ready(function() {
  // Select the button by its ID or class and add the tooltip functionality
 $('#your-button-id').attr('title', 'Tooltip text here').tooltip();
});

Make sure to include the jQuery library if it’s not already included.

  1. Add custom styles for the tooltip in the custom CSS file:
/* custom.css */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* Position the tooltip above the button */
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
 visibility: visible;
 opacity: 1;
}
  1. Reference your button with an ID or class in your navbar.html:

In your pkgdown template (which might be in inst/pkgdown/templates), reference your button with an ID or class.

<button id="your-button-id" class="tooltip">My Button<button>

You can now rebuild your pkgdown site with pkgdown::build_site().

This will add a tooltip to the button in the navigation bar. If your button is already created elsewhere in your pkgdown configuration, ensure you give it the appropriate ID or class to select it in the JavaScript and CSS.

If you need further clarification or run into any issues, please let me know!

@manciniedoardo
Copy link
Collaborator Author

My Button

Thanks @bundfussr. I am following these instructions, but unsure where to add the line for Step 5. Any ideas?

@bundfussr
Copy link
Collaborator

My Button

Thanks @bundfussr. I am following these instructions, but unsure where to add the line for Step 5. Any ideas?

As the HTML file is generated by pkgdown, you can't add the id attribute. You could look at the HTML file and check if id or class is set for the entries for which you want to provide a tooltip.

@manciniedoardo
Copy link
Collaborator Author

Hi @bundfussr @bms63 @ddsjoberg

I've made the following issue on the pkgdown repo as I don't think it's worth spending too much time trying to implement tooltips from first principles in admiral. For now I have shortened the text to "Find my function 🔎" and accordingly kept the bug button. Let me know what you think!

@bms63
Copy link
Collaborator

bms63 commented Nov 26, 2024

Seems okay to me

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.

4 participants