Summary
In 2.5.0 the code-block download button hardcodes its output filename to file.<ext> (extension derived from the language). There's no prop to override the filename or MIME type on the built-in button — while the table chrome's TableDownloadButton DOES accept a filename prop, so the API is inconsistent between the two download surfaces.
Hosts rendering assistant answers usually have better naming context available (conversation title, block index, a model-suggested name from code-fence meta) and end up disabling the download control rather than shipping file.py downloads.
Suggested fix
- Add
filename (and optionally mimeType) to CodeBlockDownloadButton, mirroring TableDownloadButton.
- For the default-rendered controls, accept it via the
controls config (e.g. controls={{code:{download:{filename: (lang, code) => string}}}}) or read it from code-fence meta (```python title=example.py).
Summary
In 2.5.0 the code-block download button hardcodes its output filename to
file.<ext>(extension derived from the language). There's no prop to override the filename or MIME type on the built-in button — while the table chrome'sTableDownloadButtonDOES accept afilenameprop, so the API is inconsistent between the two download surfaces.Hosts rendering assistant answers usually have better naming context available (conversation title, block index, a model-suggested name from code-fence meta) and end up disabling the download control rather than shipping
file.pydownloads.Suggested fix
filename(and optionallymimeType) toCodeBlockDownloadButton, mirroringTableDownloadButton.controlsconfig (e.g.controls={{code:{download:{filename: (lang, code) => string}}}}) or read it from code-fence meta (```python title=example.py).