Skip to content

refactor(playground)!: replace the saved-deck library with deck export - #124

Merged
leoafarias merged 5 commits into
mainfrom
refactor/playground-export
Sep 23, 2026
Merged

leoafarias merged 5 commits into
mainfrom
refactor/playground-export

Conversation

@leoafarias

@leoafarias leoafarias commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Make the playground one flow: generate a deck, present it, and export it. The saved-deck library (save to a remembered folder, list, reopen) is gone. It needed a set of ownership rules because a saved deck and a freshly generated deck could share the app at the same time. With one deck per run, those rules have nothing left to coordinate.

Export deck saves a zip through the platform save dialog:

slides.md   generated Markdown, images referenced as assets/<file>
assets/     generated artwork

The unzipped folder is a standard SuperDeck project. The export carries the Markdown and artwork, not the generated theme.

Commits

  1. fix: MemoryDeckLoader.reload re-emits the last result. SuperDeck's retry screen calls reload(), which used to do nothing, so a waiting session stayed loading. This fix comes from fix(pdf): release export captures; record the architecture audit #121.

  2. feat: DeckExport builds the project files and the zip, rewriting each bare asset key to assets/<key>. A follow-up commit names the export after the deck topic, as the old save dialog did, and encodes the zip off the UI isolate.

  3. refactor!: the library is replaced with export. Removed:

    • the saved-decks page and /decks route
    • DeckLibraryController, MacOsDeckLibrary and its .deck.json manifest
    • the saved-deck artwork binding
    • security-scoped bookmarks in both Dart and Swift, with their entitlement and Xcode project entries
    • Result
    • DeckDocumentStore, whose only reader was the library save

    Generated artwork now resolves from the in-memory store. file_saver is registered as a macOS plugin.

  4. docs: the playground README and AGENTS.md describe export.

Impacted packages

playground only.

Commands run

  • fvm dart run melos bootstrap and melos run build_runner:build --no-select: no generated-file drift
  • fvm dart analyze --fatal-infos in all 7 packages and playground test_live: no issues
  • fvm flutter test in playground: 371 passing. New tests cover export building, the zip round trip, and the Wizard export flow: success, cancel, failure, and a new run clearing the notice. The library tests are removed.
  • plutil -lint on project.pbxproj and both entitlements files, and xcrun swiftc -parse on MainFlutterWindow.swift: clean

macOS plugins are integrated through Swift Package Manager (FlutterGeneratedPluginSwiftPackage), and file_saver 0.4.0 ships a Package.swift, so Podfile.lock does not change.

Not run: a macOS app build. Both macOS runners target 10.15, which current Xcode rejects. Please run the app once to check the save dialog after the deployment target is raised.

SuperDeck's retry screen calls reload(), and the in-memory loader ignored it, so a session waiting on the reload could stay loading. Reload now repeats the last decoded slides or error, or reports that no markdown was supplied.
DeckExport lays out slides.md and its generated artwork under assets/, rewriting each bare asset key to a relative path any SuperDeck project can load, and encodes the result as a zip.
The Wizard now exports the deck it generated as a zip (slides.md plus assets/) through the platform save dialog, instead of saving into a remembered SuperDeck folder that the app lists and reopens.

Removed with the library: the saved-decks page and route, DeckLibraryController, MacOsDeckLibrary and its manifest, the saved-deck artwork binding, security-scoped bookmarks on the Dart and Swift sides with their entitlement, Result, and DeckDocumentStore, whose only reader was the library save. Generated artwork now resolves from the run's in-memory store alone.
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit e2152d4):

https://superdeck-dev--pr124-refactor-playground-csi9r3rm.web.app

(expires Fri, 23 Oct 2026 02:19:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9

… isolate

The save dialog now suggests the deck's topic, as the old save dialog did, falling back to the first slide title. Encoding the zip compresses every generated image, so it runs through compute instead of blocking frames.
@leoafarias
leoafarias merged commit 6712a6e into main Sep 23, 2026
5 checks passed
@leoafarias
leoafarias deleted the refactor/playground-export branch September 23, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant