Skip to content

Conversation

TaKO8Ki
Copy link
Contributor

@TaKO8Ki TaKO8Ki commented Oct 1, 2025

Summary

Fixes astral-sh/ty#1282

Block renaming to names starting with /, surfacing a clear error instead of crashing the playground.

Test Plan

2025-10-01.184254.mp4

@TaKO8Ki TaKO8Ki force-pushed the playground-leading-slash-filenames branch from c1c0f57 to 93be831 Compare October 1, 2025 10:07
newName: string,
) => {
if (newName.startsWith("/")) {
setError("File names cannot start with '/'.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the error message get cleared at some point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As shown in the video, the error message disappears as soon as you type anything. Actions like creating a file don’t dismiss it, and this behavior is the same for other error messages as well.

2025-10-01.201751.mp4

@MichaReiser MichaReiser added the playground A playground-specific issue label Oct 1, 2025
@MichaReiser MichaReiser merged commit eb34d12 into astral-sh:main Oct 1, 2025
36 checks passed
dcreager added a commit that referenced this pull request Oct 3, 2025
* origin/main:
  [`flake8-bugbear`] Include certain guaranteed-mutable expressions: tuples, generators, and assignment expressions (`B006`) (#20024)
  [`flake8-comprehensions`] Clarify fix safety documentation (`C413`) (#20640)
  [ty] improve base conda distinction from child conda (#20675)
  [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659)
  [`ruff`] Handle argfile expansion errors gracefully (#20691)
  [`flynt`] Fix f-string quoting for mixed quote joiners (`FLY002`) (#20662)
  [ty] Fix file root matching for `/`
  [ruff,ty] Enable tracing's `log` feature
  [`flake8-annotations`] Fix return type annotations to handle shadowed builtin symbols (`ANN201`, `ANN202`, `ANN204`, `ANN205`, `ANN206`) (#20612)
  Bump 0.13.3 (#20685)
  Update benchmarking CI for cargo-codspeed v4 (#20686)
  [ty] Support single-starred argument for overload call (#20223)
  [ty] `~T` should never be assignable to `T` (#20606)
  [`pylint`] Clarify fix safety to include left-hand hashability (`PLR6201`) (#20518)
  [ty] No union with `Unknown` for module-global symbols (#20664)
  [`ty`] Reject renaming files to start with slash in Playground (#20666)
  [ty] Enums: allow multiple aliases to point to the same member (#20669)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playground A playground-specific issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playground crashes if file name starts with ////
2 participants