fix(webui): remove goal halo and redundant detail header (#6417)
* fix(webui): remove goal composer halo * fix(webui): remove redundant goal detail header
This commit is contained in:
1 parent
5ae49a43e7
commit
3bd489e314
3 files changed
+26
-65
No files matched your search
@@ -979,7 +979,7 @@ function GoalStateStrip({
|
|||||||
id="nanobot-goal-panel-root"
|
id="nanobot-goal-panel-root"
|
||||||
role="dialog"
|
role="dialog"
|
||||||
aria-modal="false"
|
aria-modal="false"
|
||||||
aria-labelledby="nanobot-goal-panel-title"
|
aria-label={t("thread.composer.goalStateSheetTitle")}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
className={cn(
|
className={cn(
|
||||||
"absolute bottom-[calc(100%+8px)] left-3 right-3 z-[50] flex max-w-none flex-col overflow-hidden",
|
"absolute bottom-[calc(100%+8px)] left-3 right-3 z-[50] flex max-w-none flex-col overflow-hidden",
|
||||||
@@ -988,29 +988,9 @@ function GoalStateStrip({
|
|||||||
)}
|
)}
|
||||||
style={{ maxHeight: `${Math.round(panelMaxPx)}px` }}
|
style={{ maxHeight: `${Math.round(panelMaxPx)}px` }}
|
||||||
>
|
>
|
||||||
<div className="flex shrink-0 items-center justify-between gap-2 border-b border-black/[0.06] px-3 py-2 dark:border-white/[0.08]">
|
|
||||||
<h2
|
|
||||||
id="nanobot-goal-panel-title"
|
|
||||||
className="min-w-0 truncate text-[13px] font-semibold tracking-tight text-foreground"
|
|
||||||
>
|
|
||||||
{t("thread.composer.goalStateSheetTitle")}
|
|
||||||
</h2>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={cn(
|
|
||||||
"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full",
|
|
||||||
"text-muted-foreground transition-colors hover:text-foreground",
|
|
||||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
||||||
)}
|
|
||||||
aria-label={t("thread.composer.goalStateCloseAria")}
|
|
||||||
onClick={() => setGoalPanelOpen(false)}
|
|
||||||
>
|
|
||||||
<X className="h-4 w-4" aria-hidden />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
id="nanobot-goal-panel-scroll"
|
id="nanobot-goal-panel-scroll"
|
||||||
className="min-h-0 flex-1 overflow-y-auto scrollbar-thin px-3 pb-3 pt-2"
|
className="min-h-0 flex-1 overflow-y-auto scrollbar-thin p-3"
|
||||||
>
|
>
|
||||||
<MarkdownText className="max-w-none text-foreground/90">
|
<MarkdownText className="max-w-none text-foreground/90">
|
||||||
{markdownBody}
|
{markdownBody}
|
||||||
@@ -2668,7 +2648,7 @@ export function ThreadComposer({
|
|||||||
sessionDragPreview && "ring-1 ring-primary/25",
|
sessionDragPreview && "ring-1 ring-primary/25",
|
||||||
isDragging && "ring-2 ring-primary/40 motion-reduce:ring-0 motion-reduce:border-primary",
|
isDragging && "ring-2 ring-primary/40 motion-reduce:ring-0 motion-reduce:border-primary",
|
||||||
goalState?.active &&
|
goalState?.active &&
|
||||||
"goal-shell-glow ring-1 ring-sky-400/35 motion-reduce:ring-sky-400/25 dark:ring-sky-400/45",
|
"ring-1 ring-sky-400/35 motion-reduce:ring-sky-400/25 dark:ring-sky-400/45",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{queuedPrompt ? (
|
{queuedPrompt ? (
|
||||||
|
|||||||
@@ -856,45 +856,6 @@
|
|||||||
transform-origin: top left;
|
transform-origin: top left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Goal halo: pale sky blue (not ``--primary``, which often reads as neutral gray). */
|
|
||||||
@keyframes goal-shell-glow-breathe {
|
|
||||||
0%,
|
|
||||||
100% {
|
|
||||||
filter: drop-shadow(0 0 10px hsl(204 72% 52% / 0.22))
|
|
||||||
drop-shadow(0 0 24px hsl(199 80% 58% / 0.14));
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
filter: drop-shadow(0 0 17px hsl(204 78% 48% / 0.32))
|
|
||||||
drop-shadow(0 0 38px hsl(199 85% 55% / 0.2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.goal-shell-glow {
|
|
||||||
animation: goal-shell-glow-breathe 4.8s ease-in-out infinite;
|
|
||||||
}
|
|
||||||
@keyframes goal-shell-glow-breathe-dark {
|
|
||||||
0%,
|
|
||||||
100% {
|
|
||||||
filter: drop-shadow(0 0 12px hsl(198 90% 72% / 0.28))
|
|
||||||
drop-shadow(0 0 28px hsl(195 95% 65% / 0.16));
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
filter: drop-shadow(0 0 20px hsl(198 95% 78% / 0.42))
|
|
||||||
drop-shadow(0 0 42px hsl(195 100% 70% / 0.24));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.dark .goal-shell-glow {
|
|
||||||
animation-name: goal-shell-glow-breathe-dark;
|
|
||||||
}
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.goal-shell-glow {
|
|
||||||
animation: none;
|
|
||||||
filter: drop-shadow(0 0 14px hsl(204 70% 50% / 0.24));
|
|
||||||
}
|
|
||||||
.dark .goal-shell-glow {
|
|
||||||
filter: drop-shadow(0 0 14px hsl(198 88% 70% / 0.32));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Subtle scrollbar that doesn't fight the dark background. */
|
/* Subtle scrollbar that doesn't fight the dark background. */
|
||||||
.scrollbar-thin {
|
.scrollbar-thin {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
|||||||
@@ -1800,12 +1800,14 @@ describe("ThreadComposer", () => {
|
|||||||
expect(container.querySelector("[data-composer-status-drawer]")).toBeNull();
|
expect(container.querySelector("[data-composer-status-drawer]")).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opens an upward anchored goal panel with markdown content when expand is clicked", async () => {
|
it("shows full goal content and dismisses it without losing the composer draft", async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
const longObjective =
|
const longObjective =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789GoalTail";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789GoalTail";
|
||||||
render(
|
render(
|
||||||
<ThreadComposer
|
<ThreadComposer
|
||||||
onSend={vi.fn()}
|
onSend={vi.fn()}
|
||||||
|
persistDraft={false}
|
||||||
placeholder="Type your message..."
|
placeholder="Type your message..."
|
||||||
goalState={{
|
goalState={{
|
||||||
active: true,
|
active: true,
|
||||||
@@ -1815,12 +1817,30 @@ describe("ThreadComposer", () => {
|
|||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole("button", { name: "Show full goal" }));
|
const input = screen.getByRole("textbox", { name: "Message input" });
|
||||||
|
const trigger = screen.getByRole("button", { name: "Show full goal" });
|
||||||
|
await user.type(input, "Keep my draft");
|
||||||
|
await user.click(trigger);
|
||||||
|
|
||||||
const dialog = await screen.findByRole("dialog", { name: "Goal" });
|
const dialog = await screen.findByRole("dialog", { name: "Goal" });
|
||||||
expect(dialog).toBeInTheDocument();
|
|
||||||
expect(dialog).toHaveTextContent("Short summary for strip");
|
expect(dialog).toHaveTextContent("Short summary for strip");
|
||||||
expect(dialog).toHaveTextContent(longObjective);
|
expect(dialog).toHaveTextContent(longObjective);
|
||||||
|
expect(trigger).toHaveAttribute("aria-expanded", "true");
|
||||||
|
|
||||||
|
await user.click(trigger);
|
||||||
|
expect(screen.queryByRole("dialog", { name: "Goal" })).not.toBeInTheDocument();
|
||||||
|
expect(trigger).toHaveAttribute("aria-expanded", "false");
|
||||||
|
|
||||||
|
await user.click(trigger);
|
||||||
|
expect(await screen.findByRole("dialog", { name: "Goal" })).toBeVisible();
|
||||||
|
await user.keyboard("{Escape}");
|
||||||
|
expect(screen.queryByRole("dialog", { name: "Goal" })).not.toBeInTheDocument();
|
||||||
|
|
||||||
|
await user.click(trigger);
|
||||||
|
expect(await screen.findByRole("dialog", { name: "Goal" })).toBeVisible();
|
||||||
|
await user.click(input);
|
||||||
|
expect(screen.queryByRole("dialog", { name: "Goal" })).not.toBeInTheDocument();
|
||||||
|
expect(input).toHaveValue("Keep my draft");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("opens a slash command palette and inserts the selected command", () => {
|
it("opens a slash command palette and inserts the selected command", () => {
|
||||||
|
|||||||
Reference in new issue
Block a user