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

feat: Exit Survey Preview Mode #6167

Merged

Conversation

JiyaGupta-cs
Copy link
Contributor

What this PR does

This pull request adds an Exit button to exit the Survey Preview Mode, addressing the issue where users currently have no clear way to exit preview mode and return back to editing mode.

Fixes #6166

Changes:

  • Added an "Exit Preview Mode" button at the bottom of the preview page.
  • Positioned the button alongside the "Preview Mode" label for visibility.

Steps to Test:

  • Navigate to the survey page (/survey).
  • Click "Edit Survey" to open the editor.
  • Click "Preview Survey" to enter preview mode.
  • The "Exit Preview Mode" button appears at the bottom.
  • Click the button and it returns you back to the editing mode.

Impact:

Provides a clear way for users to exit preview mode and return back to the editing mode.

Screenshots

Before:
image

After:
image

@ragesoss
Copy link
Member

ragesoss commented Feb 6, 2025

My assumption for the Exit button is that it would exit preview mode and leave the user in non-preview mode for taking the survey, rather than going to the survey Edit view. I suggest changing the button label to make it clear, such as "Edit Survey".

@JiyaGupta-cs
Copy link
Contributor Author

My assumption for the Exit button is that it would exit preview mode and leave the user in non-preview mode for taking the survey, rather than going to the survey Edit view. I suggest changing the button label to make it clear, such as "Edit Survey".

I think Exit should be the label
Because other wise it will be confusing when the user enters the preview mode, he might wonder how to get back
So it should be "Exit" or "Back to Editing"

@ragesoss
Copy link
Member

ragesoss commented Feb 6, 2025

"Exit" is not explicit enough about what behavior to expect. There are also several different ways of entering preview mode, which exists for both Surveys and Question Groups, and can be launched from the Survey index and the Question Group index. So 'Back to Editing' may not make sense, if the user didn't start from the Survey Edit view. I think "Edit Survey" would be clear enough.

@JiyaGupta-cs
Copy link
Contributor Author

Got it

@JiyaGupta-cs
Copy link
Contributor Author

Screencast.from.2025-02-07.02-19-04.webm

@ragesoss
Copy link
Member

ragesoss commented Feb 6, 2025

Looks good! One further improvement could be to add a link to 'Edit Question' that goes to the edit view for whatever the current question is. I'm not sure how complex that would be, though, as the survey state (eg, the identity of the current question) is handled in client-side javascript that isn't part of React state.

@ragesoss ragesoss merged commit 654b951 into WikiEducationFoundation:master Feb 6, 2025
1 check passed
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.

[FEATURE REQUEST]: Add "Exit Preview Mode" Option for Surveys
2 participants