From c5d63499e999ea9c2fd7ad9b595bc810614bbf1f Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Tue, 7 Apr 2026 18:12:09 -0600 Subject: [PATCH] Remove muted facet rendering from facet bar and add Facets settings pane The facet bar now consistently shows only active facets across all apps. Muted facets are managed through a new "Facets" pane in journal settings where they can be viewed and unmuted. Removed: - .facet-pill.muted CSS rules from app.css - Muted class application from app.js pill rendering - include_muted parameter from _get_facets_data() - show_muted_facets() from App dataclass - "facets": {"muted": true} from settings app.json Added: - GET /api/facets/muted endpoint in settings routes - "Facets" nav item in settings navigation (desktop + mobile) - Facets settings pane with muted facet list and unmute action --- apps/__init__.py | 7 +-- apps/settings/app.json | 5 +- apps/settings/routes.py | 22 ++++++++ apps/settings/workspace.html | 103 ++++++++++++++++++++++++++++++++++- convey/apps.py | 24 ++------ convey/static/app.css | 19 ------- convey/static/app.js | 5 -- 7 files changed, 130 insertions(+), 55 deletions(-) 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 { +