Skip to content

Add Comic Book Builder preview mode and shareable HTML export - #47

Merged
driver727-pixel merged 1 commit into
mainfrom
copilot/add-preview-and-sharing-feature
Jun 4, 2026
Merged

driver727-pixel merged 1 commit into
mainfrom
copilot/add-preview-and-sharing-feature

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The Comic Book Builder could generate panels and export raw project JSON, but it did not provide a read-through preview of the comic or a simple artifact for sharing completed work. This change adds an in-app preview flow and a standalone HTML export/share path.

  • Preview-first reading flow

    • Adds a dedicated Preview tab to review the comic page-by-page before export.
    • Renders generated panel art with dialogue overlays in reading order.
    • Surfaces incomplete panels with placeholders so unfinished pages are still inspectable.
  • Shareable comic output

    • Adds standalone HTML preview export for a portable, human-readable comic artifact.
    • Adds native share support where available, with HTML download fallback when platform sharing is unavailable.
    • Keeps existing JSON export for source/project interchange.
  • Export generation

    • Introduces a focused HTML document builder for comic projects.
    • Escapes user-authored content before embedding it into exported markup.
  • UI updates

    • Extends Comic Book Builder navigation and export actions to include preview and sharing paths.
    • Adds preview-specific layout/styling for pages, panels, placeholders, and dialogue summaries.
const file = new File([buildComicHtmlDocument(project)], `${slug}-comic-preview.html`, {
  type: "text/html",
});

await navigator.share({
  title: `${project.title} comic preview`,
  text: `Sharing ${project.title} as a standalone comic preview.`,
  files: [file],
});

@driver727-pixel
driver727-pixel marked this pull request as ready for review June 4, 2026 14:12
Copilot AI review requested due to automatic review settings June 4, 2026 14:12
@driver727-pixel
driver727-pixel merged commit 6cec710 into main Jun 4, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an in-app “Preview” reading flow for Comic Book Builder projects and introduces a shareable standalone HTML export path (alongside existing JSON export), enabling page-by-page review and easy sharing of completed comics.

Changes:

  • Added buildComicHtmlDocument() HTML document generator with user-content escaping and panel/dialogue rendering.
  • Introduced a new Preview tab UI (ComicPreview) to review pages/panels (including placeholders for unfinished panels).
  • Expanded export UI to support JSON export, HTML export, and native share (with download fallback), plus new preview/export styling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/features/comic-builder/export-html.ts New standalone HTML builder for comic previews, including escaping and styling.
src/features/comic-builder/export-html.test.ts Vitest coverage for HTML generation and escaping behavior.
src/features/comic-builder/components/ComicPreview.tsx New Preview tab component to render pages/panels and dialogue overlays in-app.
src/features/comic-builder/ComicBuilderStudio.tsx Adds Preview tab, HTML export + share actions, and refactors download logic.
src/features/comic-builder/comic-builder.css Adds preview/export layout styles for the new UI sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +28
function downloadBlob(blob: Blob, filename: string) {
const url = URL.createObjectURL(blob);
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = filename;
anchor.click();
URL.revokeObjectURL(url);
}
Comment on lines +205 to +206
downloadBlob(file, file.name);
setExportMessage("Native sharing is unavailable here, so the preview HTML was downloaded instead.");
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.

3 participants