Skip to content

Commit 6b5a8b4

Browse files
committed
chore(cli): remove redundent preset themes
1 parent 87950db commit 6b5a8b4

32 files changed

Lines changed: 6 additions & 5585 deletions

src/apps/cli/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct CliConfig {
2828
pub struct UiConfig {
2929
/// Theme (dark, light, auto)
3030
pub theme: String,
31-
/// Theme ID (built-in: "bitfun"; custom: filename in themes dir without ".json")
31+
/// Theme ID (built-in preset name; custom: filename in themes dir without ".json")
3232
pub theme_id: String,
3333
/// Show tips
3434
pub show_tips: bool,
@@ -73,7 +73,7 @@ impl Default for UiConfig {
7373
fn default() -> Self {
7474
Self {
7575
theme: "dark".to_string(),
76-
theme_id: "bitfun".to_string(),
76+
theme_id: "cursor".to_string(),
7777
show_tips: true,
7878
animation: true,
7979
color_scheme: "default".to_string(),

src/apps/cli/src/modes/chat.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,14 +1789,7 @@ impl ChatMode {
17891789

17901790
fn list_available_themes(&self) -> Vec<ThemeItem> {
17911791
let mut themes = Vec::new();
1792-
themes.push(ThemeItem {
1793-
id: "bitfun".to_string(),
1794-
});
1795-
17961792
for id in builtin_theme_ids() {
1797-
if id == "bitfun" {
1798-
continue;
1799-
}
18001793
themes.push(ThemeItem { id });
18011794
}
18021795

@@ -1825,7 +1818,7 @@ impl ChatMode {
18251818
return Theme::monochrome();
18261819
}
18271820

1828-
if id.is_empty() || id.eq_ignore_ascii_case("bitfun") {
1821+
if id.is_empty() {
18291822
return base;
18301823
}
18311824

src/apps/cli/src/ui/startup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl StartupPage {
193193
Theme::monochrome()
194194
} else {
195195
let id = config.ui.theme_id.trim();
196-
if id.is_empty() || id.eq_ignore_ascii_case("bitfun") {
196+
if id.is_empty() {
197197
base
198198
} else if let Some(json) = builtin_theme_json(id) {
199199
base.apply_opencode_theme_json(json, appearance)

src/apps/cli/src/ui/theme.rs

Lines changed: 0 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -678,144 +678,27 @@ static BUILTIN_OPENCODE_THEMES: Lazy<HashMap<&'static str, OpencodeThemeJson>> =
678678
}
679679

680680
HashMap::from([
681-
parse(
682-
"aura",
683-
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/themes/presets/aura.json")),
684-
),
685-
parse(
686-
"ayu",
687-
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/themes/presets/ayu.json")),
688-
),
689-
parse(
690-
"carbonfox",
691-
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/themes/presets/carbonfox.json")),
692-
),
693-
parse(
694-
"catppuccin-frappe",
695-
include_str!(concat!(
696-
env!("CARGO_MANIFEST_DIR"),
697-
"/themes/presets/catppuccin-frappe.json"
698-
)),
699-
),
700-
parse(
701-
"catppuccin-macchiato",
702-
include_str!(concat!(
703-
env!("CARGO_MANIFEST_DIR"),
704-
"/themes/presets/catppuccin-macchiato.json"
705-
)),
706-
),
707-
parse(
708-
"catppuccin",
709-
include_str!(concat!(
710-
env!("CARGO_MANIFEST_DIR"),
711-
"/themes/presets/catppuccin.json"
712-
)),
713-
),
714-
parse(
715-
"cobalt2",
716-
include_str!(concat!(
717-
env!("CARGO_MANIFEST_DIR"),
718-
"/themes/presets/cobalt2.json"
719-
)),
720-
),
721681
parse(
722682
"cursor",
723683
include_str!(concat!(
724684
env!("CARGO_MANIFEST_DIR"),
725685
"/themes/presets/cursor.json"
726686
)),
727687
),
728-
parse(
729-
"dracula",
730-
include_str!(concat!(
731-
env!("CARGO_MANIFEST_DIR"),
732-
"/themes/presets/dracula.json"
733-
)),
734-
),
735688
parse(
736689
"everforest",
737690
include_str!(concat!(
738691
env!("CARGO_MANIFEST_DIR"),
739692
"/themes/presets/everforest.json"
740693
)),
741694
),
742-
parse(
743-
"flexoki",
744-
include_str!(concat!(
745-
env!("CARGO_MANIFEST_DIR"),
746-
"/themes/presets/flexoki.json"
747-
)),
748-
),
749695
parse(
750696
"github",
751697
include_str!(concat!(
752698
env!("CARGO_MANIFEST_DIR"),
753699
"/themes/presets/github.json"
754700
)),
755701
),
756-
parse(
757-
"gruvbox",
758-
include_str!(concat!(
759-
env!("CARGO_MANIFEST_DIR"),
760-
"/themes/presets/gruvbox.json"
761-
)),
762-
),
763-
parse(
764-
"kanagawa",
765-
include_str!(concat!(
766-
env!("CARGO_MANIFEST_DIR"),
767-
"/themes/presets/kanagawa.json"
768-
)),
769-
),
770-
parse(
771-
"lucent-orng",
772-
include_str!(concat!(
773-
env!("CARGO_MANIFEST_DIR"),
774-
"/themes/presets/lucent-orng.json"
775-
)),
776-
),
777-
parse(
778-
"material",
779-
include_str!(concat!(
780-
env!("CARGO_MANIFEST_DIR"),
781-
"/themes/presets/material.json"
782-
)),
783-
),
784-
parse(
785-
"matrix",
786-
include_str!(concat!(
787-
env!("CARGO_MANIFEST_DIR"),
788-
"/themes/presets/matrix.json"
789-
)),
790-
),
791-
parse(
792-
"mercury",
793-
include_str!(concat!(
794-
env!("CARGO_MANIFEST_DIR"),
795-
"/themes/presets/mercury.json"
796-
)),
797-
),
798-
parse(
799-
"monokai",
800-
include_str!(concat!(
801-
env!("CARGO_MANIFEST_DIR"),
802-
"/themes/presets/monokai.json"
803-
)),
804-
),
805-
parse(
806-
"nightowl",
807-
include_str!(concat!(
808-
env!("CARGO_MANIFEST_DIR"),
809-
"/themes/presets/nightowl.json"
810-
)),
811-
),
812-
parse(
813-
"nord",
814-
include_str!(concat!(
815-
env!("CARGO_MANIFEST_DIR"),
816-
"/themes/presets/nord.json"
817-
)),
818-
),
819702
parse(
820703
"one-dark",
821704
include_str!(concat!(
@@ -830,76 +713,13 @@ static BUILTIN_OPENCODE_THEMES: Lazy<HashMap<&'static str, OpencodeThemeJson>> =
830713
"/themes/presets/opencode.json"
831714
)),
832715
),
833-
parse(
834-
"orng",
835-
include_str!(concat!(
836-
env!("CARGO_MANIFEST_DIR"),
837-
"/themes/presets/orng.json"
838-
)),
839-
),
840-
parse(
841-
"osaka-jade",
842-
include_str!(concat!(
843-
env!("CARGO_MANIFEST_DIR"),
844-
"/themes/presets/osaka-jade.json"
845-
)),
846-
),
847-
parse(
848-
"palenight",
849-
include_str!(concat!(
850-
env!("CARGO_MANIFEST_DIR"),
851-
"/themes/presets/palenight.json"
852-
)),
853-
),
854-
parse(
855-
"rosepine",
856-
include_str!(concat!(
857-
env!("CARGO_MANIFEST_DIR"),
858-
"/themes/presets/rosepine.json"
859-
)),
860-
),
861-
parse(
862-
"solarized",
863-
include_str!(concat!(
864-
env!("CARGO_MANIFEST_DIR"),
865-
"/themes/presets/solarized.json"
866-
)),
867-
),
868-
parse(
869-
"synthwave84",
870-
include_str!(concat!(
871-
env!("CARGO_MANIFEST_DIR"),
872-
"/themes/presets/synthwave84.json"
873-
)),
874-
),
875716
parse(
876717
"tokyonight",
877718
include_str!(concat!(
878719
env!("CARGO_MANIFEST_DIR"),
879720
"/themes/presets/tokyonight.json"
880721
)),
881722
),
882-
parse(
883-
"vercel",
884-
include_str!(concat!(
885-
env!("CARGO_MANIFEST_DIR"),
886-
"/themes/presets/vercel.json"
887-
)),
888-
),
889-
parse(
890-
"vesper",
891-
include_str!(concat!(
892-
env!("CARGO_MANIFEST_DIR"),
893-
"/themes/presets/vesper.json"
894-
)),
895-
),
896-
parse(
897-
"zenburn",
898-
include_str!(concat!(
899-
env!("CARGO_MANIFEST_DIR"),
900-
"/themes/presets/zenburn.json"
901-
)),
902-
),
903723
])
904724
});
905725

src/apps/cli/src/ui/theme_selector.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
use crossterm::event::{MouseButton, MouseEvent, MouseEventKind};
66
use ratatui::{
7-
layout::{Alignment, Rect},
7+
layout::Rect,
88
style::{Color, Modifier, Style},
99
text::{Line, Span},
10-
widgets::{Block, Borders, Clear, List, ListItem, ListState, Paragraph},
10+
widgets::{Block, Borders, Clear, List, ListItem, ListState},
1111
Frame,
1212
};
1313

@@ -167,21 +167,6 @@ impl ThemeSelectorState {
167167

168168
frame.render_widget(Clear, popup_area);
169169
frame.render_stateful_widget(list, popup_area, &mut self.list_state);
170-
171-
let hint_area = Rect {
172-
x: popup_area.x,
173-
y: popup_area.y + popup_area.height,
174-
width: popup_area.width,
175-
height: 1.min(area.y + area.height - popup_area.y - popup_area.height),
176-
};
177-
if hint_area.height > 0 {
178-
let hint = Paragraph::new(Line::from(vec![Span::styled(
179-
" Built-in themes (opencode-compatible) ",
180-
theme.style(StyleKind::Info),
181-
)]))
182-
.alignment(Alignment::Center);
183-
frame.render_widget(hint, hint_area);
184-
}
185170
}
186171

187172
pub fn captures_mouse(&self, mouse: &MouseEvent) -> bool {

src/apps/cli/themes/presets/aura.json

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)