Skip to content

Commit abd6c86

Browse files
authored
fix: improve inline code rendering in signal details (#1579)
### Problem Inline code (backtick content) in signal card details is barely visible. The `Code` component uses `variant="ghost"` which has no background, and the parent container applies `color: var(--gray-11)` which makes inline code blend into surrounding text. ### Fix Added explicit CSS rules for `code` elements in the signal card body: - `bg-gray-4` — subtle background to distinguish code from text - `rounded` — rounded corners - `px-1 py-0.5` — padding for visual separation - `font-mono` — explicit monospace font This makes inline code clearly distinguishable from surrounding text while maintaining the compact signal card layout. Fixes #1567
1 parent b6e4325 commit abd6c86

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/code/src/renderer/features/inbox/components/detail/SignalCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ function SignalCardHeader({
252252
function CollapsibleBody({ body }: { body: string }) {
253253
const [expanded, setExpanded] = useState(false);
254254
const isLong = body.length > COLLAPSE_THRESHOLD;
255-
const displayBody = isLong && !expanded ? truncateBody(body) : body;
255+
// Preprocess content to handle escaped backticks and ensure proper markdown parsing
256+
const processedBody = body
257+
.replace(/\\`/g, "`") // Unescape escaped backticks
258+
.replace(/`([^`]+)`/g, "`$1`"); // Ensure proper backtick formatting
259+
const displayBody =
260+
isLong && !expanded ? truncateBody(processedBody) : processedBody;
256261

257262
return (
258263
<Box>

0 commit comments

Comments
 (0)