Skip to content

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

TypeScript

fix(control-ui): skeleton the Overview identity card name while loading (QA)

Mcf4c496050f5
diff --git a/control-ui/app/hosts/[name]/page.tsx b/control-ui/app/hosts/[name]/page.tsx
index a1c856e94..77f261476 100644
--- a/control-ui/app/hosts/[name]/page.tsx
+++ b/control-ui/app/hosts/[name]/page.tsx
@@ -1092,6 +1092,7 @@ export default function HostDetailsPage() {
<HostOverviewTab
hostName={routeName}
displayName={hostDisplaySaved || hostDisplayDraft}
+ loadingName={!overviewReady}
editingName={editingDisplayName}
nameDraft={hostDisplayDraft}
onNameDraftChange={setHostDisplayDraft}
diff --git a/control-ui/components/HostOverviewTab/index.tsx b/control-ui/components/HostOverviewTab/index.tsx
index 73c17a31b..35132a620 100644
--- a/control-ui/components/HostOverviewTab/index.tsx
+++ b/control-ui/components/HostOverviewTab/index.tsx
@@ -82,6 +82,7 @@ function truncateDescription(value: string): string {
export function HostOverviewTab({
hostName,
displayName,
+ loadingName = false,
description,
statusLabel,
statusTone,
@@ -166,18 +167,30 @@ export function HostOverviewTab({
<span className="cu-host-overview-identity__icon" aria-hidden="true">
<IconRobot />
</span>
- {shownName}
+ {/* QA: while the identity data loads the name is a skeleton —
+ * never the slug fallback (same rule as the page title). */}
+ {loadingName ? (
+ <span
+ className="cu-skeleton cu-agent-detail-title-skeleton"
+ role="progressbar"
+ aria-label="Loading agent name"
+ />
+ ) : (
+ shownName
+ )}
</div>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--ghost cu-host-overview-identity__edit"
- onClick={onStartNameEdit}
- disabled={savingName}
- aria-label="Edit agent name"
- title="Edit agent name"
- >
- <IconPencil width={16} height={16} />
- </button>
+ {loadingName ? null : (
+ <button
+ type="button"
+ className="cu-btn cu-btn--icon cu-btn--ghost cu-host-overview-identity__edit"
+ onClick={onStartNameEdit}
+ disabled={savingName}
+ aria-label="Edit agent name"
+ title="Edit agent name"
+ >
+ <IconPencil width={16} height={16} />
+ </button>
+ )}
</>
)}
</div>
diff --git a/control-ui/components/HostOverviewTab/types.ts b/control-ui/components/HostOverviewTab/types.ts
index cd7d52b0c..5d1811b87 100644
--- a/control-ui/components/HostOverviewTab/types.ts
+++ b/control-ui/components/HostOverviewTab/types.ts
@@ -10,6 +10,12 @@ export type HostTabKey = 'access' | 'model' | 'connectors'
export type HostOverviewTabProps = {
hostName: string
displayName: string
+ /**
+ * True while the header/identity data is still loading. The editable name
+ * renders a skeleton instead of falling back to the slug (QA: no flash),
+ * and the edit affordance is hidden until a real name is on screen.
+ */
+ loadingName?: boolean
description: string
statusLabel: string
statusTone: 'active' | 'inactive' | 'unknown'
diff --git a/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx b/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
index 7a7286f31..f947ec98e 100644
--- a/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
@@ -144,6 +144,15 @@ describe('HostDetailsPage identity integration', () => {
expect(screen.queryByText('Agent: foo')).toBeNull()
expect(screen.queryByText('/agents/foo')).toBeNull()
+ // QA follow-up: the Overview tab's editable identity card skeletons its
+ // name too (two skeletons total) — the slug never flashes there either —
+ // and the edit pencil stays hidden until a real name is on screen.
+ expect(document.querySelectorAll('.cu-agent-detail-title-skeleton')).toHaveLength(2)
+ expect(document.querySelector('.cu-host-overview-identity__name')?.textContent).not.toContain(
+ 'foo'
+ )
+ expect(screen.queryByRole('button', { name: 'Edit agent name' })).not.toBeInTheDocument()
+
resolveBundle({
host,
contexts: [{ metadata: { name: 'ctx' }, spec: { contextId: 'ctx' } }],
@@ -157,6 +166,14 @@ describe('HostDetailsPage identity integration', () => {
expect(await screen.findByRole('heading', { name: 'Agent: foo-display' })).toBeInTheDocument()
expect(document.querySelector('.cu-agent-detail-title-skeleton')).toBeNull()
expect(screen.queryByText('/agents/foo')).toBeNull()
+
+ // Overview identity card now shows the display name with its edit control.
+ expect(
+ await screen.findByText('foo-display', {
+ selector: '.cu-host-overview-identity__name',
+ })
+ ).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Edit agent name' })).toBeInTheDocument()
})
it('renders the agent detail tabs in order', async () => {
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 0539a8260..1f3a0a35e 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.582",
+ "version": "0.1.583",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.582",
+ "version": "0.1.583",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 9a5d2a3b3..1131e44d9 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.582",
+ "version": "0.1.583",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",