---
id: TASK-63
title: Remove iframe shell — render all modules directly via web components
status: Done
assignee: []
created_date: '2026-02-26 02:46'
updated_date: '2026-02-26 02:46'
labels:
  - refactor
  - bug-fix
  - shell
dependencies: []
references:
  - server/shell.ts
  - server/index.ts
  - modules/*/mod.ts
priority: high
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Every module except canvas was using renderIframeShell() to embed standalone domains (rdata.online, rwork.online, etc.) via iframe. None of these domains had independent deployments — they routed back to the same container, causing infinite redirect loops (for modules not in keepStandalone) or 404s (for modules in keepStandalone).

Root cause: renderIframeShell created an iframe pointing to e.g. rdata.online, which Traefik routed back to the same rspace-online container. For non-keepStandalone modules, the server 301-redirected back to demo.rspace.online/work, which rendered another iframe shell → infinite loop. For keepStandalone modules, the request fell through to Hono but no root route matched → connection refused.

Fix: All 22 modules now render their web components directly inside renderShell(), eliminating cross-origin failures, iframe loading spinners, and ~820 lines of dead code. Standalone domain requests are internally rewritten to module routes instead of 301 redirecting.

Changes:
- Removed renderIframeShell(), renderStandaloneShell(), IframeShellOptions from server/shell.ts
- Removed keepStandalone set; standalone domains now internally rewrite to /{space}/{moduleId}
- Converted all 22 module GET / handlers from renderIframeShell → renderShell + direct <folk-*> web components
- Deleted 20 standalone.ts entry points (were circular/broken)
- Net: +129 / -947 lines across 43 files
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 All 22 modules render via renderShell() with direct web component tags
- [x] #2 renderIframeShell and IframeShellOptions removed from server/shell.ts
- [x] #3 Standalone domains (rdata.online etc.) internally rewrite to module routes instead of 301 redirect
- [x] #4 keepStandalone set removed
- [x] #5 All 20 standalone.ts files deleted
- [x] #6 TypeScript compiles cleanly (bunx tsc --noEmit passes)
- [x] #7 No remaining references to renderIframeShell in source code
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Removed the broken iframe shell architecture. All modules now render their `<folk-*>` web components directly in the unified shell, fixing connection failures across rData, rWork, rNetwork, rWallet, rFiles, and all other modules. Standalone domains are internally rewritten instead of 301 redirected. Commit c2729fb, merged to main.
<!-- SECTION:FINAL_SUMMARY:END -->
