Skip to content

Graph panel nodes invisible when DSH Desktop window is maximized #72

Closed

Description

@EdyeeBlank

Environment
DSH Desktop: v2.0.5 (Windows)
dsh-mneme: 0.7.9
Node.js: v24.19.0
embedProvider: local (Xenova/bge-small-zh-v1.5, CPU)
Bug description
The knowledge graph (图谱) panel loads data correctly (API returns nodes and edges), but nodes are invisible when the DSH Desktop window is maximized. When the window is restored to a smaller size (windowed mode), nodes appear and the graph is fully interactive.

Steps to reproduce
Open DSH Desktop, go to 记忆库 → 图谱
Search for any entity (e.g. "Git", "Milie猎头SaaS系统")
Observe the search results: "2 跳数" is displayed correctly, confirming data loads
Maximize the window → canvas area is empty, nodes invisible, dragging doesn't work
Restore to windowed mode (click the restore button) → nodes appear, graph is interactive
Evidence
API is working correctly: GET /api/dsh-mneme/semantic/graph/ego?entity=Milie猎头SaaS系统&depth=2 returns proper JSON with nodes and edges arrays (3 nodes, correct relations)
Entity extraction is working: SQLite database has 22 entities and 18 relations, all with correct types and relations
Search works: typing entity name in search box returns "2 跳数" and finds the entity
Graph component mounts: the hint text "点击节点展开 · 拖拽调整布局" renders at the bottom of the canvas area
Canvas is zero-size in maximized mode: nodes are rendered but not visible; dragging doesn't respond. Works fine in windowed mode.
Hypothesis
The graph canvas likely measures its container dimensions at mount time or during resize. When the DSH Desktop window is maximized, the graph panel's container might report a zero or incorrect size to the rendering library (SVG/Canvas), causing nodes to be drawn outside the visible viewport or into a collapsed element.

This is a classic issue with tab-based UIs where the rendering component initializes before the container has its final dimensions.

Suggestion
The graph component may need to:

Use a ResizeObserver to re-measure dimensions when the container resizes
Trigger a re-layout when the graph tab becomes active
Re-measure dimensions on window resize/maximize events
Additional info
DSH settings: entityExtractionEnabled: true, embedProvider: local
The graph data is definitely correct — API returns 22 entities and 18 relations
The issue only affects the rendering, not the data layer
DSH Desktop v2.0.5 on Windows, maximized window

Activity

  1. self-assigned this
    on Sep 7, 2026
  2. added
    bug功能异常、崩溃、数据错误(agent 诊断 → 人工确认)
    on Sep 7, 2026
  3. moved this from 📋 Backlog to 🔨 In Progress in dsh-mneme 任务看板on Sep 7, 2026
  4. moved this from 🔨 In Progress to ✅ Done in dsh-mneme 任务看板on Sep 8, 2026
  5. modusensus commented on Sep 8, 2026

    @modusensus
    Member

    感谢这份教科书级的问题报告——环境、复现步骤、证据分层、假设推演一应俱全,假设也完全正确。

    根因

    力导向模拟跑在 CSS 像素上,且用的是组件挂载时捕获的容器尺寸。窗口最大化时容器尺寸发生变化,节点仍被投射进旧的坐标系——落在可见 viewport 之外,拖拽交互自然也无响应。数据层(API / 实体抽取)自始至终是好的,这正是典型的「渲染组件初始化早于容器获得最终尺寸」问题,你的三条建议方向都对。

    修复(v0.7.11 已发布)

    采用了比 ResizeObserver 更彻底的方案:力导向模拟全程改用 SVG viewBox 用户单位(固定 380×300 user units),节点位置永远落在绘制区内,由浏览器把 viewBox 缩放到容器的实际 CSS 尺寸。这样挂载时机、窗口尺寸变化、最大化/还原、缩放比例全部免疫——不需要监听 resize 也不需要重新布局,任何容器尺寸下节点都可见、可拖拽。

    请升级

    你当前是 0.7.9,升级到 ≥ 0.7.11 即可修复(当前最新为 v0.7.15,npm 或 dshmarket 均可更新)。升级后如果在最大化场景仍有异常,欢迎重开本 issue 并附截图。

  6. modusensus commented on Sep 8, 2026

    @modusensus
    Member

    已在 v0.7.11 修复并随后的版本持续验证(issue 报告的 0.7.9 → 请升级至 ≥ 0.7.11,当前最新 v0.7.15)。如升级后仍可复现,欢迎重开。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug功能异常、崩溃、数据错误(agent 诊断 → 人工确认)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions