Commit Graph

676 Commits

Author SHA1 Message Date
Jeff Emmett e7c285c752 feat(canvas): replace snap-push with continuous soft repulsion
Shapes that overlap now drift apart gently over ~1 second via an
ambient requestAnimationFrame loop, instead of snapping instantly
when dragged. folk-slide and folk-arrow are exempt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:22:06 -07:00
Jeff Emmett 47b1642156 fix: TDZ error from panX/panY/scale declared after await, add HTML no-cache
Root cause: scale/panX/panY were declared with let at line 5014, but
event handlers referencing them were registered before line 2771. Since
the module has top-level awaits (offlineStore.open, sync.initFromCache),
execution yields and events can fire before the let declarations,
causing "Cannot access variable before initialization" TDZ errors.

Fix: hoist scale/panX/panY declarations to before any await statements.
Also add Cache-Control: no-cache for HTML files and immutable for
Vite content-hashed assets to prevent stale bundle caching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:56:30 -07:00
Jeff Emmett 1568a5d0dc feat: user dashboard shown when all tabs are closed
When the last tab is closed, a dashboard appears showing the user's
spaces (sorted by most recent visit), notifications, and quick actions.
Clicking any item creates a new tab and hides the dashboard. Browser
back/forward handles dashboard state correctly.

Also adds proper cache headers for HTML and Vite-hashed assets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:55:39 -07:00
Jeff Emmett bee09b0e43 fix(canvas): toolbar labels pop out to the right as tooltips
Labels now appear as floating tags outside the toolbar on hover/open
instead of expanding the button width inside the narrow toolbar.
Toolbar overflow changed to visible so labels aren't clipped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:38:55 -07:00
Jeff Emmett eac0817d4f fix(canvas): show emoji + title in toolbar panel header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:29:01 -07:00
Jeff Emmett 0645628fb6 fix(canvas): mobile toolbar uses icon grid, tap to open panel
- Mobile toolbar shows compact 48x48 icon grid instead of full-width rows
- Labels hidden on mobile, title shown in popout panel header
- Separators hidden on mobile to save space
- Tap icon to open bottom-sheet panel with title + sub-tools

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:25:14 -07:00
Jeff Emmett fb69b41da6 fix(canvas): toolbar icons show title label on hover/open and in panel header
- Add tg-icon + tg-label spans inside toolbar group toggle buttons
- Label hidden by default, revealed on hover/open via CSS
- Panel header uses title attribute instead of emoji-only textContent
- Plus menu headings also use title attribute for group names
- Mobile: labels always visible alongside icons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:22:10 -07:00
Jeff Emmett 5842bd9f9a fix: attachShadow guard, null toggleMemoryBtn, register canvas components
- Add if (!this.shadowRoot) guard in history panel and space settings
  connectedCallback to prevent error on element reconnection
- Null-check toggleMemoryBtn before addEventListener since #toggle-memory
  element was removed
- Import and register RStackSpaceSettings + RStackHistoryPanel in
  canvas.html so settings gear and history panel work on canvas page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:15:57 -07:00
Jeff Emmett e9eb56aa2e feat(rmeets): add landing page emphasizing data sovereignty
Rich landing page for rspace.online/rmeets with sections on self-hosted
infrastructure, data sovereignty, ecosystem integrations, and roadmap
(local transcription, BYOS, data integrations).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:04:15 -07:00
Jeff Emmett 9aab4c6409 feat(canvas): replace video chat with rMeets embed in toolbar
Replace folk-video-chat toolbar button with rMeets (Jitsi) rApp
embed in the Connect group. Add rmeets, rschedule, rsocials to
folk-rapp MODULE_META. Add rMeets entry to MI tool schema.

The old folk-video-chat shape remains available for direct use
but is no longer in the toolbar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:01:37 -07:00
Jeff Emmett e76bc09151 fix(canvas): use minimize _ icon instead of chevron for toolbar collapse
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:55:43 -07:00
Jeff Emmett 0cf1db56f4 feat(rmeets): register rMeets as rApp with Jitsi embed
Adds rMeets module with hub page (Quick Meet, Join Room, Jitsi Lobby)
and room pages that embed jeffsi.localvibe.live via renderExternalAppShell.
Jitsi URL configurable via JITSI_URL env var.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:54:10 -07:00
Jeff Emmett d45aaabea7 fix(rflows): theme toggle in shadow DOM + icon-only canvas toolbar
- Fix rFlows light/dark theme: change CSS selectors from :root /
  [data-theme] to :host / :host([data-theme]) so they work inside
  shadow DOM. Mirror data-theme attribute from <html> onto the
  folk-flows-app host element via MutationObserver.
- Canvas toolbar: icons only (no text labels), hover opens group
  name header + submenu flyout. Minimize button moved to top with
  chevron icon, collapses to wrench icon. Mobile gets emoji + text
  via ::after pseudo-element for touch accessibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:39:29 -07:00
Jeff Emmett 0b58ff364b fix(auth): sync .well-known/webauthn origins with EncryptID server
The main server's Related Origins list was stale — it listed 5 generic
r*.online domains instead of the priority domains where passkey ceremonies
actually happen. This caused p2pf socials (socials.p2pfoundation.net) and
other external domains to fail WebAuthn authentication because browsers
couldn't verify them as related origins for RP ID rspace.online.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:27:31 -07:00
Jeff Emmett 2ecea4ebb8 feat: history panel with author attribution + settings gear relocation
Move settings gear to header right (next to identity) on all pages.
Add history clock button in header left that opens a new slide-out
history panel with Activity feed and Time Machine tabs. Embed author
identity (DID, username, timestamp) in Automerge change messages via
JSON envelope, with backward-compatible parsing for old plain strings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:24:27 -07:00
Jeff Emmett f24fee942b feat(rflows): fix text-click drag, smart source labels, Pay by buttons
- Prevent foreignObject HTML clicks from starting node drag (select + inline edit instead)
- New source nodes get personalized "{username}'s stream to {flowName}" label
- Replace source type <select> dropdowns with clickable "Pay by" button grid
  in ICP panel, editor panel, and source modal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:19:46 -07:00
Jeff Emmett a28eb88140 chore: remove dead social.jeffemmett.com redirect labels
Domain has no DNS record and all traffic now routes via demo.rsocials.online.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:26:43 -07:00
Jeff Emmett 0e9d00d2ac feat(rsocials): add Listmonk newsletter page + legacy domain redirect
- Add /newsletter-list route embedding Listmonk via iframe
- Add LISTMONK_URL env var to docker-compose
- Add Traefik redirect: social.jeffemmett.com → demo.rspace.online/rsocials
- Add backlog task for linked wallets security hardening (TASK-HIGH.5)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:15:05 -07:00
Jeff Emmett bc810d34e4 fix(security): low-severity hardening and security headers
- L-1: Remove internal error details from SIWE verify response
- L-2: Stop forwarding raw Safe API error bodies to clients (log server-side)
- L-3: Evict stale keys from nonce rate limiter to prevent memory leak
- L-4: Add input length/type guards on wallet-link verify body fields
- L-5: Sanitize and cap limit query param on Safe transfers route (max 200)
- L-6: Server recomputes addressHash from SIWE address instead of trusting
  client-supplied value for dedup
- L-7: Reset LinkedWalletStore singleton on logout to clear cached keys
- I-1: Add X-Content-Type-Options, X-Frame-Options, Referrer-Policy headers
- I-9: Build EIP712Domain type array dynamically from domain fields in
  ExternalSigner.signTypedData (was hardcoded to empty, dropping fields)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:06:07 -07:00
Jeff Emmett 92fde65d60 fix(security): rate limit, sender verification, icon sanitization, SSRF prevention
- H-3: Rate limit wallet-link nonce to 5 per user per 5 minutes (429)
- H-4: Verify sender address matches JWT walletAddress in add-owner-proposal;
  also include walletAddress in JWT eid claims
- M-1: Sanitize EIP-6963 provider icons — only allow https: and safe
  data:image/(png|jpeg|gif|webp), block SVG and javascript: URIs
- M-2: Validate threshold is a positive integer ≤ newOwnerCount, fetch
  actual Safe owner list for bounds checking
- M-3: Add VALID_ETH_ADDR regex validation to all 9 routes that accept
  address params (Safe proxy, EOA proxy, propose, confirm, execute,
  add-owner-proposal) to prevent SSRF via path traversal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:51:18 -07:00
Jeff Emmett 45f5cea095 fix(security): AES-256-GCM encryption at rest, XSS escape, salted hashes
- C-1: Replace Base64 fake encryption with real AES-256-GCM server-side
  encryption for linked wallet data (HKDF-derived key from JWT_SECRET)
- H-1: Escape token name/symbol in balance table to prevent XSS
- H-2: Salt address hash with user ID to prevent cross-user correlation
- M-4: Remove cleartext sessionStorage cache for linked wallets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:42:09 -07:00
Jeff Emmett 8723aae3f6 fix(encryptid): show success page instead of auto-OIDC redirect
The auto-redirect through OIDC authorize fails because the client app
(Postiz) didn't initiate the OAuth flow and has no matching state.
Instead, show a branded success page with a link to the app. The user
signs in with their passkey when they visit the app normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:31:32 -07:00
Jeff Emmett d861c0ad99 fix(encryptid): harden wallet link flow + add device_registration type
- Atomic nonce consumption prevents TOCTOU races
- SIWE domain validation against allowlist
- Unique constraint on linked_wallets(user_id, address_hash)
- Add device_registration to challenge type enum

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:17:50 -07:00
Jeff Emmett c789481d91 feat(rwallet): link external wallets via EIP-6963 + SIWE
Users can now connect browser wallets (MetaMask, Rainbow, etc.) to their
EncryptID identity via SIWE ownership proof, and view linked wallet
balances in the unified rWallet viewer.

New files:
- eip6963.ts: EIP-6963 multi-provider discovery
- external-signer.ts: EIP-1193 provider wrapper for tx signing
- linked-wallets.ts: encrypted client-side store (same AES-256-GCM pattern)

Server: wallet-link nonce/verify/list/delete routes, linked_wallets table,
Safe add-owner-proposal endpoint, new session permissions.

UI: "My Wallets" section with provider picker, SIWE linking flow,
wallet type badges, and click-to-view for linked wallets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:10:12 -07:00
Jeff Emmett ac156cbbf2 fix(encryptid): fix Docker build context for encryptid compose
Build context was set to parent dir (..) which broke all COPY paths.
Use context: . with additional_contexts for the encryptid-sdk sibling,
matching the pattern in the main docker-compose.yml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:40:32 -07:00
Jeff Emmett b6bc1a756a fix: prioritize ridentity.online in WebAuthn Related Origins
Browsers enforce a 5 eTLD+1 limit on Related Origins. The previous
config dumped all 29 r*.online domains, causing ridentity.online to
be ignored (position 15). Now only lists the 5 domains that actually
need passkey auth: ridentity, rsocials, crypto-commons, p2pfoundation,
rwallet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:37:47 -07:00
Jeff Emmett 9c74bff465 feat: add OIDC admin page for managing clients and email allowlists
Admin UI at /admin/oidc with passkey login, gated by ADMIN_DIDS.
Supports viewing/creating/deleting clients, adding/removing allowed
emails per client, revealing/rotating secrets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:32:19 -07:00
Jeff Emmett 4665d14633 fix: seed OIDC clients after DB init completes
Move OIDC client seeding into the database init IIFE to prevent
race condition where seeding runs before tables are created.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:03:46 -07:00
Jeff Emmett f19a5b9904 feat: add OIDC provider + identity invite flow to EncryptID
Add full OIDC Authorization Code flow (discovery, authorize, token,
userinfo) so external apps like Postiz can authenticate via EncryptID
passkeys through auth.ridentity.online.

Add "Claim your rSpace" identity invite system — authenticated users
can invite friends by email, who register a passkey and optionally
auto-join a space.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:53:37 -07:00
Jeff Emmett 93b6b2eb2c fix(rwallet): use CSS variable theming + soften global light mode
Replace ~30 hardcoded dark hex colors in folk-wallet-viewer with --rs-*
CSS variables so rWallet adapts to both light and dark themes. Warm up
the global light palette from pure white to off-white tones.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:27:07 -07:00
Jeff Emmett f2ce77321f fix(rnotes): remove premature seed from onInit (runs before loadAllDocs)
seedDemoIfEmpty in onInit ran before docs were loaded from disk, causing
duplicate notebooks. Seeding is already handled post-loadAllDocs via
the seedTemplate hook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:16:19 -07:00
Jeff Emmett a689445af5 feat(rcal): add swipe/pan navigation and pinch-to-zoom gestures
Add pointer-based gesture handling to the calendar for lateral navigation
(drag/swipe left/right) and pinch-to-zoom between temporal layers. Also
fix dark mode across 30+ canvas shape components by replacing hardcoded
white backgrounds and input styles with --rs-* CSS custom property
references (with light-mode fallbacks).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:12:47 -07:00
Jeff Emmett fe031094a4 fix(rnotes): resolve global scope for notebook docIds and seeding
The rnotes module has defaultScope: 'global' but several code paths
used the raw space slug instead of the resolved scope:

- subscribeNotebook() built docIds with space slug (e.g. jeff🎶...)
  instead of resolved scope (global🎶...), breaking Automerge sync
- seedDemoIfEmpty() seeded notebooks under space-scoped paths, orphaning
  them when the API queries global-scoped prefix
- onSpaceCreate() created default notebook under space scope

Also migrated 3 orphaned jeff-scoped notebook files to global/ on server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:36:38 -07:00
Jeff Emmett f5388ecc2c fix(rwallet): migrate to new Safe Global API (api.safe.global)
Safe Global deprecated per-chain subdomains (safe-transaction-*.safe.global)
in favour of api.safe.global/tx-service/{shortcode}. The old URLs now 308
redirect, and the /balances/usd/ endpoint no longer exists.

- Update CHAIN_MAP prefixes to new shortcodes (eth, oeth, gno, etc.)
- Switch all Safe API calls to new base URL
- Use /balances/ instead of /balances/usd/ (fiat data no longer available)
- Normalize balance response with native token info and placeholder fiat fields
- Update client to show tokens with non-zero balance even without fiat data
- Update encryptid/server.ts Safe verify endpoint to new API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:57:09 -07:00
Jeff Emmett f9ccd18f15 fix(rnotes): add auth headers to all REST API calls
folk-notes-app was missing Authorization headers on all fetch calls,
causing 403 errors on non-demo spaces. Now uses getAccessToken() from
rstack-identity consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:51:04 -07:00
Jeff Emmett 494568599f fix(rnotes): cache-bust JS/CSS for notebook creation fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:39:55 -07:00
Jeff Emmett c73635dcd3 fix(rsocials): remove redundant /demo space prefix from internal URLs
Subdomain routing (demo.rspace.online) already prepends the space,
so links should use /rsocials/... not /demo/rsocials/...

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:38:57 -07:00
Jeff Emmett 0b5e8198d6 fix(rwallet): always show testnet chains when toggle is on
Testnet chains (Sepolia, Base Sepolia) are now always included in
detection results when testnets are toggled on, even if no native
balance is found. This allows viewing ERC-20 tokens on testnets
where native ETH balance may be zero.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:38:39 -07:00
Jeff Emmett b553acd756 merge: resolve rsocials conflict, keep dev campaigns page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:32:45 -07:00
Jeff Emmett 79f0ebb538 fix(rnotes): create notebook instantly without browser prompt
Skip the browser prompt() dialog — clicking "+ New Notebook" now
immediately creates an "Untitled Notebook" and opens it for editing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:32:03 -07:00
Jeff Emmett 6173e17bb9 feat(rsocials): hub navigation page, route renames, and campaigns listing
Restructure rSocials landing to a hub with navigation cards for Campaigns,
Threads, and Thread Editor. Rename /thread routes to /thread-editor for
clarity. Render campaigns listing inline instead of redirecting. Also
improve rNotes notebook creation to auto-open first note for editing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:31:23 -07:00
Jeff Emmett 01a4c95fa2 chore(rwallet): cache-bust wallet viewer JS (v=2)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:56:36 -07:00
Jeff Emmett b8f32a863e chore(rwallet): cache-bust wallet viewer JS (v=2)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:56:18 -07:00
Jeff Emmett 20c26cd3d7 feat: scope system, cross-space navigation, and spaces-as-layers
Phase 1 — Fix scope system: new scope-resolver.ts resolves global vs
space-scoped docId prefixes. Server middleware sets effectiveSpace on
Hono context. All 18 modules updated to use dataSpace for Automerge
doc access while keeping space for display. Client runtime gets
setModuleScopes() and resolveDocSpace() for local-first scope
resolution.

Phase 2 — Seamless cross-space navigation: TabCache now tracks panes
per space:module key. OfflineRuntime maintains lazy WebSocket
connections per space. Space-switcher dispatches space-switch event
handled client-side with history.pushState instead of full reload.

Phase 3 — Spaces as layers: Layer type extended with spaceSlug and
spaceRole. Tab bar gains "Add Space Layer" picker. Canvas renders
cross-space shapes with visual indicators. Space layers persisted as
SpaceRefs via nesting API. Runtime provides getAllActiveSpaces() and
subscribeModuleAcrossSpaces() for module-level data aggregation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:33:32 +00:00
Jeff Emmett bfb3a588ed feat(rwallet): rich landing UI, testnet toggle, and wallet type badges
Replaces the bare address-only empty state with a full dashboard landing:
hero branding, supported chain chips, feature cards, clickable example
wallets (TEC, Gitcoin, Vitalik), and animated loading spinner.

Adds testnet toggle (off by default) that filters Sepolia/Base Sepolia
from detection endpoints via ?testnets=true query param. Shows Safe
Multisig / EOA Wallet badge when a wallet is loaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:42:23 -08:00
Jeff Emmett be8982f160 chore: switch payment defaults from staging to production
- Transak: default env PRODUCTION, fail if API key missing instead of
  falling back to STAGING_KEY
- Coinbase: default environment production instead of sandbox
- Openfort: default chain ID 8453 (Base mainnet) instead of 84532 (Sepolia)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:28:22 -08:00
Jeff Emmett a62a33b4dc feat: add wallet and spaces sections to EncryptID account page
- My Wallet: shows linked wallet address with rWallet link, plus any
  pending fund claims with "Claim Now" button
- My Spaces: lists communities the user belongs to with role and
  treasury wallet links
- New APIs: GET /api/user/spaces, GET /api/user/claims
- New DB function: listSpacesForUser()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:57:55 -08:00
Jeff Emmett f662881170 fix: cumulative fund claims — deposits accumulate until claimed
Instead of expiring old claims, new deposits add to the existing
pending claim's fiat_amount and extend the expiry. The claim email
shows the updated total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:42:44 -08:00
Jeff Emmett 6c807afeb0 fix: one wallet per EncryptID user, deduplicate fund claims
- OpenfortProvider.findOrCreateWallet() searches by player name before
  creating, ensuring the same email always maps to the same wallet
- Fund claims endpoint expires old pending claims before creating new ones
- Added expireFundClaim() to db layer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:33:45 -08:00
Jeff Emmett 5f3ffcc8d2 feat: add EOA wallet support to rWallet for any address
Previously rWallet only supported Safe multisig wallets. Now it falls
back to EOA detection via public RPC endpoints when no Safe is found,
allowing any Ethereum address to view native balances across chains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:17:46 -08:00