@@ -142,8 +142,10 @@ def callback(run_paths: List[str]):
142
142
# Add text to go to parent directory
143
143
new_element = html .Div (
144
144
[
145
- dbc .Button (
146
- "+" , id = {"type" : "general-dynamic-add-run" , "index" : - 1 }, disabled = True
145
+ html .I (
146
+ className = "fas fa-folder-open fa-lg" ,
147
+ id = {"type" : "general-dynamic-add-run" , "index" : - 1 },
148
+ style = {"pointer-events" : "none" },
147
149
),
148
150
dbc .Button (
149
151
".." ,
@@ -161,23 +163,45 @@ def callback(run_paths: List[str]):
161
163
162
164
for i , run_path in enumerate (run_paths ):
163
165
run_name = run_handler .get_run_name (run_path )
164
- new_element = html .Div (
165
- [
166
- dbc .Button ("+" , id = {"type" : "general-dynamic-add-run" , "index" : i }),
167
- dbc .Button (
168
- run_name ,
169
- id = {"type" : "general-dynamic-change-directory" , "index" : i },
170
- color = "link" ,
171
- ),
172
- dcc .Store (
173
- id = {"type" : "general-dynamic-available-run-path" , "index" : i },
174
- data = run_path ,
175
- ),
176
- ],
177
- className = "mb-1" ,
178
- )
179
- children .append (new_element )
180
166
167
+ is_run = run_handler .is_run (run_path )
168
+ # Differenciate between run and directory for visibility and usability reasons
169
+ if is_run :
170
+ new_element = html .Div (
171
+ [
172
+ dbc .Button (
173
+ "+" , id = {"type" : "general-dynamic-add-run" , "index" : i }, size = "sm"
174
+ ),
175
+ dbc .Button (
176
+ run_name ,
177
+ id = {"type" : "general-dynamic-change-directory" , "index" : i },
178
+ color = "light" ,
179
+ disabled = True ,
180
+ ),
181
+ dcc .Store (
182
+ id = {"type" : "general-dynamic-available-run-path" , "index" : i },
183
+ data = run_path ,
184
+ ),
185
+ ],
186
+ className = "mb-1" ,
187
+ )
188
+ else :
189
+ new_element = html .Div (
190
+ [
191
+ html .I (className = "fas fa-folder fa-lg" ),
192
+ dbc .Button (
193
+ run_name ,
194
+ id = {"type" : "general-dynamic-change-directory" , "index" : i },
195
+ color = "link" ,
196
+ ),
197
+ dcc .Store (
198
+ id = {"type" : "general-dynamic-available-run-path" , "index" : i },
199
+ data = run_path ,
200
+ ),
201
+ ],
202
+ className = "mb-1" ,
203
+ )
204
+ children .append (new_element )
181
205
if len (children ) == 0 :
182
206
return html .Div ("No runs found." )
183
207
0 commit comments