Skip to content

Commit

Permalink
Radically simplify the switching back and forth for the new design. See
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Feb 6, 2024
1 parent 3b8a56d commit f3170e0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
7 changes: 1 addition & 6 deletions app/controllers/themes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ def toggle
return unless Flipper.enabled?(:switch_themes, current_user)

update_tailwind_theme(!show_tailwind_theme?)
notice = if show_tailwind_theme?
"Thank you for being an early tester of the new design. Please remember to report any problems that you encounter."
else
"We're sad to see you go. Please let us know why you switched back"
end
redirect_to root_path, notice:
redirect_to root_path
end
end
9 changes: 3 additions & 6 deletions app/views/_tailwind/profiles/_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
<li><div class="pl-4"><%= pa_link_to_unless_current "Create new alert", new_profile_alert_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Your comments", comments_profile_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Edit account", edit_user_registration_path %></div></li>
<% if Flipper.enabled?(:switch_themes, current_user) %>
<li><div class="pl-4"><%= pa_link_to_unless_current "Switch design", design_profile_path %></div></li>
<% end %>
<%# Setting "Sign out" to a block breaks on ios/safari %>
<li><div class="pl-4"><%= button_to "Sign out", destroy_user_session_path, method: :delete, class: "text-fuchsia hover:underline font-bold cursor-pointer" %></div></li>
</ul>

<% if Flipper.enabled?(:switch_themes, current_user) %>
<ul class="mt-10 ml-5 text-xl list-image-dash">
<li><div class="pl-4"><%= pa_link_to "Switch me back to the original design for Planning Alerts", design_profile_path %></div></li>
</ul>
<% end %>

<% if current_user.admin? %>
<ul class="mt-10 ml-5 text-xl list-image-dash">
<li><div class="pl-4"><%= pa_link_to_unless_current "Administration panel", admin_root_path %></div></li>
Expand Down
11 changes: 3 additions & 8 deletions app/views/_tailwind/profiles/design.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<% content_for :page_title, "Switch me back" %>
<% content_for :page_title, "Switch design" %>

<h2 class="text-3xl font-bold text-navy font-display"><%= yield(:page_title) %></h2>

<p class="mt-12 text-2xl text-navy">
So there's something about the new design which isn't working for you or doesn't work. That's a shame
but you know what, we expected that and that's why we released the new design to a select group of which
you are part.
</p>
<p class="mt-8 text-2xl text-navy">
Please help and make things better by letting us know what is making you switch back. Contact us.
Thanks for helping us by trying out the new design!
</p>

<div class="mt-12">
<%= pa_button_to "Take me back to the original design", toggle_theme_path %>
<%= pa_button_to "Switch back to the original design", toggle_theme_path %>
</div>
24 changes: 4 additions & 20 deletions app/views/profiles/design.html.haml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
- content_for :page_title, "Try out the new design"
%h1.page-title Try out the new design
- content_for :page_title, "Switch design"
%h1.page-title Switch design

- if Flipper.enabled?(:switch_themes, current_user)
%p
This is where we explain what the new design is, why it's cool, and what people need to do to try it out. (e.g. install bugherd browser plugin).
%p
Some key things:
%ul
%li You are special because you can try out the new design
%li
This is what you will get
-# TODO: Screenshot of new design
%li
This is what you need to promise to do (let us know about problems). This is your part of the deal. We ask you to please send feedback to us about any problems you encounter using the new design.
We've made it easy to do this using a tool called BugHerd, which is available on the right hand side of the screen when you're on the new design. See screenshot.
%li
Please install the BugHerd browser extension at <a href="https://www.bugherd.com/extensions">www.bugherd.com/extensions</a>. It is available for Chrome, Firefox, Edge and Safari.
You can let us know about problems through BugHerd even if you don't install the browser extension but if you do it will automatically add screenshots when giving feedback
which makes things much much easier for us.
-# TODO: Show screenshot of submitting feedback with BugHerd.
%li If you opt-in to try out the new design you can switch back at any stage until we roll it out to everybody
Thanks for helping us by trying out the new design!

= button_to "Switch over to the new design", toggle_theme_path, class: "button button-action button-rounded"
= button_to "Switch to the new design", toggle_theme_path, class: "button button-action button-rounded"
- else
%p
It looks like you're not on the list to try out the new design just yet. Sorry!
Expand Down
4 changes: 1 addition & 3 deletions app/views/profiles/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
%li= link_to "Your alerts", profile_alerts_path
%li= link_to "Your comments", comments_profile_path
%li= link_to "Edit account", edit_user_registration_path

%ul
- if Flipper.enabled?(:switch_themes, current_user)
%li= link_to "Try out a brand new design for Planning Alerts!", design_profile_path
%li= link_to "Switch design", design_profile_path

= button_to "Sign out", destroy_user_session_path, method: :delete, class: "button button-action button-rounded"

0 comments on commit f3170e0

Please sign in to comment.