Include ZIP filename in Studio export success/failure toast - #1811
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Studio export toast to include ZIP filename
Include ZIP filename in Studio export success/failure toast
Sep 8, 2026
…hes.zip`) that does not match the sanitized ZIP actually downloaded (e.g. `ai-gold-rushes.zip`).
This commit fixes the issue reported at apps/web/src/components/OneLoopStudio.tsx:492
## Bug
In `exportPkg()` (`apps/web/src/components/OneLoopStudio.tsx`), the toast filename was computed up front from the raw project title:
```ts
const filename = studioExportFilename(selected?.title || 'uvai-project');
```
`studioExportFilename` (`studio-pipeline-status.ts:314`) does **not** sanitize — it only trims and appends `.zip`, preserving case and spaces.
The actual download, however, is written by `downloadScaffoldPackage` (`action-surface.ts:277`) as:
```ts
a.download = `${pkg.projectName || 'uvai-project'}.zip`;
```
where `pkg.projectName = safeProjectName(input.projectName || 'generated-project')` (`action-surface.ts:128`). `safeProjectName` lowercases and replaces every non-`[a-z0-9-_]` char with `-`.
### Trigger
Any title with uppercase letters, spaces, or special characters (the common case). For title `"AI Gold Rushes"`:
- File saved to disk: `ai-gold-rushes.zip`
- Toast displayed: `AI Gold Rushes.zip`
This mismatch affects the `officialTemplate` success branch, the `studioExportToastMessage` success branch, and the failure branch — defeating the PR's purpose of surfacing the real produced filename so users can locate their download.
## Fix
- Exported `safeProjectName` from `action-surface.ts`.
- Imported it into `OneLoopStudio.tsx`.
- Computed the toast filename from the sanitized name:
```ts
const filename = studioExportFilename(
safeProjectName(selected?.title || 'uvai-project'),
);
```
Because `pkg.projectName` is derived from `safeProjectName(selected?.title || 'uvai-project')` (the passed name is never empty, so both share the same fallback path), the toast filename now exactly matches the downloaded ZIP name in all branches, including the empty/early-return and pre-build failure cases.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: groupthinking <garveyht@gmail.com>
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🔍 PR Validation |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
groupthinking
marked this pull request as ready for review
September 12, 2026 10:05
Contributor
🔴 E2E Test Results: FAILURE DETECTED
Test Output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Canonical issue
Linked by system automation.
Outcome
Studio export now emits one live-region toast with a clear outcome message that always includes the
.zipfilename on both success and failure paths.Scope
studioExportToastMessagenow appendsfilenamefor error/empty outcomes, not just success.OneLoopStudio.exportPkgderives the export filename once and passes it to all toast branches (empty, success, catch).Risk
apps/web/src/components/OneLoopStudio.tsxandapps/web/src/lib/studio-pipeline-status.ts.Verification
Head SHA:
91083bbProduction evidence
Not applicable for this PR: change is local UI toast copy/format behavior with no deploy/runtime contract change.
Agent handoff