Make Data panel scalars selectable inline, denoise float display, and standardize breadcrumb string truncation (#4470)

* Make Data panel scalars selectable inline, denoise float display, and move breadcrumb truncation to Rust

* Code review fixes

* Remove denoising from f32
This commit is contained in:
Keavon Chambers
2026-08-22 01:28:23 -07:00
committed by GitHub
parent 2fa6b743fe
commit c8667edacc
14 changed files with 253 additions and 187 deletions
+15
View File
@@ -128,6 +128,7 @@ export function onPointerMove(e: PointerEvent, editor: EditorWrapper, documentSt
export function onPointerDown(e: PointerEvent, editor: EditorWrapper, dialogStore: DialogStore) {
potentiallyRestoreCanvasFocus(e);
potentiallyClearTextSelection(e);
const inFloatingMenu = e.target instanceof Element && e.target.closest("[data-floating-menu-content]");
const isTargetingCanvas = !inFloatingMenu && e.target instanceof Element && e.target.closest("[data-viewport], [data-viewport-container], [data-node-graph]");
@@ -351,6 +352,20 @@ function targetIsTextField(target: EventTarget | HTMLElement | undefined): boole
);
}
function potentiallyClearTextSelection(e: PointerEvent) {
const target = e.target instanceof Element ? e.target : undefined;
if (target && (targetIsTextField(target) || window.getComputedStyle(target).userSelect !== "none")) return;
// A text control's selection lives in its shadow tree, which the document's `Selection` reports as collapsed and cannot clear, so each control holding one is collapsed through its own API
const controls = window.document.querySelectorAll<HTMLInputElement | HTMLTextAreaElement>("textarea, input[type='text']");
controls.forEach((control) => {
const caret = control.selectionStart;
if (typeof caret === "number" && caret !== control.selectionEnd) control.setSelectionRange(caret, caret);
});
window.getSelection()?.removeAllRanges();
}
function potentiallyRestoreCanvasFocus(e: Event) {
const appElement = window.document.querySelector("[data-app-container]");
const app = appElement instanceof HTMLElement ? appElement : undefined;