Skip to content

Include ZIP filename in Studio export success/failure toast - #1811

Merged
groupthinking merged 4 commits into
mainfrom
copilot/fix-studio-export-toast
Sep 12, 2026
Merged

Include ZIP filename in Studio export success/failure toast#1811
groupthinking merged 4 commits into
mainfrom
copilot/fix-studio-export-toast

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Canonical issue

Linked by system automation.

Outcome

Studio export now emits one live-region toast with a clear outcome message that always includes the .zip filename on both success and failure paths.

Scope

  • Included:
    • Toast message contract: studioExportToastMessage now appends filename for error/empty outcomes, not just success.
    • Studio export wiring: OneLoopStudio.exportPkg derives the export filename once and passes it to all toast branches (empty, success, catch).
    • Regression coverage: export toast test now asserts filename presence in failure text.
    • Example:
      const toast = studioExportToastMessage({
        ok: false,
        error: 'Disk full',
        filename: 'AI Gold Rushes.zip',
      });
      // => "Disk full (AI Gold Rushes.zip)"
  • Explicitly excluded:
    • No changes to export package generation/download behavior.
    • No additional toasts, UI flow changes, or accessibility role changes.

Risk

  • Risk level: low
  • Failure mode: toast text formatting regressions (message composition only).
  • Rollback: revert touched files in apps/web/src/components/OneLoopStudio.tsx and apps/web/src/lib/studio-pipeline-status.ts.

Verification

Head SHA: 91083bb

  • Focused tests
  • Required CI
  • Review threads resolved

Production evidence

Not applicable for this PR: change is local UI toast copy/format behavior with no deploy/runtime contract change.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 12, 2026 10:06am UTC

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
Copilot AI requested a review from groupthinking September 8, 2026 23:08
Comment thread apps/web/src/components/OneLoopStudio.tsx Outdated
…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>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c3e9cb9e-b374-414b-95fb-d1d5e3197c49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Validation

⚠️ PR title should follow conventional commits format

@github-actions github-actions Bot added javascript Pull requests that update javascript code tests labels Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 66d9d6b.
Ensure 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 Files

None

@groupthinking
groupthinking marked this pull request as ready for review September 12, 2026 10:05
@groupthinking
groupthinking merged commit 4ca1be5 into main Sep 12, 2026
14 of 16 checks passed
@groupthinking
groupthinking deleted the copilot/fix-studio-export-toast branch September 12, 2026 10:05
@github-actions

Copy link
Copy Markdown
Contributor

🔴 E2E Test Results: FAILURE DETECTED

Metric Value
Status 🔴 RED
Total Tests 6
Passed 11
Failed 6
Deployment https://v0-uvai-82iqeloli-garv1.vercel.app
Test Output
2m''�[39m�[33m;�[39m
    �[90m190|�[39m       �[34mexpect�[39m(ct)�[33m.�[39m�[34mtoContain�[39m(�[32m'text/event-stream'�[39m)�[33m;�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/6]⎯�[22m�[39m

�[41m�[1m FAIL �[22m�[49m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mSSE Pipeline Stream�[2m > �[22mSSE stream emits at least a pipeline_status:running event
�[31m�[1mAssertionError�[22m: expected 0 to be greater than or equal to 1�[39m
�[36m �[2m❯�[22m tests/e2e/pipeline.test.ts:�[2m208:29�[22m�[39m
    �[90m206|�[39m
    �[90m207|�[39m       �[90m// Must have at least 1 event�[39m
    �[90m208|�[39m       �[34mexpect�[39m(events�[33m.�[39mlength)�[33m.�[39m�[34mtoBeGreaterThanOrEqual�[39m(�[34m1�[39m)�[33m;�[39m
    �[90m   |�[39m                             �[31m^�[39m
    �[90m209|�[39m
    �[90m210|�[39m       �[90m// Must start with pipeline_status:running�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/6]⎯�[22m�[39m

�[41m�[1m FAIL �[22m�[49m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mError Handling�[2m > �[22mmissing URL returns 400, not a hang
�[31m�[1mAssertionError�[22m: expected 401 to be 400 // Object.is equality�[39m

�[32m- Expected�[39m
�[31m+ Received�[39m

�[32m- 400�[39m
�[31m+ 401�[39m

�[36m �[2m❯�[22m tests/e2e/pipeline.test.ts:�[2m358:26�[22m�[39m
    �[90m356|�[39m
    �[90m357|�[39m       �[35mconst�[39m elapsed �[33m=�[39m �[33mDate�[39m�[33m.�[39m�[34mnow�[39m() �[33m-�[39m start�[33m;�[39m
    �[90m358|�[39m       �[34mexpect�[39m(res�[33m.�[39mstatus)�[33m.�[39m�[34mtoBe�[39m(�[34m400�[39m)�[33m;�[39m
    �[90m   |�[39m                          �[31m^�[39m
    �[90m359|�[39m       �[34mexpect�[39m(elapsed)�[33m.�[39m�[34mtoBeLessThan�[39m(�[34m5_000�[39m)�[33m;�[39m �[90m// Should respond instantly�[39m
    �[90m360|�[39m     })�[33m;�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/6]⎯�[22m�[39m

�[41m�[1m FAIL �[22m�[49m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mAPI Health�[2m > �[22mPOST /api/pipeline/stream with no body returns 400
�[31m�[1mAssertionError�[22m: expected [ 400, 500 ] to include 200�[39m
�[36m �[2m❯�[22m tests/e2e/pipeline.test.ts:�[2m441:26�[22m�[39m
    �[90m439|�[39m       )�[33m;�[39m
    �[90m440|�[39m       �[90m// Should handle gracefully — 400 or 500, but respond quickly�[39m
    �[90m441|�[39m       �[34mexpect�[39m([�[34m400�[39m�[33m,�[39m �[34m500�[39m])�[33m.�[39m�[34mtoContain�[39m(res�[33m.�[39mstatus)�[33m;�[39m
    �[90m   |�[39m                          �[31m^�[39m
    �[90m442|�[39m     })�[33m;�[39m
    �[90m443|�[39m   })�[33m;�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/6]⎯�[22m�[39m


�[2m Test Files �[22m �[1m�[31m1 failed�[39m�[22m�[90m (1)�[39m
�[2m      Tests �[22m �[1m�[31m6 failed�[39m�[22m�[2m | �[22m�[1m�[32m11 passed�[39m�[22m�[90m (17)�[39m
�[2m   Start at �[22m 11:07:43
�[2m   Duration �[22m 4.88s�[2m (transform 48ms, setup 0ms, import 60ms, tests 4.71s, environment 0ms)�[22m


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Studio export toast success/failure to include ZIP filename

2 participants