mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-04 11:54:55 +00:00
fix(session-ui): use standard Used labels for thoughts (#46995)
This commit is contained in:
parent
b42555cf01
commit
9acdb0be18
3 changed files with 8 additions and 9 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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() }
|
||||
|
|
|
|||
|
|
@ -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}}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue