Repository navigation
feat(tui): add About dialog #12466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(tui): add About dialog #12466
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
10ad788
feat(tui): add About dialog
IamCoder18 81d2828
docs(changeset): add entry for TUI About dialog
IamCoder18 9112b77
refactor(tui): simplify About dialog
IamCoder18 e90c6ef
fix(tui): drop hardcoded License row from About dialog
IamCoder18 abc5530
Merge branch 'main' into feat/tui-about-dialog
IamCoder18 ea1b235
Merge branch 'main' into feat/tui-about-dialog
IamCoder18 0189181
feat(tui): apply review feedback to about dialog
IamCoder18 5fc1381
Merge branch 'main' into feat/tui-about-dialog
IamCoder18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@kilocode/cli": minor | ||
| --- | ||
|
|
||
| Add an About dialog in the TUI accessible from the command palette (under "Kilo") or via the `/about` slash command. Shows version, channel, runtime/platform, config path, project root, connected providers, and default model, with helpful links (docs, GitHub, issues, Discord) and a `c` shortcut to copy diagnostics to the clipboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
packages/opencode/src/kilocode/cli/cmd/tui/component/dialog-about.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| // kilocode_change - new file | ||
| import { TextAttributes } from "@opentui/core" | ||
| import { For } from "solid-js" | ||
| import { InstallationVersion, InstallationChannel } from "@opencode-ai/core/installation/version" | ||
| import { Global } from "@opencode-ai/core/global" | ||
| import { useDialog, type DialogContext } from "@tui/ui/dialog" | ||
| import { useTheme } from "@tui/context/theme" | ||
| import { useSync } from "@tui/context/sync" | ||
| import { useProject } from "@tui/context/project" | ||
| import { useClipboard } from "@tui/context/clipboard" | ||
| import { useToast } from "@tui/ui/toast" | ||
| import { useBindings } from "@tui/keymap" | ||
|
|
||
| function runtime() { | ||
| const rt = (globalThis as { Bun?: { version?: string } }).Bun | ||
| return rt?.version ? `Bun ${rt.version}` : `Node ${process.versions.node}` | ||
| } | ||
|
|
||
| function truncate(text: string, max: number) { | ||
| return text.length > max ? text.slice(0, max - 1) + "\u2026" : text | ||
| } | ||
|
|
||
| export function showAboutDialog(dialog: DialogContext) { | ||
| dialog.replace(() => <DialogAbout />) | ||
| } | ||
|
|
||
| function Row(props: { label: string; value: string; theme: ReturnType<typeof useTheme>["theme"]; muted?: boolean }) { | ||
| return ( | ||
| <box flexDirection="row" gap={1}> | ||
| <text fg={props.theme.textMuted} width={18}> | ||
| {props.label} | ||
| </text> | ||
| <text fg={props.muted ? props.theme.textMuted : props.theme.text} wrapMode="word"> | ||
| {props.value} | ||
| </text> | ||
| </box> | ||
| ) | ||
| } | ||
|
|
||
| export function DialogAbout() { | ||
| const dialog = useDialog() | ||
| const { theme } = useTheme() | ||
| const sync = useSync() | ||
| const project = useProject() | ||
| const clipboard = useClipboard() | ||
| const toast = useToast() | ||
|
|
||
| const providers = () => { | ||
| const connected = sync.data.provider_next.connected | ||
| return connected.length ? connected.join(", ") : "(none connected)" | ||
| } | ||
| const defaultModel = () => sync.data.config.model ?? "" | ||
| const projectRoot = () => project.data.project.mainDir ?? project.instance.path().directory ?? process.cwd() | ||
|
|
||
| const links = [ | ||
| { label: "Docs", url: "https://kilo.ai/docs" }, | ||
| { label: "GitHub", url: "https://github.com/Kilo-Org/kilocode" }, | ||
| { label: "Issues", url: "https://github.com/Kilo-Org/kilocode/issues" }, | ||
| { label: "Discord", url: "https://kilo.ai/discord" }, | ||
| ] | ||
|
|
||
| const copy = () => { | ||
| if (!clipboard.write) { | ||
| toast.show({ variant: "error", message: "Clipboard not available" }) | ||
| return | ||
| } | ||
| const text = [ | ||
| `Kilo CLI ${InstallationVersion} (${InstallationChannel})`, | ||
| `Runtime: ${runtime()} (${process.platform}/${process.arch})`, | ||
| `Config: ${Global.Path.config}`, | ||
| `Project: ${projectRoot()}`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider the existing privacy mode here, and abbreviate/redact paths according to the privacy settings? |
||
| `Providers: ${providers()}`, | ||
| `Default model: ${defaultModel() || "(none)"}`, | ||
| ].join("\n") | ||
| void clipboard.write(text).then( | ||
| () => toast.show({ variant: "success", message: "Diagnostics copied" }), | ||
| (err: unknown) => | ||
| toast.show({ | ||
| variant: "error", | ||
| message: `Copy failed: ${err instanceof Error ? err.message : String(err)}`, | ||
| }), | ||
| ) | ||
| } | ||
|
|
||
| useBindings(() => ({ | ||
| bindings: [ | ||
| { key: "escape", desc: "Close about", group: "Dialog", cmd: () => dialog.clear() }, | ||
| { key: "return", desc: "Close about", group: "Dialog", cmd: () => dialog.clear() }, | ||
| { key: "c", desc: "Copy diagnostics", group: "Dialog", cmd: copy }, | ||
| ], | ||
| })) | ||
|
|
||
| return ( | ||
| <box paddingLeft={2} paddingRight={2} gap={1} paddingBottom={1}> | ||
| <box flexDirection="row" justifyContent="space-between"> | ||
| <text fg={theme.text} attributes={TextAttributes.BOLD}> | ||
| About Kilo CLI | ||
| </text> | ||
| <text fg={theme.textMuted} onMouseUp={() => dialog.clear()}> | ||
| esc | ||
| </text> | ||
| </box> | ||
|
|
||
| <box gap={1}> | ||
|
IamCoder18 marked this conversation as resolved.
Resolved
|
||
| <text fg={theme.textMuted} wrapMode="word"> | ||
| Open source AI coding agent. Access hundreds of models through Kilo Gateway. | ||
| </text> | ||
|
|
||
| <box gap={0}> | ||
| <text fg={theme.text} attributes={TextAttributes.BOLD}> | ||
| Identity | ||
| </text> | ||
| <Row theme={theme} label="Version" value={InstallationVersion} /> | ||
| <Row theme={theme} label="Channel" value={InstallationChannel} /> | ||
| </box> | ||
|
|
||
| <box gap={0}> | ||
| <text fg={theme.text} attributes={TextAttributes.BOLD}> | ||
| Runtime | ||
| </text> | ||
| <Row theme={theme} label="Runtime" value={`${runtime()} (${process.platform}/${process.arch})`} muted /> | ||
| <Row theme={theme} label="Config" value={truncate(Global.Path.config, 60)} muted /> | ||
| <Row theme={theme} label="Project" value={truncate(projectRoot(), 60)} muted /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above comment about privacy mode. |
||
| </box> | ||
|
|
||
| <box gap={0}> | ||
| <text fg={theme.text} attributes={TextAttributes.BOLD}> | ||
| Provider | ||
| </text> | ||
| <Row theme={theme} label="Connected" value={providers()} /> | ||
| <Row theme={theme} label="Default model" value={defaultModel() || "(none)"} muted={!defaultModel()} /> | ||
| </box> | ||
|
|
||
| <box gap={0}> | ||
| <text fg={theme.text} attributes={TextAttributes.BOLD}> | ||
| Links | ||
| </text> | ||
| <For each={links}> | ||
| {(link) => ( | ||
| <text fg={theme.accent} wrapMode="word"> | ||
| {" "} | ||
| {link.label}: {link.url} | ||
| </text> | ||
| )} | ||
| </For> | ||
| </box> | ||
| </box> | ||
|
|
||
| <box flexDirection="row" justifyContent="flex-start"> | ||
| <text fg={theme.textMuted} onMouseUp={copy}> | ||
| c copy diagnostics | ||
| </text> | ||
| </box> | ||
| </box> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The selected model here may differ from the model picker. Please take a look at how debug dialog uses
local.model.current().