Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix: restore styling for desktop app redirect

Josuéc532c21cfd8b
diff --git a/profile-ui/app/open/apps/[recipeNs]/[recipeName]/route.ts b/profile-ui/app/open/apps/[recipeNs]/[recipeName]/route.ts
index ee5efb425..14711d596 100644
--- a/profile-ui/app/open/apps/[recipeNs]/[recipeName]/route.ts
+++ b/profile-ui/app/open/apps/[recipeNs]/[recipeName]/route.ts
@@ -32,10 +32,11 @@ export async function GET(
headers: {
'Cache-Control': 'no-store',
'Content-Security-Policy':
- "default-src 'none'; script-src 'unsafe-inline'; base-uri 'none'; " +
+ "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; base-uri 'none'; " +
"form-action 'none'; frame-ancestors 'none'",
'Content-Type': 'text/html; charset=utf-8',
'Referrer-Policy': 'no-referrer',
+ 'X-Content-Type-Options': 'nosniff',
},
})
}
diff --git a/profile-ui/lib/desktopAppLinks.ts b/profile-ui/lib/desktopAppLinks.ts
index baa52a608..719eb931c 100644
--- a/profile-ui/lib/desktopAppLinks.ts
+++ b/profile-ui/lib/desktopAppLinks.ts
@@ -48,6 +48,20 @@ function escapeHtml(value: string): string {
.replaceAll("'", ''')
}
+function desktopAppDisplayName(parsed: URL): string {
+ const encodedRecipeName = parsed.pathname.split('/').filter(Boolean)[1]
+ if (!encodedRecipeName) return 'this app'
+
+ try {
+ const recipeName = decodeURIComponent(encodedRecipeName)
+ return recipeName.length <= MAX_APP_SEGMENT_LENGTH && APP_SEGMENT_PATTERN.test(recipeName)
+ ? recipeName
+ : 'this app'
+ } catch {
+ return 'this app'
+ }
+}
+
export function buildEvenfireDesktopAppRedirectDocument(deepLink: string): string {
const parsed = new URL(deepLink)
if (parsed.protocol !== 'evenfire:' || parsed.hostname !== 'app') {
@@ -55,6 +69,7 @@ export function buildEvenfireDesktopAppRedirectDocument(deepLink: string): strin
}
const escapedLink = escapeHtml(deepLink)
+ const escapedAppName = escapeHtml(desktopAppDisplayName(parsed))
const scriptLink = JSON.stringify(deepLink).replaceAll('<', '\\u003c')
return `<!doctype html>
<html lang="en">
@@ -62,10 +77,108 @@ export function buildEvenfireDesktopAppRedirectDocument(deepLink: string): strin
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="0;url=${escapedLink}">
- <title>Open in Evenfire</title>
+ <title>Open ${escapedAppName} in Evenfire</title>
+ <style>
+ :root {
+ color-scheme: dark;
+ font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ }
+ * { box-sizing: border-box; }
+ body {
+ min-height: 100vh;
+ margin: 0;
+ background:
+ radial-gradient(980px 520px at 16% 0%, rgba(67, 119, 250, 0.13), transparent 58%),
+ radial-gradient(860px 540px at 100% 0%, rgba(195, 212, 253, 0.08), transparent 52%),
+ #0e0f10;
+ color: #f2f2ef;
+ line-height: 1.5;
+ -webkit-font-smoothing: antialiased;
+ }
+ .center-page {
+ display: grid;
+ min-height: 100vh;
+ place-items: center;
+ padding: 2rem 1rem;
+ }
+ .page-card {
+ display: grid;
+ width: min(42rem, 100%);
+ gap: 0.95rem;
+ padding: 1.25rem 1.35rem;
+ border: 1px solid #303338;
+ border-radius: 12px;
+ background: #141518;
+ box-shadow: 0 8px 24px rgba(5, 8, 12, 0.32);
+ }
+ .stack-tight { display: grid; gap: 0.35rem; }
+ .eyebrow {
+ margin: 0;
+ color: #c6c8cc;
+ font-size: 0.7rem;
+ font-weight: 600;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ }
+ h1 {
+ margin: 0;
+ font-size: 2rem;
+ font-weight: 600;
+ letter-spacing: -0.02em;
+ line-height: 1.2;
+ }
+ .body-copy {
+ margin: 0;
+ color: #c6c8cc;
+ line-height: 1.55;
+ }
+ .open-button {
+ display: inline-flex;
+ min-height: 2.35rem;
+ width: fit-content;
+ align-items: center;
+ justify-content: center;
+ padding: 0.55rem 1rem;
+ border: 1px solid rgba(67, 119, 250, 0.3);
+ border-radius: 8px;
+ background: linear-gradient(180deg, #6a94ff 0%, #4377fa 100%);
+ color: #fff;
+ font-size: 0.875rem;
+ font-weight: 500;
+ text-decoration: none;
+ transition: background 0.15s, border-color 0.15s;
+ }
+ .open-button:hover {
+ border-color: rgba(67, 119, 250, 0.44);
+ background: linear-gradient(180deg, #4377fa 0%, #6a94ff 100%);
+ }
+ .open-button:focus-visible {
+ outline: 2px solid rgba(67, 119, 250, 0.8);
+ outline-offset: 2px;
+ }
+ @media (max-width: 640px) {
+ .center-page { padding: 1rem; }
+ h1 { font-size: 1.75rem; }
+ }
+ </style>
</head>
<body>
- <p>Opening Evenfire… <a href="${escapedLink}">Open the desktop app</a></p>
+ <main class="center-page">
+ <section class="page-card">
+ <div class="stack-tight">
+ <p class="eyebrow">Evenfire Desktop</p>
+ <h1>Open ${escapedAppName}</h1>
+ <p class="body-copy">
+ Evenfire should open this app automatically. Use the button if your browser asks for
+ confirmation.
+ </p>
+ </div>
+ <a class="open-button" href="${escapedLink}">Open in Evenfire</a>
+ <p class="body-copy">
+ If nothing happens, make sure the Evenfire desktop app is installed and try again.
+ </p>
+ </section>
+ </main>
<script>window.location.replace(${scriptLink})</script>
</body>
</html>`
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index 8d63b6148..c8d6c9724 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.103",
+ "version": "0.1.104",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.103",
+ "version": "0.1.104",
"dependencies": {
"next": "16.2.6",
"react": "^18.3.1",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index 071102856..fd3c6fad7 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.103",
+ "version": "0.1.104",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/profile-ui/test/desktopAppLinks.test.ts b/profile-ui/test/desktopAppLinks.test.ts
index a070b1cf7..6c0e5bacf 100644
--- a/profile-ui/test/desktopAppLinks.test.ts
+++ b/profile-ui/test/desktopAppLinks.test.ts
@@ -37,6 +37,10 @@ test('buildEvenfireDesktopAppRedirectDocument creates an unauthenticated protoco
assert.match(document, /http-equiv="refresh"/)
assert.match(document, /window\.location\.replace/)
assert.match(document, /evenfire:\/\/app\/sandbox-recipes\/agentic-task-board/)
+ assert.match(document, /<style>/)
+ assert.match(document, /class="page-card"/)
+ assert.match(document, /<h1>Open agentic-task-board<\/h1>/)
+ assert.match(document, /class="open-button"/)
assert.doesNotMatch(document, /login|authenticate|authorization/i)
})