Commit Graph

14 Commits

Author SHA1 Message Date
Jeff Emmett e1688e8456 feat: canvas-first rFlows with flow storage, retrieval, and management
Open rFlows directly into the interactive canvas instead of the landing
page. Adds a full flow storage system (Automerge for authenticated users,
localStorage for demo/anon) with CRUD operations, auto-save with 1.5s
debounce, flow switching via toolbar dropdown, and a management modal
for rename/duplicate/export/import/delete. Viewport state (zoom/pan)
persists per-flow in localStorage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:19:57 -08: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 a90e339323 feat: inline config panel for rFlows elements with tabbed Config/Analytics/Alloc
Double-clicking a flow element now opens a rich tabbed panel below the node:
- Config tab: form inputs (label, thresholds with range sliders, source type, status)
- Analytics tab: live-updating fill bars, conic-gradient outflow/overflow donut, stats
- Allocations tab: read-only allocation breakdowns with colored dots
- Simulation overlay preserved during ticks, analytics accumulate per-node metrics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:03:09 -08:00
Jeff Emmett 0bf3b3430c fix: rFlows canvas two-finger scroll pans instead of zooming
Wheel without Ctrl/Meta now pans (trackpad two-finger scroll, mouse
wheel). Ctrl+wheel and trackpad pinch zoom with reduced sensitivity
(0.003 multiplier vs old binary 0.9/1.1 toggle).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:31:31 -08:00
Jeff Emmett e954386489 feat: add animated SVG visuals to rFlows landing page
Three inline CSS/SVG animations demonstrate key concepts:
- Hero: 3-funnel flow diagram with animated particles, threshold lines,
  rising/falling fill levels, and flowing dashed edges with % labels
- How It Works: Sankey-style river view with multiple flowing bands
  showing Revenue/Grants splitting to Team A/B/Reserve
- Funnel Model: animated water level cycling through overflow/healthy/
  critical zones with overflow arrow that appears at peak fill

All animations are pure SVG/CSS (zero external assets), responsive,
and hidden on screens <480px. Replaces the static funnel metaphor
text block with a side-by-side animated funnel + zone descriptions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:03:06 -08:00
Jeff Emmett aab0f42ef5 feat: rewrite rFlows landing page with compelling format + save-to-space CTA
Replaces the technical-heavy landing with an approachable informational page:
- Hero with "Design Funding Flows That Respond to Reality" headline
- 4-card "What rFlows Does" feature grid with gradient icon boxes
- Numbered "How It Works" steps (Define → Wire → Simulate & Save)
- 6-card use cases section (DAOs, grants, revenue sharing, etc.)
- Cleaned up funnel model visual
- Expanded ecosystem (rWallet, rVote, rData)
- "Under the Hood" tech section (Flow Engine, EncryptID, CRDT, local-first)
- "Save Flow to Space" CTA pattern throughout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:00:38 -08:00
Jeff Emmett 5f2997d75d feat: rFlows funnel improvements — symmetry fix, rate labels, speed slider, overflow visuals, timeline, fill animation
- Fix asymmetric left taper curve control point in funnel SVG path
- Add inflow/spending/overflow rate labels on funnel nodes
- Add vertical speed slider (20ms–1000ms) visible during simulation
- Improve overflow pipes: wider burst, 1.3x stroke, round caps, animated splash
- Add timeline progress bar at canvas bottom during simulation
- Add CSS transitions on funnel fill rects for smooth animation
- Faster overflow edge animation (0.5s) with round line caps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 13:04:18 -08:00
Jeff Emmett 50054d599e feat: clickable/draggable edges with proportional width sizing in rFlows
Edges are now interactive: click to select (purple highlight), double-click
to open source node editor, drag midpoint handle to add curve waypoints.
Edge stroke widths are directly proportional to allocation percentage
instead of normalized to the largest flow amount.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 13:00:58 -08:00
Jeff Emmett 9c6c8c8dab fix: migrate all rApp components to theme variables for dark/light mode
Replace hardcoded dark-specific colors with CSS custom properties across
rcal, rflows, rbooks, rschedule, rtrips, and rwork modules. Adds
[data-theme="light"] overrides for rFlows node type buttons, danger
buttons, and overlay elements. SVG fills switched to style attributes
for theme variable support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:55:07 -08:00
Jeff Emmett 59bdd741be feat: bare-domain sub-pages show info/marketing pages + save-gate
Bare-domain URLs like rspace.online/rsocials/thread now render an info
page with CTAs instead of silently serving the functional app. The
functional app only appears inside a {space} context (e.g.
demo.rspace.online/rsocials/thread). API routes still pass through.

- Add SubPageInfo interface to shared/module.ts
- Add renderSubPageInfo() renderer to server/shell.ts
- Modify bare-domain routing: api/ passthrough → info page → demo fallback
- Add subPageInfos to 8 modules (rsocials, rflows, rnetwork, rtrips,
  rbooks, rphotos, rinbox, rsplat)
- Add window.__rspaceSaveGate() auth prompt on write operations
- Wire save-gate into rsocials Thread Builder save handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:16:17 -08:00
Jeff Emmett 676aaa7b3a feat: green flows, funnel coloring, full-page canvas, analytics popout
- All funding flow edges now use green shades (inflow/spending/overflow)
- Funnel nodes colored by 3-state support level: critical (red), sustained (amber), overflow (green)
- Removed tab system — canvas fills entire viewport with nav overlay
- Added left-side analytics popout panel (overview + transactions sub-tabs)
- Removed river tab code
- Updated legend to reflect new color scheme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 21:05:23 -08:00
Jeff Emmett 098c3db04d feat: rFlows UX overhaul — funnel shapes, inline editing, side overflow ports
Replace rectangular funnel nodes with tapered SVG containers featuring
overflow lip notches on left/right sides and a narrow spending outflow
at the bottom. Funnels scale logarithmically by monthly funding rate.

Double-click enters inline edit mode with draggable threshold markers
(min/max/sufficient), editable labels via foreignObject, and a compact
toolbar (Done/Delete/... panel fallback). Single click now selects only.

Overflow edges route from side ports with horizontal bezier curves that
create a natural "spilling over" visual before curving to targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 20:13:40 -08:00
Jeff Emmett a6008a4f2d refactor: complete rfunds → rflows rename across configs and references
Update docker-compose, vite config, Traefik labels, module imports,
and all cross-module references to use the new rflows naming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:13:14 -08:00
Jeff Emmett cdfe8c5b78 feat: add unified notification system with real-time WS delivery
Persistent, PostgreSQL-backed notification system replacing the in-memory
access request polling. Notifications are created via notify(), persisted
to DB, and delivered in real-time over WebSocket with a 30s polling fallback.

Infrastructure:
- notifications + notification_preferences tables in EncryptID schema
- 10 CRUD functions in db.ts (create, list, count, read, dismiss, etc.)
- notification-service.ts: core notify(), WS registry, notifySpaceAdmins()
- notification-routes.ts: REST API at /api/notifications
- rstack-notification-bell.ts: bell icon component with dropdown panel

Module integration (11 hooks):
- spaces.ts: access_request, access_approved, access_denied, member_joined,
  member_left, role_changed
- index.ts WS handler: ping_user (24h expiry)
- encryptid/server.ts: guardian_accepted, recovery_initiated (owner + guardians),
  recovery_approved

Legacy cleanup:
- Removed access request polling, badge, and approve/deny UI from
  rstack-identity.ts (now handled by notification bell)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 18:59:09 -08:00