Spaces:
Sleeping
Sleeping
BRIDGE Platform Agent
refactor(naming): modul β modules across metadata, wordmarks, headers, docs
195092e |
Download IMPLEMENTATION_PLAN.md from sitcod3/BRIDGE_Modul-S_prod: direct link, hf CLI and curl.
- Browser
- Download file 5.96 kB
-
https://huggingface.co/spaces/sitcod3/BRIDGE_Modul-S_prod/resolve/main/IMPLEMENTATION_PLAN.md
- Command line
-
hf download hf://spaces/sitcod3/BRIDGE_Modul-S_prod/IMPLEMENTATION_PLAN.md
-
curl -L -o IMPLEMENTATION_PLAN.md https://huggingface.co/spaces/sitcod3/BRIDGE_Modul-S_prod/resolve/main/IMPLEMENTATION_PLAN.md
5.96 kB
IMPLEMENTATION_PLAN.md β BRIDGE Platform (Modules E & S)
PHASE 2 deliverable. Executed autonomously per the brief's guardrails ("do not pause for confirmation between phases").
0. Strategy
Converge both sibling apps into ONE platform build (they share ~95 % of code and deploy to the same HF Space sitcod3/BRIDGE_Modul-S_prod):
- Base = E repo (GREENTHEME-test) β superset: ThemeContext engine, tests, Skeleton, Pricing, Stripe.
- Module S's real pages are ported into the platform under
src/modules/s/**(design preserved 100 %: true-indigo palette, slateβblack gradient, original UX). - Module E's pages stay in
src/pages/**and mount at/modules/e/**. - Platform shell (Sidebar with MODULES section, per-module nav + palette, TopBar) adapts per module via the registry.
- The identical platform build is replicated into the S repo so either pipeline produces the same Space.
1. File-by-file change list
NEW
| File | Purpose |
|---|---|
src/modules/registry.tsx |
ModuleId, MODULES registry: id, label, wordmark, accent config, tagline, nav items, icon |
src/modules/LaunchContext.tsx |
Launch sequencer: startLaunch(moduleId) bumps seq (re-seed), controlled exit choreography, useLaunch() |
src/modules/ModuleLaunchAnimation.tsx |
Random-reassembly engine (Β§3) |
src/modules/ModuleShell.tsx |
Route shell /modules/:id: data-module attr + theme override, platform chrome, launch guard β animation β <Outlet/> |
src/modules/ModuleHub.tsx |
/ platform launcher: two real-primitive module cards + Launch buttons |
src/modules/PlatformSidebar.tsx |
MODULES section (2 direct-launch buttons) + active module nav |
src/modules/PlatformTopBar.tsx |
TopBar shell per module (module-aware API-key badge) |
src/modules/s/components/{StatCard,AnimatedLogo,GlassCard}.tsx |
S variants (original implementations) |
src/modules/s/pages/*.tsx |
11 ported S pages (imports re-pointed; StatCard β S variant) |
MODIFIED
| File | Change |
|---|---|
src/App.tsx |
New route table (Β§2), LaunchProvider, legacy redirects |
src/context/ThemeContext.tsx |
Add PROD_THEME (Module S palette); default stays mint |
src/index.css |
[data-module="s"] palette var overrides + .bg-module-s gradient + reduced-motion safeguard |
src/components/Logo.tsx |
Wordmark ModulEβModuleE, label prop |
src/pages/Dashboard.tsx, src/pages/CampaignDetail.tsx |
3 absolute links β /modules/e/β¦ |
metadata.json |
name BRIDGE Modules + description migrated |
server.ts |
add GET /api/health |
README.md |
platform note |
Tests (new)
src/modules/ModuleLaunchAnimation.test.tsxβ primitives render; reduced-motion instant reveal; re-seed between launches.src/modules/routing.test.tsxβ/modules/e+/modules/sindex pages render in-shell; hub cards; direct menu routes; legacy/campaignsβ/modules/e/campaigns.src/modules/naming.test.tsβ zeroModulstragglers in registry;/modules/e+/modules/sroutes.
2. Route table
/ ModuleHub
/modules/e E Dashboard (index)
/modules/e/{campaigns,campaigns/:id,leads,email-accounts,warmup,inbox,webhooks,analytics,clients,pricing,settings}
/modules/s S Dashboard (index)
/modules/s/{campaigns,campaigns/:id,leads,email-accounts,warmup,inbox,webhooks,analytics,clients,settings}
Legacy: /campaigns, /leads, β¦ β replace β /modules/e/<same> * β /
3. Launch-animation architecture (PHASE 4)
<ModuleLaunchAnimation module mode="enter"|"exit" onComplete />
- Real primitives only: 4Γ
StatCard, chart frame (GlassCard + live Recharts AreaChart), list frame (5 lead rows + StatusBadge), StatusBadge strip, KPI chips, Skeleton shimmer bar β 12 pieces in a dashboard-like grid. - Random re-assembly:
mulberry32(seed),seed = Date.now() ^ hash(moduleId) ^ launchSeqβ re-seeded every launch. Per piece: off-canvas angle 0β360Β°, distance 240β720 px, rotation Β±8β45Β°, scale 0.55β1.35, staggeri*55 ms + rand(40β90) ms, duration 2.4β3.2 s, easingcubic-bezier(0.22, 1, 0.36, 1). - 60 fps: transform + opacity only (motion/react WAAPI/rAF β no setTimeout chains);
will-changeduring animation only; chart renders after first frame (double-rAF); pages React.lazy-preloaded on hub mount + menu hover. - Reduced motion: instant reveal, zero duration.
- Exit choreography:
startLaunchfrom inside a module βexitingβ shell swaps to primitive grid with reverse-assembly (scatter outward, 0.85 s) β navigate β target enter animation. Direct URL/back bypass controlled exit. - Per-module theming: same engine; E = mint accents, S = indigo accents on slate gradient.
4. Menu integration (PHASE 5)
PlatformSidebar gains BRIDGE MODULES section: Module E (mint dot) β /modules/e, Module S (indigo dot) β /modules/s; active state per namespace; click = startLaunch + navigate (re-seeded animation); cross-launch visible in both modules; hub cards mirror the action.
5. Risk register & rollback
| Risk | Mitigation | Rollback |
|---|---|---|
| Tailwind v4 remap collides with S indigo | [data-module="s"] scoped var overrides |
remove scope block |
| E absolute links break | 3 links rewritten + legacy redirects | revert pages |
| Route move breaks tests | component tests render directly; new routing tests | revert App.tsx |
| Space stale build | identical platform in both repos; 200 + bundle markers verified | HF UI rollback |
| Naming misses | naming.test + grep gate | β |
6. Execution order
- ThemeContext + index.css scopes β 2. registry/LaunchContext/animation/shell/hub/chrome β 3. port S pages β 4. App.tsx routes + links β 5. server/metadata/Logo β 6. tests + tsc + build + QA (PHASE 6) β 7. replicate to S repo, push both, verify live (PHASE 7).