Repository navigation
Replies: 1 comment
|
This was fixed with PR 865: #865 Thanks @maxwellpeterson for jumping on this! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Gadgets with several export variants all download under the same name.
I have a gadget with about 10 subpages. Its
ExportHandlerreturns one PDF format per page, andclient.jsrenders the right page fromgadgetExportFormatId. That part works great. The problem is that every file is named after the gadget, so I end up with 10 files calledReport.pdfand rename them by hand.Proposal
The fix is small: an optional
fileNameonGadgetExportFormat, without the extension. The Export menu uses it in place of the gadget's title.workshop-shared/src/api.tsfileName?: stringonGadgetExportFormatworkshop-backend/src/gadget-export.tsworkshop-frontend/src/GadgetExportMenu.tsxformat.fileName ?? gadgetTitleworkshop-backend/src/agent.tsExportHandlerinstructions so the agent knows it existsFormats without
fileNamebehave exactly as they do today, andmakeExportFilenamealready sanitizes the name.Example from a gadget's
ExportHandler:Status
I've been running it on my own instance and it works as intended. The branch has tests for both the schema and the menu: https://github.com/Logvin/cloudflare-os/tree/export-file-name
Happy to open a PR if you're open to it.
AI Disclosure: This change was developed with Claude Code (via CFOS!) as a pair programming tool. I directed the approach, reviewed all changes, and tested it on my own deployment. I'm the author, Claude is my editor.
All reactions