summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRavi Kumar <[email protected]>2026-01-07 23:54:44 +0530
committerGitHub <[email protected]>2026-01-07 19:24:44 +0100
commit68cf6b04a0eefd34a4c4a72881e44232c686bd16 (patch)
treee156d4b10b99aec74941098ef79286f554893d42
parent9ffaf81fb3c1b89a3e1a1921144824df2a0aecc5 (diff)
downloadopencode-68cf6b04a0eefd34a4c4a72881e44232c686bd16.tar.gz
opencode-68cf6b04a0eefd34a4c4a72881e44232c686bd16.zip
fix(tui): constrain autocomplete height to available screen space (#7181)
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
index 8a6db3424..57eac9544 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
@@ -653,8 +653,10 @@ export function Autocomplete(props: {
})
const height = createMemo(() => {
- if (options().length) return Math.min(10, options().length)
- return 1
+ const count = options().length || 1
+ if (!store.visible) return Math.min(10, count)
+ positionTick()
+ return Math.min(10, count, Math.max(1, props.anchor().y))
})
let scroll: ScrollBoxRenderable