Commit Graph

418 Commits

Author SHA1 Message Date
Jeff Emmett c233f1338b fix(rsplat): use three/addons/ import path to match importmap
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:18:19 -07:00
Jeff Emmett 03de21ddd5 feat(rnetwork): concentric spheres layout with Fibonacci distribution
Replace flat ring layout with 3D sphere distribution using Fibonacci
spiral for even node placement. Wireframe sphere guides replace flat
ring guides — visible from every camera angle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:05:30 -07:00
Jeff Emmett 246b51b2e0 feat(rbudgets): multiplayer sync, interactive pie chart, flow integration
- Add budget CRUD methods to FlowsLocalFirstClient (saveBudgetAllocation,
  addBudgetSegment, removeBudgetSegment, setBudgetTotalAmount)
- Init local-first client in budget view with real-time onChange sync
- extractBudgetState() recomputes collective averages from Automerge doc
- Debounced auto-save (1s) via scheduleBudgetSave() on slider/pie changes
- Interactive pie chart: click wedges to select, drag boundaries between
  segments to adjust allocation percentages with angle-to-pct geometry
- Selected segment highlighting (scaled wedge, white border, detail panel,
  slider row highlight, legend/table row click-to-select)
- "Apply to Flow" button pushes collective budget into canvas flow as
  funnel node with spending allocations mapped to outcome nodes
- LIVE indicator when WebSocket connected
- Falls back to API for demo/unauthenticated users

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:04:02 -07:00
Jeff Emmett 2cce369b7b chore(rsplat): bump JS/CSS cache version to v=2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:03:22 -07:00
Jeff Emmett c5f757d050 fix(rsplat): resize images client-side before 3D generation, pass through fal.ai errors
Mobile photos (12MP+) were causing generation failures due to large base64 payloads.
Now resizes to max 1024px before sending. Server now returns actual fal.ai error
messages instead of generic "3D generation failed".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:56:35 -07:00
Jeff Emmett e5b5c551b1 feat(rnetwork): multi-select delegation with per-node sliders and fuzzy search
- Click any person/member node to add them to delegation selection
- Each selected node gets 3 inline sliders (Gov/Econ/Tech) for weight assignment
- Fuzzy search input in delegation panel to find and add members by name
- Remaining weight display per authority
- "Confirm All Delegations" commits all at once, recomputes weights live
- Replaces old two-step popup with single-panel multi-select UX

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:54:45 -07:00
Jeff Emmett 48cbf22492 fix(rnetwork): check URL space slug not effectiveSpace for demo detection
effectiveSpace resolves to 'global' for rnetwork (global-scoped module),
so check the URL space param instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:49:55 -07:00
Jeff Emmett 33721819db fix(rnetwork): show demo members in demo space even when CRM token exists
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:47:56 -07:00
Jeff Emmett 98cd239418 feat(rnetwork): weight accounting, ring layout, inline delegation UI
- Per-authority effective weight computation (delegated/received/retained)
- Concentric ring layout (admin/member/viewer) with visual guides
- Inline delegation popup with total + domain split sliders
- Authority labels renamed: Gov/Econ/Tech with consistent colors
- Authority-filtered edge view in trust mode
- Demo delegation preview with live graph updates
- Trust API endpoints for delegation CRUD and score queries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:34:54 -07:00
Jeff Emmett af43e98812 feat(rflows): add rBudgets collective budget allocation sub-view
Adds a new "rBudgets" sub-tab to rFlows where participants allocate
budgets across departments via sliders, with a collective SVG pie chart
showing aggregated results. Includes schema v4 migration, budget CRUD
API routes, demo seed data (5 segments, 4 participants, $500k pool),
and slider auto-normalization to 100%. Removes redundant "Flows" and
"Flow Viewer" entries from outputPaths/subPageInfos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:11:32 -07:00
Jeff Emmett cab80f30e7 refactor(rnetwork): move Open CRM to sub-nav header
Remove standalone "Open CRM" button from graph view body and add
"Open Twenty CRM" as an external link in the module sub-nav bar,
next to Community CRM. Dashed border + margin-left:auto pushes it
to the right edge for visual distinction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 15:52:10 -07:00
Jeff Emmett e6f78a67e8 feat(rflows): Sankey-consistent edge widths, split controls, vessel path fixes
- Add computeFlowWidths() pre-pass for per-node proportional edge widths
  (outgoing edges sum to node pipe width, 8-80px range)
- Replace +/- buttons on edges with draggable split controls on nodes
  (source, funnel spending, funnel overflow — min 5% clamp, 60fps updates)
- Fix vessel wall path discontinuities by interpolating at pipe boundaries
- Stabilize overflow pipe sizing (fixed height, CSS opacity transitions)
- Tighten funnel foreignObject bounds to eliminate pointer-events overlap
- Replace foreignObject zone/overflow labels with SVG <text> elements
- Add inflow pipe indicator bars on funnels showing flow fill ratio

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 15:44:14 -07:00
Jeff Emmett 4cdba2e7de fix(rwallet): align yield rates table columns with fixed-width layout
Use table-layout:fixed with colgroup for consistent APY/30d Avg/TVL
column alignment. Dedicated yield-rates-table class with right-aligned
monospace numeric columns. Bump JS cache v=12.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 15:40:59 -07:00
Jeff Emmett a0723e261a fix(rbooks): use imported randomUUID() instead of crypto.randomUUID()
crypto.randomUUID() crashes in the server context during demo space
initialization, causing 502 Bad Gateway on /rbooks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 14:29:13 -07:00
Jeff Emmett fdf2a429f5 fix(rwallet): populate yield APY stats, hide top tabs on yield view
- Fix DeFi Llama field mapping: use apyMean30d + apyPct7D (apyMean7d
  doesn't exist in their API)
- Add apyBase, apy30d fields to YieldOpportunity type
- Deduplicate rates table (best APY per protocol+chain+asset)
- Hide "My Wallets / Wallet Visualizer" top tab bar on yield page
- Color-code APY values, better TVL formatting (B/M)
- Bump JS cache to v=11

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 12:41:11 -07:00
Jeff Emmett f9d4164f28 chore(rwallet): bump JS cache version to v=10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 12:35:34 -07:00
Jeff Emmett 6d40904fa7 fix(rwallet): yield page renders standalone without wallet detection
Force topTab=visualizer and skip hero/address/features/examples when
activeView is yield. Works for both authenticated and anonymous users.
Yield rates auto-load on page init without requiring a wallet address.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 12:33:40 -07:00
Jeff Emmett 8da42095c6 fix(rwallet): show yield rates standalone on /yield page
Yield tab now auto-loads rates on page init and renders independently
of wallet detection — no longer gated behind hasData(). Shows rates
comparison table, header with description, and back button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 11:58:02 -07:00
Jeff Emmett 3436393bfb feat(rwallet): add Aave V3 + Morpho Blue auto-yield for idle treasury
Adds yield-generating capability for idle stablecoins (USDC/USDT/DAI)
on Ethereum and Base via Aave V3 and Morpho Blue vaults, using the
existing Safe multisig proposal flow for governance.

New lib files: yield-protocols (constants/ABIs), yield-rates (DeFi Llama
+ Morpho GraphQL with 5min cache), yield-positions (on-chain queries),
yield-tx-builder (MultiSend calldata for Safe proposals),
yield-strategy (idle detection + allocation suggestions).

5 API routes, "Yield" view tab with rates table, position cards, and
advisory strategy suggestions. Zero new dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 10:17:54 -07:00
Jeff Emmett 2264267ded feat(rflows): floating play button, auto-start demo, minimizable panels
- Add prominent floating Play/Pause FAB button (bottom center)
  with glow effect and pulse animation while running
- Auto-start simulation for demo and sim-demo flows on load
- Analytics panel now has a minimize button (◀/▶) to collapse
  to a narrow strip, preserving screen space
- Keep existing toolbar Play button for discoverability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:15:21 +00:00
Jeff Emmett 99131df914 fix(rMortgage): use 5/10/15yr borrower term options
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 02:18:57 -07:00
Jeff Emmett a1f8702988 feat(rMortgage): aggregate pool viz, earnings comparison, fewer tranches
- Pool summary cards clickable → aggregate breakdown vessel showing
  total outstanding/repaid/reinvested with earnings comparison bar
- Lender detail: earnings bar (interest vs reinvestment), advantage
  callout showing % gain from reinvesting returns
- Borrower options reduced from 6 to 3 tranches (10yr, 20yr, 30yr)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 02:14:39 -07:00
Jeff Emmett 600e9080d0 feat(rflows): add rMortgage sub-tab with trust-backed lending & DeFi reinvestment
Social mortgage lending tracker at /mortgage with pool overview, active
positions table, lender detail vessel visualization, borrower options
panel (monthly-budget-constrained with lender fill bars), live Aave v3
rates on Base, reinvestment tracker, and yield projection calculator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:23:14 -07:00
Jeff Emmett d642b856a9 feat(rflows): animated flow effects on waterfalls and connections
- 5-layer animated flow strips inside waterfall paths (denser, more visible)
- Glowing edge lines along waterfall boundaries
- Animated white dashes flowing along center spine of each waterfall
- Pulsing entry glow where flow meets a funnel or outcome node
- Exit glow where flow leaves a source or funnel
- Flow amount labels ($X.Xk/mo) on each waterfall
- Overflow branches now have animated flow strips and entry pulse
- New entryPulse CSS animation for connection point emphasis

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 05:56:30 +00:00
Jeff Emmett 35eadc8a34 feat(rflows): smaller funnels for faster simulation, all outcomes start at $0
- Shrink all funnel thresholds/capacities by ~5x so they fill and drain
  visibly within a few simulation ticks
- Zero out all outcome fundingReceived and reset statuses to not-started
- Same treatment for both BCRG Demo and Simulation Demo presets
- Funnels now cycle through fill/overflow/spend much more dynamically

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 05:17:02 +00:00
Jeff Emmett d7c1aaae9c feat(rflows): pipe size = desiredOutflow, flow = inflowRate
River visualization now shows:
- Pipe width = monthly desiredOutflow (what the funnel needs)
- Inner flow height = inflowRate (what it actually receives)
- Underfunded funnels (<95%) shown in red with funding percentage
- Label shows "$inflow → $outflow/mo" for at-a-glance funding health
- Fully funded funnels get sufficiency sparkle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 04:52:55 +00:00
Jeff Emmett 3d4d2112dd feat(rflows): add simulation demo preset and dual pipe/flow visualization
- Add simDemoNodes preset: 1 source → treasury → 3 domain funnels → 6 outcomes
  All values start at zero so users can watch flow propagate through the system
- River visualization now shows pipe capacity (outer width) separately from
  active flow (inner fill height), making the two dimensions visually distinct
- Pipe width based on funnel capacity, inner flow based on current fill ratio
- Add "Simulation Demo" as a loadable flow alongside the BCRG Demo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 04:10:13 +00:00
Jeff Emmett ccca8318a3 feat: payment email notifications, GLB viewer, and EncryptID email lookup
- Add EncryptID internal endpoint for email lookup by userId
- rcart: send "Payment Sent" to payer and "Payment Received" to recipient
- rcart: resolve emails via EncryptID when not provided in request
- rsplat: add GLB/GLTF 3D viewer using Three.js GLTFLoader
- rsplat: enable publicWrite for photo uploads without space membership
- docker-compose: add SITE_URL and SPLAT_NOTIFY_EMAIL env vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 04:02:07 +00:00
Jeff Emmett 44e7639124 fix(rnetwork): switch to unpkg CDN with dynamic fallback for 3d-force-graph
jsdelivr was returning 503. Switch primary CDN to unpkg and add a dynamic
fallback loader that tries both CDNs if the initial script tag fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 12:24:54 -07:00
Jeff Emmett a1f8103237 fix(rnetwork): remove header and stats bar to maximize canvas space
Remove the "Network Graph" title and People/Organizations/Members/Cross-org
stats bar. Reduce toolbar margin for minimal chrome above the canvas.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:45:19 -07:00
Jeff Emmett 40be1c63b3 feat(rmaps): add collaborative room sync to canvas folk-map shape
Integrate RoomSync, participant markers, location sharing, waypoints,
emoji avatars, and participant panel into the canvas map shape. Users
can now create collaborative map rooms directly from the canvas toolbar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:42:34 -07:00
Jeff Emmett 1b2842fc4a fix(rwallet): remove all gap between top tabs and content
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:25:53 -07:00
Jeff Emmett 8957dd8ea7 chore(rwallet): bump cache version to v=9
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:20:07 -07:00
Jeff Emmett 4d72ba164e feat(rmaps): decompose modals into sub-components + SW offline pinging
Extract meeting point, share, import, and privacy modals from
folk-map-viewer.ts (2504→2147 lines) into standalone web components
that communicate via CustomEvent dispatch. Add OSM tile caching
(cache-first, LRU at 500), IndexedDB room state persistence for
offline location pinging, and auto-persist room state on every sync
update so last-known positions survive tab close.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:18:16 -07:00
Jeff Emmett 7c363dbae9 fix(rwallet): reduce gap between top tabs and content
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:13:10 -07:00
Jeff Emmett b0d918274d fix(rmaps): commit all pending rmaps changes and missing files
Add map-privacy.ts and updated folk-map-viewer.ts, map-push.ts, mod.ts
that were modified locally but never committed, breaking Docker builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:38:26 -07:00
Jeff Emmett 21a9a0f7e3 fix(rmaps): add missing map-import.ts to repo
File was created locally but never committed, breaking Docker builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:37:42 -07:00
Jeff Emmett e37fefe8a4 fix(rnetwork): treat TWENTY_API_TOKEN=disabled as unset
Infisical injects secrets at startup when the env var is empty/falsy,
so setting it to "disabled" blocks injection while this change ensures
the demo data fallback still triggers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:36:51 -07:00
Jeff Emmett aa6f04e45e fix: resolve all 127 TypeScript errors with Hono type augmentation
Add types/hono.d.ts declaring effectiveSpace, spaceRole, and isOwner
on Hono's ContextVariableMap. Remove 127 "as any" casts across 18
files. Fix ParticipantStatus type in rmaps SyncMessage union.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:25:29 -07:00
Jeff Emmett 2a10277ec8 feat(rcart): add real payment flow for cart contributions
Contribute button now offers "Pay Now" (creates a PaymentRequest linked
to the cart, navigates to the existing payment page) alongside "Record
Manual". When the payment completes, the server auto-records a
contribution on the cart with amount, method, and txHash.

- Add recipientAddress to ShoppingCartDoc, linkedCartId to PaymentRequestMeta
- New POST /api/shopping-carts/:cartId/contribute-pay route
- Payment status handler propagates paid → cart contribution
- Payment page shows "Return to Cart" link for linked payments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:25:17 -07:00
Jeff Emmett e2d26d506c feat(rwallet): add 5 more testnet chains for EVM balance scanning
Adds Arbitrum Sepolia, Optimism Sepolia, Polygon Amoy, Avalanche Fuji,
and BSC Testnet with RPC URLs, native tokens, popular ERC-20s, and
Alchemy slug mappings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:19:56 -07:00
Jeff Emmett fcea37b91b feat(rcart): clickable demo orders with detail view
Enrich 5 demo orders with items, buyer, payment, provider, and timeline.
Order cards show thumbnails and item counts; clicking opens a detail view
with payment info, buyer, provider, and timeline using the existing
catalog-detail 2-column layout. Demo payments expanded to 5 (3 linked).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:12:45 -07:00
Jeff Emmett 073a64fe56 feat(rnetwork): expand demo CRM to 48 members with delegation-only flows
Remove Demo DAO and space hub placeholder nodes — members now connect
only via trust delegation edges. Add 24 new members (m25–m48) with
ops-vertical specializations and expand delegation arrays to 141 edges
(47 per authority) with proper hierarchical flow patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:08:05 -07:00
Jeff Emmett 058592f5e3 fix(rwallet): fix stuck loading, auth, and add Sepolia ERC20 tokens
- Add /encryptid/ to subdomain routing passthrough (was 404 on demo.rspace.online)
- Replace rwallet's custom JWT verify with SDK's verifyEncryptIDToken (supports
  remote fallback when JWT_SECRET unavailable in rspace container)
- Fix CRDT balance loading stuck spinner (early return skipped crdtLoading=false)
- Add Sepolia testnet ERC20 tokens (USDC, WETH, LINK)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:40:02 -07:00
Jeff Emmett 5350b76b7d fix(rcart): resolve merge conflict — combine centering + subnav hiding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:59:24 -07:00
Jeff Emmett 45c2130980 fix(rcart): center form pages with margin auto instead of flex
The flex centering on main:has() was causing the subnav to shrink-wrap
and the page content to left-align on desktop. Use margin: 0 auto on
the components directly so the subnav stays full-width.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:59:01 -07:00
Jeff Emmett 1448909ffd Merge branch 'dev' 2026-03-12 18:55:24 -07:00
Jeff Emmett f0cc50a060 feat(rflows): water-themed canvas visual overhaul — taps, vessels, pools
Replaces vertical faucet sources with horizontal side taps (pipe → rotary
valve → angled nozzle → stream), rectangular tank funnels with tapered
vessels (wide top → narrow drain spout, overflow pipes at max threshold),
and card-style outcomes with U-shaped collection basins (status-colored
water fill, ripple patterns, phase markers).

Adds SVG defs for metallic pipe gradients, water surface shimmer, ripple
patterns, overflow splash effects, and status-colored basin water fills.
CSS animations for water shimmer, overflow pulse, basin transitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:55:10 -07:00
Jeff Emmett 746e4a8b59 Merge branch 'dev' 2026-03-12 18:48:30 -07:00
Jeff Emmett 3b3a642813 fix(routing): remove hardcoded /demo/ path prefix from URLs
demo.rspace.online subdomain already identifies the space, so paths
should not redundantly include /demo/. Replaced 7 occurrences across
rcart, rswag, rpubs, rschedule, and space-switcher with either relative
paths or full demo.rspace.online URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:48:20 -07:00
Jeff Emmett fb9448681c Populate demo CRM with 24 DAO members and delegation network
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 00:24:01 +00:00
Jeff Emmett d2637aff0b Fix rMeets hub page theme support and add subnav items
Theme fix: Hub page CSS used non-existent variable names with dark-mode
fallbacks (--rs-surface, --rs-bg, --rs-surface-hover), so it always
rendered dark regardless of user theme. Fixed to use correct theme
variables (--rs-bg-surface, --rs-input-bg, --rs-bg-hover, etc.).

Also removed forced theme:"dark" override on the hub page route.

Subnav: Added "Create Call" to outputPaths so the module subnav shows
Create Call / Rooms / Recordings pills. Added mobile breakpoint for
the hub nav cards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:28:18 +00:00
Jeff Emmett 71a108980c Fix payment page mobile layout — remove conflicting flex container
The cart.css had `display:flex; align-items:center` on main:has(folk-payment-page)
which fought with the component's own `width:100%; margin:0 auto` centering:
- flex align-items:center shrunk the subnav to content width
- padding:0 0.5rem overrode shell.css padding-top:92px (desktop)
- Redundant since all components already self-center with margin:auto

Also hide the shop subnav on public-facing pages (/pay/:id, /group-buy/:id)
since payers/pledgers don't need Carts/Catalog/Orders navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:08:30 +00:00
Jeff Emmett 661aca972e Fix mobile layout across all rcart pages and remove duplicate nav
- Remove duplicate internal nav (.rapp-nav tabs) from folk-cart-shop —
  the shell subnav pills already provide this navigation
- Read initial-view attribute so shell subnav routing works correctly
- Add margin: 0 auto centering to all narrow page components
  (payment-page, payment-request, payments-dashboard, group-buy-page)
- Add overflow-wrap: break-word to prevent text/address overflow
- Comprehensive mobile breakpoints across all components:
  - folk-cart-shop: 600px + 400px (grid stacking, card sizing, forms)
  - folk-payments-dashboard: 600px + 480px (header, cards, tabs)
  - folk-group-buy-page: already had good breakpoints, added centering
  - cart.css: remove justify-content:center (bad for long pages),
    add horizontal padding for mobile
- Fix share-input overflow with min-width:0 + text-overflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:50:21 +00:00
Jeff Emmett 73431d7a88 Fix mobile layout on payment page — center content and prevent overflow
- Add margin: 0 auto to center the page instead of left-aligning
- Add overflow-wrap/word-break on wallet addresses, tx hashes, URLs
- Add min-width: 0 + text-overflow on share input to prevent flex overflow
- Comprehensive mobile breakpoints at 600px and 380px for all sections
  (staging banner, recipient info, header, amount, tabs, footer)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:41:37 +00:00
Jeff Emmett 61f5544b4e Fix mobile formatting on payment request page
Add comprehensive responsive breakpoints at 600px and 380px:
- Stack step card, form field rows, share rows vertically
- Scale down typography (title, amount, hints)
- Reduce padding and QR code size for narrow screens
- Make toggle buttons and method toggles compact
- Full-width action buttons on mobile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:36:55 +00:00
Jeff Emmett 97a077b256 feat(rcart): Layer 3 — automated recurring payment execution via ERC-20 allowance
Recurring Executor (new module):
- Server-managed relayer keypair derived deterministically via HKDF
- Checks on-chain ERC-20 allowance before pulling funds
- Executes transferFrom when subscriptions are due
- Supports Base, Base Sepolia, and Ethereum mainnet

New API Endpoints:
- GET /api/payments/:id/subscription-info — returns relayer address and
  approve calldata for the client to authorize recurring pulls
- POST /api/payments/:id/subscribe — registers a subscription after
  payer approves on-chain allowance, verifies allowance exists

Scheduler Upgrade:
- Attempts automated pull first for subscriptions with approved allowance
- Falls back to email reminder if auto-pull fails or is not configured
- Sends branded receipt email after successful automated payments
- Extracted email templates into reusable helper functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:32:13 +00:00
Jeff Emmett 4304170a9a feat(rcart): recurring payment infrastructure with interval scheduling
Layer 1 — Schema & History:
- Added PaymentRecord type for individual payment tracking
- Added interval (weekly/biweekly/monthly/quarterly/yearly), nextDueAt,
  subscriberEmail, and paymentHistory[] to PaymentRequestMeta
- Payment history records txHash, method, amount, paidAt for each payment

Layer 2 — Server-Side Scheduler:
- Hourly subscription reminder scheduler sends email notifications
  when recurring payments are due (based on nextDueAt)
- nextDueAt auto-computed after each successful subscription payment
- Grace period prevents duplicate reminders
- Branded HTML reminder emails with "Pay Now" button

UI Updates:
- Billing interval selector (weekly through yearly) shown for
  subscription and payer_choice payment types
- Payment page shows subscription badge with interval and history count
- Next due date displayed for active subscriptions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:22:58 +00:00
Jeff Emmett 8345648d61 fix(rcart): fix floating-point precision in wallet payment amounts
Replace parseFloat * 10^decimals with string-based decimal parsing to
avoid precision loss for 18-decimal tokens (ETH). Affects both MetaMask
and EncryptID payment paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:11:03 +00:00
Jeff Emmett f5ac038803 feat(rcart): show creator username + wallet on payment page, add email sharing
- Payment schema now includes creatorUsername, displayed alongside the
  truncated wallet address on the payer-facing payment page
- New "Share by email" feature on the payment request page: enter
  comma-separated emails to send branded payment links via email
- New POST /api/payments/:id/share-email endpoint with HTML email template

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:06:51 +00:00
Jeff Emmett 3b666b4434 Merge branch 'dev' 2026-03-12 14:00:08 -07:00
Jeff Emmett 154f1230dc feat(rsocials): AI campaign generator from event brief
Add "Generate from Brief" feature: paste unstructured event text, AI
(Gemini 2.5 Pro) creates a full multi-phase, multi-platform campaign
with threads, emojis, newsletter content, and platform-specific formatting.

- Schema v4: add threadPosts, emailSubject, emailHtml to CampaignPost
- New POST /api/campaign/generate endpoint with platform-aware prompting
- Generate modal with platform checkboxes, tone/style selectors
- Preview mode with save/regenerate/discard flow
- Dynamic phase rendering (supports 3-5 AI-generated phases)
- Thread badge with expandable individual posts
- Newsletter platform support (icon + color)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:59:56 -07:00
Jeff Emmett 564c16e431 feat(responsive): adaptive tablet/fold breakpoints, touch/pen parity, pointer events drag
Add intermediate breakpoints (960px, 1024px, 900px, 640px, 600px) for tablets and fold
devices across all 12 rApp components. Add touch-action: manipulation and
-webkit-tap-highlight-color to eliminate 300ms tap delay. Fix undersized tap targets
(<36px) in rtasks, rfiles, rinbox, and rcart. Replace HTML5 drag API with pointer events
in rtasks kanban and rchoices ranking for touch/pen/mouse parity. Replace mouseenter/
mouseleave with pointerenter/pointerleave in rchoices spider chart with click toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:41:29 -07:00
Jeff Emmett 233b7e3689 feat(responsive): adaptive tablet/fold breakpoints, touch/pen parity, pointer events drag
Add intermediate breakpoints (960px, 1024px, 900px, 640px, 600px) for tablets and fold
devices across all 12 rApp components. Add touch-action: manipulation and
-webkit-tap-highlight-color to eliminate 300ms tap delay. Fix undersized tap targets
(<36px) in rtasks, rfiles, rinbox, and rcart. Replace HTML5 drag API with pointer events
in rtasks kanban and rchoices ranking for touch/pen/mouse parity. Replace mouseenter/
mouseleave with pointerenter/pointerleave in rchoices spider chart with click toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:41:08 -07:00
Jeff Emmett d6be2f2039 feat(rcart): add payment context, staging banner, and Transak amount pre-fill
- Payment page now shows recipient info and available payment methods
- Testnet chains show staging environment disclaimer
- Transak widget receives effective amount for editable-amount payments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:40:58 +00:00
Jeff Emmett 12f25edaf3 fix(rcart): add mobile wallet derivation fallback for payment requests
WebAuthn PRF extension is unsupported on most mobile browsers, causing
"Could not derive wallet address" error. Added 3-layer fallback:
1. Client-side PRF derivation (desktop)
2. Server-side wallet lookup via session API
3. DID-based deterministic address provisioning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:34:46 +00:00
Jeff Emmett 2d636f5f25 feat(rcart): send branded payment success email on completed payments
Sends an HTML email with payment details, rFlows CTA, and resource links
when a card/Transak payment completes. Fire-and-forget (never blocks response).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:53:58 -07:00
Jeff Emmett e614df1b54 feat(responsive): add mobile breakpoints (768px/480px) across all rApps
Payment pages (folk-payment-page, folk-payment-request, folk-group-buy-page)
had zero or minimal media queries — now stack headers, reduce padding, and
resize iframes for 375px viewports. Other rApp dashboards (rchoices, rwallet,
rnotes, rfiles, rinbox, rforum, rtasks, rvote) gain consistent 768px/480px
breakpoints: collapsing grids to 1-column, shrinking fonts and padding, and
stacking flex rows on mobile. Also adds folk-payments-dashboard to the flex
centering rule in cart.css.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:32:47 -07:00
Jeff Emmett ba5ce34620 feat(transak): pre-fill fiat amount and currency in widget
Pass fiatAmount, defaultFiatAmount, fiatCurrency, and defaultFiatCurrency
to the Transak widget URL so users see the transaction total immediately
without manual entry. Applied to both rcart payment sessions and rflows
onramp adapter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:12:31 -07:00
Jeff Emmett 357e0bb4c0 refactor(transak): split API keys by environment (staging/production)
Add getTransakApiKey() and getTransakWebhookSecret() helpers that
resolve TRANSAK_API_KEY_STAGING or TRANSAK_API_KEY_PRODUCTION based
on TRANSAK_ENV, with fallback to legacy TRANSAK_API_KEY. All consumers
(rcart, rflows, transak-onramp) now use the shared helpers instead of
reading env vars directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:06:33 -07:00
Jeff Emmett 9d34eca103 fix(transak): default to STAGING environment for all purchases
Switch TRANSAK_ENV default from PRODUCTION to STAGING in shared/transak.ts,
docker-compose.yml, and rflows config endpoint. All card purchases now
route through Transak's staging gateway until production is ready.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:54:42 -07:00
Jeff Emmett 8af4309b41 feat(rwallet): show EncryptID identity card with both CRDT and EVM wallets
Every EncryptID identity has two wallets: a CRDT wallet (DID-based for
local tokens) and an EVM wallet (passkey-derived for on-chain tokens).
The My Wallets tab now always shows both in a dedicated EncryptID card
with distinct sections, rather than burying CRDT tokens as a subsection
that only appears when balances are non-empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:41:42 -07:00
Jeff Emmett a4a4175e9f feat(rwallet): add My Wallets tab with per-wallet balance breakdowns
Restructure rWallet with a top-level tab system: "My Wallets" (default
for authenticated users) shows wallet cards with on-chain balances and
CRDT tokens, while "Wallet Visualizer" preserves existing explore-any-
address functionality. View Flows button bridges the two tabs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:36:23 -07:00
Jeff Emmett 2cb1ff092b feat(shell): redesign rApp info popup as centered modal with overlay
- Fix z-index (9000 → 10001) so popup renders above header and tab bar
- Center popup as a proper modal with blurred backdrop overlay
- Header now shows module emoji icon + name (fetched from API)
- Bigger, bolder CTA buttons with gradient fills and hover effects
- Tour/guide links auto-promoted to prominent purple-accent buttons
- Loading spinner animation, Escape key to dismiss, click-outside-to-close
- Mobile: slides up from bottom instead of top-right corner
- Also: rcart/rwallet subnav route support, rcart tour simplification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:24:41 -07:00
Jeff Emmett 7ec1434e64 feat(rcart): add payments dashboard for Payments subnav tab
New folk-payments-dashboard component shows payment requests in/out with
status badges, links to pay pages, and a create button. Resolves 404 on
the existing Payments outputPath.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:17:54 -07:00
Jeff Emmett c668d5700c fix(transak): derive referrerDomain from request hostname instead of hardcoding
Resolves T-INF-101 Access Denied when accessing payment links from
subdomains like demo.rspace.online. Adds extractRootDomain() helper
to shared/transak.ts, used by both rcart and rflows onramp adapters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 10:49:29 -07:00
Jeff Emmett 87d5e8b1cb fix(rnetwork): pre-load THREE before graph creation
nodeThreeObject callback was returning a Promise (from async
createNodeObjectAsync) because THREE wasn't cached yet. Pre-load
THREE via import("three") before creating the graph so the callback
always returns a synchronous Three.js object.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 10:30:43 -07:00
Jeff Emmett f4d7448c9d fix(rnetwork): use UMD build for 3d-force-graph, avoid ESM bare specifiers
ESM builds on esm.sh kept resolving transitive deps to latest versions
that import three/webgpu. Switch to the pre-built UMD bundle from
jsdelivr which bundles all deps including Three.js. Keep separate
import map entry for "three" ESM for custom node object creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 10:23:04 -07:00
Jeff Emmett 14dead3896 fix(rnetwork): lock esm.sh transitive deps with * prefix
esm.sh was resolving three-render-objects@^1.29 to latest 1.x which
imports three/webgpu. The * prefix locks transitive dependency
versions to those specified in the package's own dependency tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:15:58 -07:00
Jeff Emmett 4d6e7664a4 fix(rnetwork): pin 3d-force-graph@1.73.4, revert to three.module.js
three.webgpu.js doesn't export legacy utilities like UniformsUtils
needed by Three.js addons. Pin 3d-force-graph to 1.73.4 which
predates the three/webgpu dependency, and use three.module.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:06:42 -07:00
Jeff Emmett ccf31edcbe fix(rnetwork): use three.webgpu.js for WebGPURenderer export
Map both "three" and "three/webgpu" to three.webgpu.js so only one
copy loads and WebGPURenderer is available. Also externalize
three/webgpu in esm.sh URL so it uses the import map.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:00:27 -07:00
Jeff Emmett 47d2c41400 fix(rnetwork): remove linkLineDash (3D unsupported), fix three/webgpu duplication
- Remove .linkLineDash() chain call — only exists in 2D force-graph,
  not 3d-force-graph. Dashed edges were visual-only, no functional loss.
- Map three/webgpu to three.module.js instead of three.webgpu.js to
  avoid loading two full copies of Three.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:54:17 -07:00
Jeff Emmett dfcd3fa85a fix(rnetwork): add three/webgpu to import map for 3d-force-graph
The esm.sh bundle of 3d-force-graph@1.79.1 imports "three/webgpu"
which wasn't in the import map. Map it to the jsdelivr CDN path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:42:52 -07:00
Jeff Emmett 9091c988ff feat: add subnav outputPaths for rcart, rmeets, rwallet; CRM URL-path tabs
- rcart: add subscriptions outputPath
- rmeets: add rooms + recordings outputPaths
- rwallet: add wallets, tokens, transactions outputPaths
- folk-crm-view: read active tab from URL pathname instead of ?tab=
  query param (with backward compat fallback)
- rstack-app-switcher: rename rtasks category to "Work & Productivity"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:37:05 -07:00
Jeff Emmett 0c3d8728a0 fix: graph 3d-force-graph resolution, DID/username display, space role checks
- Switch 3d-force-graph CDN from jsdelivr to esm.sh with bundle-deps
  to resolve missing "three-forcegraph" bare specifier error
- Fix storeCredential() to pass displayName and DID to createUser()
  (prevents NULL did column for credential-first user creation)
- Fix invite acceptance to use claims.did instead of claims.sub for
  space_members.user_did (DID format consistency)
- Fix session refresh to look up username from DB when missing from
  old token (prevents empty username after token refresh)
- Fix resolveCallerRole() in spaces.ts to check both claims.sub and
  claims.did against ownerDID and member keys (auto-provisioned spaces
  store ownerDID as did🔑, API-created as raw userId)
- Refactor CRM route to use URL subpath tabs with renderCrm helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:31:24 -07:00
Jeff Emmett a658b20fb1 feat(rsocials): thread editor link from campaign publish-thread nodes
- Add threadId config field to publish-thread nodes
- Add "Create Thread" / "Edit Thread" button in config panel
- Opens thread editor in new tab (new or edit by ID)
- Styled button matching indigo accent theme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:34:34 -07:00
Jeff Emmett c0de770e70 fix(rsocials): two-finger trackpad pans, pinch/ctrl+scroll zooms
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:28:19 -07:00
Jeff Emmett 456d0de9c1 fix(rsocials): proper canvas sizing, SVG zoom icons, category-styled nodes
- Fix height to account for shell header (92px not 60px)
- Add min-height:0 on flex children to prevent overflow
- Replace text zoom buttons with SVG icons matching rFlows pattern
- Add fit-to-view icon (corner brackets) with separators
- Add category class per node (trigger/delay/condition/action)
  with tinted backgrounds and category badge chips
- Add keyboard shortcuts: F=fit, +/-=zoom

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:20:01 -07:00
Jeff Emmett 78284e448c fix(rsocials): remove duplicate port labels in campaign workflow nodes
SVG text labels were rendering alongside HTML span labels, causing
each input/output name to appear twice on drag & drop nodes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:07:42 -07:00
Jeff Emmett 0b08a286cf feat(rwallet): unified all-chains balance view with ERC-20 scanning
- Add POPULAR_TOKENS map (USDC, USDT, DAI, WETH) for 7 chains
- Add ERC-20 balanceOf scanning to EOA balance endpoint
- Add /api/eoa/:address/all-balances and /api/safe/:address/all-balances
  endpoints that fan out to all chains in parallel
- Replace single-chain view with unified multi-chain balance table
- Add Chain column with colored dots, "All" filter button
- Merge CRDT tokens into unified table (chainId="local")
- Enable testnets by default
- Chain buttons now act as filters (no extra API call)
- Stats aggregate across all chains regardless of filter
- Bump JS cache version to v=6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 22:20:44 -07:00
Jeff Emmett 2054a239df chore(rwallet): bump JS cache version to v=5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 22:01:01 -07:00
Jeff Emmett 7e5aa2e7f1 fix(rwallet): use claims.did instead of claims.sub for CRDT token balance lookup
JWT sub contains the userId (not the DID). The DID is in claims.did.
Without this fix, my-balances never matches any token holder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:59:09 -07:00
Jeff Emmett 9f177147df feat(rwallet): auto-load EncryptID wallet or demo EOA on page load
Instead of showing an empty form, rWallet now automatically detects and
loads the user's EncryptID wallet address, or Vitalik.eth as a demo if
not logged in. URL ?address= param still takes priority.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:58:13 -07:00
Jeff Emmett 8efe18280c feat: consolidate domains, install deps, fix EncryptID types
- TASK-24: Install h3-js, @xterm/xterm, @xterm/addon-fit
- TASK-51.3: Remove app switcher external link arrows, update
  ridentity.online UI links to /rids paths
- TASK-51.4: Prune allowedOrigins (~30 → 16), simplify JWT aud
  to 'rspace.online', remove standalone domains from webauthn,
  update EncryptID HTML template links. Keep ridentity.online as
  canonical EncryptID/OIDC domain.
- Fix EncryptIDClaims type: add username, did fields; update aud
  type to string | string[] — resolves pre-existing TS error
- TASK-12: Update backlog status (80% code-complete, blocked on
  security audit)
- Backlog task updates for TASK-25/37/40/44, new TASK-110

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:55:39 -07:00
Jeff Emmett 7a771f53c9 fix(rnetwork): add missing importmap entry for three/examples/jsm/
3d-force-graph imports from three/examples/jsm/controls/DragControls.js
but only three/addons/ was mapped. Add the three/examples/jsm/ prefix
so the browser can resolve it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:53:46 -07:00
Jeff Emmett ba3a0018ea feat(rwallet): add cUSDC CRDT token system with Automerge ledger
Introduces CRDT-native token infrastructure stored as Automerge documents.
Seeds 5 cUSDC to user jeff on startup. Adds token API routes and a
"Local Tokens" section in the rWallet viewer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:43:49 -07:00
Jeff Emmett 347ba73942 feat(rsocials): replace campaign planner with n8n-style workflow builder
Add folk-campaign-workflow component with SVG canvas, node palette (12 nodes
across 4 categories: triggers, delays, conditions, actions), Bezier wiring,
config panel, drag-and-drop, pan/zoom, and REST auto-save. Includes 7 API
endpoints for CRUD + stub execution, SocialsDoc v3 migration, demo workflow
seeding, and local-first client methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:29:09 -07:00
Jeff Emmett 44dff1991f fix(rcart): recognize existing session without wallet + show username
checkExistingSession() required a derived wallet address to set
authenticated=true, causing a re-login prompt even with a valid session.
Now authenticates on valid session and derives wallet lazily at payment
generation time. Also extracts claims.username for display instead of
showing raw did:key identifiers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:25:26 -07:00
Jeff Emmett 4c44eb9941 feat(rnetwork): enhanced trust flow viz + rename authorities to gov/fin/dev-ops
- Compute delegatedWeight per node from delegation edges (both directions)
- Animated directional particles on delegation edges (count/size ~ weight)
- Wider delegation edges (1+weight*8) with 0.15 curvature
- "All" authority overlay mode with per-authority colored edges
- Rename 5 authorities (voting/moderation/curation/treasury/membership)
  to 3 verticals: gov-ops, fin-ops, dev-ops
- DB migration: update CHECK constraint + migrate existing data
- Update all frontend components + backend defaults

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:51:30 -07:00
Jeff Emmett f2d575d1a2 feat(shell): add consistent rApp tab bar system with URL-backed ?tab= params
Server-rendered tab bar via renderShell tabs option. Tabs use ?tab= query
params with history.replaceState and dispatch rapp-tab-change events.
Migrated rNetwork CRM from internal Shadow DOM tabs to the shared system.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:50:26 -07:00