Skip to content

feat(tui): configurable custom home placeholders#25387

Closed
wyMinLwin wants to merge 1 commit intoanomalyco:devfrom
wyMinLwin:tui/custom-prompt-placeholders
Closed

feat(tui): configurable custom home placeholders#25387
wyMinLwin wants to merge 1 commit intoanomalyco:devfrom
wyMinLwin:tui/custom-prompt-placeholders

Conversation

@wyMinLwin
Copy link
Copy Markdown

@wyMinLwin wyMinLwin commented May 2, 2026

Issue for this PR

Closes #

Type of change

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

What does this PR do?

Adds a placeholders field to tui.json so users can override
the rotating placeholder text inside the prompt input on the
home screen.

  • placeholders.input replaces the normal-mode placeholder
    pool.
  • placeholders.shell replaces the shell-mode placeholder
    pool.
  • Items are used literally — when a user supplies their own
    array, the built-in Ask anything... "..." / Run a command... "..." framing is dropped so the strings show as-is.
    Without this the user's strings would still be wrapped in the
    prefix, which I didn't want for my own setup.
  • Either field can be set independently; the other keeps its
    default. Omitting placeholders entirely keeps the existing
    behavior.

Why this works: the placeholder string is built in one place —
placeholderText in component/prompt/index.tsx — which
already reads the rotating index off
props.placeholders.normal/shell. I added two internal-only
flags (rawNormal, rawShell) on that same prop. When set,
placeholderText returns the rotated item literally instead of
wrapping it in the prefix. home.tsx is the only caller that
turns the flags on, and it does so based on whether the user
supplied an array. Existing random-pick rotation (on mount, on
session change, on entering shell mode) is preserved unchanged.

Files touched:

  • packages/opencode/src/cli/cmd/tui/config/tui-schema.ts
    schema entry.

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
rawNormal / rawShell flags + branching in
placeholderText.

  • packages/opencode/src/cli/cmd/tui/routes/home.tsx — reads
    useTuiConfig().placeholders and forwards arrays with the raw
    flags set.

How did you verify your code works?

Ran bunx tsgo --noEmit in packages/opencode and
packages/plugin — both clean.

Manually with bun run dev:

  • No placeholders in tui.json → home shows Ask anything... "Fix broken tests" rotation as before.
  • placeholders.input: ["foo", "bar"] → input rotates through
    foo / bar literally, no prefix.
  • placeholders.shell: ["git status"] → entering shell mode
    with ! shows git status literally.
  • Setting only input left shell on its default and vice
    versa.
  • Single-item array always shows that item; multi-item picks
    randomly across new sessions.

Screenshots / recordings

Screenshot 2026-05-02 at 3 06 13 pm Screenshot 2026-05-02 at 3 12 01 pm

Before:

Ask anything... "Fix broken tests"

After (tui.json):

{
  "$schema": "https://opencode.ai/tui.json",
  "placeholders": {
    "input": ["whatever I want here", "another literal"],
    "shell": ["git command?"]
  }
}

Renders:

whatever I want here

(no Ask anything... prefix, no quotes)

Checklist

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Hey! Your PR title tui: configurable custom home placeholders doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:title needs:compliance This means the issue will auto-close after 2 hours. labels May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@wyMinLwin wyMinLwin changed the title tui: configurable custom home placeholders feat(tui): configurable custom home placeholders May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 2, 2026
@github-actions github-actions Bot closed this May 2, 2026
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.

1 participant