diff options
| author | Adam <[email protected]> | 2025-12-25 19:21:04 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-25 19:21:04 -0600 |
| commit | 7469cba7cf25ee1593fa9d1afefe6c0a5b553c3f (patch) | |
| tree | ada37cfc9197f32482ab3c167380ffad955ed5cc | |
| parent | 5420702f693b08001d0d1edb2010b03648dbaa59 (diff) | |
| download | opencode-7469cba7cf25ee1593fa9d1afefe6c0a5b553c3f.tar.gz opencode-7469cba7cf25ee1593fa9d1afefe6c0a5b553c3f.zip | |
fix(desktop): move session context to top-right
| -rw-r--r-- | packages/app/src/components/prompt-input.tsx | 6 | ||||
| -rw-r--r-- | packages/app/src/components/session-context-usage.tsx | 25 |
2 files changed, 16 insertions, 15 deletions
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 33e1f4890..7a1a3fdfb 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -989,7 +989,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { onInput={handleInput} onKeyDown={handleKeyDown} classList={{ - "w-full px-5 py-3 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true, + "w-full px-5 py-3 pr-12 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true, "[&_[data-type=file]]:text-icon-info-active": true, "font-mono!": store.mode === "shell", }} @@ -1001,6 +1001,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => { : `Ask anything... "${PLACEHOLDERS[store.placeholder]}"`} </div> </Show> + <div class="absolute top-4.5 right-4"> + <SessionContextUsage /> + </div> </div> <div class="relative p-3 flex items-center justify-between"> <div class="flex items-center justify-start gap-1"> @@ -1057,7 +1060,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => { </Tooltip> </Match> </Switch> - <SessionContextUsage /> </div> <div class="flex items-center gap-1 absolute right-2 bottom-2"> <input diff --git a/packages/app/src/components/session-context-usage.tsx b/packages/app/src/components/session-context-usage.tsx index 5474005c7..c8e6918ca 100644 --- a/packages/app/src/components/session-context-usage.tsx +++ b/packages/app/src/components/session-context-usage.tsx @@ -34,28 +34,27 @@ export function SessionContextUsage() { <Show when={context?.()}> {(ctx) => ( <Tooltip - openDelay={300} value={ - <div class="flex flex-col gap-1 p-2"> - <div class="flex justify-between gap-4"> - <span class="text-text-weaker">Tokens</span> - <span class="text-text-strong">{ctx().tokens}</span> + <div class="flex flex-col gap-1"> + <div class="flex gap-3"> + <span class="opacity-70 text-right flex-1">Tokens</span> + <span class="text-left flex-1">{ctx().tokens}</span> </div> - <div class="flex justify-between gap-4"> - <span class="text-text-weaker">Usage</span> - <span class="text-text-strong">{ctx().percentage ?? 0}%</span> + <div class="flex gap-3"> + <span class="opacity-70 text-right flex-1">Usage</span> + <span class="text-left flex-1">{ctx().percentage ?? 0}%</span> </div> - <div class="flex justify-between gap-4"> - <span class="text-text-weaker">Cost</span> - <span class="text-text-strong">{cost()}</span> + <div class="flex gap-3"> + <span class="opacity-70 text-right flex-1">Cost</span> + <span class="text-left flex-1">{cost()}</span> </div> </div> } placement="top" > - <div class="flex items-center gap-1"> - <span class="text-12-medium text-text-weak">{`${ctx().percentage ?? 0}%`}</span> + <div class="flex items-center gap-1.5"> <ProgressCircle size={16} strokeWidth={2} percentage={ctx().percentage ?? 0} /> + {/* <span class="text-12-medium text-text-weak">{`${ctx().percentage ?? 0}%`}</span> */} </div> </Tooltip> )} |
