Skip to content

What should my app do with a generation result after the user closes its editor?

Closing an editor should detach that view from the task, while accepted generation remains tracked in your application. Store the result under its project and submitted version, then surface it in a task inbox or project history. Closing a screen does not cancel AISwapLab work.

DESIGN A CLEAR API PRODUCT EXPERIENCEAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Record a destination before dispatch; Detach view callbacks safely; Make late results discoverable.
Workflow diagram: Record a destination before dispatch → Detach view callbacks safely → Make late results discoverable. Read the article for evidence and limits.

View lifetime differs from task lifetime

A person may navigate away because the job is slow, not because the asset is unwanted. Another may abandon the draft entirely. Your app should preserve paid work without reopening dismissed screens, changing the current project selection or treating navigation as a cancellation request.

What to do next

  1. 01

    Record a destination before dispatch

    Associate the approved action with a durable project or inbox destination that survives closing the editor. Do not rely on the component's in-memory callback to decide where a completed result belongs.

  2. 02

    Detach view callbacks safely

    When the editor closes, remove subscriptions and preview resources while leaving backend task tracking intact. Mark whether the user wants completion notices through your application's preferences, independently of the generation's remote state.

  3. 03

    Make late results discoverable

    Add completed work to project history or an inbox with its submitted prompt revision and creation time. Let users open or dismiss that entry deliberately rather than navigating them away from their current work.

A concrete example

Illustrative example: a user closes a poster draft and opens a video project. The poster result later appears in the poster project's history. The current video editor remains unchanged, and the poster is still available for review.

Before you call it ready

  • Closing the editor keeps the durable task.
  • Late completion never changes the current project.
  • History identifies the submitted draft version.

When to stop or choose another method

Stop using component cleanup as evidence that generation was cancelled or that a result can be discarded without a product policy.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation