Skip to content

Conversation

@dylanpieper
Copy link
Contributor

This PR adds survey restart functionality, cookie-clearing options, and updates the exit flow in both the UI and server.

  • Added new parameters to sd_close():
    • show_restart — displays a Restart Survey button.
    • label_restart — allows customizing the restart button label.
    • clear_cookies — enables clearing cookies when the user exits.
  • Added "restart" message to all supported languages in R/messages.R.
  • Added new restart survey handler (input$restart_survey) in R/server.R.
  • Added support for clearing cookies on exit (clear_cookies_on_exit) and new Shiny message handlers:
    • clearCookies
    • forceRestart
  • Added new cookie utilities in inst/js/cookies.js:
    • clear()
    • forceRestart()

These changes allow surveys to be restarted cleanly, ensure cookies can be cleared when exiting, and improve consistency in how exit/restart events update data and client-side state.

- Add restart button option to `sd_close()` with `show_restart` parameter
- Add cookie clearing functionality with `clear_cookies` parameter
- Extend JavaScript cookie API with `clear()` and `forceRestart()` methods
- Add multilingual support for 'restart' button across 6 languages
- Implement server-side restart handler in `sd_server()`
- Add cookie clearing on exit when `clear_cookies_on_exit` is enabled
- Update `sd_close()` documentation with new parameters

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jhelvy
Copy link
Collaborator

jhelvy commented Dec 4, 2025

Just noting these are on my radar, but I'm slammed with grading and such at the end of the semester. Will look through it in the next week or so.

@dylanpieper
Copy link
Contributor Author

No worries or urgency on my end. Good luck! I'm happy to jump back in later. I have flexible time in my new role to help with open source projects.

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.

2 participants