Browser Panel

The browser an agent works in: tabs, navigation, the address and the page.

mail.harborpine.example/inbox/remittance-4410

Remittance advice — invoice 4410

From Priya Anand, Alder Supply

We paid invoice 4410 on 16 November by bank transfer.

Amount $1,920.00

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/browser

Usage

import { type BrowserTab, BrowserPanel } from "./ui/uicontext/components/kit/Browser.ts"
const Message = UiSchema.TaggedEnum({ PickedTab: { tab: Schema.String }, ClosedTab: { tab: Schema.String } })// the tabs are the app's: a press asks, and the agent's browser answers with the new tabsexport const AgentBrowser = (h: Html.H<typeof Message.Type>, tabs: ReadonlyArray<BrowserTab>, active: string) =>	BrowserPanel(h, {		label: "Accounts' browser",		tabs,		active,		onSelect: (tab) => Message.PickedTab({ tab }),		onClose: (tab) => Message.ClosedTab({ tab }),		children: [h.p.children("The page the agent is reading")],	})

API reference

Options

BrowserPanel options
NameTypeDescription
labelrequiredstringWhat this browser is, for screen readers: "Accounts' browser"
tabsrequiredBrowserTab[]—
activerequiredstringThe shown tab's id
onSelect(id: string) => Message—
onClose(id: string) => Message—
onNewMessage—
onBackMessage—
onForwardMessage—
onReloadMessage—
canBackboolean—
canForwardboolean—
childrenrequiredView.ChildrenThe shown tab's page
emptystringWhat shows with no tabs open
styleStyle—

Source