Skip to content

fix(desktop): prevent Agent Graph Selected results label from shrinking to min-content #3966

Description

@me2seeks

What happened

The Selected results / 已选择结果 row at the bottom of the Desktop Agent Graph panel wraps instead of staying on one line.

  • At the panel's full measure min(680px, calc(100% - 32px)) with no narrowing at all, Selected results already wraps to two lines when the code sibling holds two graph_record_* ids. The span label has no flex-shrink: 0 / white-space: nowrap, so it shrinks to min-content as soon as the code is long enough. zh is the louder symptom(one character per line), en wraps to two lines — same shrink, not a separate zh-only case. Captured at both 430px and 980px in fix(desktop): keep Agent Graph results label from shrinking #3970.

Root cause in apps/desktop/src/renderer/agent-graph-panel.tsx:484:

<div className="maka-agent-graph-results">
  <span>{copy.selectedResults}</span>
  <code>{snapshot.finish.resultIds.join(', ')}</code>
</div>

paired with apps/desktop/src/renderer/styles/agent-graph.css:40:

.maka-agent-graph-heading,
.maka-agent-graph-heading > div,
.maka-agent-graph-results { display:flex; align-items:center; gap:var(--space-2); }
.maka-agent-graph-results code { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

code is a single-line graph_record_xxx, graph_record_yyy with white-space: nowrap. The span defaults to min-width: auto; flex: 0 1 auto without white-space: nowrap. Under flex shrink the label collapses to min-content (one character for scripts without break opportunities), producing the vertical layout.

This affects all locales. The current shipped locales in packages/core/src/ui-locale.ts are ['zh', 'en'] (UI_LOCALES), and the panel only branches on locale === 'zh'. The mechanism holds for any script without break opportunities, but the observed cases are zh and en only.

How to reproduce

  1. Start Desktop and trigger a task that produces an Agent Graph finish (--graph or TUI /graph <task>) so snapshot.finish.resultIds contains two or more long graph_record_* ids.
  2. Open the session and look at the Selected results row at the bottom of the panel.
  3. At the default width min(680px, calc(100% - 32px)) with no resize, the label already wraps. Narrowing is not required for en; two ids are sufficient at 680px. zh shows the vertical per-character wrapping, en shows a two-line wrap.

Stable reproduction, no specific model required. Reproducible at both 430px and 980px (see #3970).

Environment

  • Maka version or commit: c66846ddb (fix/shell-run-legacy-visibility-tolerance branch, 2026-08-27)
  • OS and version: Linux
  • Surface: Desktop
  • Node.js version: >=22.19.0 (when running from source)

Logs, screenshots, or additional context

  • Screenshot:

issue-3966-agent-graph-selected-results-vertical

  • Expected: span stays on one line, code takes the remaining space with ellipsis. Suggested fix:
.maka-agent-graph-results > span { flex: 0 0 auto; white-space: nowrap; }
.maka-agent-graph-results code { flex: 1 1 0; min-width: 0; }
  • Related files: apps/desktop/src/renderer/agent-graph-panel.tsx:94,484, apps/desktop/src/renderer/styles/agent-graph.css:40,174
  • Label suggestion: bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions