~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Connecting an AI app is three numbered steps, and the account menu keeps its width

Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:console/connect-steps
harness/e2e/flows.spec.mjs+1−1
@@ -393,7 +393,7 @@ test('connecting an AI app is shown to those who run the group', async () => {
'It acts for you in Hikers, with what your roles let you do.'
);
await expect(connect.locator('code')).toHaveText(`${world.base}/mcp`);
await expect(connect).toContainText('It will ask you to sign in here and approve it.');
await expect(connect).toContainText('When it asks, sign in here and approve it');
await expect(connect.locator('.asks li')).toHaveCount(3);
// Not to a plain member.
await bob.goto(url('/g/hikers.groups.test'));
web/src/lib/molecules/UserMenu.svelte+3−2
@@ -56,8 +56,9 @@
<input type="hidden" name="did" value={account.did} />
<input type="hidden" name="back" value={here} />
<button class="account" type="submit" aria-label={`Switch to ${named(account)}`}
><Avatar name={account.handle ?? account.did} size="sm" /><span class="handle mono"
>{named(account)}</span
><Avatar name={account.handle ?? account.did} size="sm" /><span
class="handle mono"
title={named(account)}>{named(account)}</span
></button
>
</form>
web/src/lib/organisms/ConnectAiApp.svelte+28−17
@@ -1,9 +1,9 @@
<script lang="ts">
import Copy from '#lib/atoms/Copy.svelte';
/**
* How to have an AI app act for the person in the group: the address
* to add it at (`mcp`), what it then asks, and what to ask of it, each
* a thing the host's tools do.
* How to have an AI app act for the person in the group, in three
* numbered steps: add the address (`mcp`) to it, sign in here and
* approve it, then ask it things, each a thing the host's tools do.
*/
let { name, mcp }: { name: string; mcp: string } = $props();
const asks = [
@@ -13,17 +13,28 @@
];
</script>
<div class="connect stack">
<p class="mute">It acts for you in {name}, with what your roles let you do.</p>
<div class="well stack">
<strong>In your AI app, add a connector with this address</strong>
<div class="address"><code>{mcp}</code><Copy text={mcp} /></div>
<small class="mute">It will ask you to sign in here and approve it.</small>
</div>
<div class="stack">
<strong>Then ask it things like</strong>
<ul class="asks">
{#each asks as ask (ask)}<li>{ask}</li>{/each}
</ul>
</div>
</div>
<ol class="connect">
<li>
<span class="ordinal">1</span>
<div class="step">
<strong>Add this address to your AI app as a connector</strong>
<div class="address"><code>{mcp}</code><Copy text={mcp} /></div>
</div>
</li>
<li>
<span class="ordinal">2</span>
<div class="step">
<strong>When it asks, sign in here and approve it</strong>
<span class="what">It acts for you in {name}, with what your roles let you do.</span>
</div>
</li>
<li>
<span class="ordinal">3</span>
<div class="step">
<strong>Ask it things like</strong>
<ul class="asks">
{#each asks as ask (ask)}<li>{ask}</li>{/each}
</ul>
</div>
</li>
</ol>
web/src/app.css+66−8
@@ -168,8 +168,7 @@ img {
right: 0;
top: calc(100% + var(--space-2));
z-index: 2;
width: max-content;
min-width: var(--menu);
width: var(--menu);
max-width: calc(100vw - 2 * var(--space-4));
background: var(--panel);
border: var(--border);
@@ -232,8 +231,8 @@ img {
font-weight: var(--weight-semibold);
}
/* The other accounts the browser is signed in to, under a quiet label:
each its picture and its whole handle, the menu as wide as the longest,
wrapping only past the screen's edge, switched to in a click. */
each its picture and its handle, cut short with an ellipsis past the
menu's width (whole in its title), switched to in a click. */
.menu-label {
margin: 0;
padding: var(--space-1) var(--space-3);
@@ -248,7 +247,9 @@ img {
}
.menu .account .handle {
min-width: 0;
overflow-wrap: anywhere;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.menu hr {
width: 100%;
@@ -1382,20 +1383,77 @@ ul.chosen[class] > li {
border-bottom-color: var(--primary);
}
/* Connecting an AI app: the address in a well, to copy; then what to ask it. */
/* A well: something set apart inside a card, on the soft ground. */
.well {
background: var(--soft);
border-radius: var(--radius-md);
padding: var(--space-4);
}
/* Connecting an AI app: three numbered steps down the card, each its
title and under it what to do; the address in a field to copy from,
and what to ask it as a chat's bubbles. */
.connect[class] {
display: flex;
flex-direction: column;
gap: var(--space-5);
}
.connect[class] > li {
flex-wrap: nowrap;
align-items: flex-start;
gap: var(--space-3);
padding: 0;
border: 0;
}
.connect .step {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
padding-top: var(--space-1);
}
.connect .address {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
background: var(--soft);
border: var(--border);
border-radius: var(--radius-pill);
}
.connect .address code {
flex: 1;
min-width: 0;
overflow-wrap: anywhere;
user-select: all;
}
.asks li {
color: var(--mute);
.connect .address button {
flex: none;
min-height: var(--control-sm);
padding: 0 var(--space-3);
font-size: var(--text-sm);
background: var(--panel);
}
.asks[class] {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: var(--space-2);
}
.connect .asks[class] > li {
padding: var(--space-2) var(--space-3);
border: 0;
background: var(--soft);
border: var(--border);
border-radius: var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-xs);
font-size: var(--text-sm);
}
.connect .step > strong {
font-weight: var(--weight-medium);
}
.connect + .ai-apps,
.connect + .empty {
margin-top: var(--space-4);
}
/* What an app would get, as an account's PDS lists it: a row for each kind