fix: cut long item summaries in the session composer placeholder (#12312)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
Guilhem
2026-11-10 15:46:26 +01:00
committed by GitHub
co-authored by Claude Opus 5.5 Ruben Fiszel
parent a2685ef718
commit abfa6b1a67
@@ -29,6 +29,7 @@
import { workspaceIsFork } from '$lib/utils/workspaceHierarchy'
import { WorkspaceService } from '$lib/gen'
import { sendUserToast } from '$lib/toast'
import { truncate } from '$lib/utils'
import Toggle from '$lib/components/Toggle.svelte'
import { copilotInfo, copilotWorkspace } from '$lib/aiStore'
import { loadCopilot } from '$lib/components/copilot/loadCopilot'
@@ -356,12 +357,14 @@
const bannerClass =
'flex flex-row items-center justify-between gap-2 py-2 px-3 text-xs border rounded-md'
const previewedItemPlaceholder = $derived(
previewedItem &&
(heldInUse
? `Ask about the ${previewedItem.kind} ${previewedItem.name}, or run it…`
: `Ask about the ${previewedItem.kind} ${previewedItem.name}, or describe a change…`)
)
// A placeholder that wraps grows the composer, so a long summary is cut to keep it on one line.
const previewedItemPlaceholder = $derived.by(() => {
if (!previewedItem) return undefined
const item = `${previewedItem.kind} ${truncate(previewedItem.name, 24, '…')}`
return heldInUse
? `Ask about the ${item}, or run it…`
: `Ask about the ${item}, or describe a change…`
})
</script>
{#if !session || !runtime}