Skip to content

Add project export/download and responsive mobile layout to Playground#4652

Open
shai-almog wants to merge 8 commits intomasterfrom
codex/add-mobile-layout-support-and-download-button
Open

Add project export/download and responsive mobile layout to Playground#4652
shai-almog wants to merge 8 commits intomasterfrom
codex/add-mobile-layout-support-and-download-button

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a way for users to export the current playground as a downloadable CN1 project zip.
  • Improve the Playground editor/preview layout on narrow and portrait devices for a better mobile experience.
  • Expose a toolbar action to trigger the export/download flow from the UI.

Description

  • Added PlaygroundProjectExporter which composes a minimal CN1 project (Java source and theme CSS), zips it using zipme, and returns a Base64-encoded zip via ExportedProject.
  • Added a download icon to the toolbar that calls downloadProject(), which uses PlaygroundProjectExporter.build() and triggerBrowserDownload() to either invoke browser-based blob download via the shared BrowserComponent JavaScript context or fall back to copying the Base64 payload to the clipboard.
  • Implemented triggerBrowserDownload() and escapeJsString() to run safe JS that creates a Blob and triggers a file download in the browser, and added responsive layout logic in createMainContent() to present a two-tab mobile view in portrait mode while preserving the large-screen SplitPane and stacked layout fallbacks.

Testing

  • Ran a local project assemble build (./gradlew assemble) which completed successfully.
  • No automated unit tests were added or modified for this change.
  • Manual verification was performed to confirm the toolbar button triggers the exporter and that the layout adapts between large, portrait, and stacked modes.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant