Commit Graph

40 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 adb0d173d8 feat(shell): add module sub-nav bar + rCart UX polish + fix TS errors
- Add secondary pill navigation bar between tab-row and <main> showing
  each module's outputPaths + subPageInfos as navigable links with
  client-side active highlighting
- Rename rcart /buy/:id route to /group-buy/:id, add payments and
  group-buys outputPaths, rename products → catalog
- Add outputPaths (mailboxes) to rinbox module
- Polish group buy page: hero stat cards, fill-up liquid progress
  visual with tier markers, warm amber→green gradient, pledge avatars,
  green CTA button, price box, responsive improvements
- Fix centering for narrow rcart form pages (flex layout in cart.css)
- Fix TS error: add walletAddress to rstack-identity SessionState type
- Fix TS errors: add ambient type declarations for 3d-force-graph and
  three (dynamically imported in folk-graph-viewer)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:44:45 -07:00
Jeff Emmett 28dbb059eb fix: remove stray brace in folk-payment-request checkExistingSession
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:22:23 -07:00
Jeff Emmett 911713e9aa fix(rcart): use rstack-identity auth instead of separate passkey flow
folk-payment-request now triggers the rstack-identity auth modal
instead of its own passkey flow. This ensures the username displays
correctly in the identity badge and avoids duplicate session management.
Also checks both session sources for wallet address and access token.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:21:18 -07:00
Jeff Emmett 71b2acd47b feat(rcart): persist payment request ID in URL for reloadability
After generating a payment request, push ?id=<paymentId> into the URL.
On page load, if ?id= is present, fetch the payment from the API and
display the QR/share view directly. Reset clears the URL param.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:14:10 -07:00
Jeff Emmett cbf1ae0b2c feat(rcart): group buys tab + interactive what-if calculator
Add Group Buys tab to the shop nav with listing of all ongoing group buys,
showing progress bars, tier chips, and clickable cards that navigate to the
full group buy page. Add "What If" simulator to the group buy page with
slider-driven pledge projection, dynamic tier highlighting, and a commons
revenue calculator with adjustable share percentage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:30:10 -07:00
Jeff Emmett 8040c30756 feat(rcart,rcal): group buy page, multi-scale calendar demo, TS fixes
- Add folk-group-buy-page.ts: public shareable group buy component
  with tier progress, pledge panel, and demo mode
- Add vite build block for folk-group-buy-page
- Wire rSwag "Send to rCart" to navigate to /demo/rcart?tab=catalog
- Add multi-scale calendar demo events: planetary (equinoxes, Earth Day),
  continental (Europe Day, Mobility Week), country (Unity Day), region
  (Brandenburg festivals), and multi-continent (Tokyo, Nairobi, Bogota)
- Add season-scale and year-scale events for temporal zoom demo
- Fix pre-existing TS errors: add missing likelihood field to CalendarEvent
  creation in rcal/mod.ts and rschedule/mod.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:59:02 -07:00
Jeff Emmett 13f331d72c feat(rcart): catalog detail view, order queue, and group buy
- Add catalog-detail view with quantity selector and order queue
- Add group buy creation flow
- Add ?tab=catalog URL param support
- Expand catalog item schema with inventory fields

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:45:46 -07:00
Jeff Emmett 4212a651e1 fix(auth): exchange WebAuthn credential for server-signed JWT + rNetwork CRM cleanup
- Session manager now calls EncryptID /api/auth/start + /api/auth/complete
  to get a properly signed JWT instead of creating unsigned local tokens.
  This fixes 401 errors on /api/payments, /api/notifications, and other
  authenticated endpoints that verify tokens via EncryptID server.
- Token refresh calls /api/session/refresh instead of extending unsigned tokens
- Server generateSessionToken now includes authTime, jti, recoveryConfigured
- rNetwork: /crm route renders folk-crm-view instead of iframe
- rNetwork: ?view=app redirects 301 to /crm (backward compat)
- rNetwork: graph viewer always uses API (removed hardcoded demo data)
- docker-compose: pass through TWENTY_API_TOKEN from Infisical
- rcart: add catalog product images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:13:19 -07:00
Jeff Emmett 4199a8c6e0 feat(rcart): add "Payer Decides" option for payment type and amount
- Add 'payer_choice' as third paymentType option on request form
- When set, the payment page shows a One-time / Recurring toggle for the payer
- Payer's choice sent to server via chosenPaymentType in status update
- Server uses chosenPaymentType to determine subscription reset behavior
- Combined with existing amountEditable, creators can now leave both
  amount and payment type fully up to the payer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:57:09 -07:00
Jeff Emmett 636fc133fe feat(rcart): add subscription/inventory/method-toggles to payment requests + fix 403
- Fix: add publicWrite to cartModule so payment routes aren't blocked
  by space-level write auth (routes have their own auth checks)
- Add paymentType field: 'single' (one-time) or 'subscription' (reusable QR)
- Add maxPayments inventory limit: QR codes auto-fill when limit reached
- Add paymentCount to track how many payments received
- Add enabledMethods: toggle card/wallet/encryptid per payment request
- Payment page only shows enabled tabs, shows inventory progress bar
- Subscriptions reset to 'pending' after each payment until filled
- New 'filled' status for inventory-limited payments that are full

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:35:11 -07:00
Jeff Emmett c049d7e8df feat(rcart): QR code payment requests with self-service generator
Add shareable QR payment system to rCart:
- PaymentRequestDoc schema with amountEditable support
- Payment API routes (create, list, get, update, QR SVG, Transak session)
- folk-payment-page: 3-tab payer view (Card/Wallet/EncryptID passkey)
- folk-payment-request: self-service QR generator with passkey auth
- Payments tab in folk-cart-shop for managing requests
- Extract Transak utils to shared/transak.ts (used by rFlows + rCart)

Routes: /:space/rcart/request (generator), /:space/rcart/pay/:id (payer)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:11:20 -07:00
Jeff Emmett 31b088543e feat: add ViewHistory for in-app back navigation, rename rWork to rTasks
Add shared ViewHistory<V> utility class that provides a proper navigation
stack for rApps with hierarchical views. Replaces hardcoded data-back
targets with stack-based back navigation across 10 rApps: rtrips, rmaps,
rtasks, rforum, rphotos, rvote, rnotes, rinbox, rschedule, rcart.

Rename rWork module to rTasks — directory, component (folk-tasks-board),
CSS, exports, domains, and all cross-module references updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:04:13 -07:00
Jeff Emmett 72100c0922 feat: migrate hardcoded colors to --rs-* CSS variables across 18 modules
Replace structural UI colors with theme-aware CSS custom properties so
all rApp modules respond correctly to light/dark theme switching.

Covers: folk-social-post, folk-forum-dashboard, folk-video-player,
folk-video-chat, folk-thread-gallery, folk-campaign-manager,
folk-wallet-viewer, folk-vote-dashboard, folk-swag-designer,
folk-cart-shop, folk-workflow-block, folk-choices-dashboard,
folk-pubs-editor, folk-book-shelf, folk-flows-app, folk-analytics-view,
folk-campaign-planner, and flows.css canvas background.

Intentionally preserved: platform brand colors, chain colors,
data-viz/chart colors, video player black, call action buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:34:13 -07:00
Jeff Emmett c8e95ed506 feat(rcart): add cart tab to browser extension + install banner in web UI
Extension gets Clipper/Cart mode tabs, space/cart picker with persistence,
JSON-LD product detection, "Add to rCart" context menu, and badge count.
Web UI shows a dismissible indigo banner prompting extension install when
not detected. Content script sets detection marker on rspace.online pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:07:13 -07:00
Jeff Emmett 12d3e86e13 feat(rcart): merge group shopping into rCart module
Add shared shopping carts with URL product extraction, pooled funding,
and extension support alongside existing cosmolocal catalog/orders.

- Shopping cart schemas (ShoppingCartDoc, ShoppingCartIndexDoc)
- Server-side product extraction (JSON-LD, meta tags, Amazon/Shopify)
- 13 new API routes (cart CRUD, items, contributions, extension endpoints)
- 3-tab UI (Carts/Catalog/Orders) with cart detail, funding progress
- Local-first client subscriptions for real-time cart sync
- Updated landing page to reflect group shopping workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:21:38 -07:00
Jeff Emmett 4cc420d0f6 feat: wire offline-first Automerge sync to all 13 rSpace modules
Add shared RSpaceOfflineRuntime singleton that coordinates IndexedDB
persistence (EncryptedDocStore), WebSocket sync (DocSyncManager), and
in-memory Automerge docs (DocumentManager) for all module web components.

- Phase 0: runtime.ts singleton, shell integration, beforeunload flush
- Phase 1: rstack-offline-indicator status dot in shell header
- Phase 2: service worker stale-while-revalidate for API GETs + offline fallback
- Phase 3: storage-quota.ts with LRU eviction (30d) and quota warnings (70%)
- Phase 4: Tier 1 single-doc modules (rFlows, rCal, rBooks, rSplat)
- Phase 5: Tier 2 multi-doc modules (rNotes, rWork, rInbox, rVote, rTrips, rFiles)
  with doc-list-request/response wire protocol for document discovery
- Phase 6: Tier 3 special cases (rCart hybrid, rForum global doc, rSchedule)

Data now loads instantly from IndexedDB, syncs via WebSocket when online,
and remains browsable offline. rNotes migrated from inline Automerge WS
to shared runtime. All modules fall back to REST when runtime unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:07:59 -08:00
Jeff Emmett 35a5a5f29a feat: workflow template, choice components, space settings, EncryptID vault, UI polish
- Pre-populated 4-node workflow template (trigger→action→condition→output) with blue arrows
- Add folk-choice-vote, folk-choice-rank, folk-choice-spider component libraries
- New rstack-space-settings component
- EncryptID encrypted vault schema and server endpoints
- Space management and community store enhancements
- Shell, landing, and module CSS refinements
- Tab bar, app switcher, identity, and MI component updates
- rNotes app improvements
- rFunds diagram adjustments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:15:13 -08:00
Jeff Emmett b6ddd4a833 fix: getApiBase() across all 16 rApp modules for subdomain routing
All modules had getApiBase() matching wrong module names (e.g. /vote
instead of /rvote) and requiring /{space}/ prefix in the URL path.
On subdomains like jeff.rspace.online, the browser URL is /rfunds/...
not /jeff/rfunds/..., so the regex never matched.

New pattern: /^(\/[^/]+)?\/rmodule/ handles both:
- Subdomain: /rfunds/... → base = /rfunds
- Direct: /demo/rfunds/... → base = /demo/rfunds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:01:06 -08:00
Jeff Emmett 75b148e772 Merge branch 'dev'
# Conflicts:
#	modules/rcal/mod.ts
#	modules/rfiles/mod.ts
#	modules/rforum/mod.ts
#	modules/rmaps/mod.ts
#	modules/rnetwork/mod.ts
#	modules/rswag/mod.ts
#	modules/rwork/mod.ts
#	shared/module.ts
2026-02-28 19:51:51 -08:00
Jeff Emmett 5613370817 refactor: rename module directories to match r-prefixed module IDs
All 22 module directories under modules/ now match their module IDs
(e.g. modules/cart → modules/rcart, modules/canvas → modules/rspace).
Updated all import paths, vite build config, HTML template asset refs,
docker-compose standalone commands, and .gitignore accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 19:49:26 -08:00