mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Add inline badges to custom statuslines (#64010)
Add a `badge` element to the statusline UI tree and TypeScript contract. It renders one string as a padded, single-line label with normalized whitespace. The optional `color` accepts `secondary` (the default), `info`, `success`, `warning`, or `danger`. The renderer uses the active theme for the label and blends the fill with the surrounding background when its color is known. Badges wrap as a unit. When a line limit requires an ellipsis after earlier content, a trailing badge that cannot fit is dropped. At the viewport edge, the right padding can clip while the full label remains visible. ## Testing Add rendering tests for wrapping, clipping, theme colors, and linked badges, along with checks for UI tree limits and the TypeScript contract. GitOrigin-RevId: be9e9799d6832976d325ba5fda48f5793dbbc722
This commit is contained in:
@@ -30,6 +30,7 @@ fn statusline_typescript_contract_matches_the_bundled_reference() -> color_eyre:
|
||||
"RowElement",
|
||||
"ColElement",
|
||||
"BoxElement",
|
||||
"BadgeElement",
|
||||
"SpacerElement",
|
||||
"CodeElement",
|
||||
"StatuslineItemId",
|
||||
@@ -71,6 +72,7 @@ fn generate_reference(output: &Path) -> color_eyre::Result<String> {
|
||||
"Row",
|
||||
"Col",
|
||||
"Box",
|
||||
"Badge",
|
||||
"Spacer",
|
||||
"Code",
|
||||
] {
|
||||
|
||||
Reference in New Issue
Block a user