fix(app): match notice updates to used label styling (#48895)

This commit is contained in:
Luke Parker
2026-09-14 12:02:16 +10:00
committed by GitHub
Unverified
parent 5d3019e5a1
commit a71bb4d38c
3 changed files with 37 additions and 5 deletions
@@ -36,6 +36,33 @@ export const MixedTools = {
},
}
export const NoticesOnly = {
render: () => {
const [open, setOpen] = createStore({ tools: false, notices: false })
const tools = [storyTool("notice_read", "read", "completed", { path: "AGENTS.md" })]
return (
<section class="mx-auto flex w-full max-w-[720px] flex-col gap-4 p-6">
<CurrentSessionProviders document={storyDocument(tools)}>
<CurrentContextToolGroup
parts={tools}
busy={false}
open={open.tools}
onOpenChange={(value) => setOpen("tools", value)}
/>
<CurrentContextToolGroup
parts={[
{ type: "notice", id: "notice_instructions", render: () => <p>Instructions updated: AGENTS.md</p> },
]}
busy={false}
open={open.notices}
onOpenChange={(value) => setOpen("notices", value)}
/>
</CurrentSessionProviders>
</section>
)
},
}
export const MixedReasoning = {
args: { reasoningDefaultOpen: false },
render: (args: { reasoningDefaultOpen: boolean }) => {
@@ -536,8 +536,8 @@ export function CurrentContextToolGroup(props: {
const label = createMemo(() => {
const thoughts = props.parts.filter((part) => part.type === "reasoning").length
if (!names() && !thoughts) {
const title = i18n.t("ui.messagePart.context.details")
return { text: title, title, before: "", count: "", between: "", after: "" }
const text = i18n.t("ui.messagePart.context.updates")
return { text, title: "", before: text, count: "", between: "", after: "" }
}
const title = names() || i18n.plural("ui.messagePart.context.thought", thoughts)
const count = props.parts.filter((part) => part.type === "tool" || part.type === "shell").length || thoughts
@@ -622,7 +622,12 @@ export function CurrentContextToolGroup(props: {
<Show when={label().before || label().count || label().between}>
<span data-slot="context-tool-group-usage">
<Show when={label().before}>
{(before) => <span data-slot="context-tool-group-prefix">{before()} </span>}
{(before) => (
<span data-slot="context-tool-group-prefix">
{before()}
{label().title ? " " : ""}
</span>
)}
</Show>
<Show when={label().count}>
{(count) => <span data-slot="context-tool-group-count">{count()} </span>}
@@ -632,7 +637,7 @@ export function CurrentContextToolGroup(props: {
</Show>
</span>
</Show>
<span data-slot="basic-tool-tool-title">{label().title}</span>
<Show when={label().title}>{(title) => <span data-slot="basic-tool-tool-title">{title()}</span>}</Show>
<Show when={label().after}>
{(after) => <span data-slot="context-tool-group-prefix">{after()}</span>}
</Show>
+1 -1
View File
@@ -111,7 +111,7 @@ const source = {
"ui.messagePart.compaction.interrupted": "Session compaction interrupted",
"ui.messagePart.providerCompaction": "Session compacted by provider",
"ui.messagePart.compaction.usage": "{{input}} in · {{output}} out",
"ui.messagePart.context.details": "Details",
"ui.messagePart.context.updates": "Updates",
"ui.messagePart.context.read.one": "{{count}} read",
"ui.messagePart.context.read.other": "{{count}} reads",
"ui.messagePart.context.search.one": "{{count}} search",