Skip to content

feat(tui): add logo setting to hide or replace the home logo - #65358

Open
martinwangjian wants to merge 2 commits into
anomalyco:devfrom
martinwangjian:feat/tui-logo-setting
Open

martinwangjian wants to merge 2 commits into
anomalyco:devfrom
martinwangjian:feat/tui-logo-setting

Conversation

@martinwangjian

@martinwangjian martinwangjian commented Nov 21, 2026 •

Copy link
Copy Markdown

Issue for this PR

Part of #51916 (the setting option; #65354 is the slot option) and #54947 (the logo part only). Covers what #12016 asked for (a logo setting). Removes the logo from the source patches described in #55986. Complements #65354, which adds a home.logo plugin slot. The two PRs don't touch the same lines and work together: the setting changes the default logo, a plugin can still replace it.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a logo setting to cli.json so the logo (home screen and /stats) can be changed without writing a plugin:

  • "logo": false hides it
  • "logo": ["line 1", "line 2"] replaces it with these lines, rendered as plain text. Like the built-in logo, it's hidden when it doesn't fit: when its widest line is wider than the terminal, or the terminal is shorter than 12 rows.
  • No setting: unchanged.

It's a schema field in packages/tui/src/config and a branch in component/logo.tsx, plus a row and an example in cli/config.mdx. We ship OpenCode with our own branding, and a config value is easier to manage centrally than a plugin.

How did you verify your code works?

  • New test/logo-config.test.tsx: custom lines replace the logo, false hides it, the default logo shows without the setting, text with _ , ^ ~ renders as typed, and a logo wider than the terminal is hidden. Each fails without the matching logo.tsx change.
  • When the logo is hidden, the home update notice no longer takes the logo's width (0); it sizes to its text.
  • bun run typecheck, oxlint and the pre-push hook pass. packages/cli config tests pass. The full packages/tui suite has the same 3 failures as dev on my machine (shell output timeouts and a colour test).

Screenshots / recordings

Captured from the test fixture with "logo": ["▄▀█ █▀▀ █▀▄▀█ █▀▀", "█▀█ █▄▄ █ ▀ █ ██▄"]:

                                          ▄▀█ █▀▀ █▀▄▀█ █▀▀
                                          █▀█ █▄▄ █ ▀ █ ██▄
             ┃  Ask anything… "What is the tech stack of this project?"

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Fixes #51916

Related: #54947, #39368

Public API: adds the optional logo setting to cli.json (false or an array of lines) (backwards compatible)

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting works as described. I checked it by running the TUI from source on the base and on this branch with a custom logo in cli.json (screenshots below). The new tests pass here and fail on the base, and type-checking finds no new errors.

Public API: adds an optional logo key to cli.json (false or string[]) and a row in the settings docs. This is backwards compatible: existing configs don't change.

Concerns (details are in the inline comments):

  • <Logo /> is also rendered by /stats, so the setting replaces or hides the logo there too, not only on the home screen. The docs only mention the home screen, so either document this or limit the setting to home.
  • With "logo": false, the home screen measures the logo's width as 0. The update notification uses that width, so it would likely disappear for users who hide the logo.
  • Custom lines go through the same renderer as the built-in logo, so _ , ^ ~ are always drawn as shaded blocks. A plain-text logo such as acme_code or Hello, world would come out garbled.
  • Design: in #51916 the plugin-slot approach was the one suggested to maintainers. Whether a config setting is also wanted is up to them.

Fixes #51916
Related: #54947, #39368

Before

After

Comment thread packages/tui/src/component/logo.tsx Resolved
…t fit

Address review: custom lines no longer get the built-in shading marks,
a custom logo wider than the terminal is hidden like the built-in one
falls back, the update notice keeps its width when the logo is hidden,
and the docs say the setting also applies to /stats.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All four points from my last review are fixed in abcecc0:

  • Custom lines render as plain text, so _ , ^ ~ show as typed.
  • A custom logo that is wider than the terminal is hidden. Width is measured with stringWidth, so wide characters count properly.
  • With "logo": false, the update notice sizes to its own text instead of getting a zero width.
  • The docs and schema now say the setting also applies to /stats.

I checked it with the 5 tests in logo-config.test.tsx (all pass), a type check (no new errors compared with the base), and by running the TUI on this branch with a custom logo (screenshots below). I didn't open /stats or see the update notice with the logo hidden; for those two I read the code.

Public API: adds an optional logo key to cli.json (false or an array of lines). This is backwards compatible.

I have no remaining code concerns. The one open question is for maintainers: whether they want this config setting as well as, or instead of, the plugin slot discussed in #51916.

Fixes #51916
Related: #54947, #39368

Before

After

@martinwangjian

Copy link
Copy Markdown
Author

On the open question: either works for us, and they compose. The setting covers the simple case without code, and the home.logo slot (#65354) lets a plugin render anything. Happy to drop one if you'd rather keep a single mechanism.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Custom home screen logo (slot or setting; V1 home_logo has no V2 equivalent)

1 participant