Promote "Share encrypted history" from labs (#33281)

* Promote "Share encrypted history" from labs

* fix lint

* Update labs.md

* update snapshots

* Update unit tests

* update playwright screenshot
This commit is contained in:
Richard van der Hoff
2026-04-23 16:04:09 +00:00
committed by GitHub
parent c02b970d35
commit c4638d1773
14 changed files with 72 additions and 107 deletions
@@ -446,7 +446,6 @@ export default function RoomHeader({
const roomName = useRoomName(room);
const joinRule = useRoomState(room, (state) => state.getJoinRule());
const historyVisibility = useRoomState(room, (state) => state.getHistoryVisibility());
const historySharingEnabled = useFeatureEnabled("feature_share_history_on_invite");
const dmMember = useDmMember(room);
const isDirectMessage = !!dmMember;
const isRoomEncrypted = useIsEncrypted(client, room);
@@ -532,7 +531,7 @@ export default function RoomHeader({
</Tooltip>
)}
{isRoomEncrypted && historySharingEnabled && historyVisibilityIcon(historyVisibility)}
{isRoomEncrypted && historyVisibilityIcon(historyVisibility)}
</Text>
</Box>
</button>
-3
View File
@@ -1577,9 +1577,6 @@
"report_to_moderators": "Report to moderators",
"report_to_moderators_description": "In rooms that support moderation, the “Report” button will let you report abuse to room moderators.",
"room_list_sections": "Room list sections",
"share_history_on_invite": "Share encrypted history with new members",
"share_history_on_invite_description": "When inviting a user to an encrypted room that has history visibility set to \"shared\", share encrypted history with that user, and accept encrypted history when you are invited to such a room.",
"share_history_on_invite_warning": "This feature is EXPERIMENTAL and not all security precautions are implemented. Do not enable on production accounts.",
"sliding_sync": "Sliding Sync mode",
"sliding_sync_description": "Under active development, cannot be disabled. Currently, not compatible with Element Call.",
"sliding_sync_disabled_notice": "Sign in again to disable",
-24
View File
@@ -212,7 +212,6 @@ export interface Settings {
"feature_mjolnir": IFeature;
"feature_custom_themes": IFeature;
"feature_exclude_insecure_devices": IFeature;
"feature_share_history_on_invite": IFeature;
"feature_html_topic": IFeature;
"feature_bridge_state": IFeature;
"feature_jump_to_date": IFeature;
@@ -522,29 +521,6 @@ export const SETTINGS: Settings = {
supportedLevelsAreOrdered: true,
default: false,
},
"feature_share_history_on_invite": {
isFeature: true,
labsGroup: LabGroup.Encryption,
displayName: _td("labs|share_history_on_invite"),
description: () => (
<>
{_t("labs|share_history_on_invite_description")}
<div className="mx_SettingsFlag_microcopy">
{_t(
"settings|warning",
{},
{
w: (sub) => <span className="mx_SettingsTab_microcopy_warning">{sub}</span>,
description: _t("labs|share_history_on_invite_warning"),
},
)}
</div>
</>
),
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
supportedLevelsAreOrdered: true,
default: false,
},
// Defaulted to true Feb 26, intention is to remove entirely, all being well,
// as this fixes bugs where display name / avatar are missing and also makes
// Element Web consistent with Element X.
+1 -3
View File
@@ -544,11 +544,9 @@ export class RoomViewStore extends EventEmitter {
const joinOpts: IJoinRoomOpts = {
viaServers,
acceptSharedHistory: true,
...(payload.opts ?? {}),
};
if (SettingsStore.getValue("feature_share_history_on_invite")) {
joinOpts.acceptSharedHistory = true;
}
try {
const cli = MatrixClientPeg.safeGet();
await retry<Room, MatrixError>(
+3 -3
View File
@@ -228,10 +228,10 @@ export default class MultiInviter {
}
}
const opts: InviteOpts = {};
const opts: InviteOpts = {
shareEncryptedHistory: true,
};
if (this.reason !== undefined) opts.reason = this.reason;
if (SettingsStore.getValue("feature_share_history_on_invite")) opts.shareEncryptedHistory = true;
return this.matrixClient.invite(roomId, addr, opts);
} else {
throw new Error("Unsupported address");