Commit Graph

415 Commits

Author SHA1 Message Date
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 aceeedb366 fix: resolve circular import crash in rnotes converters
Bun evaluates the converters Map after the circular import from obsidian.ts
triggers registerConverter(), causing "Cannot access before initialization".
Lazy-load converter modules via require() to break the cycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:47:23 -08:00
Jeff Emmett 4822895ca4 fix: copy src/ directory into Docker image for notification module
The notification routes import from src/encryptid/db which was missing
from the production container, causing a crash loop on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:45:13 -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 20b75c999d feat: add photo upload for thread preview images
Allow users to upload their own image as a thread preview alongside the
existing AI generation option. Adds upload-image API endpoint with file
type/size validation and two side-by-side UI buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:12: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
Jeff Emmett e838cb9a7e feat: add colorful, spatially-enriched calendar event rendering
Progressive spatial detail across all zoom levels: stacked source-color
bars in multi-year, multi-dot indicators in year views, city chips in
season, colored bg tints with location labels in month/week/day views,
description previews and virtual platform badges in day detail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 18:20:14 -08:00
Jeff Emmett 7e5499d087 feat: add multi-workspace Twenty CRM support & CRM view component
Enable multi-workspace mode in Twenty docker-compose with per-space API
token routing. Add folk-crm-view component with Pipeline, Contacts,
Companies, and Graph tabs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 18:17:09 -08:00
Jeff Emmett 5396c52c75 feat: add KOI-inspired knowledge provenance schema & calendar scheduling API
Add KnowledgeProvenance, ItemPreview, and ScheduledItemMetadata interfaces
to rcal schemas following BlockScience KOI's RID pattern. Extend POST
/api/events to accept scheduled knowledge items with provenance tracking,
add GET /api/events/scheduled endpoint with date/upcoming/pending filters,
and enable metadata patching on PATCH /api/events/:id for reminder status
updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:43:02 -08:00
Jeff Emmett bb052c49d3 feat: add universal reminders system with calendar integration & cross-module drag
Add a Reminders subsystem to rSchedule that lets users create date-based
reminders (free-form or linked to cross-module items), receive email
notifications via the existing tick loop, and sync bidirectionally with
rCal calendar events. Includes drag-and-drop from rWork task cards onto
calendar day cells to create reminders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:37:54 -08:00
Jeff Emmett da2b21cd98 feat: add voice dictation to MI bar, markdown, chat & prompt inputs
Extract Web Speech API logic from folk-transcription into a reusable
SpeechDictation utility, then wire mic buttons into all 4 text input
surfaces. Dictation fills inputs in real-time without auto-submitting.
Hidden gracefully in unsupported browsers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:10:52 -08:00
Jeff Emmett 997ccc0bef feat: add thread drafts, shareable permalinks & Twitter card previews
Thread builder now persists drafts to disk (JSON files in /data/files/threads/),
supports shareable permalink URLs with OG/Twitter meta tags, and generates
AI preview images via fal.ai for social card previews.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:29:52 -08:00
Jeff Emmett 763567baea feat: fix rApp canvas bugs + add widget data card mode
Fix zoom over iframes (transparent overlay captures wheel events),
eliminate black boxes (flex layout replaces calc height), and enable
resize handles (overlay lets pointerdown bubble to shape). Add widget
mode that fetches compact data from each module's API with 60s
auto-refresh, plus mode toggle button in header.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:26:33 -08:00
Jeff Emmett b6eeb41daf feat: add 3D stacked spider plot visualization component
Pure computation library (spider-3d.ts) with polar mesh generation,
overlap detection via point-in-polygon sampling, and membrane preset
mapping SpaceConnections to FlowKind axes. FolkShape component
(folk-spider-3d.ts) renders CSS 3D-transformed stacked SVG layers
with interactive orbit, dataset toggling, and demo data fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:05:46 -08:00
Jeff Emmett 7db591da17 feat: add settings menus to all 4 decide/choice canvas elements
Each choice component now has a gear (⚙) settings panel for configuring
title, options, criteria, and tool-specific parameters inline on the canvas.

- folk-choice-vote: title, options (color+label), QV budget, reset votes
- folk-choice-conviction: title, options (color+label), reset stakes
- folk-choice-rank: title, options (label), reset rankings
- folk-choice-spider: title, options, criteria with weight sliders, reset scores

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:47:26 -08:00
Jeff Emmett a5d4c22177 fix: rename schedule module ID to rschedule + update hero banner
Route is now /:space/rschedule (consistent with other rApp naming).
Hero: "Automate (you)rSpace, on (you)rSchedule."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:16:45 -08:00
Jeff Emmett 6ea4f1cf5a feat: add thread builder + /campaigns redirect + markdown import
- Add /thread route with two-column tweet thread composer and live preview
- Add /campaigns redirect to /campaign
- Add "Import from Markdown" modal to campaign page with platform select

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:12:20 -08:00
Jeff Emmett 92f75141eb fix: debounce synced event spam + fix rApp iframe 404s on subdomains
Synced event was firing 100+ times during initial Automerge sync negotiation.
Debounce with 300ms timer so it fires once after the burst settles.

folk-rapp iframes built URLs as /{space}/{moduleId} which on subdomain
URLs (jeff.rspace.online) got double-prefixed to /{space}/{space}/{moduleId}
causing 404s. Now detects subdomains and uses /{moduleId} directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:10:51 -08:00
Jeff Emmett 15be495e91 feat: add SpaceConnection primitive + default visibility to private
Introduces bilateral typed inter-space connections (economic, trust,
data, governance, resource) stored in both spaces' Automerge docs.
Includes connection policy, approval flow, membrane permeability
endpoint, and full CRUD API. Also changes default space visibility
from public to private for all user-facing creation paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:05:23 -08:00
Jeff Emmett c55e28a400 style: gradient background + (you)rSpace wordmark on landing page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:58:15 -08:00
Jeff Emmett a8395aa0d6 docs: fix Twenty CRM deploy guide container name + boot time
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:54:49 -08:00
Jeff Emmett 272624b0c7 feat: add feeds/acceptsFeeds to rsplat, rdesign, rdocs, rschedule
Ensures all 26 rApp modules have proper feed declarations for the
canvas layer/stack flow wiring UI. Adds landingPage functions to
rdesign and rdocs for canvas embedding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:41:55 -08:00
Jeff Emmett 24cc3ffe95 fix: feed view DOM restore + toolbar cleanup
Save/restore DOM child order when toggling feed view so element
positions revert correctly on exit. Remove unused Feed and Connect
toolbar buttons (connect mode still works via 'A' key). Rename
Memory panel to Recent Changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:39:08 -08:00
Jeff Emmett 59b1ae2d05 feat: add rSchedule module — persistent cron-based job scheduling
New module providing in-process, Automerge-backed job scheduling to
replace system-level crontabs. Includes email, webhook, calendar-event,
broadcast, and backlog-briefing action types with a 60-second tick loop.

- modules/rschedule/ — schemas, mod, landing page, web component UI
- Seed jobs: morning/weekly/monthly backlog briefings
- SMTP env vars added to docker-compose for email actions
- ONTOLOGY.md updated (26+ modules, rSchedule in Planning & Spatial)
- Also: Twenty CRM docker-compose aligned to rspace-internal network

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:34:53 -08:00
Jeff Emmett acc0faca01 feat: wire up recent tools tracking + favorites pin menu in bottom toolbar
Tracks last 2 sidebar tools used and shows them at the right end of the
bottom toolbar. [+] button opens a grouped menu to pin up to 4 favorite
tools. Pins and recents persist in localStorage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:31:39 -08:00
Jeff Emmett d988e0b112 refactor: slim Note toolbar, move rApps to Embed/Creative
Remove Card, Rich Note, rNotes, rBooks, rPubs, rForum from the Note
toolbar group. Move rNotes/rBooks/rForum to Embed as interactive
embeds (data port-ins). Move rPubs to Creative. Remove Card and
Obsidian Note from MI tool schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:26:04 -08:00
Jeff Emmett 63ac2a268e perf: parallelize local-first init — batch IDB loads, cache crypto keys, preload sync states
Sequential document loading during init() was the main bottleneck: each cached
doc required a serial IDB read + key derivation + decryption + Automerge.load.
With N documents this meant N× single-doc latency instead of 1×.

Changes:
- Add loadMany() to EncryptedDocStore for parallel Promise.all() batch loading
- Cache derived space/doc CryptoKeys in DocCrypto (one derivation per session)
- Add preloadSyncStates() to DocSyncManager for parallel sync state loading
- Update all 11 module local-first-client init() methods to use batch APIs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:18:55 -08:00
Jeff Emmett 7a34239071 chore: backlog tasks 87-101 for recent untracked work
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:03:40 -08:00
Jeff Emmett 96e1afb143 feat: add conviction timeline chart + dynamic option reordering
SVG chart plots each option's conviction growth over time with colored
lines and area fills. Options now sort by conviction score (highest
first) and reorder every 10s as conviction accumulates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:03:03 -08:00
Jeff Emmett 588a52f2cc fix: rename Twenty CRM containers to twenty-ch-* prefix to avoid conflicts
Existing Twenty instances on Netcup use twenty-server/twenty-db/twenty-redis
names. Renamed to twenty-ch-server/twenty-ch-db/twenty-ch-redis for the
commons-hub instance. Updated TWENTY_API_URL accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:56:53 -08:00
Jeff Emmett 07e53d6aa1 feat: add Twenty CRM /crm route + deploy stack for commons-hub lead funnel
Adds dedicated /crm sub-route to rNetwork module embedding Twenty CRM
via ExternalAppShell iframe. Updates TWENTY_API_URL to use internal Docker
networking (http://twenty-server:3000). Includes full Twenty CRM Docker
stack (server, worker, postgres, redis) with Traefik routing for
crm.rspace.online and deployment instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:53:50 -08:00
Jeff Emmett 80e42596b3 fix: normalize visibility enums + tab tracking across remaining files
Update remaining references from legacy 4-value visibility model
(public/public_read/authenticated/members_only) to simplified 3-value
model (public/permissioned/private) in rInbox, rVote, identity component,
admin panel, and create-space page. Add tab trackRecent calls in shell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:29:01 -08:00
Jeff Emmett eb2859d849 refactor: normalize space visibility enums + inline space create form
Align visibility values across server and UI to the canonical set:
public, permissioned, private (replacing public_read, authenticated,
members_only). Add inline space creation form to the space switcher
dropdown and tab bar instead of navigating to /new.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:27:31 -08:00
Jeff Emmett fb26324929 fix: rNetwork graph viewer now fetches /api/graph and normalizes CRM data
The folk-graph-viewer component was never calling /api/graph — it only
fetched /api/workspaces and /api/info, leaving nodes/edges empty for
non-demo spaces. Now loadData() fetches the graph endpoint and maps
server field names (label→name, works_at→work_at) to match the client
interface. Force layout and org colors are now dynamic instead of
hardcoded for 3 demo orgs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:25:11 -08:00
Jeff Emmett de4da8429f feat: rChoices drawers + conviction wiring in canvas
Add conviction component to canvas toolbar, SHAPE_DEFAULTS,
newShapeElement switch, CSS position selectors, and connect-mode
selectors. Complete the wiring for folk-choice-conviction alongside
existing spider/rank/vote drawer enhancements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:24:18 -08:00
Jeff Emmett 6801916c60 feat: conviction voting button handler, server import cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:21:36 -08:00
Jeff Emmett 06f7d67cd3 chore: slash-command refinements, server import fixes, misc cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:21:04 -08:00
Jeff Emmett f86c6234af fix: register FolkChoiceConviction component in canvas
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:20:43 -08:00
Jeff Emmett b52aa8298b feat: conviction voting component, rNotes refinements, space visibility endpoints
- Add folk-choice-conviction library and register in lib/index
- Refactor rNotes app layout and interaction
- Space visibility normalization in server/spaces
- Minor canvas.html tweaks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:19:45 -08:00
Jeff Emmett daa6013fd0 fix: add migrateVisibility runtime migration, fix participant→member role label
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:17:53 -08:00
Jeff Emmett 0d8d8202a5 fix: normalize legacy space visibility values to 3-type model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 13:16:06 -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 6dae60ea1f feat: single-click text inputs to edit, drag/resize on shape body
Shapes are now grabbable/draggable/resizable on first click (body or
handles), editable on double-click, but clicking directly on a text
input (textarea, contenteditable, text input) immediately enters edit
mode and focuses the input — no double-click required.

Works by hit-testing text inputs at pointer coordinates before
initiating drag, checking both light DOM and shadow DOM of slotted
content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 12:03:33 -08:00
Jeff Emmett 8bd899d146 fix: persist theme via html[data-theme] + theme.css custom properties
- Blocking <head> script restores canvas-theme from localStorage
  with prefers-color-scheme fallback (no FOUC)
- New theme.css with CSS custom properties for dark/light
- Removed data-theme from body/header/tab-row (now on <html>)
- Theme toggle writes to documentElement instead of body

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:56:51 -08:00
Jeff Emmett b77fb30001 fix: persist light/dark theme preference across sessions
Restore canvas-theme from localStorage on page load with a blocking
script before first paint (body) and a fixup for header/tab-row.
Applied to all three shell renderers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:50:49 -08:00
Jeff Emmett 161f7a10de feat: fall back to demo data when rPhotos/rInbox APIs return empty
Show sample data with an info banner instead of blank empty states
when Immich isn't configured or no mailboxes exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:16:22 -08:00
Jeff Emmett 023a88352f fix: deep-clone shape data to prevent Automerge proxy re-assignment error
Break Automerge proxy chain in #shapeToData() and #updateShapeInDoc()
to fix "Cannot create a reference to an existing document object" on
canvas load and WS sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:14:42 -08:00
Jeff Emmett e2e12afc96 feat: add encrypted server-side account vault for EncryptID
Zero-knowledge vault stores account data (profile, emails, devices,
wallets, preferences) as AES-256-GCM encrypted blob via backup API.
Key derived from WebAuthn PRF — server never sees plaintext. Dashboard
UI with save/restore buttons triggers passkey re-auth for encryption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:13:41 -08:00
Jeff Emmett 91cafc92ce fix: cursor world-coords, loading skeleton, WebSocket readyState guard
- Convert cursor positions to canvas world coordinates (screen→world on
  send, world→screen on render) so remote cursors appear at correct
  canvas locations regardless of pan/zoom
- Add PresenceManager.setCamera() to reproject cursors on pan/zoom
- Add loading spinner overlay dismissed on first cache hit or sync
- Guard WebSocket open handler with readyState check after async load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:40:13 -08:00
Jeff Emmett fef419f572 fix: folk-wrapper crash, service worker API exclusion, fal.ai endpoint
- folk-wrapper: createRenderRoot crashed because innerHTML="" removed the
  slot from DOM, making parentElement null on the next line. Save parent
  ref before clearing.

- sw.ts: module API paths (/space/module/api/...) weren't excluded from
  caching. Changed startsWith("/api/") to includes("/api/"). Also fixed
  catch handler returning undefined instead of a Response.

- image-gen: changed queue.fal.run to fal.run for synchronous responses.
  The queue endpoint returns request_id, not the actual image data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:36:15 -08:00