AI handoff

Architecture

This Cloudflare Pages build is a static port of Sniplets desktop 0.1.8. Serve the directory containing index.html as the Pages output directory. Scripts load in order from the vendored Markdown renderer to sniplets.js and then renderer.js.

Data and storage

The bridge returns { items, shortcutRegistered, palettePreset, buildInfo }. Each item has a numeric id, a kind of folder or snippet, a name, string content, and nullable parentId. The browser stores items in sniplets.library and display settings in sniplets.meta.

Seed only when the library key is absent. An empty array represents an intentionally empty library. Validate a restore before writing it. JSON exports wrap the item array in { app, version, items }. Desktop backups are SQLite. Convert only the needed item fields for web import, and keep personal libraries outside the Pages output directory.

Slash commands are derived from titles and any stored shortcut when the library loads. The versionless title is shown in results and the complete title remains searchable. Slash mode ranks exact names first and searches across all folders. Changing a title or restoring a backup rebuilds the command index.

Verify and prepare a release

  1. Serve the deploy root over local HTTP, for example with python -m http.server 8765. Open http://localhost:8765/.
  2. In a fresh browser profile, verify the starter data, both help links, search, Markdown, copy, and folder navigation.
  3. Create and edit a snippet, reload, and verify it persists. Test JSON download, valid restore, and rejection of invalid folder relationships.
  4. Check the narrow layout and desktop size presets. Upload only the static output directory. Keep any browser profile or private export separate.

See the Cloudflare Pages Direct Upload guide for the upload workflow.