mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-15 04:35:58 +00:00
fix(app): remove context tab indicator tooltip (#59505)
Co-authored-by: iamdavidhill <1879069+iamdavidhill@users.noreply.github.com> Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
This commit is contained in:
parent
2273b607bc
commit
d5bee9ecb4
1 changed files with 9 additions and 31 deletions
|
|
@ -8,15 +8,6 @@ import { lastAssistantWithUsage } from "@opencode/client/solid"
|
|||
import { usePlugin, type MountedSession } from "@opencode/plugin/gui"
|
||||
import { catalogModel, syncCatalog } from "./catalog"
|
||||
|
||||
function ContextTooltipRow(props: { name: JSX.Element; value: JSX.Element }) {
|
||||
return (
|
||||
<div class="flex min-w-0 items-center gap-4">
|
||||
<span class="shrink-0 text-v2-text-text-muted">{props.name}</span>
|
||||
<span class="ml-auto min-w-0 truncate text-right text-v2-text-text-base">{props.value}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function SessionContextUsage(props: {
|
||||
session: MountedSession
|
||||
/** False while the session's view is detached; it loads nothing until selected again. */
|
||||
|
|
@ -126,16 +117,6 @@ export function SessionContextUsage(props: {
|
|||
</div>
|
||||
)
|
||||
|
||||
const tooltipValue = () => (
|
||||
<div class="flex w-[120px] flex-col gap-2">
|
||||
<Show when={showCost()}>
|
||||
<ContextTooltipRow name={ctx.t("usage.cost")} value={cost()} />
|
||||
</Show>
|
||||
<ContextTooltipRow name={ctx.t("usage.usage")} value={`${context()?.usage ?? 0}%`} />
|
||||
<ContextTooltipRow name={ctx.t("usage.tokens")} value={context()?.total.toLocaleString(i18n.locale()) ?? "0"} />
|
||||
</div>
|
||||
)
|
||||
|
||||
const menuRow = (name: JSX.Element, value: JSX.Element) => (
|
||||
<div class="flex h-7 min-w-0 items-center gap-4 px-3 text-[13px] font-[440] leading-[var(--line-height-compact)] tracking-[-0.04px]">
|
||||
<span class="shrink-0 text-v2-text-text-muted">{name}</span>
|
||||
|
|
@ -172,13 +153,10 @@ export function SessionContextUsage(props: {
|
|||
return (
|
||||
<Show when={props.session.id}>
|
||||
<Show when={!props.compact} fallback={usageMenu()}>
|
||||
<Tooltip
|
||||
value={variant() === "indicator" ? tooltipValue() : ctx.t("usage.toggle")}
|
||||
placement={props.placement ?? "top"}
|
||||
>
|
||||
<Show
|
||||
when={variant() === "indicator"}
|
||||
fallback={
|
||||
<Show
|
||||
when={variant() === "indicator"}
|
||||
fallback={
|
||||
<Tooltip value={ctx.t("usage.toggle")} placement={props.placement ?? "top"}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost-muted"
|
||||
|
|
@ -199,11 +177,11 @@ export function SessionContextUsage(props: {
|
|||
</Show>
|
||||
</span>
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
{circle()}
|
||||
</Show>
|
||||
</Tooltip>
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
{circle()}
|
||||
</Show>
|
||||
</Show>
|
||||
</Show>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue