fix(threads): add a debug thread button (#3276)

This commit is contained in:
Jiralite authored and GitHub committed 2026-10-08 17:57:47 +02:00
1 parent 27baa38fd1
commit e94b7d7ad8
37 files changed
+383 -7

No files matched your search

@@ -2,6 +2,7 @@
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import type {Channel} from '@app/features/channel/models/Channel';
import {ChannelDebugModal} from '@app/features/devtools/components/debug/ChannelDebugModal';
import {MARK_AS_READ_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {buildChannelLink} from '@app/features/messaging/utils/MessageLinkUtils';
import Navigation from '@app/features/navigation/state/Navigation';
@@ -28,6 +29,7 @@ import {
import {
CopyIdIcon,
CopyLinkIcon,
DebugChannelIcon,
DeleteIcon,
EditIcon,
LeaveIcon,
@@ -266,14 +268,32 @@ export function useThreadMenuData(thread: Channel, {onClose}: {onClose: () => vo
},
];
if (UserSettings.developerMode) {
copyItems.push({
icon: <CopyIdIcon size={20} data-flx="threads.use-thread-menu-data.copy-id-icon" />,
label: i18n._(D.COPY_THREAD_ID_DESCRIPTOR),
onClick: () => {
void TextCopyCommands.copy(i18n, thread.id, true);
onClose();
copyItems.push(
{
icon: <DebugChannelIcon size={20} data-flx="threads.use-thread-menu-data.debug-thread-icon" />,
label: i18n._(D.DEBUG_THREAD_DESCRIPTOR),
onClick: () => {
ModalCommands.pushAfterBottomSheetClose(
onClose,
modal(() => (
<ChannelDebugModal
title={i18n._(D.THREAD_DEBUG_DESCRIPTOR)}
channel={thread}
data-flx="threads.use-thread-menu-data.channel-debug-modal"
/>
)),
);
},
},
});
{
icon: <CopyIdIcon size={20} data-flx="threads.use-thread-menu-data.copy-id-icon" />,
label: i18n._(D.COPY_THREAD_ID_DESCRIPTOR),
onClick: () => {
void TextCopyCommands.copy(i18n, thread.id, true);
onClose();
},
},
);
}
groups.push({items: copyItems});
return {groups};
@@ -118,6 +118,14 @@ export const COPY_THREAD_ID_DESCRIPTOR = msg({
message: 'Copy thread ID',
comment: 'Developer mode action that copies the thread ID.',
});
export const DEBUG_THREAD_DESCRIPTOR = msg({
message: 'Debug thread',
comment: 'Developer-mode action that opens the thread debug modal.',
});
export const THREAD_DEBUG_DESCRIPTOR = msg({
message: 'Thread debug',
comment: 'Title of the developer-mode thread debug modal.',
});
export const THREAD_LINK_COPIED_DESCRIPTOR = msg({
message: 'Thread link copied',
comment: 'Toast after the thread link was copied.',