diff --git a/apps/__init__.py b/apps/__init__.py index e6d75bd95..48863b74c 100644 --- a/apps/__init__.py +++ b/apps/__init__.py @@ -26,7 +26,7 @@ app.json fields (all optional): { "icon": "🏠", # Emoji icon for menu bar (default: "📦") "label": "Custom Label", # Display label (default: title-cased app name) - "facets": {}, # Facet options: {"disabled": true} to hide, {"muted": true} to show disabled facets + "facets": {}, # Facet options: {"disabled": true} to hide facet bar "date_nav": true, # Show date navigation bar (default: false) "allow_future_dates": true # Allow future dates in month picker (default: false) } @@ -68,7 +68,6 @@ class App: # Facet configuration (optional, default {}) # Options: # - disabled: If true, facets bar is hidden for this app - # - muted: Include facets marked as disabled in facet.json facets_config: dict = field(default_factory=dict) # Date navigation (renders date nav below facet bar) @@ -81,10 +80,6 @@ class App: """Check if facets are enabled for this app.""" return not self.facets_config.get("disabled", False) - def show_muted_facets(self) -> bool: - """Check if muted/disabled facets should be shown.""" - return self.facets_config.get("muted", False) - def date_nav_enabled(self) -> bool: """Check if date nav is enabled for this app.""" return self.date_nav diff --git a/apps/settings/app.json b/apps/settings/app.json index f23432896..56edf1cbc 100644 --- a/apps/settings/app.json +++ b/apps/settings/app.json @@ -1,7 +1,4 @@ { "icon": "⚙️", - "label": "Settings", - "facets": { - "muted": true - } + "label": "Settings" } diff --git a/apps/settings/routes.py b/apps/settings/routes.py index fe963a6fd..987358963 100644 --- a/apps/settings/routes.py +++ b/apps/settings/routes.py @@ -1213,6 +1213,28 @@ def update_observe() -> Any: return jsonify({"error": str(e)}), 500 +@settings_bp.route("/api/facets/muted") +def get_muted_facets() -> Any: + """List muted facets.""" + try: + from think.facets import get_facets + + facets = get_facets() + muted = [ + { + "name": name, + "title": data.get("title", name), + "color": data.get("color", ""), + "emoji": data.get("emoji", ""), + } + for name, data in facets.items() + if data.get("muted", False) + ] + return jsonify({"facets": muted}) + except Exception as e: + return jsonify({"error": str(e)}), 500 + + @settings_bp.route("/api/facet", methods=["POST"]) def create_facet() -> Any: """Create a new facet. diff --git a/apps/settings/workspace.html b/apps/settings/workspace.html index 729699b28..1a513d5f1 100644 --- a/apps/settings/workspace.html +++ b/apps/settings/workspace.html @@ -1617,6 +1617,7 @@ input:checked + .slider:before { +