Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
refactor: drop name-check gate from subscription dialog
Miguelon Peluchonbc0faf4c888f
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.cssindex bcafd91b6..b1d4613b2 100644--- a/control-ui/app/globals.css+++ b/control-ui/app/globals.css@@ -8617,20 +8617,6 @@ textarea.cu-input {font-size: 0.75rem;}-/* Name confirmation affordance in the subscription dialog: the check button- creates the grant; once confirmed it flips to a static green check. */-.cu-name-check {- display: inline-grid;- place-items: center;- width: 2rem;- height: 2rem;- color: var(--cu-text-muted);-}--.cu-name-check--confirmed {- color: var(--cu-success);-}-/* Wrapper that keeps a tooltip available on a disabled button (disabledelements suppress their own title in some browsers). */.cu-hover-hint {diff --git a/control-ui/components/CodexSubscriptionHub/index.tsx b/control-ui/components/CodexSubscriptionHub/index.tsxindex 1ad1377c7..3ea20b5ee 100644--- a/control-ui/components/CodexSubscriptionHub/index.tsx+++ b/control-ui/components/CodexSubscriptionHub/index.tsx@@ -33,7 +33,7 @@ import { SelectionDropdown } from '../SelectionDropdown'import { IconKey } from '../Sidebar/icons'import { TablePanelHeader } from '../TablePanelHeader'import { useToast } from '../Toast'-import { IconCheck, IconCopy, IconRefresh, IconX } from '../icons'+import { IconCopy, IconRefresh, IconX } from '../icons'import { CheckboxField } from '../ui'function grantLabel(row: CodexSubscriptionConnectionView): string {@@ -128,14 +128,14 @@ export function CodexSubscriptionHub() {)}, [connections, searchQuery])- // The name check (or the footer CTA) confirms the name: it creates the empty- // grant with that display name and starts the device sign-in right away —- // by the time the operator approves the code, the catalog is already synced- // server-side (connect handshake) and the models grid is populated.- async function confirmNameAndCreate() {+ // Create makes the grant with the typed display name and starts the device+ // sign-in right away — by the time the operator approves the code, the+ // catalog is already synced server-side (connect handshake) and the models+ // grid is populated.+ async function handleCreate() {const displayName = editName.trim()if (!displayName) {- setError('Please confirm the name first — type a name, then select the check.')+ setError('Subscription name is required.')return}setBusyKey('create')@@ -540,39 +540,15 @@ export function CodexSubscriptionHub() {{error ? <div className="cu-banner cu-banner--error">{error}</div> : null}<div className="cu-field"><label htmlFor="codex-sub-name">Name</label>- <div className="cu-copy-field">- <input- id="codex-sub-name"- value={editName}- onChange={e => setEditName(e.target.value)}- disabled={Boolean(busyKey) || Boolean(creating && editing)}- placeholder="The name agents see when they pick this subscription"- />- {creating && editing ? (- <span- className="cu-name-check cu-name-check--confirmed"- title="Name confirmed"- aria-label="Name confirmed"- >- <IconCheck width={16} height={16} />- </span>- ) : (- <button- type="button"- className="cu-btn cu-btn--icon cu-btn--ghost"- onClick={() => void confirmNameAndCreate()}- disabled={!editName.trim() || Boolean(busyKey)}- aria-label="Confirm name"- title="Confirm name"- >- <IconCheck width={16} height={16} />- </button>- )}- </div>+ <input+ id="codex-sub-name"+ value={editName}+ onChange={e => setEditName(e.target.value)}+ disabled={Boolean(busyKey)}+ placeholder="The name agents see when they pick this subscription"+ /><span className="cu-field__hint">- {creating && editing- ? 'Name confirmed — the subscription exists. Sign in and pick models to finish.'- : 'Confirm the name to create the subscription and unlock sign-in.'}+ The name agents see when they pick this subscription.</span></div>{setupNew && editing ? (@@ -594,7 +570,7 @@ export function CodexSubscriptionHub() {</p><div className="cu-form-inline"><span- title={editing ? undefined : 'Please confirm the name first'}+ title={editing ? undefined : 'Create the subscription first'}className="cu-hover-hint"><button@@ -773,9 +749,9 @@ export function CodexSubscriptionHub() {<buttontype="button"className="cu-btn cu-btn--primary"- onClick={() => void confirmNameAndCreate()}+ onClick={() => void handleCreate()}disabled={!editName.trim() || Boolean(busyKey)}- title={editName.trim() ? undefined : 'Please confirm the name first'}+ title={editName.trim() ? undefined : 'Type a name to create the subscription'}>{busyKey === 'create' ? 'Creating…' : 'Create and set up'}</button>diff --git a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsxindex 20e3e4ae5..dd8e1461b 100644--- a/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx+++ b/control-ui/components/__tests__/CodexSubscriptionHub.test.tsx@@ -114,7 +114,7 @@ describe('CodexSubscriptionHub', () => {expect(await screen.findByText('Team A')).toBeInTheDocument()fireEvent.click(screen.getByRole('button', { name: 'Add subscription' }))- // Before confirmation the full form is shown, but sign-in is gated and+ // Before creating, the full form is shown but sign-in is gated and// nothing has been created yet.expect(createCodexSubscriptionConnection).not.toHaveBeenCalled()const nameInput = screen.getByRole('textbox', { name: 'Name' })@@ -122,19 +122,18 @@ describe('CodexSubscriptionHub', () => {expect(signIn).toBeDisabled()expect(signIn.closest('.cu-hover-hint')).toHaveAttribute('title',- 'Please confirm the name first'+ 'Create the subscription first')- // Confirming the name creates the grant and starts the device sign-in.+ // Creating the grant starts the device sign-in right away.fireEvent.change(nameInput, { target: { value: 'New team' } })- fireEvent.click(screen.getByRole('button', { name: 'Confirm name' }))+ fireEvent.click(screen.getByRole('button', { name: 'Create and set up' }))await waitFor(() => {expect(createCodexSubscriptionConnection).toHaveBeenCalledWith({ displayName: 'New team' })})await waitFor(() => {expect(startCodexDeviceConnect).toHaveBeenCalledWith('connect', 'codex-bbb')})- expect(screen.getByTitle('Name confirmed')).toBeInTheDocument()// Once the device flow settles the dialog keeps the setup form with the// models synced by the connect handshake.await waitFor(() => {diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 97eabc9bc..41ee6ede4 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.480",+ "version": "0.1.481","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.480",+ "version": "0.1.481","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/llm-providers": "file:../packages/llm-providers",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 609de6926..c01e8feb6 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.480",+ "version": "0.1.481","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",