Skip to content

A platform for community discussion. Free, open, simple.

UX: Always show options in bookmark modal (#40075)

chapoi6c7c08178ace
diff --git a/app/assets/stylesheets/common/components/bookmark-modal.scss b/app/assets/stylesheets/common/components/bookmark-modal.scss
index 935c14d67ca..5e8dfea3a86 100644
--- a/app/assets/stylesheets/common/components/bookmark-modal.scss
+++ b/app/assets/stylesheets/common/components/bookmark-modal.scss
@@ -31,31 +31,11 @@
}
}
- .bookmark-name-wrap {
- display: inline-flex;
- width: 100%;
- align-items: end;
- }
-
- .bookmark-options-button {
- margin-left: 0.5em;
- margin-bottom: 0.5em;
- }
-
.bookmark-options-panel {
margin-bottom: 18px;
.select-kit {
width: 100%;
}
-
- label {
- display: flex;
-
- span {
- display: block;
- flex: 1;
- }
- }
}
}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 1484cb97744..26f7bd38422 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -4858,7 +4858,6 @@ en:
name_placeholder: "What is this bookmark for?"
name_input_label: "Bookmark name"
set_reminder: "Remind me"
- options: "Options"
actions:
delete_bookmark:
name: "Delete bookmark"
diff --git a/frontend/discourse/app/components/modal/bookmark.gjs b/frontend/discourse/app/components/modal/bookmark.gjs
index fd539617429..dabe7bfbfc5 100644
--- a/frontend/discourse/app/components/modal/bookmark.gjs
+++ b/frontend/discourse/app/components/modal/bookmark.gjs
@@ -48,7 +48,6 @@ export default class BookmarkModal extends Component {
@tracked postDetectedLocalTimezone = null;
@tracked prefilledDatetime = null;
@tracked flash = null;
- @tracked showOptions = this.args.model.bookmark.id ? true : false;
@tracked _closeWithoutSaving = false;
@tracked _savingBookmarkManually = false;
@@ -196,11 +195,6 @@ export default class BookmarkModal extends Component {
});
}
- @action
- toggleShowOptions() {
- this.showOptions = !this.showOptions;
- }
-
@action
onTimeSelected(type, time) {
this.bookmark.selectedReminderType = type;
@@ -384,7 +378,7 @@ export default class BookmarkModal extends Component {
</:headerPrimaryAction>
<:body>
- <div class="control-group bookmark-name-wrap">
+ <div class="control-group">
<Input
id="bookmark-name"
@value={{this.bookmark.name}}
@@ -393,30 +387,21 @@ export default class BookmarkModal extends Component {
placeholder={{i18n "post.bookmarks.name_placeholder"}}
aria-label={{i18n "post.bookmarks.name_input_label"}}
/>
- <DButton
- @icon="gear"
- @action={{this.toggleShowOptions}}
- @ariaLabel="post.bookmarks.options"
- @title="post.bookmarks.options"
- class="bookmark-options-button"
- />
</div>
- {{#if this.showOptions}}
- <div class="bookmark-options-panel">
- <label
- class="control-label"
- for="bookmark_auto_delete_preference"
- >{{i18n "bookmarks.auto_delete_preference.label"}}</label>
- <ComboBox
- @content={{this.autoDeletePreferences}}
- @value={{this.bookmark.autoDeletePreference}}
- @id="bookmark-auto-delete-preference"
- @onChange={{fn (mut this.bookmark.autoDeletePreference)}}
- class="bookmark-option-selector"
- />
- </div>
- {{/if}}
+ <div class="bookmark-options-panel">
+ <label
+ class="control-label"
+ for="bookmark_auto_delete_preference"
+ >{{i18n "bookmarks.auto_delete_preference.label"}}</label>
+ <ComboBox
+ @content={{this.autoDeletePreferences}}
+ @value={{this.bookmark.autoDeletePreference}}
+ @id="bookmark-auto-delete-preference"
+ @onChange={{fn (mut this.bookmark.autoDeletePreference)}}
+ class="bookmark-option-selector"
+ />
+ </div>
{{#if this.showExistingReminderAt}}
<div class="alert alert-info existing-reminder-at-alert">
diff --git a/spec/system/bookmarks_spec.rb b/spec/system/bookmarks_spec.rb
index 3c048ceaafc..8809140ac58 100644
--- a/spec/system/bookmarks_spec.rb
+++ b/spec/system/bookmarks_spec.rb
@@ -67,10 +67,6 @@ describe "Bookmarking posts and topics" do
bookmark_menu.click_menu_option("custom")
expect(bookmark_modal).to be_open
- # NOTE: (martin) Not sure why, but I need to click this twice for the panel to open :/
- bookmark_modal.open_options_panel
- bookmark_modal.open_options_panel
-
expect(bookmark_modal).to have_auto_delete_preference(
Bookmark.auto_delete_preferences[:on_owner_reply],
)
@@ -79,7 +75,6 @@ describe "Bookmarking posts and topics" do
expect(topic_page).to have_post_bookmarked(post_2, with_reminder: false)
topic_page.click_post_action_button(post_2, :bookmark)
bookmark_menu.click_menu_option("edit")
- expect(bookmark_modal).to have_open_options_panel
expect(bookmark_modal).to have_auto_delete_preference(
Bookmark.auto_delete_preferences[:clear_reminder],
)
@@ -231,7 +226,6 @@ describe "Bookmarking posts and topics" do
it "prefills the name of the bookmark and the custom reminder date and time" do
visit_topic_and_open_bookmark_menu(post_2, expand_actions: false)
bookmark_menu.click_menu_option("edit")
- expect(bookmark_modal).to have_open_options_panel
expect(bookmark_modal.name.value).to eq("test name")
expect(bookmark_modal.existing_reminder_alert).to have_content(
bookmark_modal.existing_reminder_alert_message(bookmark),
diff --git a/spec/system/page_objects/modals/bookmark.rb b/spec/system/page_objects/modals/bookmark.rb
index 839c72711a4..17aacb88ae7 100644
--- a/spec/system/page_objects/modals/bookmark.rb
+++ b/spec/system/page_objects/modals/bookmark.rb
@@ -32,14 +32,6 @@ module PageObjects
has_css?(".bookmark-reminder-modal[data-bookmark-id='#{bookmark_id}']")
end
- def open_options_panel
- find(".bookmark-options-button").click
- end
-
- def has_open_options_panel?
- has_css?(".bookmark-options-panel")
- end
-
def select_relative_time_duration(duration)
find("#bookmark-relative-time-picker").fill_in(with: duration)
end