From 9bdb9b6a7c5491c55ae0a6cfd577ea7acef7d87c Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 24 Dec 2025 19:17:27 -0500 Subject: [PATCH] Improve wording around the various link preview options In my opinion, the significance of these options was still not super clear. It wasn't obvious that the setting under Appearance will disable them globally, and that the per-room option was discoverable. Another change was using the term "Link preview" instead of "URL preview", which is more common verbiage in chat applications other than Element. --- src/settings/AppearanceSettingsPage.qml | 3 +- src/settings/RoomGeneralPage.qml | 47 ++++++++++++------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/settings/AppearanceSettingsPage.qml b/src/settings/AppearanceSettingsPage.qml index ef6ae2a61..0cb33861e 100644 --- a/src/settings/AppearanceSettingsPage.qml +++ b/src/settings/AppearanceSettingsPage.qml @@ -341,7 +341,8 @@ FormCard.FormCardPage { FormCard.FormCheckDelegate { id: showLinkPreviewDelegate - text: i18nc("@label:checkbox", "Show link previews in messages") + text: i18nc("@label:checkbox", "Show link previews") + description: i18nc("@info:label", "You can customize this per-room under room settings. If unchecked, disables link previews in every room.") checked: NeoChatConfig.showLinkPreview onToggled: { NeoChatConfig.showLinkPreview = checked; diff --git a/src/settings/RoomGeneralPage.qml b/src/settings/RoomGeneralPage.qml index 9d3bf363b..be586abd8 100644 --- a/src/settings/RoomGeneralPage.qml +++ b/src/settings/RoomGeneralPage.qml @@ -191,44 +191,43 @@ FormCard.FormCardPage { } FormCard.FormHeader { - title: i18nc("@title", "URL Previews") - } - FormCard.FormCard { - FormCard.FormCheckDelegate { - text: i18nc("@label:checkbox", "Enable URL previews by default for room members") - checked: root.room.defaultUrlPreviewState - visible: root.room.canSendState("org.matrix.room.preview_urls") - onToggled: { - root.room.defaultUrlPreviewState = checked; - } - } - FormCard.FormCheckDelegate { - enabled: NeoChatConfig.showLinkPreview - text: i18nc("@label:checkbox", "Enable URL previews") - // Most users won't see the above setting so tell them the default. - description: root.room.defaultUrlPreviewState ? i18nc("@info", "URL previews are enabled by default in this room") : i18nc("@info", "URL previews are disabled by default in this room") - checked: root.room.urlPreviewEnabled - onToggled: { - root.room.urlPreviewEnabled = checked; - } - } + title: i18nc("@title", "Link Previews") } Kirigami.InlineMessage { Layout.fillWidth: true Layout.maximumWidth: Kirigami.Units.gridUnit * 30 - Layout.topMargin: Kirigami.Units.largeSpacing + Layout.bottomMargin: Kirigami.Units.largeSpacing Layout.alignment: Qt.AlignHCenter - text: i18nc("As in the user has switched off showing previews of hyperlinks in timeline messages", "URL previews are currently disabled for your account") + text: i18nc("As in the user has switched off showing previews of hyperlinks in timeline messages", "Link previews are disabled globally in Appearance settings") type: Kirigami.MessageType.Information visible: !NeoChatConfig.showLinkPreview actions: Kirigami.Action { - text: i18nc("@action:button", "Enable") + icon.name: "checkmark-symbolic" + text: i18nc("@action:button Enable link previews globally", "Enable") onTriggered: { NeoChatConfig.showLinkPreview = true; NeoChatConfig.save(); } } } + FormCard.FormCard { + visible: NeoChatConfig.showLinkPreview || root.room.canSendState("org.matrix.room.preview_urls") + + FormCard.FormCheckDelegate { + visible: NeoChatConfig.showLinkPreview + text: i18nc("@label:checkbox", "Enable link previews for this room") + // Most users won't see the above setting so tell them the default. + description: root.room.defaultUrlPreviewState ? i18nc("@info", "Link previews were enabled by default by the room admins.") : i18nc("@info", "Link previews were disabled by default by the room admins.") + checked: root.room.urlPreviewEnabled + onToggled: root.room.urlPreviewEnabled = checked + } + FormCard.FormCheckDelegate { + text: i18nc("@label:checkbox", "Enable link previews by default") + checked: root.room.defaultUrlPreviewState + visible: root.room.canSendState("org.matrix.room.preview_urls") + onToggled: root.room.defaultUrlPreviewState = checked + } + } FormCard.FormHeader { title: i18nc("@title", "Official Parent Spaces") }