Commit Graph

583 Commits

Author SHA1 Message Date
Jeff Emmett 2ba2034e3a feat: embed Twenty CRM via iframe on /crm route
Switch /crm and ?view=app from custom folk-crm-view component to
renderExternalAppShell iframe embedding crm.rspace.online. Also fix
twentyQuery endpoint from /api to /api/graphql for the data proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:26:16 -08:00
Jeff Emmett 99749d8cf2 refactor: replace ?view= query params with path-based routes in rSocials
/rsocials → canvas view (default)
/rsocials/scheduler → Postiz iframe
/rsocials/feed → demo feed / landing
/rsocials/landing → landing page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:19:27 -08:00
Jeff Emmett bc9f5bcfb4 fix: re-apply rSocials canvas route and vite build entry
The rSocials refactor commit overwrote the canvas route changes.
Re-adds: default canvas view, ?view=feed for old demo feed,
?view=landing for landing page, and vite build entry for
folk-socials-canvas.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:15:06 -08:00
Jeff Emmett 6822ee5b47 Merge branch 'main' into dev 2026-03-04 20:44:30 -08:00
Jeff Emmett 91d414fc88 feat: refactor rSocials from monolith to full rApp
Decompose the 2,116-line mod.ts into a canonical rApp matching the
rFlows/rBooks pattern with Automerge sync, web components, and
extracted CSS.

New files:
- schemas.ts: SocialsDoc, ThreadData, Campaign types + Automerge schema
- local-first-client.ts: browser-side sync client
- lib/types.ts: shared types, DEMO_FEED, PLATFORM_LIMITS
- lib/image-gen.ts: server-only fal.ai + file upload helpers
- components/folk-thread-builder.ts: compose/preview/readonly component
- components/folk-thread-gallery.ts: thread listing grid component
- components/folk-campaign-manager.ts: campaign viewer with import modal
- components/socials.css: all extracted CSS (~550 lines)

mod.ts slimmed to ~616 lines: ensureDoc, image APIs, page routes
injecting <folk-*> web components, file→Automerge migration, seed
template, and module export. Thread/campaign CRUD moved from REST
to Automerge local-first sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:44:17 -08:00
Jeff Emmett 831c8b1c24 feat: refactor rSocials from monolith to full rApp
Decompose the 2,116-line mod.ts into a canonical rApp matching the
rFlows/rBooks pattern with Automerge sync, web components, and
extracted CSS.

New files:
- schemas.ts: SocialsDoc, ThreadData, Campaign types + Automerge schema
- local-first-client.ts: browser-side sync client
- lib/types.ts: shared types, DEMO_FEED, PLATFORM_LIMITS
- lib/image-gen.ts: server-only fal.ai + file upload helpers
- components/folk-thread-builder.ts: compose/preview/readonly component
- components/folk-thread-gallery.ts: thread listing grid component
- components/folk-campaign-manager.ts: campaign viewer with import modal
- components/socials.css: all extracted CSS (~550 lines)

mod.ts slimmed to ~616 lines: ensureDoc, image APIs, page routes
injecting <folk-*> web components, file→Automerge migration, seed
template, and module export. Thread/campaign CRUD moved from REST
to Automerge local-first sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:42:18 -08:00
Jeff Emmett fff0fd3150 Merge remote-tracking branch 'origin/dev' 2026-03-05 05:34:45 +01:00
Jeff Emmett aa45cabc4e fix: add wasm plugin to folk-flows-app build + add missing rsocials components
The folk-flows-app sub-build imports Automerge which requires WASM support.
Added wasm() plugin, esnext target, and Automerge alias to the sub-build config.

Also adds folk-socials-canvas.ts and socials-canvas.css that were on the server
but missing from git, causing the vite build to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:34:32 -08:00
Jeff Emmett cdae6606ab Merge branch 'main' of ssh://gitea.jeffemmett.com:223/jeffemmett/rspace-online 2026-03-05 05:26:42 +01:00
Jeff Emmett 1e7e0f029d Merge remote-tracking branch 'origin/dev' 2026-03-05 05:26:28 +01:00
Jeff Emmett 02c8aa1fb3 fix: disable Twenty multi-workspace to prevent subdomain redirect loop
Multi-workspace mode caused crm.rspace.online to redirect to
admin-crm.crm.rspace.online which doesn't exist. Space-level tenancy
is handled by rSpace's per-space API tokens instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:23:57 -08:00
Jeff Emmett ba3fddc7d4 Merge branch 'dev' 2026-03-04 20:13:27 -08:00
Jeff Emmett 7443f9df9f feat: redesign canvas toolbar with fluid expand and 9-group layout
Toolbar buttons now smoothly widen on hover/click to reveal title text
instead of using CSS tooltips. Reorganized from 7 groups into 9 (Note,
Connect, Media, Embed, AI, Create, Decide, Spend, Travel) with better
categorization. Collapse button uses chevron instead of dots. Mobile
tap targets increased to 48px min-height for accessibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:13:19 -08:00
Jeff Emmett 2bb01c5240 Merge branch 'dev' 2026-03-04 19:36:17 -08:00
Jeff Emmett 991c0ed8a5 chore: remove rDocs and rDesign from module registry
Placeholder modules not yet built out as full rApps. Removes them
from the dropdown/tab bar until they have proper schemas, components,
and local-first support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:36:10 -08:00
Jeff Emmett 3c26addeae fix: defer tab bar active state until switchTo() resolves
The tab bar was setting its `active` attribute synchronously on click,
before TabCache.switchTo() finished fetching and injecting the new pane.
This caused a visual desync where the tab highlighted immediately but
the content area showed a blank flash or stale content.

Now the tab bar dispatches the layer-switch event without changing its
own active state. The shell event handler sets active only after
switchTo() confirms the pane is ready, eliminating the race condition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:32:38 -08:00
Jeff Emmett b28b551ee1 Merge branch 'dev' 2026-03-04 19:20:08 -08:00
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 02547fbe47 Merge branch 'dev' 2026-03-04 19:16:53 -08:00
Jeff Emmett cbe9fb5103 feat: add interactive canvas to rNetwork + rSocials canvas view
rNetwork: upgrade folk-graph-viewer with pan/zoom/drag, fitView, touch
pinch-zoom, zoom controls, persisted node positions, and incremental
drag updates. rSocials: new folk-socials-canvas component with campaign
and thread card nodes, Postiz slide-out panel, and canvas interactions.
Default / route now renders canvas view; old feed moved to ?view=feed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:16:46 -08:00
Jeff Emmett 741a519a30 fix: add wasm plugin to shell.js build for Automerge runtime
The shell now imports RSpaceOfflineRuntime which transitively pulls in
Automerge WASM. Without the wasm() plugin and esnext target on the
shell build step, vite fails with "ESM integration proposal for Wasm
is not supported".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:16:36 -08:00
Jeff Emmett 798a5edb65 Merge branch 'dev' 2026-03-04 19:12:15 -08:00
Jeff Emmett b2b5644f94 feat: add service worker precaching for cold-start offline support
Generate precache-manifest.json at build time by scanning dist/ for all
cacheable assets. SW fetches the manifest during install and precaches
core shell assets (shell.js, shell.css, theme.css, HTML pages) immediately.
Module JS/CSS bundles are lazy-cached in the background after activation.

Bumps CACHE_VERSION to rspace-v2 to trigger SW update and cache cleanup.
The app can now load fully offline even after browser restart with no network.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:12:05 -08:00
Jeff Emmett afc66ac4c1 Merge branch 'dev' 2026-03-04 19:08:09 -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 b86747d4e1 Merge branch 'dev' 2026-03-04 18:31:36 -08:00
Jeff Emmett f62da0841c feat: redesign rCal timescale bar as bottom spectrum slider
Replace discrete dot-tick zoom controller with a continuous gradient
spectrum slider at the bottom of the calendar. Move lunar overlay and
its toggle to the bottom bar. Add drag + touch support on the slider
thumb for smooth timescale navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:28:04 -08:00
Jeff Emmett e9e257cc15 Merge branch 'dev' 2026-03-04 18:14:34 -08:00
Jeff Emmett e827229447 feat: show rSocials landing page on space subdomains
Space subdomain /rsocials now renders the same marketing landing page
as the bare domain, instead of the bare Community Feed placeholder.
Demo space still shows the demo feed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:14:14 -08:00
Jeff Emmett 2428fcdf78 Merge branch 'dev' 2026-03-04 18:03:19 -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 627277303e Merge branch 'dev' 2026-03-04 18:02:38 -08:00
Jeff Emmett 3b3eecdddb fix: stop demo→personal space redirect and clean up space switcher
Logged-in users visiting demo.rspace.online were auto-redirected to
their personal space on page load. Now only provisions the space
silently without redirecting. Also removes the redundant "Public
spaces" section from the dropdown and filters the /api/spaces endpoint
to only return demo, user's own spaces, and permissioned spaces.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:02:00 -08:00
Jeff Emmett bbbb7a16fb Merge branch 'dev' 2026-03-04 17:49:48 -08:00
Jeff Emmett 2bc1b78f30 fix: make active tab local-only, stop Automerge from overriding it
The active tab was stored in Automerge's shared doc (activeLayerId),
causing different browser windows/sessions to fight over which tab
is highlighted. When one window switched to rInbox, another window
showing rFlows would have its tab bar update to highlight rInbox
while still displaying rFlows content.

Changes:
- Active tab is now always determined locally by the URL/currentModuleId
- Automerge sync only manages the tab LIST (which modules are open)
  and flows, not which tab is active
- Removed sync.setActiveLayer() calls on tab switch
- Removed activeLayerId reads from Automerge on connect and on
  remote change events
- TabCache continues to manage active state correctly when switching
  tabs within the same page load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:49:40 -08:00
Jeff Emmett 4f271a469a Merge branch 'dev' 2026-03-04 17:31:38 -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 279450c00d Merge branch 'dev' 2026-03-04 17:29:11 -08:00
Jeff Emmett 57fd1f4913 fix: always show Demo Space at top of space switcher dropdown
Adds a permanent "Demo Space" entry as the first item in the space
switcher dropdown across all rApps. Previously demo only appeared
in the "Public spaces" section (if the API returned it), making it
easy to miss. Now it's always visible at the top with a game
controller icon, followed by the sign-in/personal space CTA.

Also filters demo out of the "Public spaces" section to avoid
showing it twice.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:29:04 -08:00
Jeff Emmett 7dfe69d861 Merge branch 'dev' 2026-03-04 17:03:12 -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 fbeb3743b2 Merge branch 'dev' 2026-03-04 16:46:46 -08:00
Jeff Emmett 707d83525b fix: responsive header dropdowns + space switcher on all pages
- Remove overflow:hidden from header__left on mobile (was clipping
  app-switcher and space-switcher triggers)
- Add white-space/overflow/text-overflow to both trigger buttons so
  they truncate gracefully on narrow screens
- Add <rstack-space-switcher> to module landing and sub-page info
  shells so the spaces dropdown always appears next to the rApps dropdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 16:46:40 -08:00
Jeff Emmett e86ae0c352 Merge branch 'dev' 2026-03-04 15:47:40 -08:00
Jeff Emmett e2ebd11d75 style: differentiate rApp tab headers with borders and spacing
Inactive tabs get a subtle background tint, hover/active tabs show
visible borders, active tab uses solid surface background. Wider gap
between tabs and full-width indicator line for clearer separation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 15:47:20 -08:00
Jeff Emmett 16ef872b8d Merge branch 'dev' 2026-03-04 15:13:09 -08:00
Jeff Emmett 497bfd3db7 fix: migrate rNetwork components to theme variables for dark/light mode
Replace 60+ hardcoded hex colors in folk-graph-viewer and folk-crm-view
with var(--rs-*) CSS variables. Add city/location data to graph API query
so graph nodes show the same location info as the CRM view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 15:12:58 -08:00
Jeff Emmett 683b96e5cc Merge branch 'dev' 2026-03-04 15:11:28 -08:00
Jeff Emmett ebecfe4983 fix: app-switcher sidebar invisible due to backdrop-filter containing block
backdrop-filter on .rstack-header created a CSS containing block that
trapped the sidebar's position:fixed, giving it zero height. Moved the
backdrop-filter and background to a ::before pseudo-element so the header
no longer traps fixed-positioned children.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 15:11:16 -08:00