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

Cookies panel issues #53

Open
5 tasks
cjrace opened this issue Oct 1, 2024 · 4 comments · May be fixed by #86
Open
5 tasks

Cookies panel issues #53

cjrace opened this issue Oct 1, 2024 · 4 comments · May be fixed by #86
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cjrace
Copy link
Contributor

cjrace commented Oct 1, 2024

Describe the bug

Three current bugs from following the vignette (potential to split into separate issues):

  • 1. Automatically redirects to the cookies page (due to the ID issue Rich mentions below, we should update the guidance to cover it to prevent others hitting it without realising)
  • 2. Once accepted there is excess whitespace at the top of the screen
  • 3. There is not enough padding on the left of the text and buttons inside the banner
  • 4. There is spill of some kind causing a horizontal scroll bar to appear
  • 5. Need to include an example of using with a hidden tab opened from the footer

How to reproduce

Have a draft PR with a branch with the current functions in on the apps provider dashboard - dfe-analytical-services/apprenticeships-provider-dashboard#100

Expected behaviour

  • The cookies banner to stay at the top until a user accepts.
  • When a user accepts the page doesn't change.
  • There is no whitespace left once cookie option set.
  • The link to more cookies information works with a bslib hidden tab and we have an example for this.

Screenshots

Excess whitespace
image

Lack of margin / padding for cookies banner
image

Spillover on right hand side causing horizontal scroll bar
image

Additional context

Suspect we'll want to update the vignette and the code to fix these, some will be bugs with the package, others just a lack of detail in the guidance.

@rmbielby
Copy link
Contributor

rmbielby commented Nov 5, 2024

@rmbielby
Copy link
Contributor

rmbielby commented Nov 7, 2024

Ok, I looked in the dashboard code and you have three different inputs with the ID cookies:

  1. input$cookies: set by the cookies scripting, which stores a bunch of cookie information from the browser and a required input of cookies_banner_server() and cookies_panel_server()
  2. input$navlistpanel = cookies: the value of a panel in the navlist
  3. input$cookies: the id of an actionLink created in the footer

So the cookie panel auto opens because the following line is triggering whenever the cookie scripting writes to input$cookies 1 above, when what you wanted was it to trigger off input$cookies 3:

  • observeEvent(input$cookies, nav_select("pages", "cookies"))

And I suspect the buttons aren't working because input$cookies 3 is overriding input$cookies 1 when it gets passed to cookies_banner_server().

@cjrace
Copy link
Contributor Author

cjrace commented Nov 18, 2024

There doesn't seem to be a facepalm emoji that I can react with, but if there was I would...

I'll have a look into this later this week and then close if you're right @rmbielby! I think there's still something outstanding around the styling and a white bar being left at the top in bslib styled apps, will check that at the same time and raise a new issue if that's still there

@cjrace cjrace self-assigned this Dec 3, 2024
@cjrace cjrace changed the title Cookies panel has issues in a bslib app Cookies panel issues Dec 31, 2024
@cjrace
Copy link
Contributor Author

cjrace commented Dec 31, 2024

Still issues so have updated the issue to reflect those. The vignette needs updating as well as some of the CSS styling.

@cjrace cjrace added this to the v1.0 milestone Jan 2, 2025
@cjrace cjrace linked a pull request Jan 10, 2025 that will close this issue
@cjrace cjrace linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants