kheMessage has no build step. You can run it in several ways:
Open index.html in a browser. Note: some features (service worker, /qr routing) work best with a local server.
# Python
python -m http.server 8000
# Node (if npx available)
npx serve .
# PHP
php -S localhost:8000Then visit http://localhost:8000.
Tip: Encryption (password lock) requires HTTPS or localhost because WebCrypto is only available in secure contexts.
Use the Live Server extension to serve the project.
- JavaScript: ES2020+, camelCase, async/await for async operations
- CSS: Use custom properties (
--bg,--text, etc.) for theming - localStorage: Wrap in try/catch
- Comments: Add for complex logic; use
// ====section headers - Naming: Follow existing conventions (e.g.
blocksToHash,hashToBlocks)
| Feature type | Location in index.html |
|---|---|
| New block type | BLOCK_TYPES, TYPE_NAMES, renderBlocks, slash menu |
| New UI element | HTML section (~800–1800), CSS section, JS event handlers |
| New export format | download* functions in Export section |
| New compression format | Compression section (~2525), format byte constants |
| New theme | CSS html.new-theme variables, theme toggle logic |
kheMessage/
├── index.html # Main app (CSS + HTML + JS)
├── qr.html # Full-page QR view
├── qrcode.js # QR generation library
├── sw.js # Service worker
├── manifest.json # PWA manifest
├── 404.html # Fallback for invalid routes
├── vercel.json # Vercel config
└── docs/ # Documentation
See docs/TESTING.md for the full testing checklist. Before submitting a PR:
- Test locally in Chrome, Firefox, Safari
- Test both light and dark themes
- Test PWA (install, offline)
- Test keyboard navigation
- Check console for errors
- Share URL computation: The app computes the share URL from the current saved hash (origin + path + optional theme + hash). Status bar and QR use this computed URL so the displayed size matches the actual share link.
- Limits are conservative: The 8 KB “danger” threshold is a safety limit; real platform maximums vary. The app blocks input at the danger threshold to prevent broken links.
- Local files: When running from
file://, share URLs reuse the current file path + hash becauselocation.originisnull.
The project includes .cursor/ with:
- Rules: Project overview, PWA, version history, testing guidelines
- Commands: deploy, add-feature, fix-bug, code-review, etc.
- Skills: compression-utils, editor-core, qr-code, markdown-enhancement, theme-customization, web-design-guidelines
- Agents: reviewer, tester, documenter, accessibility