Skip to content

Commit da69d50

Browse files
authored
fix: stop using ANSI blue (#2421)
- One less color. - Replaced with cyan which looks better next to other cyan components.
1 parent be6a4fa commit da69d50

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

codex-rs/tui/src/bottom_pane/selection_popup_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) fn render_rows(
101101
if Some(i) == state.selected_idx {
102102
cell = cell.style(
103103
Style::default()
104-
.fg(Color::Blue)
104+
.fg(Color::Cyan)
105105
.add_modifier(Modifier::BOLD),
106106
);
107107
} else if *is_current {

codex-rs/tui/src/history_cell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ pub(crate) fn new_plan_update(update: UpdatePlanArgs) -> PlainHistoryCell {
711711
Span::styled(
712712
step,
713713
Style::default()
714-
.fg(Color::Blue)
714+
.fg(Color::Cyan)
715715
.add_modifier(Modifier::BOLD),
716716
),
717717
),
@@ -913,9 +913,9 @@ fn format_mcp_invocation<'a>(invocation: McpInvocation) -> Line<'a> {
913913
.unwrap_or_default();
914914

915915
let invocation_spans = vec![
916-
Span::styled(invocation.server.clone(), Style::default().fg(Color::Blue)),
916+
Span::styled(invocation.server.clone(), Style::default().fg(Color::Cyan)),
917917
Span::raw("."),
918-
Span::styled(invocation.tool.clone(), Style::default().fg(Color::Blue)),
918+
Span::styled(invocation.tool.clone(), Style::default().fg(Color::Cyan)),
919919
Span::raw("("),
920920
Span::styled(args_str, Style::default().add_modifier(Modifier::DIM)),
921921
Span::raw(")"),

codex-rs/tui/src/onboarding/auth.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ impl AuthModeWidget {
130130

131131
let line1 = if is_selected {
132132
Line::from(vec![
133-
format!("{} {}. ", caret, idx + 1).blue().dim(),
134-
text.to_string().blue(),
133+
format!("{} {}. ", caret, idx + 1).cyan().dim(),
134+
text.to_string().cyan(),
135135
])
136136
} else {
137137
Line::from(format!(" {}. {text}", idx + 1))
138138
};
139139

140140
let line2 = if is_selected {
141141
Line::from(format!(" {description}"))
142-
.fg(Color::Blue)
142+
.fg(Color::Cyan)
143143
.add_modifier(Modifier::DIM)
144144
} else {
145145
Line::from(format!(" {description}"))
@@ -163,6 +163,8 @@ impl AuthModeWidget {
163163
));
164164
lines.push(Line::from(""));
165165
lines.push(
166+
// AE: Following styles.md, this should probably be Cyan because it's a user input tip.
167+
// But leaving this for a future cleanup.
166168
Line::from(" Press Enter to continue")
167169
.style(Style::default().add_modifier(Modifier::DIM)),
168170
);
@@ -194,7 +196,7 @@ impl AuthModeWidget {
194196
lines.push(Line::from(" If the link doesn't open automatically, open the following link to authenticate:"));
195197
lines.push(Line::from(vec![
196198
Span::raw(" "),
197-
state.auth_url.as_str().blue().underlined(),
199+
state.auth_url.as_str().cyan().underlined(),
198200
]));
199201
lines.push(Line::from(""));
200202
}
@@ -238,7 +240,7 @@ impl AuthModeWidget {
238240
])
239241
.style(Style::default().add_modifier(Modifier::DIM)),
240242
Line::from(""),
241-
Line::from(" Press Enter to continue").fg(Color::Blue),
243+
Line::from(" Press Enter to continue").fg(Color::Cyan),
242244
];
243245

244246
Paragraph::new(lines)
@@ -267,7 +269,7 @@ impl AuthModeWidget {
267269
Line::from(
268270
" To use Codex with the OpenAI API, set OPENAI_API_KEY in your environment",
269271
)
270-
.style(Style::default().fg(Color::Blue)),
272+
.style(Style::default().fg(Color::Cyan)),
271273
Line::from(""),
272274
Line::from(" Press Enter to return")
273275
.style(Style::default().add_modifier(Modifier::DIM)),

codex-rs/tui/src/onboarding/trust_directory.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl WidgetRef for &TrustDirectoryWidget {
7575
|idx: usize, option: TrustDirectorySelection, text: &str| -> Line<'static> {
7676
let is_selected = self.highlighted == option;
7777
if is_selected {
78-
Line::from(format!("> {}. {text}", idx + 1)).blue()
78+
Line::from(format!("> {}. {text}", idx + 1)).cyan()
7979
} else {
8080
Line::from(format!(" {}. {}", idx + 1, text))
8181
}
@@ -109,6 +109,8 @@ impl WidgetRef for &TrustDirectoryWidget {
109109
lines.push(Line::from(format!(" {error}")).fg(Color::Red));
110110
lines.push(Line::from(""));
111111
}
112+
// AE: Following styles.md, this should probably be Cyan because it's a user input tip.
113+
// But leaving this for a future cleanup.
112114
lines.push(Line::from(" Press Enter to continue").add_modifier(Modifier::DIM));
113115

114116
Paragraph::new(lines)

codex-rs/tui/src/user_approval_widget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl UserApprovalWidget<'_> {
145145
} => {
146146
let cmd = strip_bash_lc_and_escape(command);
147147
let mut contents: Vec<Line> = to_command_display(
148-
vec!["? ".fg(Color::Blue), "Codex wants to run ".bold()],
148+
vec!["? ".fg(Color::Cyan), "Codex wants to run ".bold()],
149149
cmd,
150150
vec![],
151151
);

codex-rs/tui/styles.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
# Foreground colors
88

99
- **Default:** Most of the time, just use the default foreground color. `reset` can help get it back.
10-
- **Selection:** Use ANSI `blue`. (Ed & AE want to make this cyan too, but we'll do that in a followup since it's riskier in different themes.)
11-
- **User input tips and status indicators:** Use ANSI `cyan`.
10+
- **User input tips, selection, and status indicators:** Use ANSI `cyan`.
1211
- **Success and additions:** Use ANSI `green`.
1312
- **Errors, failures and deletions:** Use ANSI `red`.
1413
- **Codex:** Use ANSI `magenta`.
1514

1615
# Avoid
1716

18-
- Avoid custom colors because there's no guarantee that they'll contrast well or look good in various terminal color themes.
17+
- Avoid custom colors because there's no guarantee that they'll contrast well or look good in various terminal color themes. (`shimmer.rs` is an exception that works well because we take the default colors and just adjust their levels.)
1918
- Avoid ANSI `black` & `white` as foreground colors because the default terminal theme color will do a better job. (Use `reset` if you need to in order to get those.) The exception is if you need contrast rendering over a manually colored background.
20-
- Avoid ANSI `yellow` because for now the style guide doesn't use it. Prefer a foreground color mentioned above.
19+
- Avoid ANSI `blue` and `yellow` because for now the style guide doesn't use them. Prefer a foreground color mentioned above.
2120

2221
(There are some rules to try to catch this in `clippy.toml`.)

0 commit comments

Comments
 (0)