Skip to content

Web: let the hosting page offer its own storage for Open and Save #4111

Open

Description

@hayone1

What I'd like

When a website hosts the browser version of VectorCraft, it should be able to offer its own file storage (like a cloud drive or a team folder) in File › Open and when saving.

Why

Right now the browser version can only open files from the device and save by downloading. That works, but:

  • People on an iPad or a shared computer have nowhere good to keep their work.
  • After you open a file and edit it, File › Save downloads a new copy. It can't put the file back where it came from.

We host VectorCraft for a small team with a shared cloud folder. To make Open and Save use it, we patch the web build. A small, built-in hook would let any host do this, and it changes nothing for everyone else.

Proposal

If the page defines window.craftStorage, the web build uses it:

window.craftStorage = {
  async chooseOpen(extensions) { /* {path, bytes}, "device", or null */ },
  async chooseSave(suggested)  { /* a path, "device", or null */ },
  async write(path, bytes)     { /* save the file */ },
};
  • "device" means: use the browser's normal picker or download.
  • null means the user cancelled.
  • Paths from the host have their own prefix, like cloud:home/art/logo.svg. A document opened from the host keeps that path, so File › Save writes back to it.
  • Without window.craftStorage, nothing changes.

The same hook is proposed for PhotoCraft, so a host only has to write it once.

I have a PR ready for this.

Activity

  1. hayone1 commented on Nov 13, 2026

    @hayone1
    Author

    This issue asked for File › Open and Save to use storage that the hosting page offers. The plan now is craft-page-storage, a craft-cloud destination, once storytold/craft-libs#160 lands. Here is what it makes possible.

    Craft apps inside VS Code, used by a person or by an AI agent

    I want to show what this kind of change makes possible. I built a small VS Code extension, craft-vscode. It opens the Craft apps as tabs inside VS Code. It works in VS Code on the desktop, and in a browser through code-server or a cloud workspace such as Coder.

    1. A person, the app and the workspace files together

    PhotoCraft opens a picture straight from the VS Code workspace with its own File › Open. File › Save As writes back into the workspace, and the new file shows up in the Explorer at once. A file dragged from the Explorer onto the app opens in the app.

    PhotoCraft in VS Code: open from the workspace, save into it, drag a file in

    2. An AI agent working across two apps

    Claude Code runs in VS Code's terminal. It gets one prompt and does the rest through the apps' own command APIs. It opens a picture in PhotoCraft, adds a title, and saves the result into the workspace. Then it opens EffectCraft, brings in the same file, animates it, and saves the project into the workspace too. Each file passes from one app to the next through the workspace, where you can see it in the Explorer.

    Claude Code drives PhotoCraft and EffectCraft and moves files between them through the workspace

    Why this matters

    The apps are WebAssembly, so they run on the user's own device and use its own graphics chip. The workspace, the files and the agent can live in the cloud. This means a device with only a browser, such as an iPad, gets full photo, vector and motion editors. It also gets an AI agent that works inside those apps, and one place for files that every app and the agent share. As far as I know, nobody has put full creative apps, a code editor and an AI agent together this way before. I think it could change how people make media on light devices.

    What the apps need for this

    craft-vscode works today with app builds that add a few small page scripts. With these pieces upstream, it would work with the official builds instead:

    craft-vscode could live in storytold

    I'm happy to contribute craft-vscode to the storytold organization, so that it lives next to the apps and follows their contracts. If that sounds useful, tell me where you would like it and I will move it and keep maintaining it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions