Skip to content

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

TypeScript

feat: improve the Profile Portal home

Josuéfb3470171eec
diff --git a/profile-ui/app/components/Sidebar/index.tsx b/profile-ui/app/components/Sidebar/index.tsx
index 223f09e06..273be993c 100644
--- a/profile-ui/app/components/Sidebar/index.tsx
+++ b/profile-ui/app/components/Sidebar/index.tsx
@@ -19,7 +19,11 @@ export function Sidebar({ currentRoute, isOpen = false, onNavigate, onLogout }:
Object.entries(PROFILE_SIDEBAR_ITEMS) as Array<[ProfileRouteKey, ProfileSidebarItem]>
)
.filter(([routeKey]) => routeKey !== 'settings')
- .sort(([, first], [, second]) => first.label.localeCompare(second.label))
+ .sort(([firstRouteKey, first], [secondRouteKey, second]) => {
+ if (firstRouteKey === 'home') return -1
+ if (secondRouteKey === 'home') return 1
+ return first.label.localeCompare(second.label)
+ })
const settings = PROFILE_SIDEBAR_ITEMS.settings
return (
diff --git a/profile-ui/app/components/icons/index.tsx b/profile-ui/app/components/icons/index.tsx
index 68a17651d..a77b7e91a 100644
--- a/profile-ui/app/components/icons/index.tsx
+++ b/profile-ui/app/components/icons/index.tsx
@@ -96,3 +96,18 @@ export function IconCopy({ height = 16, width = 16 }: IconProps) {
</svg>
)
}
+
+export function IconExternalLink({ height = 16, width = 16 }: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" width={width} height={height} aria-hidden="true">
+ <path
+ d="M14 3h7v7m0-7-11 11m8-2v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="2"
+ />
+ </svg>
+ )
+}
diff --git a/profile-ui/app/globals.css b/profile-ui/app/globals.css
index de2e8c40d..ce41c17bf 100644
--- a/profile-ui/app/globals.css
+++ b/profile-ui/app/globals.css
@@ -298,6 +298,37 @@ code {
text-decoration: underline;
}
+.cu-home-desktop-link {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--cu-space-1);
+ color: var(--cu-link);
+ font-weight: 600;
+ text-decoration: none;
+}
+
+.cu-home-desktop-link:hover,
+.cu-home-desktop-link:focus-visible {
+ color: var(--cu-link-hover);
+ text-decoration: underline;
+}
+
+.cu-home-desktop-link:focus-visible {
+ border-radius: 2px;
+ outline: 2px solid rgba(var(--cu-focus-rgb), 0.8);
+ outline-offset: 2px;
+}
+
+.cu-home-desktop-link--unavailable {
+ color: var(--cu-text-soft);
+ cursor: default;
+}
+
+.cu-home-desktop-link--unavailable:hover {
+ color: var(--cu-text-soft);
+ text-decoration: none;
+}
+
.cu-auth-return-link {
margin-top: var(--cu-space-4);
}
diff --git a/profile-ui/app/page.tsx b/profile-ui/app/page.tsx
index 81c428aa7..8f9172cdc 100644
--- a/profile-ui/app/page.tsx
+++ b/profile-ui/app/page.tsx
@@ -1,12 +1,41 @@
'use client'
+import { useEffect, useState } from 'react'
import { useAuth } from '@components/AuthContext'
import { AuthGate } from '@components/AuthGate'
+import { IconExternalLink } from '@components/icons'
+import { getDesktopEnvironment } from '@lib/api'
+import type { DesktopEnvironmentResponse } from '@/app/types/api'
+
+function getDesktopAppHref(environment: DesktopEnvironmentResponse): string | null {
+ if (!environment.externalRestApiBaseUrl) return null
+ const params = new URLSearchParams({
+ externalRestApiBaseUrl: environment.externalRestApiBaseUrl,
+ tenantName: environment.appName || 'Evenfire',
+ })
+ return `evenfire://desktop-environment?${params.toString()}`
+}
function HomeContent() {
const { authState } = useAuth()
const me = authState.me
const displayName = me?.profile?.displayName || me?.name || me?.email || 'there'
+ const [desktopAppHref, setDesktopAppHref] = useState<string | null>(null)
+
+ useEffect(() => {
+ let isCurrent = true
+ void getDesktopEnvironment()
+ .then(environment => {
+ if (isCurrent) setDesktopAppHref(getDesktopAppHref(environment))
+ })
+ .catch(() => {
+ if (isCurrent) setDesktopAppHref(null)
+ })
+
+ return () => {
+ isCurrent = false
+ }
+ }, [])
return (
<section className="cu-page-stack">
@@ -14,7 +43,29 @@ function HomeContent() {
<div className="cu-card__body">
<p className="eyebrow">Evenfire Profile</p>
<h2 className="page-title page-title--large">Welcome, {displayName}</h2>
- <p className="body-copy">You are signed in to your Evenfire profile.</p>
+ </div>
+ </div>
+
+ <div className="cu-card">
+ <div className="cu-card__body">
+ <p className="body-copy">
+ You are signed in to the Evenfire <strong>Profile Portal</strong>.
+ </p>
+ <p className="body-copy">
+ {desktopAppHref ? (
+ <a className="cu-home-desktop-link" href={desktopAppHref}>
+ Open Desktop App <IconExternalLink />
+ </a>
+ ) : (
+ <span
+ className="cu-home-desktop-link cu-home-desktop-link--unavailable"
+ aria-disabled="true"
+ >
+ Open Desktop App <IconExternalLink />
+ </span>
+ )}{' '}
+ instead
+ </p>
</div>
</div>
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index 33e4c55cd..07a1caded 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.143",
+ "version": "0.1.144",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.143",
+ "version": "0.1.144",
"dependencies": {
"@clerum/desktop-app-links": "file:../packages/desktop-app-links",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index ded59f1aa..02f14aceb 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.143",
+ "version": "0.1.144",
"private": true,
"scripts": {
"dev": "next dev",