From eb34d12151f0d71c878fdd9e25705907299a6556 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 1 Oct 2025 22:54:28 +0900 Subject: [PATCH] [`ty`] Reject renaming files to start with slash in Playground (#20666) --- playground/ty/src/Playground.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playground/ty/src/Playground.tsx b/playground/ty/src/Playground.tsx index e0e600c5ed..5ace4b9134 100644 --- a/playground/ty/src/Playground.tsx +++ b/playground/ty/src/Playground.tsx @@ -96,6 +96,11 @@ export default function Playground() { file: FileId, newName: string, ) => { + if (newName.startsWith("/")) { + setError("File names cannot start with '/'."); + return; + } + const handle = files.handles[file]; let newHandle: FileHandle | null = null; if (handle == null) {