Skip to content

[ty] Add Download button to ty playground which creates a zip export#23478

Merged
MichaReiser merged 4 commits intoastral-sh:mainfrom
sinon:ty-play-zip-download
Mar 13, 2026
Merged

[ty] Add Download button to ty playground which creates a zip export#23478
MichaReiser merged 4 commits intoastral-sh:mainfrom
sinon:ty-play-zip-download

Conversation

@sinon
Copy link
Contributor

@sinon sinon commented Feb 22, 2026

Closes: astral-sh/ty#418

Summary

Add a Download button which zips up the current state of the editor and triggers a browser download.

  • Adds new dependency fflate chosen due to it's size/simplicity/speed
  • Adds new Download button beside Share
  • Generates a hash of the content for use in the zip files name. I did consider coupling this to the Share and use the uuid it generates to include in the zip name instead but for now not requiring a network call makes it a bit simpler to test/verify.
Screenshot 2026-02-22 at 15 45 33 Screenshot 2026-02-22 at 15 47 00

Sample zip export: ty-playground-89bb077f.zip

Test Plan

  • Create some files in editors
  • Click Download
  • See browser download starter
  • Open file / verify content

@sinon sinon force-pushed the ty-play-zip-download branch from ae17e5a to 33c51d6 Compare February 22, 2026 16:12
@AlexWaygood AlexWaygood added playground A playground-specific issue ty Multi-file analysis & type inference labels Feb 22, 2026
@carljm
Copy link
Contributor

carljm commented Feb 24, 2026

Closing and reopening this to test the new PR auto-assignment workflow.

@carljm carljm closed this Feb 24, 2026
@carljm carljm reopened this Feb 24, 2026
@carljm carljm requested a review from MichaReiser February 24, 2026 17:32
@MichaReiser
Copy link
Member

I'll review #23002 first because it would remove the need for adding a separate button

@MichaReiser MichaReiser force-pushed the ty-play-zip-download branch from 923f27c to 372716a Compare March 13, 2026 12:12
@MichaReiser MichaReiser enabled auto-merge (squash) March 13, 2026 12:13
@MichaReiser MichaReiser merged commit 08a3a22 into astral-sh:main Mar 13, 2026
42 checks passed
carljm added a commit that referenced this pull request Mar 13, 2026
* main: (94 commits)
  Fix shell injection via `shell=True` in subprocess calls (#23894)
  [ty] Refactor `relation.rs` to store state on a struct rather than passing around 7 arguments every time we recurse (#23837)
  Don't return code actions for non-Python documents (#23905)
  [ty] Make the default database truly statically infallible (#23929)
  [ty] Add `Download` button to ty playground which creates a zip export (#23478)
  [ty] Respect `kw_only` overwrites in dataclasses (#23930)
  [ty] Clarify in diagnostics that `from __future__ import annotations` only stringifies type annotations (#23928)
  [ty]  Add a `Copy Markdown` button to playground (#23002)
  [ty] Fix folding range classification of lines starting with `#` (#23831)
  [ty] Fix folding ranges for notebooks (#23830)
  [ty] fix too-many-cycle panics when inferring literal type loop variables (#23875)
  Add `RegularCallableTypeOf` and `into_regular_callable` in `ty_extensions` (#23909)
  [ty] treat properties as full structural types (#23925)
  [ty] Avoid duplicated work during multi-inference (#23923)
  [ty]: make `possibly-missing-attribute` ignored by default
  [ty]: split out `possibly-missing-submodule` from `possibly-missing-attribute`
  Update astral-sh/setup-uv action to v7.5.0 (#23922)
  [ty] Show truthiness in ConstraintSet display and simplify falsy error message (#23913)
  Bump 0.15.6 (#23919)
  [ty] Narrow type context during collection literal inference (#23844)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

playground A playground-specific issue ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[playground] Download ZIP button

4 participants