Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ core 继续负责 presenter 文档生成;Node runtime 负责文件系统资源
runtime 可以 best-effort 写入 Finder custom icon;该步骤属于本机文件系统增
强,失败时不能影响 HTML 导出。

macOS Finder 的 Quick Look / Get Info 预览不可靠读取 HTML favicon、Open
Graph metadata 或 Finder custom icon。为改善该预览,导出的 HTML 可以在
首屏放置一个静态 Quick Look logo poster,并由浏览器 runtime 立即隐藏它。
这个 poster 属于导出文档的静态 fallback,不应影响正常 presenter runtime。

## Alternatives considered

### Open browser fullscreen with the existing editor iframe
Expand Down
5 changes: 5 additions & 0 deletions docs/skills-references/STARRY-SLIDES-CLI-USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ favicon、apple touch icon、Open Graph image 和 theme color。在 macOS 上通
CLI 写入本地文件时,runtime 会 best-effort 写入 Finder custom icon;如果系统
命令不可用或写入失败,HTML 导出仍会成功。

导出的 HTML 还包含一个静态 Quick Look logo poster。macOS Finder 的 “Get
Info” 预览区域通常不会读取 HTML favicon 或 Open Graph metadata,但会渲染
HTML 的静态首屏;runtime 会在浏览器打开时隐藏这个 poster,让正常播放界面直
接显示。

Example result:

```json
Expand Down
19 changes: 19 additions & 0 deletions packages/slides-core/src/html-export.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { describe, expect, test } from "vitest";
import {
STARRY_SLIDES_EXPORT_ICON_DATA_URL,
STARRY_SLIDES_EXPORT_ICON_PNG_BASE64,
STARRY_SLIDES_QUICKLOOK_POSTER_DATA_URL,
STARRY_SLIDES_QUICKLOOK_POSTER_PNG_BASE64,
createSingleHtmlExportDocument,
planHtmlExportSlides,
} from "./html-export.js";
Expand Down Expand Up @@ -73,4 +76,20 @@ describe("single HTML export", () => {
expect(iconBytes.readUInt32BE(16)).toBe(1024);
expect(iconBytes.readUInt32BE(20)).toBe(1024);
});

test("includes a static Quick Look poster that the browser runtime hides", () => {
const document = createSingleHtmlExportDocument({
title: "Preview Deck",
slides: [slideA],
});
const posterBytes = Buffer.from(STARRY_SLIDES_QUICKLOOK_POSTER_PNG_BASE64, "base64");

expect(document).toContain("document.documentElement.classList.add('starry-runtime')");
expect(document).toContain('class="starry-quicklook-poster"');
expect(document).toContain(`src="${STARRY_SLIDES_QUICKLOOK_POSTER_DATA_URL}"`);
expect(document).not.toContain(`class="starry-quicklook-poster" aria-hidden="true">
<img src="${STARRY_SLIDES_EXPORT_ICON_DATA_URL}"`);
expect(document).toContain(".starry-runtime .starry-quicklook-poster{display:none!important}");
expect(posterBytes.subarray(0, 8).toString("hex")).toBe("89504e470d0a1a0a");
});
});
14 changes: 13 additions & 1 deletion packages/slides-core/src/html-export.ts

Large diffs are not rendered by default.

Loading