Skip to content

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

Closed

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

Activity

  1. heeoneie commented on Aug 27, 2026

    @heeoneie
    Contributor

    I'd like to take this one.

    Reproduced the shrink behaviour in isolation from the rules at agent-graph.css 40 and 174-186. One thing worth adding to the report: this is not zh-only. The label <span> has neither flex-shrink: 0 nor white-space: nowrap, so it shrinks to min-content in every locale — CJK just has no break opportunities, which is why it degrades to one character per line:

    zh   已选 / 择结 / 果        one char per line, as reported
    ko   선택된 / 결과            same cause, same shape
    en   Selected / results     two lines - milder, still wrong
    

    So the fix reads better as "the label never shrinks" than as "add nowrap for Chinese".

    Planning exactly what you proposed:

    .maka-agent-graph-results > span { flex: 0 0 auto; white-space: nowrap; }
    .maka-agent-graph-results code   { flex: 1 1 0; min-width: 0; }

    Will attach before/after covering zh, en and ko.

  2. me2seeks commented on Aug 27, 2026

    @me2seeks
    ContributorAuthor

    @heeoneie Thx for grabbing this! Since you're testing multiple languages, any chance you'd be interested in helping with our i18n? AI translations can be a bit weird sometimes, so a native speaker's touch would be amazing.

  3. added a commit that references this issue on Aug 27, 2026
  4. heeoneie commented on Aug 27, 2026

    @heeoneie
    Contributor

    One more thing from building the fix, since it widens what this issue reports: en breaks without any narrowing.

    At the panel's full measure — min(680px, 100% - 32px), no resize at all — Selected results already wraps to two lines. The label has no flex-shrink: 0, so it shrinks to min-content as soon as the code sibling is long enough, and two graph_record_* ids already are at 680px.

    So this reproduce step:

    当面板宽度为 min(var(--maka-chat-measure), calc(100% - var(--space-8))) 且 code 内容超过剩余宽度时

    is not a narrowing precondition for en — it is already true at the default width. zh is the louder symptom (one character per line), but it is the same shrink, not a separate zh-only case.

    Captured at both 430px and 980px in #3970.

  5. heeoneie commented on Aug 27, 2026

    @heeoneie
    Contributor

    Correction to my first comment: I listed a ko row as if Korean were a shipped locale. It isn't — UI_LOCALES in packages/core/src/ui-locale.ts is ['zh', 'en'], and this panel only branches on locale === 'zh'. The mechanism holds for any script without break opportunities, but I shouldn't have presented ko as an observed case. #3970 covers zh and en only.

    @me2seeks On i18n — yes, I'd be glad to help. Korean is my native language, so if ko is something the project wants to add I can carry the copy. For the existing zh/en surfaces I can review wording rather than translate.

    Where would you like me to start — is there an issue tracking the locale catalogs, or should I open one? I noticed #3962 is already working the presentation boundary for built-in tool names, so I'd want to avoid cutting across that.

    And thanks for the screenshot on a fork branch — that made the zh case reproducible without your local file.

  6. changed the title [-]fix(desktop): Agent Graph 已选择结果因 flex 挤压竖排显示[/-] [+]fix(desktop): prevent Agent Graph Selected results label from shrinking to min-content[/+] on Aug 27, 2026
  7. me2seeks commented on Aug 27, 2026

    @me2seeks
    ContributorAuthor

    Hi @heeoneie — thanks so much for picking up #3966, and for the really thorough digging you did!

    Really appreciate how you caught the en case at full width and how you corrected the ko note — that kind of care with UI_LOCALES being ['zh','en'] is exactly the standard we try to keep here. Your proposed 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; }

    looks spot-on, and the before/after you put in #3970 (430 + 980 × zh/en) makes it super easy to review.

    You kindly asked about i18n — yes, we'd love your help! Korean is a native perspective we don't have on the team, and even a wording review for the existing zh/en surfaces would be wonderful.

    To make it easy to get started without bumping into other work, I've opened a tracking issue for the new locale:

    #3974 feat(i18n): add Korean (ko) locale — it reuses the typed UiCatalog<T> contract from #2672 and the zh-TW pattern from #3853, so no new framework or global file.

    It's split into six small slices so you can claim just one at a time:

    Totally up to you where you'd like to begin — even starting with a review on slice 1 would be a huge help, and you can just comment I'd like to take #3975 (or whichever slice you prefer) on the relevant issue and I'll assign it right away. No rush at all.

    Thanks again for the great work on #3966 and for offering to help with Korean — it really means a lot to the project!

  8. added a commit that references this issue on Aug 27, 2026
    14e8c7b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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