Skip to content

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

TypeScript

fix(profile-ui): r3-l7 preserve desktop handoff live region

Josuéd95b82408dbe
diff --git a/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx b/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
index 6c5be6b6a..32957f39d 100644
--- a/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
+++ b/profile-ui/app/components/__tests__/ProfilePortalHome.test.tsx
@@ -69,6 +69,28 @@ describe('Profile Portal home desktop app link', () => {
expect(screen.queryByRole('link', { name: 'Open Desktop App' })).not.toBeInTheDocument()
})
+ it('keeps one polite live region as desktop setup changes from loading to ready', async () => {
+ let resolveEnvironment!: (environment: DesktopEnvironmentResponse) => void
+ api.getDesktopEnvironment.mockReturnValue(
+ new Promise<DesktopEnvironmentResponse>(resolve => {
+ resolveEnvironment = resolve
+ })
+ )
+
+ render(<Page />)
+
+ const status = screen.getByRole('status')
+ expect(status).toHaveTextContent('Checking desktop app setup…')
+ expect(status).toHaveAttribute('aria-live', 'polite')
+ expect(status).toHaveAttribute('aria-atomic', 'true')
+
+ resolveEnvironment(desktopEnvironment)
+
+ await screen.findByRole('link', { name: 'Open Desktop App' })
+ expect(screen.getByRole('status')).toBe(status)
+ expect(status).toHaveTextContent('Open Desktop App instead.')
+ })
+
it('explains unavailable setup and links to Settings when discovery fails', async () => {
api.getDesktopEnvironment.mockRejectedValue(new Error('Service unavailable'))
diff --git a/profile-ui/app/page.tsx b/profile-ui/app/page.tsx
index f4525dda8..4c918fa0b 100644
--- a/profile-ui/app/page.tsx
+++ b/profile-ui/app/page.tsx
@@ -48,23 +48,24 @@ function HomeContent() {
<p className="body-copy">
You are signed in to the Evenfire <strong>Profile Portal</strong>.
</p>
- {desktopAppLink.state === 'loading' ? (
- <p className="body-copy" role="status" aria-live="polite">
- Checking desktop app setup…
- </p>
- ) : desktopAppLink.state === 'unavailable' ? (
- <p className="body-copy" role="status" aria-live="polite">
- Desktop app setup is unavailable right now. Visit{' '}
- <Link href={PROFILE_ROUTES.settings.profile}>Settings</Link> to review setup options.
- </p>
- ) : (
- <p className="body-copy">
- <a className="cu-home-desktop-link" href={desktopAppLink.href}>
- Open Desktop App <IconExternalLink />
- </a>{' '}
- instead.
- </p>
- )}
+ <p className="body-copy" role="status" aria-live="polite" aria-atomic="true">
+ {desktopAppLink.state === 'loading' ? (
+ 'Checking desktop app setup…'
+ ) : desktopAppLink.state === 'unavailable' ? (
+ <>
+ Desktop app setup is unavailable right now. Visit{' '}
+ <Link href={PROFILE_ROUTES.settings.profile}>Settings</Link> to review setup
+ options.
+ </>
+ ) : (
+ <>
+ <a className="cu-home-desktop-link" href={desktopAppLink.href}>
+ Open Desktop App <IconExternalLink />
+ </a>{' '}
+ instead.
+ </>
+ )}
+ </p>
</div>
</div>
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index 1723bc763..86ebc7f83 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.162",
+ "version": "0.1.163",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.162",
+ "version": "0.1.163",
"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 047685943..a166ab8bd 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.162",
+ "version": "0.1.163",
"private": true,
"scripts": {
"dev": "next dev",