Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: allowed user to select text in json body field in log details (#8450)

Sahil Khan6327ab5ec610
diff --git a/frontend/src/container/LogDetailedView/BodyTitleRenderer.styles.ts b/frontend/src/container/LogDetailedView/BodyTitleRenderer.styles.ts
index f5d157ee2e..1f7502b925 100644
--- a/frontend/src/container/LogDetailedView/BodyTitleRenderer.styles.ts
+++ b/frontend/src/container/LogDetailedView/BodyTitleRenderer.styles.ts
@@ -1,6 +1,9 @@
import styled from 'styled-components';
export const TitleWrapper = styled.span`
+ user-select: text !important;
+ cursor: text;
+
.hover-reveal {
visibility: hidden;
}
diff --git a/frontend/src/container/LogDetailedView/BodyTitleRenderer.tsx b/frontend/src/container/LogDetailedView/BodyTitleRenderer.tsx
index 856c2b01dc..8eb1b9aa8c 100644
--- a/frontend/src/container/LogDetailedView/BodyTitleRenderer.tsx
+++ b/frontend/src/container/LogDetailedView/BodyTitleRenderer.tsx
@@ -71,8 +71,13 @@ function BodyTitleRenderer({
onClick: onClickHandler,
};
+ const handleTextSelection = (e: React.MouseEvent): void => {
+ // Prevent tree node click when user is trying to select text
+ e.stopPropagation();
+ };
+
return (
- <TitleWrapper>
+ <TitleWrapper onMouseDown={handleTextSelection}>
<Dropdown menu={menu} trigger={['click']}>
<SettingOutlined style={{ marginRight: 8 }} className="hover-reveal" />
</Dropdown>
diff --git a/frontend/src/container/LogDetailedView/TableView/TableViewActions.styles.scss b/frontend/src/container/LogDetailedView/TableView/TableViewActions.styles.scss
index f5a45ef416..5f5e94c74b 100644
--- a/frontend/src/container/LogDetailedView/TableView/TableViewActions.styles.scss
+++ b/frontend/src/container/LogDetailedView/TableView/TableViewActions.styles.scss
@@ -11,6 +11,18 @@
}
}
+.selectable-tree {
+ .ant-tree-node-content-wrapper {
+ user-select: text !important;
+ cursor: text !important;
+ }
+
+ .ant-tree-title {
+ user-select: text !important;
+ cursor: text !important;
+ }
+}
+
.table-view-actions-content {
.ant-popover-inner {
border-radius: 4px;
diff --git a/frontend/src/container/LogDetailedView/TableView/TableViewActions.tsx b/frontend/src/container/LogDetailedView/TableView/TableViewActions.tsx
index f09e9a5c57..af0a75e785 100644
--- a/frontend/src/container/LogDetailedView/TableView/TableViewActions.tsx
+++ b/frontend/src/container/LogDetailedView/TableView/TableViewActions.tsx
@@ -53,7 +53,12 @@ const convert = new Convert();
// Memoized Tree Component
const MemoizedTree = React.memo<{ treeData: any[] }>(({ treeData }) => (
- <Tree defaultExpandAll showLine treeData={treeData} />
+ <Tree
+ defaultExpandAll
+ showLine
+ treeData={treeData}
+ className="selectable-tree"
+ />
));
MemoizedTree.displayName = 'MemoizedTree';