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

✨🥗🌸 Room: Improve clarity of publicity and access level options #1301

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

anaulin
Copy link
Member

@anaulin anaulin commented Apr 3, 2023

As a follow-up on #1300, this PR replaces the visibility and access level select drop-downs in the Room edit form with radio groups.

My goal is to make the available options and current setting clearer.

I would like to soon add an "explanation text" to each of these options. I was experimenting with using Tailwind's peer/... and peer/...checked classes and I couldn't get them working reliably, so I've given up on that for now. But I'll be back.

I also:

  • added a database-level default for the publicity_level
  • converted the access and publicity levels to Rails enums, so that we can get the scopes and predicate methods and validations for free

Screenshots

Before

image

After

image

@anaulin anaulin force-pushed the au/clearer-room-visibility-ui branch from b3eeb76 to 5d0e196 Compare April 3, 2023 01:46
@anaulin anaulin force-pushed the au/clearer-room-visibility-ui branch 2 times, most recently from 9543fea to fb5c2dd Compare April 3, 2023 02:24
@anaulin anaulin force-pushed the au/clearer-room-visibility-ui branch from fb5c2dd to b611f7a Compare April 3, 2023 02:28
Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I really like where this is going!

@@ -0,0 +1,9 @@
class AddDefaultPublicity < ActiveRecord::Migration[7.0]
def up
change_column :rooms, :publicity_level, :string, default: :listed, null: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to decide whether :listed or :unlisted is the better default, but I am landing on 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't sure either, but if feels like a public default sort of implies a listed default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me!

…groups, so that the options and choices are a little bit more visible.
@anaulin anaulin changed the title [WIP] Au/clearer room visibility UI 🌸 Neighborhood: Improve clarity of Room publicity and access level options Apr 3, 2023
@anaulin anaulin marked this pull request as ready for review April 3, 2023 03:47
@anaulin anaulin requested review from zspencer and a team April 3, 2023 03:47
@anaulin
Copy link
Member Author

anaulin commented Apr 3, 2023

Just realized that there is some weirdness in the mobile version:
image

Not sure if that's ok to merge and iterate or not, y'all tell me.

Either way, I'll look into fixing that later this week.

Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v pretty

<%= form.label attribute, option, value: option,
class: "ml-3 block text-sm leading-6 text-gray-900" %>
</div>
<%- end %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'm glad we have a radio component now!

@@ -0,0 +1,9 @@
class AddDefaultPublicity < ActiveRecord::Migration[7.0]
def up
change_column :rooms, :publicity_level, :string, default: :listed, null: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me!

@anaulin anaulin merged commit d5ea52a into main Apr 3, 2023
@anaulin anaulin deleted the au/clearer-room-visibility-ui branch April 3, 2023 05:50
@zspencer zspencer changed the title 🌸 Neighborhood: Improve clarity of Room publicity and access level options 🌸 Room: Improve clarity of publicity and access level options Apr 3, 2023
@zspencer zspencer added 🌸 Polish Improves the UX! ✨ feature Reduces Client's Burden or Grants them Benefits 🥗 test automation Adds some automated tests. V nutritious. labels Apr 3, 2023
@zspencer zspencer changed the title 🌸 Room: Improve clarity of publicity and access level options ✨🥗🌸 Room: Improve clarity of publicity and access level options Apr 3, 2023
@zspencer zspencer added this to the 1.0 - Andromeda milestone May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Reduces Client's Burden or Grants them Benefits 🌸 Polish Improves the UX! 🥗 test automation Adds some automated tests. V nutritious.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants