fix: use native GraphRAG renderer on macOS

This commit is contained in:
thanhnv
2026-09-16 00:38:56 +09:00
parent c00b83cd1a
commit caf3b74931
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -237,7 +237,7 @@ class GraphRenderer(QWidget):
# ---- prewarm / scan lifecycle -------------------------------------------------- # # ---- prewarm / scan lifecycle -------------------------------------------------- #
def prewarm(self) -> None: def prewarm(self) -> None:
"""Pay for the graph view before it is clicked on, not during.""" """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 return
self._ensure_web() self._ensure_web()
if self._graph is None and self.path_edit.text().strip(): if self._graph is None and self.path_edit.text().strip():
@@ -27,7 +27,14 @@ def _frozen_onefile() -> bool:
return True 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 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.QtWebEngineWidgets import QWebEngineView # noqa: F401
from PySide6.QtWebChannel import QWebChannel # noqa: F401 from PySide6.QtWebChannel import QWebChannel # noqa: F401
HAS_WEB_ENGINE = not _frozen_onefile() HAS_WEB_ENGINE = not _frozen_onefile()