Skip to content

Commit 37a40e3

Browse files
authored
[playground] Allow selecting the diagnostic message (astral-sh#17051)
## Summary Allow selecting the diagnostic message so that the message can be copied (e.g. into an issue) ## Test Plan <img width="1679" alt="Screenshot 2025-03-28 at 16 52 45" src="https://github.com/user-attachments/assets/06674d87-6c88-45d4-b46c-0bcb3e151996" />
1 parent 98438a7 commit 37a40e3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

playground/knot/src/Editor/Diagnostics.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function Items({
8484
<li key={`${diagnostic.text_range()?.start ?? 0}-${id ?? index}`}>
8585
<button
8686
onClick={() => onGoTo(startLine, startColumn)}
87-
className="w-full text-start cursor-pointer"
87+
className="w-full text-start cursor-pointer select-text"
8888
>
8989
{diagnostic.message()}
9090
<span className="text-gray-500">

playground/ruff/src/Editor/Diagnostics.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useMemo } from "react";
66
interface Props {
77
diagnostics: Diagnostic[];
88
theme: Theme;
9+
910
onGoTo(line: number, column: number): void;
1011
}
1112

@@ -79,7 +80,7 @@ function Items({
7980
diagnostic.start_location.column,
8081
)
8182
}
82-
className="w-full text-start"
83+
className="w-full text-start cursor-pointer select-text"
8384
>
8485
{diagnostic.message}{" "}
8586
<span className="text-gray-500">

0 commit comments

Comments
 (0)