Official
chat
Built-in chat UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.8
Permissions in 0.2.8
Files
views/find.tsx2.6 KB
// The Find in Chat bar (`../find.ts`): glass over the transcript's top right corner, holding the field, where the
// reader is among the matches, the two steps and close.
import type { Element, KeyEvent, SubmitEvent, ValueEvent } from "divergence";
import type { ChatView } from "../controller.ts";
import { chatHits, closeFind, positionOf, search, step } from "../find.ts";
import { RAISED, row } from "./styles.tsx";
/** The bar is a field and its controls wide; a narrow pane gives it less. */
const WIDTH = 340;
export function renderFindBar(v: ChatView, chatId: string): Element | null {
const c = v.controller;
const t = c.transcript(chatId);
const find = t.find;
if (!find) return null;
const hits = chatHits(c, t);
// Where the reader is among the matches; only how many there are while they are on none (the match they were on
// went with a rewritten reply, or the matches came in with older messages after they typed).
const at = positionOf(hits, find.current);
const count = !find.query
? ""
: !hits.length
? "No results"
: at >= 0
? `${at + 1} of ${hits.length}`
: `${hits.length} ${hits.length === 1 ? "result" : "results"}`;
const close = () => {
closeFind(c, chatId);
v.ctx.run(c.views.focus(`prompt-${chatId}`));
};
return (
<div
{...row}
id={`find-bar-${chatId}`}
position="absolute"
top="small"
right="medium"
width={WIDTH}
maxWidth="90%"
gap={2}
padding={4}
background="card/40"
backdrop={{ blur: 6 }}
borderRadius="md"
{...RAISED}
>
<div {...row} flexGrow={1} flexShrink={1} minWidth={0}>
<input
id={`find-${chatId}`}
value={find.query}
ghost
placeholder="Find in chat"
keys={["escape"]}
onKey={(event: KeyEvent) => {
if (event.key === "escape") close();
}}
onChange={(event: ValueEvent<string>) => search(c, chatId, event.value)}
onSubmit={(event: SubmitEvent) => step(c, chatId, event.shift ? 1 : -1)}
/>
</div>
{count ? <text style="body" size="xs" tone="muted" text={count} /> : null}
<button id={`find-older-${chatId}`} icon="chevron-up" variant="ghost" small disabled={!hits.length} tooltip="Older match" onClick={() => step(c, chatId, -1)} />
<button id={`find-newer-${chatId}`} icon="chevron-down" variant="ghost" small disabled={!hits.length} tooltip="Newer match" onClick={() => step(c, chatId, 1)} />
<button id={`find-close-${chatId}`} icon="x" variant="ghost" small tooltip="Close" onClick={close} />
</div>
);
}Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.9latest | Nov 21, 2026 | >=5 <6 | 349 KB | 5 permissions | Listed |
| 0.2.8 | Nov 16, 2026 | >=5 <6 | 348.6 KB | 5 permissions | Listed |
| 0.2.7 | Nov 11, 2026 | >=5 <6 | 314.3 KB | 5 permissions | Listed |
| 0.2.6 | Nov 9, 2026 | >=5 <6 | 306.2 KB | 5 permissions | Listed |
| 0.2.5 | Oct 27, 2026 | >=2 <4 | 178.6 KB | 5 permissions | Listed |
No comments yet.