Merge pull request #1294 from bradleypriest/pr/sessions-labels

ui(sessions): support editing session labels
This commit is contained in:
Peter Steinberger
2026-01-20 11:05:46 +00:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ export async function patchSession(
state: SessionsState,
key: string,
patch: {
label?: string | null;
thinkingLevel?: string | null;
verboseLevel?: string | null;
reasoningLevel?: string | null;
@@ -50,6 +51,7 @@ export async function patchSession(
) {
if (!state.client || !state.connected) return;
const params: Record<string, unknown> = { key };
if ("label" in patch) params.label = patch.label;
if ("thinkingLevel" in patch) params.thinkingLevel = patch.thinkingLevel;
if ("verboseLevel" in patch) params.verboseLevel = patch.verboseLevel;
if ("reasoningLevel" in patch) params.reasoningLevel = patch.reasoningLevel;

View File

@@ -24,6 +24,7 @@ export type SessionsProps = {
onPatch: (
key: string,
patch: {
label?: string | null;
thinkingLevel?: string | null;
verboseLevel?: string | null;
reasoningLevel?: string | null;
@@ -195,7 +196,17 @@ function renderRow(
<div class="mono">${canLink
? html`<a href=${chatUrl} class="session-link">${displayName}</a>`
: displayName}</div>
<div>${row.label ?? ""}</div>
<div>
<input
.value=${row.label ?? ""}
?disabled=${disabled}
placeholder="(optional)"
@change=${(e: Event) => {
const value = (e.target as HTMLInputElement).value.trim();
onPatch(row.key, { label: value || null });
}}
/>
</div>
<div>${row.kind}</div>
<div>${updated}</div>
<div>${formatSessionTokens(row)}</div>