Skip to content

Select: add showSelectionIndicator option#1192

Open
leonid-shutov wants to merge 1 commit into
anomalyco:mainfrom
leonid-shutov:show-selection-indicator
Open

Select: add showSelectionIndicator option#1192
leonid-shutov wants to merge 1 commit into
anomalyco:mainfrom
leonid-shutov:show-selection-indicator

Conversation

@leonid-shutov

@leonid-shutov leonid-shutov commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Issue #1193

Summary

Add a showSelectionIndicator boolean option to SelectRenderable that controls whether the glyph is rendered next to the currently selected item.

API

const select = new SelectRenderable(renderer, {
  width: 40,
  height: 10,
  options,
  showSelectionIndicator: false, // hides ▶ and reclaims its 2-column gutter
})

Default: true (no behaviour change for existing consumers).

When set to false, the indicator glyph and its 2-column gutter are both removed, giving item text two extra columns of horizontal space.

Screenshots

Image Image

Incidental cleanup

Two refactors that aren't part of the feature but were needed to keep the render loop coherent once the configurable indicator was introduced:

  1. Removed const contentX = 0 / const contentY = 0. Always 0, added as-is to every coordinate (a no-op).
  2. Renamed descX → textX. It was seeded as the description's x-position but then reused as the start column for the item name too.

@leonid-shutov leonid-shutov marked this pull request as ready for review June 21, 2026 12:15
simonklee added a commit that referenced this pull request Jun 26, 2026
Add showSelectionIndicator to hide the selected-item marker and reclaim
its two-column gutter. Preserve the existing default, restore it for
nullish framework updates, and document the new option.

Closes #1193
Refs #1192

Co-authored-by: leonid-shutov <leonid.shutov@hey.com>
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