Commit Graph

528 Commits

Author SHA1 Message Date
Jeff Emmett 348f86c179 fix(rtrips): fit all views on one screen without page scrolling
Pin nav bar and tabs at top, make tab content scroll within the remaining
viewport height. Uses flex layout with overflow-y: auto on the content
area. Applies to list, detail, and AI planner views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 18:28:50 -07:00
Jeff Emmett 1eb4e1cb66 feat(rmaps): UX parity with rmaps-online — route overlay, ping cooldown, session persistence
Phase 1: Route double-layer outline, ScaleControl, route instruction summary,
Enter key in meeting search, select-all toggle in import preview, fitToParticipants FAB.
Phase 2: Ping All sidebar button, push vibrate+requireInteraction, 30s ping cooldown,
bundled QR code (qrcode package with external API fallback), ping toast with vibration.
Phase 3: Location persistence across sessions (<30min restore), auto-start sharing preference.
Also fix pre-existing TS error in community-sync.ts (bulkForget changes array typing).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 18:25:46 -07:00
Jeff Emmett 496dff3c7f feat(rtrips): add in-module AI planner with split-view chat + canvas export
"Plan with AI" now opens a split-view within rTrips instead of redirecting
to the canvas. Left panel: chat with model selector. Right panel: generated
trip cards (destinations, itineraries, budgets, packing lists) with
accept/discard flow. Demo mode provides realistic mock responses for Japan,
Europe, and beach queries. Accepted items export to canvas via sessionStorage
+ #trip-import hash handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 18:21:40 -07:00
Jeff Emmett 3f496d9fc6 feat(rnotes,canvas): comments in demo mode, emoji reactions, reminders + inline picker modal
- rNotes comments now work in demo mode via in-memory thread storage
- Added emoji reactions (7-emoji palette) and date reminders on comment threads
- Reminders integrate with rSchedule API for persistent notifications
- Canvas toolbar: split Note into "Blank Note" (always available) and "From rNotes" (picker)
- Replaced browser prompt()-based pickFromList with showPickerModal (dark-themed, searchable, keyboard nav)
- Updated pickTrip, destination, and booking handlers to use the new modal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 17:53:06 -07:00
Jeff Emmett 41051715b9 feat(rtasks): ClickUp two-way sync integration
Add bidirectional sync between rTasks and ClickUp:
- API client with 100 req/min rate limiter
- OAuth2 + personal API token connection flows
- Import wizard (workspace → space → list picker)
- Outbound push queue (5s intervals, 10-item batches)
- Inbound webhook with HMAC-SHA256 validation
- Field-level conflict detection (rTasks wins)
- Source badges (purple CU) with sync status dots on task cards
- Sync status indicator in board header for connected boards

Also fix 6 pre-existing TS errors across crowdsurf, rcal, rnotes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 17:37:01 -07:00
Jeff Emmett 3a222e2ddc fix(rnotes): register comment and suggestion marks in legacy editor
The CommentMark, SuggestionInsertMark, and SuggestionDeleteMark extensions
were only registered in the collab (Yjs) editor, causing "no mark type
named 'comment'" crash when adding comments in demo/legacy mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 17:24:56 -07:00
Jeff Emmett e8379541cc fix(tabs): strip duplicate shell elements from canvas tab injection
The canvas.html body contained <rstack-tab-bar>, <rstack-space-settings>,
and <rstack-history-panel> elements that weren't being stripped by
extractCanvasContent (the tab-row regex failed due to extra children).
When injected via TabCache, these duplicate elements interfered with the
shell's tab management, causing tabs to appear wiped.

Fixes:
- Server: robust div-counting strip for rstack-tab-row + explicit strips
  for space-settings and history-panel
- Client: DOM-based safety strip in TabCache.extractContent()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 17:21:52 -07:00
Jeff Emmett df8631360e feat(collab): unified presence system across all 27 rApps
Harmonize the two disconnected presence systems into one:
- New shared/collab-presence.ts utility (broadcastPresence, startPresenceHeartbeat)
- Collab overlay now listens to custom presence messages, shows module context in people panel
- Fixed Shadow DOM focus tracking using composedPath() for focus rings through shadow boundaries
- Replaced rNotes custom presence with shared utility (kept sidebar dots)
- Added presence heartbeat to all 27 rApp components with dynamic context strings
- Bumped cache versions in all modified mod.ts files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 16:56:06 -07:00
Jeff Emmett 32524fdf00 feat(rnotes): add collab status bar, sidebar indicator, mobile UX polish
Adds a visible collab status bar between toolbar and editor showing
connection state (live editing with peer count, sync enabled, or offline).
Sidebar footer now shows a live collab indicator dot. Mobile sidebar
auto-closes when selecting a note. Mobile FAB button now shows "Docs"
label. Bumps cache version to v=5.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 16:11:49 -07:00
Jeff Emmett c35f39380e feat(rflows): replace drain valve bar with rotary knob, move allocations to panel
- Add renderDrainKnob() with rotating handle matching source valve style
- Remove rectangular ◁ $/mo ▷ drag bar and split control overlays from canvas
- Add editable range sliders in inline config Allocations tab
- Rewire drag handler for live knob rotation during drain rate adjustment
- Clean up dead split-divider CSS and event listeners

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 15:38:59 -07:00
Jeff Emmett 8635b54800 fix(rflows): eliminate SVG NaN errors via comprehensive data sanitization
Added safeNum() + migrateNodeData() to sanitize all numeric fields (including
positions and allocation percentages) at every data loading boundary. The nullish
coalescing operator (??) doesn't catch NaN, so corrupted Automerge/localStorage
data cascaded NaN through pipe positions, port coordinates, and edge paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 15:14:26 -07:00
Jeff Emmett 2d28252f1a feat(rwallet): replace S-curve flows with L-curve right-angle flows in timeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 15:03:23 -07:00
Jeff Emmett ef65ec49ff chore(rnotes): bump JS/CSS cache version to v=4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:45:26 -07:00
Jeff Emmett 0e9ca3ec30 feat(rnotes): convert to Docmost-style persistent sidebar layout
Replace 3-step drill-down navigation (notebook grid → note list → editor)
with a persistent sidebar showing collapsible notebook tree alongside the
editor. Sidebar supports search, per-notebook note lists, hover add buttons,
and active note highlighting. Mobile collapses to slide-in overlay <768px.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:43:21 -07:00
Jeff Emmett 5f25ae02e1 fix(rsocials): use checkboxes for campaign wizard platform selectors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:22:49 -07:00
Jeff Emmett 4e6d0b885b fix(rdesign): chat messages top-to-bottom, input at bottom, no page scroll
Move chat input below messages container so conversation flows naturally
top-to-bottom. Add overflow:hidden on html/body to prevent page scrolling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:16:07 -07:00
Jeff Emmett bf0661fab2 feat(cad): LLM-orchestrated MCP tool-calling for KiCad and FreeCAD
Add Gemini Flash agentic loop that converts natural language prompts
into real MCP tool call sequences for PCB design (KiCad) and parametric
CAD (FreeCAD). Dynamic schema conversion from MCP tools to Gemini
function declarations, 8-turn/60s loop with real execution and result
feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:07:19 -07:00
Jeff Emmett d8736ba341 fix(rcal): add post-load migration for tags field on existing events
Automerge docs created before the tags schema don't have the field.
The migration runs 5s after startup (after loadAllDocs completes),
patches missing tags onto events, and assigns known demo event tags.
Also removes debug endpoint and tracing logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 14:01:01 -07:00
Jeff Emmett 9ae88e14b7 debug: add tags tracing logs 2026-03-24 13:56:22 -07:00
Jeff Emmett d7e195c0b3 debug: temporary tags debug endpoint 2026-03-24 13:48:21 -07:00
Jeff Emmett a3b6d7f425 fix(rcal): convert Automerge proxy arrays to plain arrays for tags serialization
Automerge proxy lists don't serialize to JSON properly via ?? null.
Use Array.from() to materialize them before returning in API responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:41:32 -07:00
Jeff Emmett 2dd5e764cd feat(rcal): MI calendar awareness, tags, saved views, MCP server
Phase 1: MI now knows the current date/time and upcoming events (14-day
lookahead, 5 events max) via direct Automerge read — no HTTP overhead.

Phase 2: Tags (string[] | null) on CalendarEvent for first-class filtering.
Saved views (named filter presets) with full CRUD API. Tag filter on
GET /api/events via comma-separated AND logic. Demo events seeded with tags.

Phase 3: Calendar MCP server (5 tools: cal_list_events, cal_get_event,
cal_list_sources, cal_list_views, cal_create_event) registered in .mcp.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:28:02 -07:00
Jeff Emmett 90d511077c fix: campaign wizard using wrong localStorage key for auth token
Was reading `auth_token`, should be `encryptid-token`. Also removes
the premature client-side auth guard that blocked signed-in users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:04:57 -07:00
Jeff Emmett 7f327eb07a fix: whitelist rvote GET API as public + guard campaign wizard auth client-side
1. Add GET /rvote/api/* to public endpoint whitelist so proposal
   listings work on private/permissioned spaces without auth.
2. Campaign wizard now checks for auth token before POSTing,
   showing "Please sign in" instead of a cryptic 401.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 12:58:21 -07:00
Jeff Emmett 50c003e8e3 fix(rdesign): catch SSE stream close errors (Cloudflare QUIC reset)
Add .catch() to the ReadableStream reader loop so Cloudflare QUIC
protocol resets on stream close don't surface as uncaught errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 12:13:44 -07:00
Jeff Emmett 4ed940d75c fix(rdesign): run Scribus runner as standalone supervisor process
The Scribus --python-script flag requires GUI initialization which
blocks in headless environments. Instead, run the runner as a separate
supervisor-managed Python process (always-on socket server). The bridge
server now simply verifies the socket exists rather than launching
Scribus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 12:05:51 -07:00
Jeff Emmett e5466491c7 fix(rdesign): auto-restart Scribus when runner socket is missing
The bridge's /start endpoint was returning "already running" even when
the runner script had crashed (socket gone). Now kills zombie Scribus
and restarts. Agent route also verifies runner connectivity after start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 11:41:58 -07:00
Jeff Emmett fdf4db2050 fix(rdesign): move prompt input above replies in chat panel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 11:37:08 -07:00
Jeff Emmett 3cb2298569 feat(rdesign): split-pane chat + visual editor UI, SSE keepalive
Rewrite rDesign UI from cramped textarea+step-log to proper split-screen:
left = chat conversation with bubbles, right = interactive SVG editor
with click-to-select, drag-to-move, and corner-handle resize.

SSE keepalive pings every 15s prevent Cloudflare QUIC stream drops.
Tool calls now show human-readable descriptions in collapsible details.
Gemini reasoning text included in thinking events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 11:28:28 -07:00
Jeff Emmett 68edfaae66 feat(rflows): rewrite flow engine — conservation-enforcing simulation + Sankey renderer
Simplify FunnelNodeData from 4-tier thresholds to 2 fields (overflowThreshold + capacity),
replace 3-tier spending multiplier with flat drainRate. Rewrite folk-flow-river.ts as clean
Sankey-style SVG renderer (~580 lines, was ~1043). Add migrateFunnelNodeData() for backward
compat with saved flows. Net -616 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:58:53 -07:00
Jeff Emmett c2b5820f8a fix(rdesign): use relative path for API fetch to avoid mixed content
The bare-domain router redirects /demo/... paths to demo.rspace.online
with http:// protocol, causing mixed content errors. Use the current
page path as the base URL instead of constructing an absolute path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:41:13 -07:00
Jeff Emmett aec42ef976 fix(rdesign): add publicWrite flag to unblock POST requests
The write-method middleware was returning 403 for POST /api/design-agent
because the module lacked publicWrite: true.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:36:14 -07:00
Jeff Emmett ddb5b0b2e4 fix(rdesign): fix 401 auth error and theme-aware CSS for light mode
Pass encryptid auth token in design-agent API requests. Replace
non-existent --rs-bg-elevated with real theme variables and remove
hardcoded dark fallbacks so the UI works in both light and dark mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:22:16 -07:00
Jeff Emmett 77b7aba893 feat(rdesign): Scribus noVNC + AI design agent + CRDT sync
Replace Affine wrapper with full Scribus DTP stack:
- Docker container: Scribus 1.5 + Xvfb + x11vnc + noVNC + Python bridge
- Bridge API: Flask server (port 8765) proxying to Scribus Python API via Unix socket
- Design agent: Gemini tool-calling loop drives Scribus headlessly from text briefs
- CRDT sync: Automerge schema v2 with pages/frames, bidirectional SLA bridge
- Canvas tool: folk-design-agent shape + create_design_agent in canvas-tools registry
- Module UI: inline text prompt + step log + SVG layout preview (no iframe)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:06:04 -07:00
Jeff Emmett d74512ddcd chore(rflows): bump folk-flow-river.js cache version to v=2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 19:33:56 -07:00
Jeff Emmett 8b43df5ce9 fix(rflows): Sankey-style constant-width L-shaped ribbons for waterfalls
Three fixes for S-curve appearance:
- Constant width throughout each waterfall (no taper between source/river)
- Stack inflow waterfalls side-by-side at funnel top proportionally
- Widen spending drain to 80% of vessel bottom width

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 19:23:46 -07:00
Jeff Emmett aa4a200f32 feat(history): add "Revert to this point" button in Time Machine panel
Forward Automerge change that overwrites content fields with snapshot data,
preserving meta and full history. Also fixes pre-existing TS errors in
folk-flow-river (undefined exitX) and test-full-loop (StepResult type).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 19:08:15 -07:00
Jeff Emmett 47a3fe32fb fix(rflows,rwallet): unstaged fixes from previous session
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 18:42:11 -07:00
Jeff Emmett 8aa2e9773a feat(rmaps): ZIP import, chat, route requests, indoor maps
- ZIP import: Google Takeout + generic FeatureCollection ZIP via JSZip
- Route requests: "Ask to navigate" sends WebSocket route_request, toast notification with Navigate/Dismiss in other tab
- Chat: Automerge-backed persistent messages with MapChatMessage schema (v2), sidebar tab toggle, unread badge
- Indoor maps: <map-indoor-view> with c3nav raster tile proxy, level selector, Easter egg on Level 0 triple-click
- Indoor/outdoor toggle in controls bar and mobile FAB
- Cache bust v2→v3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 18:42:02 -07:00
Jeff Emmett aa520d41a2 chore(rwallet): bump JS cache version to v=15
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 18:23:07 -07:00
Jeff Emmett 51be476694 feat(rwallet): timeline-first UX overhaul with proportional rivers
- Fix USD estimation: add NATIVE_APPROX_USD price table for ETH, MATIC,
  BNB, AVAX, xDAI, CELO, GNO; unknown tokens fall back to $0 instead of
  raw token amounts (fixes wildly wrong river widths)
- Fix scroll hijacking: only intercept Ctrl+wheel (pinch-to-zoom) on
  timeline, flow chart, and sankey; normal two-finger scroll passes through
- Collapse address bar to compact chip after wallet loads with Save/Change
- Promote watchlist as horizontal chip selector above dashboard; merge
  example wallets as dashed "suggested" chips when watchlist is empty
- Default to timeline view after wallet detection (auto-loads transfers)
- Move balance/transaction tables to Details modal (pill button, overlay
  with backdrop blur) — stats cards hidden in viz views since D3 shows them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 18:16:06 -07:00
Jeff Emmett bfdb320b3e fix(rcal): prevent multi-day event spans from displacing day cells
Multi-day event span bars used grid-row/grid-column inside the same
CSS grid as auto-placed day cells. The grid auto-placement algorithm
skipped cells occupied by explicitly-placed spans, pushing day numbers
to wrong positions.

Fix: make .ev-span position:absolute with .grid position:relative.
Absolutely-positioned grid children still use grid-row/column for
their containing block but don't participate in layout flow. Also
account for expanded day-detail rows when calculating span grid rows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 17:37:35 -07:00
Jeff Emmett 245d2ec3b4 feat(rwallet): HyperSwitch full-loop fiat↔CRDT payment integration
- /api/internal/mint-crdt: on-ramp webhook → cUSDC mint (idempotent)
- /api/internal/escrow-burn: off-ramp escrow with two-step confirm/reverse
- $MYCO bonding curve (server/bonding-curve.ts): quadratic price curve,
  buy/sell/quote/settlement-state endpoints in rwallet
- BFT token renamed to $MYCO (6 decimals) in seed data
- LedgerEntry schema extended with offRampId, status for escrow tracking
- burnTokens, burnTokensEscrow, confirmBurn, reverseBurn in token-service
- Wallet UI: Buy cUSDC, $MYCO Swap, Withdraw sections with live quotes
- scripts/test-full-loop.ts for end-to-end verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 17:34:48 -07:00
Jeff Emmett 6ab9790373 fix(rflows): match overflow pipe widths to edge width formula
Compute overflow/spending pipe widths as proportional shares of
outflowWidthPx (matching edge formula: outflowWidthPx * flow/total)
instead of independent globalMaxFlow scaling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 17:26:05 -07:00
Jeff Emmett 3def8f73fe fix(rflows): cache-bust folk-flows-app.js for CDN
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 17:11:24 -07:00
Jeff Emmett db1c0ec490 feat(rflows): proportional flow pipes on all node types
Scale source stream, funnel inflow/overflow/spending, and outcome
inflow/overflow pipes using the same 8-80px global Sankey scale as
edges, replacing fixed-width cosmetic pipes with flow-consistent ones.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 17:06:45 -07:00
Jeff Emmett 68adc7ad17 feat(rwallet): add yield sandbox simulator with compound interest engine
Client-side sandbox for "what-if" yield projections — enter any amount,
pick asset/chain, scrub a time slider, and compare all protocol APYs
instantly. Uses live DeFi Llama rates when available, mock fallbacks offline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 16:50:06 -07:00
Jeff Emmett 3cfec226a4 fix(rflows): proportional node sizing + remove organic visualization
Nodes now scale with dollar values (sources by flowRate, funnels by
maxCapacity, outcomes by fundingTarget). Removed unused organic/
mycorrhizal render mode including renderer, CSS, and all toggle logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 15:08:08 -07:00
Jeff Emmett cb92a7f6d8 feat(rtrips): AI trip planner — canvas tools + "Plan with AI" button
Register 5 trip-specific tools (destination, itinerary, booking, budget,
packing list) in canvas-tools.ts so Gemini can create trip shapes.
Add public toolsEnabled/systemPrompt properties to folk-prompt with
persistence. Add #trip-planner hash handler to canvas.html that auto-
creates a pre-configured AI prompt. Add "Plan with AI" gradient button
to rTrips list and detail views.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 14:32:28 -07:00
Jeff Emmett 0c04d6bee1 fix(rmeets): use Jitsi External API by default, clean up toolbar buttons
Switch default room view to External API (cleaner toolbar, no stray
close buttons). Slim toolbar to essentials, disable participant pane
overlay. Fall back to iframe embed with ?iframe=1.

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