Skip to content

zidane-ui/views

import { … } from 'zidane-ui/views'ui/src/views/index.ts

Components#

ViewSessionNavProviderComponent#

Provides the app's way to open what a view's session actions start.

TypeScript
function ViewSessionNavProvider(props: ViewSessionNavProviderProps): Element
Element
ViewSessionNavProvider props
NameTypeDescription
childrenReactNode

The app.

valueViewSessionNav

The app's way to open a session and a draft. Memoize it.

ui/src/views/session-nav.tsx:46

ViewsProviderComponent#

Provides a ViewsHost to the components below it.

TypeScript
function ViewsProvider(props: ViewsProviderProps): Element
Parameters
NameTypeDescription
propsViewsProviderProps

Provider props: the host and the children to render.

Element
ViewsProvider props
NameTypeDescription
childrenReactNode

The app.

hostViewsHost

Where the stored views come from.

ui/src/views/ViewsProvider.tsx:28

Functions#

useViewSessionNavFunction#

The app's ViewSessionNav, with the transcript's openSession when the app gives none.

TypeScript
function useViewSessionNav(): ViewSessionNav

ui/src/views/session-nav.tsx:51

useViewsHostFunction#

zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider that puts a ViewsHost in context and the hooks that read it. The components that draw a view load in their own chunk, the first time the transcript draws a ```view fence with its views option on, so this entry stays small for apps that mount the provider with views off.

TypeScript
function useViewsHost(): ViewsHost | null
ViewsHost | null

ui/src/views/ViewsProvider.tsx:33

useViewsLabelsFunction#

zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider that puts a ViewsHost in context and the hooks that read it. The components that draw a view load in their own chunk, the first time the transcript draws a ```view fence with its views option on, so this entry stays small for apps that mount the provider with views off.

TypeScript
function useViewsLabels(): { cancel: string; copiedShort: string; retry: string; viewActionDenied: string; viewActionFailed: string; viewActionRuns: (tool: string) => string; viewActions: string; viewActionSends: (text: string) => string; viewActionWaiting: string; viewChoiceOptions: string; viewCloseTab: string; viewCopyFailed: string; viewCopyImage: string; viewCopyText: string; viewCustomConsoleError: string; viewCustomEmpty: string; viewCustomFailed: string; viewCustomFrame: (title: string) => string; viewCustomImage: (title: string) => string; viewCustomOff: string; viewCustomOverflow: string; viewCustomRun: string; viewCustomSnapshot: (title: string) => string; viewCustomUnsupported: string; viewCustomWaiting: string; viewDeleteFailed: string; viewDrawing: string; viewErrors: string; viewExpand: string; viewFormNo: string; viewFormYes: string; viewFrame: (title: string) => string; viewImageHidden: (alt: string) => string; viewInPanel: string; viewInputsFailed: string; viewInputsOff: string; viewInputsPending: string; viewInputsSend: string; viewInputsSending: string; viewInputsSent: string; viewInputsUnsupported: string; viewInvalid: (name: string) => string; viewLinkDomain: (domain: string) => string; viewLive: (seconds: number) => string; viewLoadFailed: string; viewLoading: string; viewMcpAppAllow: string; viewMcpAppAllowed: (names: string) => string; viewMcpAppAsks: (names: string) => string; viewMcpAppDownloadBody: (server: string, size: string) => string; viewMcpAppDownloadSave: string; viewMcpAppDownloadTitle: (name: string) => string; viewMcpAppFailed: string; viewMcpAppFrame: (server: string, title: string) => string; viewMcpAppFrom: (server: string) => string; viewMcpAppOff: string; viewMcpAppPermission: (name: 'camera' | 'microphone' | 'geolocation' | 'clipboardWrite') => string; viewMcpAppRefused: string; viewMcpAppRun: string; viewMcpAppUiOff: string; viewMcpAppUnsupported: string; viewMcpAppWaiting: string; viewMissingRef: (ref: string) => string; viewNewerVersion: string; viewNo: string; viewOpenChat: string; viewOpenInArtifacts: string; viewOpenInChat: string; viewOpenPanel: string; viewPending: string; viewPin: string; viewPinFailed: string; viewPinnedHomeOff: string; viewRefresh: string; viewRefreshedAgo: (age: string) => string; viewRefreshedAt: (when: string) => string; viewRefreshFailed: string; viewRefreshing: string; viewRefreshUnsupported: string; viewRename: string; viewRenameFailed: string; viewRenameTitle: (title: string) => string; viewSave: string; viewSaved: string; viewSavedDelete: string; viewSaveFailed: string; viewSessionAgent: string; viewSessionAgentDefault: string; viewSessionAlways: string; viewSessionAnother: string; viewSessionArtifacts: string; viewSessionAsk: (verb: 'start' | 'send' | 'schedule' | 'command') => string; viewSessionChip: (status: string, title: string) => string; viewSessionCommand: string; viewSessionDraft: string; viewSessionFailed: string; viewSessionMore: string; viewSessionOnce: (verb: 'start' | 'send' | 'schedule' | 'command') => 'Start once' | 'Run once'; viewSessionOpen: string; viewSessionOpenToast: string; viewSessionPrompt: string; viewSessionRan: string; viewSessionScheduled: string; viewSessionSent: string; viewSessionStarted: (title: string) => string; viewSessionStartedDefault: (title: string, agent: string) => string; viewSessionStatus: (status: 'done' | 'failed' | 'running' | 'blocked') => string; viewSessionWhen: string; viewSessionWhere: string; viewSessionWhereBranch: (branch: string) => string; viewSessionWhereProject: string; viewShowLatest: string; viewShowOriginal: string; viewSourceAgo: (age: string) => string; viewSourceAllow: string; viewSourceAllowMenu: string; viewSourceAllowOnce: string; viewSourceAllowTool: string; viewSourceAllowView: string; viewSourceAskBar: string; viewSourceAskTitle: string; viewSourceDetail: (target: string, state: string) => string; viewSourceDetails: string; viewSourceError: (reason: string, message: string) => string; viewSourceFailed: (name: string) => string; viewSourceFetched: (age: string) => string; viewSourceMore: (count: number) => string; viewSourceNeedsSignIn: (server: string) => string; viewSourceNoArgs: string; viewSourceNotNow: string; viewSourceOld: (age: string) => string; viewSourceReadOnly: string; viewSourceReason: (reason: ViewSourceFailure) => string; viewSourceSignIn: string; viewSourcesMenu: string; viewSourcesOff: string; viewSourceToolChanged: (server: string) => string; viewSourceToolNotAllowed: string; viewSourceWantMany: (count: number) => string; viewSourceWantsAccess: (server: string) => string; viewSourceWantsRun: string; viewSourceWantsSessions: string; viewStateControl: string; viewStateFailed: string; viewStateSearch: string; viewStateUnsupported: string; viewTitleField: string; viewTurnFailed: string; viewTurnIntoBlock: string; viewTurnIntoPanel: string; viewTurnOnHome: string; viewUnknown: (name: string) => string; viewUnpin: string; viewUnsave: string; viewUnsaveConfirm: string; viewUnsaveConfirmAction: string; viewUnsaveConfirmBody: string; viewUntitled: string; viewVersionOf: (version: number, latest: number) => string; viewVersionPick: string; viewYes: string }
{ cancel: string; copiedShort: string; retry: string; viewActionDenied: string; viewActionFailed: string; viewActionRuns: (tool: string) => string; viewActions: string; viewActionSends: (text: string) => string; viewActionWaiting: string; viewChoiceOptions: string; viewCloseTab: string; viewCopyFailed: string; viewCopyImage: string; viewCopyText: string; viewCustomConsoleError: string; viewCustomEmpty: string; viewCustomFailed: string; viewCustomFrame: (title: string) => string; viewCustomImage: (title: string) => string; viewCustomOff: string; viewCustomOverflow: string; viewCustomRun: string; viewCustomSnapshot: (title: string) => string; viewCustomUnsupported: string; viewCustomWaiting: string; viewDeleteFailed: string; viewDrawing: string; viewErrors: string; viewExpand: string; viewFormNo: string; viewFormYes: string; viewFrame: (title: string) => string; viewImageHidden: (alt: string) => string; viewInPanel: string; viewInputsFailed: string; viewInputsOff: string; viewInputsPending: string; viewInputsSend: string; viewInputsSending: string; viewInputsSent: string; viewInputsUnsupported: string; viewInvalid: (name: string) => string; viewLinkDomain: (domain: string) => string; viewLive: (seconds: number) => string; viewLoadFailed: string; viewLoading: string; viewMcpAppAllow: string; viewMcpAppAllowed: (names: string) => string; viewMcpAppAsks: (names: string) => string; viewMcpAppDownloadBody: (server: string, size: string) => string; viewMcpAppDownloadSave: string; viewMcpAppDownloadTitle: (name: string) => string; viewMcpAppFailed: string; viewMcpAppFrame: (server: string, title: string) => string; viewMcpAppFrom: (server: string) => string; viewMcpAppOff: string; viewMcpAppPermission: (name: 'camera' | 'microphone' | 'geolocation' | 'clipboardWrite') => string; viewMcpAppRefused: string; viewMcpAppRun: string; viewMcpAppUiOff: string; viewMcpAppUnsupported: string; viewMcpAppWaiting: string; viewMissingRef: (ref: string) => string; viewNewerVersion: string; viewNo: string; viewOpenChat: string; viewOpenInArtifacts: string; viewOpenInChat: string; viewOpenPanel: string; viewPending: string; viewPin: string; viewPinFailed: string; viewPinnedHomeOff: string; viewRefresh: string; viewRefreshedAgo: (age: string) => string; viewRefreshedAt: (when: string) => string; viewRefreshFailed: string; viewRefreshing: string; viewRefreshUnsupported: string; viewRename: string; viewRenameFailed: string; viewRenameTitle: (title: string) => string; viewSave: string; viewSaved: string; viewSavedDelete: string; viewSaveFailed: string; viewSessionAgent: string; viewSessionAgentDefault: string; viewSessionAlways: string; viewSessionAnother: string; viewSessionArtifacts: string; viewSessionAsk: (verb: 'start' | 'send' | 'schedule' | 'command') => string; viewSessionChip: (status: string, title: string) => string; viewSessionCommand: string; viewSessionDraft: string; viewSessionFailed: string; viewSessionMore: string; viewSessionOnce: (verb: 'start' | 'send' | 'schedule' | 'command') => 'Start once' | 'Run once'; viewSessionOpen: string; viewSessionOpenToast: string; viewSessionPrompt: string; viewSessionRan: string; viewSessionScheduled: string; viewSessionSent: string; viewSessionStarted: (title: string) => string; viewSessionStartedDefault: (title: string, agent: string) => string; viewSessionStatus: (status: 'done' | 'failed' | 'running' | 'blocked') => string; viewSessionWhen: string; viewSessionWhere: string; viewSessionWhereBranch: (branch: string) => string; viewSessionWhereProject: string; viewShowLatest: string; viewShowOriginal: string; viewSourceAgo: (age: string) => string; viewSourceAllow: string; viewSourceAllowMenu: string; viewSourceAllowOnce: string; viewSourceAllowTool: string; viewSourceAllowView: string; viewSourceAskBar: string; viewSourceAskTitle: string; viewSourceDetail: (target: string, state: string) => string; viewSourceDetails: string; viewSourceError: (reason: string, message: string) => string; viewSourceFailed: (name: string) => string; viewSourceFetched: (age: string) => string; viewSourceMore: (count: number) => string; viewSourceNeedsSignIn: (server: string) => string; viewSourceNoArgs: string; viewSourceNotNow: string; viewSourceOld: (age: string) => string; viewSourceReadOnly: string; viewSourceReason: (reason: ViewSourceFailure) => string; viewSourceSignIn: string; viewSourcesMenu: string; viewSourcesOff: string; viewSourceToolChanged: (server: string) => string; viewSourceToolNotAllowed: string; viewSourceWantMany: (count: number) => string; viewSourceWantsAccess: (server: string) => string; viewSourceWantsRun: string; viewSourceWantsSessions: string; viewStateControl: string; viewStateFailed: string; viewStateSearch: string; viewStateUnsupported: string; viewTitleField: string; viewTurnFailed: string; viewTurnIntoBlock: string; viewTurnIntoPanel: string; viewTurnOnHome: string; viewUnknown: (name: string) => string; viewUnpin: string; viewUnsave: string; viewUnsaveConfirm: string; viewUnsaveConfirmAction: string; viewUnsaveConfirmBody: string; viewUntitled: string; viewVersionOf: (version: number, latest: number) => string; viewVersionPick: string; viewYes: string }

ui/src/views/ViewsProvider.tsx:58

useViewsMetaFunction#

zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider that puts a ViewsHost in context and the hooks that read it. The components that draw a view load in their own chunk, the first time the transcript draws a ```view fence with its views option on, so this entry stays small for apps that mount the provider with views off.

TypeScript
function useViewsMeta(
  host: ViewsHost | null,
  sessionId: string | null,
): ViewsMetaState | null
Parameters
NameTypeDescription
hostViewsHost | null

The views host, or null.

sessionIdstring | null

The session, or null.

ui/src/views/ViewsProvider.tsx:48

Interfaces#

ViewSessionDraftInterface#

A new chat a view's action fills, not sent.

TypeScript
interface ViewSessionDraft
ViewSessionDraft properties
NameTypeDescription
cwdstring

The project folder it runs in.

promptstring

The filled prompt and its context block.

title?string

The filled title, when the action has one.

ui/src/views/session-nav.tsx:14

ViewSessionNavInterface#

What a view's session actions ask of the app. Each member is optional: its control hides without it.

TypeScript
interface ViewSessionNav
ViewSessionNav properties
NameTypeDescription
openDraft?(draft: ViewSessionDraft, from: ViewRef) => void

Opens the new-chat draft with this prompt in its composer, never sent.

openSession?(sessionId: string, from: ViewRef) => void

Shows a session a view's action started or links to. from: the view, so the app knows its host.

ui/src/views/session-nav.tsx:24

ViewSessionNavProviderPropsInterface#

Props for ViewSessionNavProvider.

TypeScript
interface ViewSessionNavProviderProps
ViewSessionNavProviderProps properties
NameTypeDescription
childrenReactNode

The app.

valueViewSessionNav

The app's way to open a session and a draft. Memoize it.

ui/src/views/session-nav.tsx:34

ViewsProviderPropsInterface#

Props for ViewsProvider.

TypeScript
interface ViewsProviderProps
ViewsProviderProps properties
NameTypeDescription
childrenReactNode

The app.

hostViewsHost

Where the stored views come from.

ui/src/views/ViewsProvider.tsx:16