mirror of
https://github.com/openai/codex.git
synced 2026-04-28 18:32:04 +03:00
2.5 KiB
2.5 KiB
DOs
-
Sync Docs With Enums: When changing
ReasoningEffort(e.g., removingNone), updateconfig.mdto match supported values.// protocol/src/config_types.rs #[derive(Debug, Serialize, Deserialize, Default, Clone, Copy, PartialEq, Eq)] #[serde(rename_all = "lowercase")] pub enum ReasoningEffort { Minimal, Low, #[default] Medium, High, }<!-- config.md --> Supported: "minimal", "low", "medium" (default), "high". Note: to minimize reasoning, choose "minimal". -
Make Esc Cancel: Bind
Escto cancel/close popups; reserveEnterfor accept.match key_event { KeyEvent { code: KeyCode::Esc, .. } => self.cancel(), KeyEvent { code: KeyCode::Enter, modifiers: KeyModifiers::NONE, .. } => self.accept(), KeyEvent { code: KeyCode::Up, .. } => self.move_up(), KeyEvent { code: KeyCode::Down, .. } => self.move_down(), _ => {} } -
Add Clear Titles To Popups: Provide a title (and optional subtitle/footer hint) for selection views.
// bottom_pane/mod.rs bottom_pane.show_selection_view( "Select model and reasoning level".to_string(), Some("Affects this and future Codex CLI session".to_string()), Some("Enter: confirm • Esc: cancel".to_string()), items, );// In the view's render() let title_para = Paragraph::new(Line::from(vec![ Span::styled("▌ ", Style::default().add_modifier(Modifier::DIM)), Span::styled(self.title.clone(), Style::default().add_modifier(Modifier::BOLD)), ])); title_para.render(title_area, buf);
DON’Ts
-
Don’t Document Removed Values: Avoid referencing
"none"in docs once the enum no longer supports it.<!-- Bad --> model_reasoning_effort = "none" # disable reasoning <!-- Good --> # Use "minimal" to minimize reasoning. -
Don’t Bind Esc To Accept: Esc should never trigger selection actions.
// Bad KeyEvent { code: KeyCode::Esc, .. } => self.accept(), // Good KeyEvent { code: KeyCode::Esc, .. } => self.cancel(), -
Don’t Ship Untitled Popups: Avoid selection popups without a visible, descriptive title.
// Bad: missing title/subtitle/footer ListSelectionView::new(items, app_event_tx); // Good: clear, guided UI ListSelectionView::new( "Choose preset".to_string(), Some("Applies model and reasoning effort".to_string()), Some("Enter to confirm, Esc to cancel".to_string()), items, app_event_tx, );