[playground] Allow selecting the diagnostic message (#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"
/>
This commit is contained in:
Micha Reiser 2025-03-28 21:58:05 +01:00 committed by GitHub
parent 98438a77f2
commit 37a40e30f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -84,7 +84,7 @@ function Items({
<li key={`${diagnostic.text_range()?.start ?? 0}-${id ?? index}`}> <li key={`${diagnostic.text_range()?.start ?? 0}-${id ?? index}`}>
<button <button
onClick={() => onGoTo(startLine, startColumn)} onClick={() => onGoTo(startLine, startColumn)}
className="w-full text-start cursor-pointer" className="w-full text-start cursor-pointer select-text"
> >
{diagnostic.message()} {diagnostic.message()}
<span className="text-gray-500"> <span className="text-gray-500">

View file

@ -6,6 +6,7 @@ import { useMemo } from "react";
interface Props { interface Props {
diagnostics: Diagnostic[]; diagnostics: Diagnostic[];
theme: Theme; theme: Theme;
onGoTo(line: number, column: number): void; onGoTo(line: number, column: number): void;
} }
@ -79,7 +80,7 @@ function Items({
diagnostic.start_location.column, diagnostic.start_location.column,
) )
} }
className="w-full text-start" className="w-full text-start cursor-pointer select-text"
> >
{diagnostic.message}{" "} {diagnostic.message}{" "}
<span className="text-gray-500"> <span className="text-gray-500">