Skip to content

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

TypeScript

fix(control-ui): give the Teams install link its own line and demote the fallback

Jose Ramirez1771dff9dbc6
diff --git a/control-ui/app/communication-channels/new/page.tsx b/control-ui/app/communication-channels/new/page.tsx
index 7ae2cf97b..de0f96798 100644
--- a/control-ui/app/communication-channels/new/page.tsx
+++ b/control-ui/app/communication-channels/new/page.tsx
@@ -847,9 +847,8 @@ export default function CreateCommunicationChannelPage() {
</li>
<li>Paste CLIENT_ID, TENANT_ID, and CLIENT_SECRET below.</li>
<li>
- Install the app in Teams. The link below appears once CLIENT_ID and
- TENANT_ID are filled in, because it is built from exactly those two
- values.
+ Install the app in Teams, picking the channel during install rather than
+ adding it afterwards.
{teamsInstallLink ? (
<>
<a
@@ -860,21 +859,28 @@ export default function CreateCommunicationChannelPage() {
>
Install in Teams
</a>
- <span className="cu-muted">
- Pick the channel during install rather than adding it afterwards.
- If it says the app cannot be found, the Teams app catalog has not
- caught up yet: wait a few minutes and retry, or upload the package
- by hand with the command below and Apps &gt; Manage your apps &gt;
- Upload an app.
- </span>
- <CommandBlock
- command={teamsPackageDownloadCommand}
- onCopy={copyTeamsPackageDownloadCommand}
- copyDisabled={saving}
- copyLabel="Copy Teams package download command"
- />
+ <details className="cu-advanced-details cu-teams-setup__fallback">
+ <summary>If the link says the app cannot be found</summary>
+ <p className="cu-advanced-details__hint">
+ The Teams app catalog has not caught up with the Developer
+ Portal yet. Wait a few minutes and retry the link first. If it
+ still fails, build the package and upload it by hand from Apps
+ &gt; Manage your apps &gt; Upload an app.
+ </p>
+ <CommandBlock
+ command={teamsPackageDownloadCommand}
+ onCopy={copyTeamsPackageDownloadCommand}
+ copyDisabled={saving}
+ copyLabel="Copy Teams package download command"
+ />
+ </details>
</>
- ) : null}
+ ) : (
+ <span className="cu-teams-setup__pending">
+ The install link appears here once CLIENT_ID and TENANT_ID are
+ filled in, because it is built from exactly those two values.
+ </span>
+ )}
</li>
</ol>
</section>
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index eb2ac1e89..491ebe3d7 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -9797,6 +9797,55 @@ textarea.cu-input {
font-size: inherit;
}
+/* The install link is the step's control, not a phrase in the sentence above it.
+ A bare .cu-btn is inline-flex, so it lands mid-paragraph in button weight and
+ chrome and reads as a typographic accident. Block-level with a fitted width
+ puts it on its own line at its own size without stretching to the card. */
+.cu-teams-setup__instructions .cu-teams-setup__install {
+ display: flex;
+ width: fit-content;
+ margin: var(--cu-space-2) 0;
+ text-decoration: none;
+}
+
+/* The package fallback recovers from Teams' catalog lag, which usually resolves
+ on a retry of the link above. Collapsed, it stays available without reading as
+ a fifth step that everyone has to perform. */
+.cu-teams-setup__instructions .cu-teams-setup__fallback {
+ margin-bottom: var(--cu-space-2);
+}
+
+/* .cu-advanced-details blanks the native ::marker and supplies nothing in its
+ place. A label like "Advanced options" survives that, but this summary is a
+ sentence: with no chevron it reads as an assertion that the link HAS failed
+ rather than a control you open if it does. The summary is an inline-flex row
+ with a gap, so the pseudo-element lands as its first item. */
+.cu-teams-setup__fallback summary::before {
+ content: '';
+ width: 0.4rem;
+ height: 0.4rem;
+ flex: none;
+ border-right: 1.5px solid currentColor;
+ border-bottom: 1.5px solid currentColor;
+ transform: rotate(-45deg);
+ transition: transform var(--cu-control-transition) ease;
+}
+
+.cu-teams-setup__fallback[open] summary::before {
+ transform: rotate(45deg);
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .cu-teams-setup__fallback summary::before {
+ transition: none;
+ }
+}
+
+.cu-teams-setup__instructions .cu-teams-setup__pending {
+ display: block;
+ margin-top: var(--cu-space-1);
+}
+
.cu-command-block {
overflow: hidden;
border: 1px solid var(--cu-border);
diff --git a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
index 6045a4c1b..47550e9a7 100644
--- a/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
+++ b/control-ui/components/__tests__/CreateCommunicationChannelPage.test.tsx
@@ -13,7 +13,7 @@
*/
import React from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { ToastProvider } from '@components/Toast'
import CreateCommunicationChannelPage from '../../app/communication-channels/new/page'
import * as api from '../../lib/api'
@@ -885,4 +885,34 @@ describe('CreateCommunicationChannelPage — Teams install link', () => {
expect(link).toHaveAttribute('target', '_blank')
expect(link).toHaveAttribute('rel', expect.stringContaining('noopener'))
})
+
+ it('keeps the package fallback collapsed, so it does not read as a step of its own', async () => {
+ vi.stubEnv('NEXT_PUBLIC_WORKFLOW_APPROVAL_READER_BASE_URL', 'https://webhook.example.com')
+ render(
+ <ToastProvider>
+ <CreateCommunicationChannelPage />
+ </ToastProvider>
+ )
+
+ await fillStep1AndContinue()
+ fireEvent.click(screen.getByRole('radio', { name: 'Microsoft Teams' }))
+ fireEvent.change(screen.getByLabelText(/^Name/), { target: { value: 'Evenfire Bot' } })
+ const appId = '0cd0e1e6-adf7-40f4-952f-79006d320a05'
+ fireEvent.change(screen.getByLabelText(/^CLIENT_ID/), { target: { value: appId } })
+ fireEvent.change(screen.getByLabelText(/^TENANT_ID/), {
+ target: { value: '18517e81-9d09-4c73-88f3-e84a6c90c3d9' },
+ })
+
+ // Downloading a package is a recovery path for Teams' catalog lag, not
+ // something every operator does. Rendered as a sibling of the install link it
+ // reads as a required step and sends people to hand-upload an app the link
+ // would have installed. It stays inside a closed disclosure.
+ const command = screen.getByText(`teams app package download ${appId}`)
+ const disclosure = command.closest('details')
+ expect(disclosure).not.toBeNull()
+ expect(disclosure).not.toHaveAttribute('open')
+ expect(
+ within(disclosure as HTMLElement).getByText('If the link says the app cannot be found')
+ ).toBeInTheDocument()
+ })
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index c2b2a3a63..58e5c1398 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.428",
+ "version": "0.1.429",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.428",
+ "version": "0.1.429",
"dependencies": {
"@clerum/llm-providers": "file:../packages/llm-providers",
"@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",
diff --git a/control-ui/package.json b/control-ui/package.json
index 4703e9431..bda415e48 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.428",
+ "version": "0.1.429",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/docs/how-to/connect-teams.md b/docs/how-to/connect-teams.md
index e04be6746..76391ff5f 100644
--- a/docs/how-to/connect-teams.md
+++ b/docs/how-to/connect-teams.md
@@ -313,7 +313,7 @@ the manifest update with `--yes` and verify by downloading the manifest.
**You lost the install link.**
```shell
-teams app get <teamsAppId> --install-link
+teams app get YOUR_CLIENT_ID --install-link
teams app list # every app with its id
```