From caf3b7493137d52c8765bc298588882b3750238e Mon Sep 17 00:00:00 2001 From: thanhnv Date: Wed, 16 Sep 2026 00:38:56 +0900 Subject: [PATCH] fix: use native GraphRAG renderer on macOS --- presentation/graph/graph_renderer.py | 2 +- presentation/shared/web_engine_support.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/presentation/graph/graph_renderer.py b/presentation/graph/graph_renderer.py index 6a8493f..2d8a771 100644 --- a/presentation/graph/graph_renderer.py +++ b/presentation/graph/graph_renderer.py @@ -237,7 +237,7 @@ class GraphRenderer(QWidget): # ---- prewarm / scan lifecycle -------------------------------------------------- # def prewarm(self) -> None: """Pay for the graph view before it is clicked on, not during.""" - if not HAS_WEB_ENGINE or self.web is not None: + if self.web is not None: return self._ensure_web() if self._graph is None and self.path_edit.text().strip(): diff --git a/presentation/shared/web_engine_support.py b/presentation/shared/web_engine_support.py index 39f5ef4..a333c0f 100644 --- a/presentation/shared/web_engine_support.py +++ b/presentation/shared/web_engine_support.py @@ -27,7 +27,14 @@ def _frozen_onefile() -> bool: return True +# QtWebEngine is noisy and unreliable on the macOS runtime we support (GPU/ +# helper-process failures leave the stacked view blank). The native Qt graph is +# already available and avoids that failure path entirely. +HAS_WEB_ENGINE = False + try: # WebEngine + WebChannel are optional PySide6 add-ons + if sys.platform == "darwin": + raise ImportError("use native graph renderer on macOS") from PySide6.QtWebEngineWidgets import QWebEngineView # noqa: F401 from PySide6.QtWebChannel import QWebChannel # noqa: F401 HAS_WEB_ENGINE = not _frozen_onefile()