Compare commits

...

1 Commits

Author SHA1 Message Date
Kit Langton ba09de81f8 feat(tui): show /connect tip when user has no models configured
When no providers are connected, the home screen tip now always shows
a prompt to run /connect instead of a random tip. Also shows the tip
on the very first session if no models are available, overriding the
previous first-session suppression.
2026-04-23 11:32:39 -04:00
2 changed files with 14 additions and 6 deletions
@@ -30,9 +30,12 @@ function parse(tip: string): TipPart[] {
return parts
}
export function Tips() {
const NO_MODELS_TIP = "Run {highlight}/connect{/highlight} to add an AI provider and start coding"
export function Tips(props: { connected?: boolean }) {
const theme = useTheme().theme
const parts = parse(TIPS[Math.floor(Math.random() * TIPS.length)])
const tip = props.connected === false ? NO_MODELS_TIP : TIPS[Math.floor(Math.random() * TIPS.length)]
const parts = parse(tip)
return (
<box flexDirection="row" maxWidth="100%">
@@ -4,11 +4,11 @@ import { Tips } from "./tips-view"
const id = "internal:home-tips"
function View(props: { show: boolean }) {
function View(props: { show: boolean; connected: boolean }) {
return (
<box height={4} minHeight={0} width="100%" maxWidth={75} alignItems="center" paddingTop={3} flexShrink={1}>
<Show when={props.show}>
<Tips />
<Tips connected={props.connected} />
</Show>
</box>
)
@@ -35,8 +35,13 @@ const tui: TuiPlugin = async (api) => {
home_bottom() {
const hidden = createMemo(() => api.kv.get("tips_hidden", false))
const first = createMemo(() => api.state.session.count() === 0)
const show = createMemo(() => !first() && !hidden())
return <View show={show()} />
const connected = createMemo(() =>
api.state.provider.some(
(item) => item.id !== "opencode" || Object.values(item.models).some((model) => model.cost?.input !== 0),
),
)
const show = createMemo(() => (!first() || !connected()) && !hidden())
return <View show={show()} connected={connected()} />
},
},
})