Provides the cross-platform primitives needed to wrap the mkstack web app
as a native iOS and Android binary using Capacitor, modeled on how Ditto
integrates the framework.
Each helper works unconditionally on every platform \u2014 native builds
use the real Capacitor plugin, web falls back to an equivalent browser
API:
- haptics: impactLight/Medium/Heavy, notificationSuccess/Warning/Error,
selectionChanged \u2014 taptic engine on native, navigator.vibrate() on
web, silent no-op where neither exists
- downloadTextFile / openUrl \u2014 @capacitor/filesystem and native
share sheet on native, <a download> and window.open on web
- secureStorage + useSecureLocalStorage \u2014 iOS Keychain / Android
KeyStore adapter with automatic migration of existing plaintext values
from localStorage on first native read, plus an async-aware React hook
that exposes a 'ready' flag
- DeepLinkHandler \u2014 listens for Capacitor appUrlOpen and forwards
into React Router navigation
- bootstrapNative() \u2014 hides the iOS keyboard accessory bar and keeps
the system-bar icon style in sync with the active CSS theme via
MutationObserver on both the <html> class and the theme-vars style
element; detects dark background from theme class or computed body
luminance
- safe-area CSS utilities \u2014 .safe-area-top/-bottom/-left/-right
padding classes plus .safe-area-inset-top/-bottom positional variants,
preferring --safe-area-inset-* CSS vars (injected by the SystemBars
plugin on Android) over env(safe-area-inset-*) so Chromium <140 on
Android Just Works
- capacitor.config.ts template \u2014 preconfigured with androidScheme
https, ios contentInset never, SystemBars insetsHandling css; placeholder
appId / appName / scheme ready to be customized
- patch-cap-config.mjs \u2014 post-cap-sync hook that restores
packageClassList entries for local (non-SPM) native plugin classes so
they get registered at startup
SKILL.md documents the full setup sequence: install the nine
@capacitor/* + capacitor-secure-storage-plugin packages, copy files
into src/, paste the CSS snippet into index.css, edit capacitor.config.ts
identity fields, add viewport-fit=cover, wire bootstrapNative() into
main.tsx and DeepLinkHandler into AppRouter, npx cap add android / ios,
build, sync, run. Also covers common follow-ups (custom plugins, icons,
splash, push, deep-link verification, credential manager integration)
and troubleshooting (safe-area zero on Android, navigation no-op, keychain
orphaning, keyboard accessory bar timing, custom theme detection).
Validated: all files staged into src/ + deps installed \u2014 npm run
test passes with only the 6 pre-existing baseline errors (template
FIXMEs + missing index.html manifest/meta), then cleanly reverted.
Replaces the minimal NoteContent component with the full-featured
version from ~/Projects/ditto, and bundles the helper modules and
minimal companion stubs needed to make it work standalone.
New capabilities:
- BOLT11 lightning-invoice detection (renders LightningInvoiceCard)
- Inline image / video / audio / webxdc embeds with MIME detection
- Consecutive images grouped into an ImageGallery with shared Lightbox
- NIP-94 imeta-declared media appended when absent from content
- Embedded nevent / naddr cards, with relay and author hints pulled
from q tags; supports naddr1 fragments embedded in external URLs
- Bare and @-prefixed NIP-19 identifiers (no nostr: prefix required)
- Line-end-aware link rendering: URLs at the end of a line become
preview cards, mid-sentence URLs stay inline
- Trailing-punctuation stripping on URLs so 'see https://x.com.'
links correctly
- wss:// relay URLs routed to /r/<encoded>
- Unicode-aware hashtag regex (matches non-ASCII letters)
- NIP-30 custom emoji via :shortcode: with per-event and viewer-wide
fallback collections (useCustomEmojis)
- Flag emoji linkified to /i/iso3166:<CC>
- 'Emoji-only' posts auto-rendered at large size
- dir="auto" for RTL content
- Whitespace normalization around block embeds
- disableEmbeds / disableMediaEmbeds / disableNoteEmbeds /
hideEmbedImages props for recursive embed cards and preview
contexts
New bundled files:
- lib/: mediaUrls.ts, sanitizeUrl.ts, imeta.ts, customEmoji.ts,
getDisplayName.ts, avatarShape.ts, countries.ts
- hooks/: useCustomEmojis.ts (stub), useBlossomFallback.ts (stub),
useProfileUrl.ts (stub)
- components/: LinkEmbed, EmbeddedNote, EmbeddedNaddr,
LightningInvoiceCard, VideoPlayer, AudioVisualizer, WebxdcEmbed,
ImageGallery + Lightbox, ProfileHoverCard, CustomEmoji \u2014 all
minimal but functional stubs; each file documents how to upgrade
to a richer implementation
SKILL.md rewritten with full file list, upgrade paths for each
stub, routing expectations, and a patterns-to-render table.
Validated: tsc --noEmit clean, vitest run passes all 5 NoteContent
tests, vite build succeeds \u2014 when all skill files are staged
into src/ alongside the component.
Moves src/components/NoteContent.tsx and its test file into a new
note-content skill at .agents/skills/note-content/. The component
linkifies URLs, hashtags, and Nostr URIs (npub/nprofile/note/nevent)
inside plaintext event content, and was previously imported only by
the comments and DM stacks that have already been extracted/removed.
Also removes the 'Rendering Rich Text Content' section from
AGENTS.md since NoteContent is no longer part of the default
template surface. The new SKILL.md documents the expected /:nip19
and /t/:hashtag routes and the existing template hooks it relies on
(useAuthor, genUserName).
Moves src/components/RelayListManager.tsx into a new
relay-management skill at .agents/skills/relay-management/, with a
SKILL.md covering installation, NIP-65 background, and how the
component hooks into the existing AppContext / NostrSync / kind
10002 publishing already present in the core template.
AGENTS.md's 'Relay Management' section keeps the NIP-65 sync
description but drops the RelayListManager usage example, pointing
at the new skill instead.
Moves src/components/EditProfileForm.tsx into a new edit-profile
skill at .agents/skills/edit-profile/, with a SKILL.md covering
installation, the kind 0 fields it edits (name, about, picture,
banner, website, nip05, bot), and the existing template hooks it
plugs into (useCurrentUser, useNostrPublish, useUploadFile,
useToast).
Also removes the 'Nostr Edit Profile' section from AGENTS.md since
the component is no longer part of the default template surface.
Moves src/hooks/useShakespeare.ts into
.agents/skills/ai-chat/files/hooks/useShakespeare.ts and prepends
setup instructions to the existing SKILL.md.
Also removes the useShakespeare bullet from AGENTS.md since the hook
is no longer part of the default template surface.
Moves the NIP-22 (kind 1111) commenting stack out of src/ and into
.agents/skills/nostr-comments/files/ \u2014 useComments, usePostComment,
and the Comment / CommentForm / CommentsSection components.
Updates the existing SKILL.md with a setup preamble explaining how
to copy the files back into src/ when a project needs comment
functionality. No dependency changes were required; the skill only
uses packages already present in the template.
Deletes the entire DM stack \u2014 DMProvider, DMContext, the dm/ UI
components, useDMContext, useConversationMessages, the dm* library
modules, pages/Messages.tsx, and the nostr-direct-messages skill.
Also drops the idb dependency, which was only used by the DM
IndexedDB message store.
The implementation was complex and tightly coupled; removing it
clears the way for a future, cleaner approach if DM support is
needed again.
Moves NWC wallet connection (useNWC, NWCContext, WalletModal) along with
the WebLN wallet detection (useWallet) and NIP-57 zap stack (useZaps,
ZapButton, ZapDialog) out of src/ and into .agents/skills/nwc/ as an
opt-in skill. Removes NWCProvider from App.tsx and TestApp.tsx, drops
the NWC-only dependencies (@getalby/sdk, @webbtc/webln-types) from
package.json, and updates AGENTS.md to stop referencing the extracted
hooks and components.
The new SKILL.md explains how to reinstall the dependencies, copy the
files back into src/, and wire up NWCProvider when a project actually
needs Lightning wallet and zap functionality.
@radix-ui/react-popper 1.2.4 had a useEffect with no dependency array
that called setState on every render, causing an infinite loop. Fixed
in 1.2.8 by tracking the previous anchor in a ref.
Sign kind 22242 AUTH events automatically when relays send challenges.
Uses a signer ref pattern so the pool doesn't need to be recreated
when the user logs in/out or switches accounts.
Upgrade to @nostrify/[email protected] and implement the nostrconnect:// login flow:
- QR code display on desktop, deep link on mobile
- Copy URI button, retry on timeout, abort on dialog close
- Bunker URI manual input as fallback under the Remote Signer tab
- Add QRCodeCanvas component using the existing qrcode dependency