mirror of
https://github.com/openai/codex.git
synced 2026-05-04 21:32:21 +03:00
Hide numeric prefixes on disabled TUI list rows (#15660)
- Remove numeric prefixes for disabled rows in shared list rendering. These numbers are shortcuts, Ex: Pressing "2" selects option `#2`. Disabled items can not be selected, so keeping numbers on these items is misleading. - Apply the same behavior in both tui and tui_app_server. - Update affected snapshots for apps/plugins loading and plugin detail rows. _**This is a global change.**_ Before: <img width="1680" height="488" alt="image" src="https://github.com/user-attachments/assets/4bcf94ad-285f-48d3-a235-a85b58ee58e2" /> After: <img width="1706" height="484" alt="image" src="https://github.com/user-attachments/assets/76bb6107-a562-42fe-ae94-29440447ca77" />
This commit is contained in:
@@ -371,11 +371,14 @@ impl ListSelectionView {
|
||||
""
|
||||
};
|
||||
let name_with_marker = format!("{name}{marker}");
|
||||
let is_disabled = item.is_disabled || item.disabled_reason.is_some();
|
||||
let n = visible_idx + 1;
|
||||
let wrap_prefix = if self.is_searchable {
|
||||
// The number keys don't work when search is enabled (since we let the
|
||||
// numbers be used for the search query).
|
||||
format!("{prefix} ")
|
||||
} else if is_disabled {
|
||||
format!("{prefix} {}", " ".repeat(n.to_string().len() + 2))
|
||||
} else {
|
||||
format!("{prefix} {n}. ")
|
||||
};
|
||||
@@ -388,7 +391,6 @@ impl ListSelectionView {
|
||||
.flatten()
|
||||
.or_else(|| item.description.clone());
|
||||
let wrap_indent = description.is_none().then_some(wrap_prefix_width);
|
||||
let is_disabled = item.is_disabled || item.disabled_reason.is_some();
|
||||
GenericDisplayRow {
|
||||
name: name_with_marker,
|
||||
name_prefix_spans,
|
||||
|
||||
Reference in New Issue
Block a user