+
{copied ? 'Copied' : 'Copy'}
+
+ {largeCodeBlock && (
+
+
+
+ )}
+
+
+
+
{domToReact(children, opts)}
- >
+ {largeCodeBlock && !expanded &&
}
+
);
}
@@ -355,11 +383,7 @@ export const getReactCustomHtmlParser = (
}
if (name === 'pre') {
- return (
-
- {CodeBlock(children, opts)}
-
- );
+ return
{children};
}
if (name === 'blockquote') {
@@ -409,9 +433,9 @@ export const getReactCustomHtmlParser = (
}
} else {
return (
-
+
{domToReact(children, opts)}
-
+
);
}
}
diff --git a/src/app/styles/CustomHtml.css.ts b/src/app/styles/CustomHtml.css.ts
index ecbdbeee..f717669c 100644
--- a/src/app/styles/CustomHtml.css.ts
+++ b/src/app/styles/CustomHtml.css.ts
@@ -41,16 +41,19 @@ export const BlockQuote = style([
]);
const BaseCode = style({
- fontFamily: 'monospace',
- color: color.Secondary.OnContainer,
- background: color.Secondary.Container,
- border: `${config.borderWidth.B300} solid ${color.Secondary.ContainerLine}`,
+ color: color.SurfaceVariant.OnContainer,
+ background: color.SurfaceVariant.Container,
+ border: `${config.borderWidth.B300} solid ${color.SurfaceVariant.ContainerLine}`,
borderRadius: config.radii.R300,
});
+const CodeFont = style({
+ fontFamily: 'monospace',
+});
export const Code = style([
DefaultReset,
BaseCode,
+ CodeFont,
{
padding: `0 ${config.space.S100}`,
},
@@ -86,34 +89,31 @@ export const CodeBlock = style([
{
fontStyle: 'normal',
position: 'relative',
+ overflow: 'hidden',
},
]);
-export const CodeBlockInternal = recipe({
- base: {
- padding: `${config.space.S200} ${config.space.S200} 0`,
- minWidth: toRem(100),
- },
- variants: {
- collapsed: {
- true: {
- maxHeight: `calc(${config.lineHeight.T400} * 9.6)`,
- },
- },
- },
+export const CodeBlockHeader = style({
+ padding: `0 ${config.space.S200} 0 ${config.space.S300}`,
+ borderBottomWidth: config.borderWidth.B300,
+ gap: config.space.S200,
});
-export const CodeBlockControls = style({
- position: 'absolute',
- top: config.space.S200,
- right: config.space.S200,
- visibility: 'hidden',
- selectors: {
- [`${CodeBlock}:hover &`]: {
- visibility: 'visible',
- },
- [`${CodeBlock}:focus-within &`]: {
- visibility: 'visible',
- },
+export const CodeBlockInternal = style([
+ CodeFont,
+ {
+ padding: `${config.space.S200} ${config.space.S200} 0`,
+ minWidth: toRem(200),
},
+]);
+
+export const CodeBlockBottomShadow = style({
+ position: 'absolute',
+ bottom: 0,
+ left: 0,
+ right: 0,
+ pointerEvents: 'none',
+
+ height: config.space.S400,
+ background: `linear-gradient(to top, #00000022, #00000000)`,
});
export const List = style([
From ccf10fc20cadde14868e27f913414b251dbb75f2 Mon Sep 17 00:00:00 2001
From: Ajay Bura <32841439+ajbura@users.noreply.github.com>
Date: Mon, 4 Aug 2025 20:29:12 +0530
Subject: [PATCH 34/72] Revert "Fix menus congestion and improve thread reply
layout (#2402)" (#2409)
This reverts commit d8d4714370fbe6c6ea6f6889ba4a5aae505220b8.
---
src/app/components/BackupRestore.tsx | 8 ++++++--
src/app/components/HexColorPickerPopOut.tsx | 2 +-
src/app/components/JoinRulesSwitcher.tsx | 2 +-
src/app/components/ManualVerification.tsx | 2 +-
src/app/components/MemberSortMenu.tsx | 2 +-
src/app/components/MembershipFilterMenu.tsx | 2 +-
src/app/components/RoomNotificationSwitcher.tsx | 4 ++--
src/app/components/editor/Toolbar.tsx | 2 +-
.../components/image-pack-view/UsageSwitcher.tsx | 2 +-
src/app/components/message/Reply.css.ts | 6 ++++++
src/app/components/message/Reply.tsx | 15 ++++-----------
src/app/components/power/PowerSelector.tsx | 5 ++---
src/app/components/room-card/RoomCard.tsx | 2 +-
.../general/RoomHistoryVisibility.tsx | 2 +-
.../common-settings/permissions/Powers.tsx | 2 +-
src/app/features/lobby/HierarchyItemMenu.tsx | 6 +++---
src/app/features/lobby/LobbyHeader.tsx | 6 +++---
src/app/features/lobby/SpaceItem.tsx | 4 ++--
src/app/features/message-search/SearchFilters.tsx | 5 +++--
src/app/features/room-nav/RoomNavItem.tsx | 8 ++++----
src/app/features/room/RoomInput.tsx | 2 +-
src/app/features/room/RoomViewHeader.tsx | 8 ++++----
src/app/features/room/message/Message.tsx | 10 ++++------
src/app/features/room/message/styles.css.ts | 2 +-
.../features/settings/devices/Verification.tsx | 2 +-
src/app/features/settings/general/General.tsx | 6 +++---
.../notifications/NotificationModeSwitcher.tsx | 2 +-
src/app/pages/auth/ServerPicker.tsx | 4 ++--
src/app/pages/auth/login/PasswordLoginForm.tsx | 4 ++--
src/app/pages/client/ClientRoot.tsx | 2 +-
src/app/pages/client/direct/Direct.tsx | 4 ++--
src/app/pages/client/explore/Server.tsx | 6 +++---
src/app/pages/client/home/Home.tsx | 4 ++--
src/app/pages/client/sidebar/DirectTab.tsx | 4 ++--
src/app/pages/client/sidebar/HomeTab.tsx | 4 ++--
src/app/pages/client/sidebar/SpaceTabs.tsx | 6 +++---
src/app/pages/client/space/Space.tsx | 8 ++++----
37 files changed, 83 insertions(+), 82 deletions(-)
diff --git a/src/app/components/BackupRestore.tsx b/src/app/components/BackupRestore.tsx
index 8b3732b1..068f437b 100644
--- a/src/app/components/BackupRestore.tsx
+++ b/src/app/components/BackupRestore.tsx
@@ -203,8 +203,12 @@ export function BackupRestoreTile({ crypto }: BackupRestoreTileProps) {
escapeDeactivates: stopPropagation,
}}
>
-