Official

sidebar

Built-in sidebar 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/sidebar@0.2.6

Permissions in 0.2.6

  • Control chats chats.controlHighCreates chats, sends prompts and cancels runs.Add and remove workspaces, and create, rename, check off and archive chats
  • Run other plugins' commands commands.runHighRuns commands of other plugins.Open the chat search from the search button, and close the tab on screen with Cmd+W when its chat is part of a task
  • Read chats chats.readMediumReads your transcripts and chat lists.List workspaces and chats, and follow them as agents work
  • Show panels ui.slotsAlways grantedShows views in the listed parts of the window.Draw the sidebar, and its top controls in the title strip after the sidebar toggleSlots: lefttitle

Files

rename.ts2.3 KB
// Renaming a row in place: the pencil opens a field with the keyboard in it,
// Enter or leaving the field saves what was typed, Escape keeps the title,
// and a field open on another row closes first, saving what was typed there
// as Enter would.
import * as Effect from "effect/Effect";
import { Host, Notify, Plugin } from "divergence/effect";
import type { HostError } from "divergence/effect";
import type { Editing, SidebarState } from "./sections.ts";

const describe = (error: unknown): string => (error instanceof Error && error.message ? error.message : "unknown error");

export const makeRename = Effect.fn("Sidebar.renaming")(function* (state: SidebarState, redraw: () => void) {
  const host = yield* Host;
  const notify = yield* Notify;
  const plugin = yield* Plugin;
  const startRename = Effect.fn("Sidebar.startRename")(function* (editing: Omit<Editing, "seed">) {
    if (state.editing?.id === editing.id) return;
    yield* commitRename();
    state.editing = { ...editing, seed: editing.title };
    redraw();
    plugin.api.focus(`rename-${editing.id}`);
  });
  const cancelRename = (): Effect.Effect<void> =>
    Effect.sync(() => {
      if (!state.editing) return;
      state.editing = null;
      redraw();
    });
  // `id` names the field that asks: a field that loses the keyboard after
  // Escape, or after another row's field opened, has nothing left to save.
  const commitRename = Effect.fn("Sidebar.commitRename")(function* (id?: string) {
    const editing = state.editing;
    if (!editing || (id !== undefined && editing.id !== id)) return;
    state.editing = null;
    redraw();
    // Unchanged, the title stays the host's: a title the agent gave the chat
    // meanwhile survives, and a task row keeps following its first chat.
    if (editing.title.trim() === editing.seed.trim()) return;
    // A task row's name is the task's; clearing it goes back to its first
    // chat's title (document 1).
    const renamed: Effect.Effect<unknown, HostError> = editing.task
      ? host.call("host/tasks.update", { taskId: editing.task, title: editing.title.trim() || null })
      : host.call("host/chats.update", { chatId: editing.id, title: editing.title.trim() || "New Chat" });
    yield* renamed.pipe(Effect.catch((error: unknown) => notify.error(`Rename failed: ${describe(error)}`)));
  });
  return { startRename, cancelRename, commitRename };
});

Versions

VersionPublishedPlugin APISizePermissionsStatus
0.2.7latestNov 21, 2026>=5 <6100.9 KB4 permissionsListed
0.2.6Nov 16, 2026>=5 <6100.6 KB4 permissionsListed
0.2.5Nov 11, 2026>=5 <665.1 KB4 permissionsListed
0.2.4Nov 9, 2026>=5 <660.4 KB4 permissionsListed
0.2.3Oct 27, 2026>=2 <426.1 KB3 permissionsListed

Reviews and comments

0 threads · 0 reviews

No comments yet.