diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index e0a097210fa..e85913dd46d 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -109,9 +109,8 @@ function renderCronFilterIcon(hiddenCount: number) { - ${ - hiddenCount > 0 - ? html` 0 + ? html`${hiddenCount}` - : "" - } + : ""} `; } @@ -313,13 +311,11 @@ export function renderChatControls(state: AppViewState) { state.sessionsHideCron = !hideCron; }} aria-pressed=${hideCron} - title=${ - hideCron - ? hiddenCronCount > 0 - ? t("chat.showCronSessionsHidden", { count: String(hiddenCronCount) }) - : t("chat.showCronSessions") - : t("chat.hideCronSessions") - } + title=${hideCron + ? hiddenCronCount > 0 + ? t("chat.showCronSessionsHidden", { count: String(hiddenCronCount) }) + : t("chat.showCronSessions") + : t("chat.hideCronSessions")} > ${renderCronFilterIcon(hiddenCronCount)} @@ -945,9 +941,9 @@ export function renderTopbarThemeModeToggle(state: AppViewState) { (opt) => html` ` - : nothing - } + : nothing}
- ${ - state.updateAvailable && - state.updateAvailable.latestVersion !== state.updateAvailable.currentVersion && - !isUpdateBannerDismissed(state.updateAvailable) - ? html`
${renderExecApprovalPrompt(state)} ${renderGatewayUrlConfirmation(state)} ${nothing} diff --git a/ui/src/ui/chat/grouped-render.ts b/ui/src/ui/chat/grouped-render.ts index d9a9edfb7e3..3dc1187ff86 100644 --- a/ui/src/ui/chat/grouped-render.ts +++ b/ui/src/ui/chat/grouped-render.ts @@ -177,11 +177,9 @@ export function renderMessageGroup( ${timestamp} ${renderMessageMeta(meta)} ${normalizedRole === "assistant" && isTtsSupported() ? renderTtsButton(group) : nothing} - ${ - opts.onDelete - ? renderDeleteButton(opts.onDelete, normalizedRole === "user" ? "left" : "right") - : nothing - } + ${opts.onDelete + ? renderDeleteButton(opts.onDelete, normalizedRole === "user" ? "left" : "right") + : nothing} @@ -697,84 +695,70 @@ function renderGroupedMessage( return html`
- ${ - hasActions - ? html`
+ ${hasActions + ? html`
${canExpand ? renderExpandButton(markdown!, onOpenSidebar!) : nothing} ${canCopyMarkdown ? renderCopyAsMarkdownButton(markdown!) : nothing}
` - : nothing - } - ${ - isToolMessage - ? html` + : nothing} + ${isToolMessage + ? html`
${icons.zap} Tool output - ${ - toolSummaryLabel - ? html`${toolSummaryLabel}` - : toolPreview - ? html`${toolPreview}` - : nothing - } + ${toolSummaryLabel + ? html`${toolSummaryLabel}` + : toolPreview + ? html`${toolPreview}` + : nothing}
${renderMessageImages(images)} - ${ - reasoningMarkdown - ? html`
+ ${reasoningMarkdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(reasoningMarkdown))}
` - : nothing - } - ${ - jsonResult - ? html`
+ : nothing} + ${jsonResult + ? html`
JSON ${jsonSummaryLabel(jsonResult.parsed)}
${jsonResult.pretty}
` - : markdown - ? html`
+ : markdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(markdown))}
` - : nothing - } + : nothing} ${hasToolCards ? renderCollapsedToolCards(toolCards, onOpenSidebar) : nothing}
` - : html` + : html` ${renderMessageImages(images)} - ${ - reasoningMarkdown - ? html`
+ ${reasoningMarkdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(reasoningMarkdown))}
` - : nothing - } - ${ - jsonResult - ? html`
+ : nothing} + ${jsonResult + ? html`
JSON ${jsonSummaryLabel(jsonResult.parsed)}
${jsonResult.pretty}
` - : markdown - ? html`
+ : markdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(markdown))}
` - : nothing - } + : nothing} ${hasToolCards ? renderCollapsedToolCards(toolCards, onOpenSidebar) : nothing} - ` - } + `}
`; } diff --git a/ui/src/ui/chat/tool-cards.ts b/ui/src/ui/chat/tool-cards.ts index 0a5d85542ca..2e79283fe88 100644 --- a/ui/src/ui/chat/tool-cards.ts +++ b/ui/src/ui/chat/tool-cards.ts @@ -81,49 +81,35 @@ export function renderToolCardSidebar(card: ToolCard, onOpenSidebar?: (content: @click=${handleClick} role=${canClick ? "button" : nothing} tabindex=${canClick ? "0" : nothing} - @keydown=${ - canClick - ? (e: KeyboardEvent) => { - if (e.key !== "Enter" && e.key !== " ") { - return; - } - e.preventDefault(); - handleClick?.(); + @keydown=${canClick + ? (e: KeyboardEvent) => { + if (e.key !== "Enter" && e.key !== " ") { + return; } - : nothing - } + e.preventDefault(); + handleClick?.(); + } + : nothing} >
${icons[display.icon]} ${display.label}
- ${ - canClick - ? html`${hasText ? "View" : ""} ${icons.check}` - : nothing - } - ${ - isEmpty && !canClick - ? html`${icons.check}` - : nothing - } + : nothing} + ${isEmpty && !canClick + ? html`${icons.check}` + : nothing}
${detail ? html`
${detail}
` : nothing} - ${ - isEmpty - ? html` -
Completed
- ` - : nothing - } - ${ - showCollapsed - ? html`
${getTruncatedPreview(card.text!)}
` - : nothing - } + ${isEmpty ? html`
Completed
` : nothing} + ${showCollapsed + ? html`
${getTruncatedPreview(card.text!)}
` + : nothing} ${showInline ? html`
${card.text}
` : nothing}
`; diff --git a/ui/src/ui/icons.ts b/ui/src/ui/icons.ts index 9cba6e36ef1..4c10abc1f6c 100644 --- a/ui/src/ui/icons.ts +++ b/ui/src/ui/icons.ts @@ -121,9 +121,7 @@ export const icons = { `, - check: html` - - `, + check: html` `, arrowDown: html` @@ -144,8 +142,12 @@ export const icons = { `, brain: html` - - + + @@ -236,9 +238,7 @@ export const icons = { `, - circle: html` - - `, + circle: html` `, puzzle: html` `, - stop: html` - - `, + stop: html` `, pin: html` diff --git a/ui/src/ui/views/agents-panels-overview.ts b/ui/src/ui/views/agents-panels-overview.ts index 2dafff0d28e..eefb35e2bcf 100644 --- a/ui/src/ui/views/agents-panels-overview.ts +++ b/ui/src/ui/views/agents-panels-overview.ts @@ -115,13 +115,13 @@ export function renderAgentOverview(params: {
- ${ - configDirty - ? html` -
You have unsaved config changes.
- ` - : nothing - } + ${configDirty + ? html` +
+ You have unsaved config changes. +
+ ` + : nothing}
Model Selection
@@ -134,17 +134,13 @@ export function renderAgentOverview(params: { @change=${(e: Event) => onModelChange(agent.id, (e.target as HTMLSelectElement).value || null)} > - ${ - isDefault - ? html` - - ` - : html` + ${isDefault + ? html` ` + : html` - ` - } + `} ${buildModelOptions(configForm, effectivePrimary ?? undefined, params.modelCatalog)} diff --git a/ui/src/ui/views/agents-panels-status-files.ts b/ui/src/ui/views/agents-panels-status-files.ts index 02f660171b2..634f1a753d4 100644 --- a/ui/src/ui/views/agents-panels-status-files.ts +++ b/ui/src/ui/views/agents-panels-status-files.ts @@ -179,24 +179,19 @@ export function renderAgentChannels(params: {
Last refresh: ${lastSuccessLabel}
- ${ - params.error - ? html`
${params.error}
` - : nothing - } - ${ - !params.snapshot - ? html` -
Load channels to see live status.
- ` - : nothing - } - ${ - entries.length === 0 - ? html` -
No channels found.
- ` - : html` + ${params.error + ? html`
${params.error}
` + : nothing} + ${!params.snapshot + ? html` +
+ Load channels to see live status. +
+ ` + : nothing} + ${entries.length === 0 + ? html`
No channels found.
` + : html`
${entries.map((entry) => { const summary = summarizeChannelAccounts(entry.accounts); @@ -222,33 +217,28 @@ export function renderAgentChannels(params: {
${status}
${configLabel}
${enabled}
- ${ - summary.configured === 0 - ? html` -
- Setup guide -
- ` - : nothing - } - ${ - extras.length > 0 - ? extras.map((extra) => html`
${extra.label}: ${extra.value}
`) - : nothing - } + ${summary.configured === 0 + ? html` +
+ Setup guide +
+ ` + : nothing} + ${extras.length > 0 + ? extras.map((extra) => html`
${extra.label}: ${extra.value}
`) + : nothing}
`; })}
- ` - } + `} `; @@ -299,33 +289,26 @@ export function renderAgentCron(params: {
${formatNextRun(params.status?.nextWakeAtMs ?? null)}
- ${ - params.error - ? html`
${params.error}
` - : nothing - } + ${params.error + ? html`
${params.error}
` + : nothing}
Agent Cron Jobs
Scheduled jobs targeting this agent.
- ${ - jobs.length === 0 - ? html` -
No jobs assigned.
- ` - : html` + ${jobs.length === 0 + ? html`
No jobs assigned.
` + : html`
${jobs.map( (job) => html`
${job.name}
- ${ - job.description - ? html`
${job.description}
` - : nothing - } + ${job.description + ? html`
${job.description}
` + : nothing}
${formatCronSchedule(job)} @@ -350,8 +333,7 @@ export function renderAgentCron(params: { `, )}
- ` - } + `}
`; } @@ -394,60 +376,46 @@ export function renderAgentFiles(params: { ${params.agentFilesLoading ? "Loading…" : "Refresh"} - ${ - list - ? html`
+ ${list + ? html`
Workspace: ${list.workspace}
` - : nothing - } - ${ - params.agentFilesError - ? html`
+ : nothing} + ${params.agentFilesError + ? html`
${params.agentFilesError}
` - : nothing - } - ${ - !list - ? html` -
- Load the agent workspace files to edit core instructions. -
- ` - : files.length === 0 - ? html` -
No files found.
- ` - : html` + : nothing} + ${!list + ? html` +
+ Load the agent workspace files to edit core instructions. +
+ ` + : files.length === 0 + ? html`
No files found.
` + : html`
${files.map((file) => { const isActive = active === file.name; const label = file.name.replace(/\.md$/i, ""); return html` `; })}
- ${ - !activeEntry - ? html` -
Select a file to edit.
- ` - : html` + ${!activeEntry + ? html`
Select a file to edit.
` + : html`
${activeEntry.path}
@@ -482,15 +450,13 @@ export function renderAgentFiles(params: {
- ${ - activeEntry.missing - ? html` -
- This file is missing. Saving will create it in the agent workspace. -
- ` - : nothing - } + ${activeEntry.missing + ? html` +
+ This file is missing. Saving will create it in the agent workspace. +
+ ` + : nothing}
`; @@ -130,9 +128,8 @@ export function renderNostrCard(params: { style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;" >
Profile
- ${ - summaryConfigured - ? html` + ${summaryConfigured + ? html` - ${ - vs.pinnedExpanded - ? html` + ${vs.pinnedExpanded + ? html`
${entries.map( ({ index, text, role }) => html` @@ -771,8 +768,7 @@ function renderPinnedSection( )}
` - : nothing - } + : nothing} `; } @@ -805,11 +801,9 @@ function renderSlashMenu( requestUpdate(); }} > - ${ - vs.slashMenuCommand?.icon - ? html`${icons[vs.slashMenuCommand.icon]}` - : nothing - } + ${vs.slashMenuCommand?.icon + ? html`${icons[vs.slashMenuCommand.icon]}` + : nothing} ${arg} /${vs.slashMenuCommand?.name} ${arg} @@ -851,9 +845,9 @@ function renderSlashMenu( ${entries.map( ({ cmd, globalIdx }) => html`
selectSlashCommand(cmd, props, requestUpdate)} @@ -866,15 +860,11 @@ function renderSlashMenu( /${cmd.name} ${cmd.args ? html`${cmd.args}` : nothing} ${cmd.description} - ${ - cmd.argOptions?.length - ? html`${cmd.argOptions.length} options` - : cmd.executeLocal && !cmd.args - ? html` - instant - ` - : nothing - } + ${cmd.argOptions?.length + ? html`${cmd.argOptions.length} options` + : cmd.executeLocal && !cmd.args + ? html` instant ` + : nothing}
`, )} @@ -954,46 +944,49 @@ export function renderChat(props: ChatProps) { @click=${handleCodeBlockCopy} >
- ${ - props.loading - ? html` -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ${props.loading + ? html` +
+
+
+
+
+
+
- ` - : nothing - } +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ` + : nothing} ${isEmpty && !vs.searchOpen ? renderWelcomeState(props) : nothing} - ${ - isEmpty && vs.searchOpen - ? html` -
No matching messages
- ` - : nothing - } + ${isEmpty && vs.searchOpen + ? html`
No matching messages
` + : nothing} ${repeat( chatItems, (item) => item.key, @@ -1171,9 +1164,8 @@ export function renderChat(props: ChatProps) { > ${props.disabledReason ? html`
${props.disabledReason}
` : nothing} ${props.error ? html`
${props.error}
` : nothing} - ${ - props.focusMode - ? html` + ${props.focusMode + ? html`
` - : nothing - } + : nothing}
- ${ - props.queue.length - ? html` + ${props.queue.length + ? html`
Queued (${props.queue.length})
@@ -1231,10 +1219,8 @@ export function renderChat(props: ChatProps) { (item) => html`
- ${ - item.text || - (item.attachments?.length ? `Image (${item.attachments.length})` : "") - } + ${item.text || + (item.attachments?.length ? `Image (${item.attachments.length})` : "")}
` - : nothing - } + : nothing} ${renderFallbackIndicator(props.fallbackStatus)} ${renderCompactionIndicator(props.compactionStatus)} ${renderContextNotice(activeSession, props.sessions?.defaults?.contextTokens ?? null)} - ${ - props.showNewMessages - ? html` + ${props.showNewMessages + ? html` ` - : nothing - } + : nothing}
@@ -1277,11 +1260,9 @@ export function renderChat(props: ChatProps) { @change=${(e: Event) => handleFileSelect(e, props)} /> - ${ - vs.sttRecording && vs.sttInterimText - ? html`
${vs.sttInterimText}
` - : nothing - } + ${vs.sttRecording && vs.sttInterimText + ? html`
${vs.sttInterimText}
` + : nothing} - ` - } + `}
`; - })() - } + })()}
- ${ - props.issues.length > 0 - ? html`
+ ${props.issues.length > 0 + ? html`
${JSON.stringify(props.issues, null, 2)}
` - : nothing - } + : nothing}
`; diff --git a/ui/src/ui/views/cron.ts b/ui/src/ui/views/cron.ts index b6632b35667..3d19cdb6d64 100644 --- a/ui/src/ui/views/cron.ts +++ b/ui/src/ui/views/cron.ts @@ -341,14 +341,12 @@ function focusFormField(id: string) { function renderFieldLabel(text: string, required = false) { return html` ${text} - ${ - required - ? html` + ${required + ? html` ${t("cron.form.requiredSr")} ` - : nothing - } + : nothing} `; } @@ -402,13 +400,11 @@ export function renderCron(props: CronProps) {
${t("cron.summary.enabled")}
- ${ - props.status - ? props.status.enabled - ? t("cron.summary.yes") - : t("cron.summary.no") - : t("common.na") - } + ${props.status + ? props.status.enabled + ? t("cron.summary.yes") + : t("cron.summary.no") + : t("common.na")}
@@ -547,18 +543,15 @@ export function renderCron(props: CronProps) {
- ${ - props.jobs.length === 0 - ? html`
${t("cron.jobs.noMatching")}
` - : html` + ${props.jobs.length === 0 + ? html`
${t("cron.jobs.noMatching")}
` + : html`
${props.jobs.map((job) => renderJob(job, props))}
- ` - } - ${ - props.jobsHasMore - ? html` + `} + ${props.jobsHasMore + ? html`
` - : nothing - } + : nothing}
@@ -581,11 +573,9 @@ export function renderCron(props: CronProps) {
${t("cron.runs.title")}
- ${ - props.runsScope === "all" - ? t("cron.runs.subtitleAll") - : t("cron.runs.subtitleJob", { title: selectedRunTitle }) - } + ${props.runsScope === "all" + ? t("cron.runs.subtitleAll") + : t("cron.runs.subtitleJob", { title: selectedRunTitle })}
@@ -676,24 +666,21 @@ export function renderCron(props: CronProps) { })}
- ${ - props.runsScope === "job" && props.runsJobId == null - ? html` + ${props.runsScope === "job" && props.runsJobId == null + ? html`
${t("cron.runs.selectJobHint")}
` - : runs.length === 0 - ? html` + : runs.length === 0 + ? html`
${t("cron.runs.noMatching")}
` - : html` + : html`
${runs.map((entry) => renderRun(entry, props.basePath, props.onNavigateToChat))}
- ` - } - ${ - (props.runsScope === "all" || props.runsJobId != null) && props.runsHasMore - ? html` + `} + ${(props.runsScope === "all" || props.runsJobId != null) && props.runsHasMore + ? html`
` - : nothing - } + : nothing} @@ -847,16 +833,13 @@ export function renderCron(props: CronProps) {
- ${ - props.form.payloadKind === "systemEvent" - ? t("cron.form.systemEventHelp") - : t("cron.form.agentTurnHelp") - } + ${props.form.payloadKind === "systemEvent" + ? t("cron.form.systemEventHelp") + : t("cron.form.agentTurnHelp")}
- ${ - isAgentTurn - ? html` + ${isAgentTurn + ? html` - ${ - isCronSchedule - ? html` + ${isCronSchedule + ? html` - ${ - isTrustedProxy - ? "" - : html` + ${isTrustedProxy + ? "" + : html` - ` - } + `}