tweak(tui): new session banner with logo and details (#13970)
This commit is contained in:
@@ -227,12 +227,20 @@ export function Session() {
|
|||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
const title = Locale.truncate(session()?.title ?? "", 50)
|
const title = Locale.truncate(session()?.title ?? "", 50)
|
||||||
|
const pad = (text: string) => text.padEnd(10, " ")
|
||||||
|
const weak = (text: string) => UI.Style.TEXT_DIM + pad(text) + UI.Style.TEXT_NORMAL
|
||||||
|
const logo = UI.logo(" ").split(/\r?\n/)
|
||||||
return exit.message.set(
|
return exit.message.set(
|
||||||
[
|
[
|
||||||
``,
|
``,
|
||||||
` █▀▀█ ${UI.Style.TEXT_DIM}${title}${UI.Style.TEXT_NORMAL}`,
|
`${logo[0] ?? ""}`,
|
||||||
` █ █ ${UI.Style.TEXT_DIM}opencode -s ${session()?.id}${UI.Style.TEXT_NORMAL}`,
|
`${logo[1] ?? ""}`,
|
||||||
` ▀▀▀▀ `,
|
`${logo[2] ?? ""}`,
|
||||||
|
`${logo[3] ?? ""}`,
|
||||||
|
``,
|
||||||
|
` ${weak("Session")}${UI.Style.TEXT_NORMAL_BOLD}${title}${UI.Style.TEXT_NORMAL}`,
|
||||||
|
` ${weak("Continue")}${UI.Style.TEXT_NORMAL_BOLD}opencode -s ${session()?.id}${UI.Style.TEXT_NORMAL}`,
|
||||||
|
``,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user