@@ -72,6 +72,7 @@ def main(
72
72
# Use ThemeManager to load styles
73
73
logger .debug ("Loading theme..." )
74
74
theme_manager = ThemeManager (theme_path )
75
+
75
76
try :
76
77
styles = theme_manager .load_theme ()
77
78
except ThemeManagerError as e :
@@ -102,19 +103,37 @@ def main(
102
103
else :
103
104
diagram .nodes = nodes
104
105
106
+ available_themes = theme_manager .list_available_themes ()
107
+ available_themes .sort ()
108
+
109
+
105
110
if interactive :
106
111
logger .debug ("Entering interactive mode..." )
107
112
processor = YAMLProcessor ()
108
113
interactor = InteractiveManager ()
109
114
interactor .run_interactive_mode (
110
- diagram .nodes ,
111
- styles ["icon_to_group_mapping" ],
112
- containerlab_data ,
113
- input_file ,
114
- processor ,
115
- prefix ,
116
- lab_name ,
115
+ diagram = diagram ,
116
+ available_themes = available_themes ,
117
+ icon_to_group_mapping = styles ["icon_to_group_mapping" ],
118
+ containerlab_data = containerlab_data ,
119
+ output_file = input_file ,
120
+ processor = processor ,
121
+ prefix = prefix ,
122
+ lab_name = lab_name ,
117
123
)
124
+ # After wizard finishes:
125
+ layout = interactor .final_summary .get ("Layout" , layout )
126
+ chosen_theme = interactor .final_summary .get ("Theme" )
127
+
128
+ if chosen_theme :
129
+ # Load that theme or switch to it
130
+ new_theme_path = os .path .join (os .path .dirname (theme_path ), f"{ chosen_theme } .yaml" )
131
+ if os .path .exists (new_theme_path ):
132
+ logger .debug (f"Loading user-chosen theme: { chosen_theme } " )
133
+ theme_manager .config_path = new_theme_path
134
+ styles = theme_manager .load_theme ()
135
+ else :
136
+ logger .warning (f"User chose theme '{ chosen_theme } ' but no file found. Keeping old theme." )
118
137
119
138
logger .debug ("Assigning graph levels..." )
120
139
graph_manager = GraphLevelManager ()
0 commit comments