mirror of
https://github.com/Louis-CFM/coucou.git
synced 2026-12-07 07:32:35 +09:00
The island gets a recap view that opens on Monday from 8 am, once a week, when the app starts, an agent starts working or the island wakes, and any time from the tray. "Share image" flips the card to a share panel: a 1080 x 1920 PNG with Mochi drawn by the island's engine, saved into Pictures or Downloads, or copied through the web clipboard; project names can be hidden. Settings -> General gets the history toggle and Clear history. dev/recap-preview.html shows it all on the sample week. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
929 B
TypeScript
24 lines
929 B
TypeScript
// The weekly recap card in a real island, and the shared image with and
|
|
// without project names, on the sample week of scripts/test-weekly-recap.swift.
|
|
// `npm run dev`, then open /dev/recap-preview.html. Not shipped in the app.
|
|
|
|
import "../src/style.css";
|
|
import { Island } from "../src/island/island";
|
|
import { Recap } from "../src/recap/recap";
|
|
import { renderShareImage } from "../src/recap/share";
|
|
|
|
const island = new Island(document.getElementById("root")!);
|
|
await Recap.open(island);
|
|
|
|
const images = document.getElementById("images")!;
|
|
const summary = Recap.summary;
|
|
if (summary) {
|
|
for (const [hide, caption] of [[false, "Shared image"], [true, "Project names hidden"]] as const) {
|
|
const img = document.createElement("img");
|
|
img.src = renderShareImage(summary, hide).toDataURL("image/png");
|
|
const figure = document.createElement("figure");
|
|
figure.append(img, caption);
|
|
images.append(figure);
|
|
}
|
|
}
|