diff --git a/apps/web/src/components/chat/ComposerPrimaryActions.tsx b/apps/web/src/components/chat/ComposerPrimaryActions.tsx index a4a8993a7036e..d0c5b34bceb9f 100644 --- a/apps/web/src/components/chat/ComposerPrimaryActions.tsx +++ b/apps/web/src/components/chat/ComposerPrimaryActions.tsx @@ -1,5 +1,5 @@ import { memo, type MouseEventHandler, type PointerEventHandler } from "react"; -import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, Minimize2Icon, PlayIcon } from "lucide-react"; +import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, PlayIcon } from "lucide-react"; import { CornerUpRight, ListPlus } from "lucide"; import { MorphIcon } from "~/components/MorphIcon"; import { useEnvironmentIdentificationMode } from "~/hooks/useSettings"; @@ -10,6 +10,7 @@ import { StageBackdropButtonArt, useSidebarStageBackdropVariant } from "../Sideb import { Button } from "../ui/button"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; import { Spinner } from "../ui/spinner"; +import { Switch } from "../ui/switch"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { composerFloatingLayerProps } from "./composerEventScope"; import { @@ -359,30 +360,28 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ + } + > + Compact + {compactTokens} + {/* A label would focus the hidden input and steal focus from the composer. */} + + - } - > - -
- {keepFullHistory - ? `Next send keeps all ${compactTokens} tokens.` - : `Next send compacts ${compactTokens} tokens first.`} -
-
{keepFullHistory ? "Click to compact first" : "Click to keep full history"}
+ {keepFullHistory + ? `Next send keeps all ${compactTokens} tokens.` + : `Next send compacts ${compactTokens} tokens first.`}
{submit} diff --git a/docs/user/providers-claude.md b/docs/user/providers-claude.md index 206d82ce32333..ca33be4edbe99 100644 --- a/docs/user/providers-claude.md +++ b/docs/user/providers-claude.md @@ -50,17 +50,16 @@ window. Leave it empty for Claude Code's default. You can also send `/compact` in an existing conversation. Web and desktop offer **Compact context** from the context meter. When you return to a large thread -after Claude's prompt cache expires, a **Compact** chip with the thread's token count shows -next to the send button. While it is on, Enter summarizes the history first, then -sends your message. Click the chip to switch it to **Full** and keep the full -history for that message. The cache lasts about an hour on a Claude +after Claude's prompt cache expires, a **Compact** switch shows next to the send +button. While it is on, Enter summarizes the history first, then sends your +message. Turn it off to keep the full history for that message. The cache lasts about an hour on a Claude subscription and 5 minutes with an API key, Bedrock, or Vertex. See [commands and skills](./composer.md#commands-and-skills) for using composer commands. **Compact idle threads** in **Settings > Providers > Advanced** controls this for threads over 200,000 tokens. Each Claude provider's settings can override it: -- **When you return** shows the **Compact** chip described above. This is the default. +- **When you return** shows the **Compact** switch described above. This is the default. - **Before the cache expires (beta)** compacts an idle thread shortly before its prompt cache expires, so coming back does not reprocess the whole conversation. The compaction appears in the thread as a `/compact` turn sent by T3 Code.