0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-10 23:00:09 +08:00
discourse/app/serializers/current_user_option_serializer.rb
Keegan George 436041645f
FEATURE: Make the message send shortcut a core user option (#42105)
**Previously**, the enter/meta+enter send shortcut was a chat-only
preference (`chat_send_shortcut`), so chat-style composers in other
plugins — like AI bot conversations — always sent on Enter with no way
to insert a newline.

**In this update**, promoted it to a core `send_shortcut` user option on
the Interface preferences page, honored by the chat composer, the core
docked composer, and AI bot conversations.

The `chat_send_shortcut` column is backfilled into `send_shortcut`
post-deploy and kept (ignored) for now, mirroring the
`push_notification_level` promotion; the column drop, the serializer
compatibility alias removal, and the `plugin_manifest.yml` cleanup land
in a follow-up PR.

| Before | After |
| --- | --- |
|
![before](https://github.com/discourse/discourse/releases/download/_gh-attach-assets/before-jmgi09.png)
|
![after](https://github.com/discourse/discourse/releases/download/_gh-attach-assets/after-crkznx.png)
|
2026-07-28 13:58:12 -07:00

44 lines
1.3 KiB
Ruby
Vendored

# frozen_string_literal: true
class CurrentUserOptionSerializer < ApplicationSerializer
attributes :mailing_list_mode,
:external_links_in_new_tab,
:enable_quoting,
:enable_smart_lists,
:enable_markdown_monospace_font,
:dynamic_favicon,
:automatically_unpin_topics,
:likes_notifications_disabled,
:hide_profile_and_presence,
:hide_profile,
:hide_presence,
:title_count_mode,
:enable_defer,
:timezone,
:skip_new_user_tips,
:default_calendar,
:bookmark_auto_delete_preference,
:notify_on_linked_posts,
:seen_popups,
:should_be_redirected_to_top,
:redirected_to_top,
:treat_as_new_topic_start_date,
:sidebar_link_to_filtered_list,
:sidebar_show_count_of_new_items,
:composition_mode,
:interface_color_mode,
:show_original_content,
:send_shortcut
def likes_notifications_disabled
object.likes_notifications_disabled?
end
def include_redirected_to_top?
object.redirected_to_top.present?
end
def include_seen_popups?
SiteSetting.enable_user_tips
end
end