fix(session-ui): use standard Used labels for thoughts (#46995)

This commit is contained in:
Luke Parker 2026-09-03 17:10:56 +10:00 committed by GitHub
parent b42555cf01
commit 9acdb0be18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 9 deletions

View file

@ -42,7 +42,7 @@ test("changes timeline presets and saves custom thinking details", async ({ page
.toEqual({ placement: "grouped", details: "collapsed" })
await settings.getByRole("button", { name: "Back to app", exact: true }).click()
await expect(settings).toBeHidden()
await page.getByRole("button", { name: "Reasoning", exact: true }).click()
await page.getByRole("button", { name: "Used 1 Thought", exact: true }).click()
await expect(part.getByRole("button")).toHaveAttribute("aria-expanded", "false")
await part.getByRole("button").click()
await expect(part.getByText("The selected mode controls these details.", { exact: true })).toBeVisible()

View file

@ -529,13 +529,11 @@ export function CurrentContextToolGroup(props: {
)
const label = createMemo(() => {
const notices = props.parts.filter((part) => part.type === "notice").length
if (!names() && !notices) {
const title = i18n.t("ui.messagePart.context.reasoning")
return { text: title, title, before: "", after: "" }
}
const title = [names(), notices ? i18n.plural("ui.messagePart.context.notice", notices) : undefined]
.filter(Boolean)
.join(", ")
const title =
[names(), notices ? i18n.plural("ui.messagePart.context.notice", notices) : undefined]
.filter(Boolean)
.join(", ") ||
i18n.plural("ui.messagePart.context.thought", props.parts.filter((part) => part.type === "reasoning").length)
const text = i18n.t("ui.messagePart.tools.used", { tools: title })
const index = text.indexOf(title)
return { text, title, before: text.slice(0, index).trim(), after: text.slice(index + title.length).trim() }

View file

@ -110,7 +110,8 @@ const source = {
"ui.messagePart.context.list.other": "{{count}} lists",
"ui.messagePart.context.notice.one": "{{count}} Notice",
"ui.messagePart.context.notice.other": "{{count}} Notices",
"ui.messagePart.context.reasoning": "Reasoning",
"ui.messagePart.context.thought.one": "{{count}} Thought",
"ui.messagePart.context.thought.other": "{{count}} Thoughts",
"ui.messagePart.context.match.one": "({{count}} match)",
"ui.messagePart.context.match.other": "({{count}} matches)",
"ui.messagePart.tools.used": "Used {{tools}}",