import gradio as gr from typing import Dict, Any, List, Optional import pandas as pd import logging logger = logging.getLogger(__name__) def create_enhanced_okr_tab(): """ Creates a modern, visually appealing OKR tab with improved layout and styling. This version includes robust support for Gradio's dark mode with multiple detection methods and fallback mechanisms. Returns: gr.HTML: The Gradio HTML component that will display the formatted OKRs. """ # Enhanced CSS for modern OKR styling with improved Dark Mode support okr_custom_css = """ """ with gr.Column(elem_classes=["okr-root-column"]): # Inject custom CSS and the enhanced theme-syncing JS gr.HTML(okr_custom_css) # Main OKR display area with enhanced styling okr_display_html = gr.HTML( value=get_initial_okr_display(), elem_classes=["okr-display"] ) return okr_display_html def get_initial_okr_display() -> str: """ Returns the initial HTML display for the OKR tab, showing a loading state. Returns: str: HTML string for the initial OKR display. """ return """