mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-29 16:22:02 +00:00
fix(tui): preserve prompt metadata visibility across sessions (#45116)
This commit is contained in:
parent
03fb5c6c67
commit
97ba700fac
1 changed files with 12 additions and 3 deletions
|
|
@ -102,6 +102,7 @@ export type PromptRef = {
|
|||
}
|
||||
|
||||
const DRAFT_RETENTION_MIN_CHARS = 20
|
||||
const revealedPromptMetadata = new WeakSet<object>()
|
||||
|
||||
function randomIndex(count: number) {
|
||||
if (count <= 0) return 0
|
||||
|
|
@ -1608,12 +1609,20 @@ export function Prompt(props: PromptProps) {
|
|||
return promptDisplay().agentColor ?? theme.border.default
|
||||
})
|
||||
const agentLabel = createMemo(() => (store.mode === "shell" ? "Shell" : promptDisplay().agentLabel))
|
||||
const agentMetaAlpha = createFadeIn(() => !!agentLabel(), animationsEnabled)
|
||||
const modelMetaAlpha = createFadeIn(() => !!promptDisplay().agentLabel && store.mode === "normal", animationsEnabled)
|
||||
const animateMetadata = !revealedPromptMetadata.has(local)
|
||||
const metadataAnimationsEnabled = () => animationsEnabled() && animateMetadata
|
||||
const agentMetaAlpha = createFadeIn(() => !!agentLabel(), metadataAnimationsEnabled)
|
||||
const modelMetaAlpha = createFadeIn(
|
||||
() => !!promptDisplay().agentLabel && store.mode === "normal",
|
||||
metadataAnimationsEnabled,
|
||||
)
|
||||
const variantMetaAlpha = createFadeIn(
|
||||
() => !!promptDisplay().agentLabel && store.mode === "normal" && !!promptDisplay().variant,
|
||||
animationsEnabled,
|
||||
metadataAnimationsEnabled,
|
||||
)
|
||||
createEffect(() => {
|
||||
if (agentLabel()) revealedPromptMetadata.add(local)
|
||||
})
|
||||
const borderHighlight = createMemo(() => tint(theme.border.default, highlight(), agentMetaAlpha()))
|
||||
const footerInput = () => ({ sessionID: props.sessionID, mode: store.mode })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue