Spaces:
Running
Running
Update ui/okr_ui_generator.py
Browse files- ui/okr_ui_generator.py +17 -6
ui/okr_ui_generator.py
CHANGED
@@ -456,20 +456,29 @@ def get_initial_okr_display() -> str:
|
|
456 |
</div>
|
457 |
"""
|
458 |
|
459 |
-
def format_okrs_for_enhanced_display(
|
460 |
"""
|
461 |
Enhanced formatting function that creates beautiful HTML for OKR display
|
462 |
-
from the
|
463 |
|
464 |
Args:
|
465 |
-
|
466 |
-
|
467 |
|
468 |
Returns:
|
469 |
str: A comprehensive HTML string representing the OKRs, or an empty state HTML.
|
470 |
"""
|
471 |
-
if not
|
472 |
-
logger.warning("No
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
return get_empty_okr_state()
|
474 |
|
475 |
actionable_okrs = raw_results.get("actionable_okrs", {})
|
@@ -479,6 +488,8 @@ def format_okrs_for_enhanced_display(raw_results: dict) -> str:
|
|
479 |
logger.info("No OKRs found in 'actionable_okrs' list.")
|
480 |
return get_empty_okr_state()
|
481 |
|
|
|
|
|
482 |
# Calculate statistics for the stats bar
|
483 |
total_objectives = len(okrs_list)
|
484 |
total_key_results = sum(len(okr.get('key_results', [])) for okr in okrs_list)
|
|
|
456 |
</div>
|
457 |
"""
|
458 |
|
459 |
+
def format_okrs_for_enhanced_display(reconstruction_cache: dict) -> str:
|
460 |
"""
|
461 |
Enhanced formatting function that creates beautiful HTML for OKR display
|
462 |
+
from the reconstruction cache dictionary.
|
463 |
|
464 |
Args:
|
465 |
+
reconstruction_cache (dict): The reconstruction cache containing reconstructed data.
|
466 |
+
Expected to contain report data with 'actionable_okrs' key.
|
467 |
|
468 |
Returns:
|
469 |
str: A comprehensive HTML string representing the OKRs, or an empty state HTML.
|
470 |
"""
|
471 |
+
if not reconstruction_cache:
|
472 |
+
logger.warning("No reconstruction cache found for display.")
|
473 |
+
return get_empty_okr_state()
|
474 |
+
|
475 |
+
# Extract actionable_okrs from the first (and typically only) report in cache
|
476 |
+
for report_id, report_data in reconstruction_cache.items():
|
477 |
+
if isinstance(report_data, dict) and 'actionable_okrs' in report_data:
|
478 |
+
raw_results = {'actionable_okrs': report_data['actionable_okrs']}
|
479 |
+
break
|
480 |
+
else:
|
481 |
+
logger.warning("No 'actionable_okrs' found in reconstruction cache for display.")
|
482 |
return get_empty_okr_state()
|
483 |
|
484 |
actionable_okrs = raw_results.get("actionable_okrs", {})
|
|
|
488 |
logger.info("No OKRs found in 'actionable_okrs' list.")
|
489 |
return get_empty_okr_state()
|
490 |
|
491 |
+
# Rest of the function remains the same...
|
492 |
+
|
493 |
# Calculate statistics for the stats bar
|
494 |
total_objectives = len(okrs_list)
|
495 |
total_key_results = sum(len(okr.get('key_results', [])) for okr in okrs_list)
|