fix: architecture diagram unreadable in dark mode (#3752)

## Summary
- The inline HTML/CSS flow diagram in `docs/concepts/architecture` was
broken — marked's smartypants text transforms corrupted the `<style>`
block, stripping all styling
- Replaced with a standalone SVG
(`www/static/docs/architecture-flow-v2.svg`) using theme-neutral
mid-gray colors that are readable on both light and dark backgrounds

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bartek Iwańczuk
2026-04-07 11:08:11 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent d6b0a169a3
commit 895bcacdae
2 changed files with 109 additions and 85 deletions
+1 -85
View File
@@ -9,91 +9,7 @@ browser. This page explains how a request flows through the framework.
## Request lifecycle
<div style="max-width:620px;font-family:system-ui,-apple-system,sans-serif;font-size:14px;color:#1a1a1a;">
<style>
.flow-step{display:flex;align-items:flex-start;gap:16px}
.flow-box{flex-shrink:0;width:200px;padding:10px 14px;border:1.5px solid #333;border-radius:6px;background:#f8f9fa;text-align:center}
.flow-box strong{display:block;font-size:14px}
.flow-box small{font-size:11px;color:#777}
.flow-box.accent{background:#eef6ff}
.flow-box.green{background:#f0faf0}
.flow-desc{padding-top:10px;font-size:12.5px;color:#555;line-height:1.5}
.flow-arrow{text-align:center;width:200px;color:#666;font-size:18px;line-height:1;padding:4px 0}
.flow-arrow-label{text-align:center;width:200px;padding:2px 0}
.flow-arrow-label em{font-size:11px;color:#777}
.flow-divider{margin:12px 0 8px;padding-top:8px;border-top:1px dashed #e0e0e0;font-size:11px;color:#999;font-weight:600;letter-spacing:0.5px;text-transform:uppercase}
</style>
<!-- Browser Request -->
<div class="flow-step">
<div class="flow-box accent"><strong>Browser Request</strong></div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Static Files -->
<div class="flow-step">
<div class="flow-box"><strong>Static Files</strong></div>
<div class="flow-desc">Serve file directly if path matches a static asset</div>
</div>
<div class="flow-arrow-label"><em>no match</em></div>
<div class="flow-arrow">&#x2193;</div>
<!-- Global Middleware -->
<div class="flow-step">
<div class="flow-box"><strong>Global Middleware</strong><small>runs in registration order</small></div>
<div class="flow-desc">Can modify request/response, set state, or short&#8209;circuit with a Response</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Router -->
<div class="flow-step">
<div class="flow-box"><strong>Router</strong></div>
<div class="flow-desc">Match URL pattern + HTTP method. Static routes checked first, then dynamic.</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Scoped Middleware -->
<div class="flow-step">
<div class="flow-box"><strong>Scoped Middleware</strong></div>
<div class="flow-desc">Middleware that only runs for matching path prefixes (e.g. /admin/*). Used for auth, logging, or other route&#8209;specific logic.</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Handler -->
<div class="flow-step">
<div class="flow-box"><strong>Handler</strong></div>
<div class="flow-desc">API route? Return Response directly (JSON, redirect, etc.)</div>
</div>
<div class="flow-arrow-label"><em>has component</em></div>
<div class="flow-arrow">&#x2193;</div>
<!-- Rendering section -->
<div class="flow-divider">Rendering</div>
<!-- App Wrapper -->
<div class="flow-step">
<div class="flow-box"><strong>App Wrapper</strong></div>
<div class="flow-desc">Outer &lt;html&gt;/&lt;head&gt;/&lt;body&gt; structure</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Layouts -->
<div class="flow-step">
<div class="flow-box"><strong>Layouts</strong></div>
<div class="flow-desc">Nested layout components (inherited from parent directories)</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Page Component -->
<div class="flow-step">
<div class="flow-box"><strong>Page Component</strong></div>
<div class="flow-desc">Route component receives props.data from handler</div>
</div>
<div class="flow-arrow">&#x2193;</div>
<!-- HTML Response -->
<div class="flow-step">
<div class="flow-box accent"><strong>HTML + JS Response</strong><small>sent to browser</small></div>
<div class="flow-desc">Server&#8209;rendered HTML with island props <a href="/docs/advanced/serialization">serialized</a> inline</div>
</div>
<!-- Client section -->
<div class="flow-divider">Client (Browser)</div>
<div class="flow-arrow">&#x2193;</div>
<!-- Hydration -->
<div class="flow-step">
<div class="flow-box green"><strong>Island Hydration</strong><small>only islands receive JS</small></div>
<div class="flow-desc">Rest of the page stays static HTML. No JavaScript for non&#8209;island components.</div>
</div>
</div>
![Request lifecycle flow diagram](/docs/architecture-flow-v2.svg)
## Key concepts