Skip to content

fix(desktop): correct Agent Graph collapse chevron direction - #3466

Merged
Astro-Han merged 4 commits into
apache:mainfrom
1625567290:fix/agent-graph-collapse-chevron
Aug 23, 2026
Merged

fix(desktop): correct Agent Graph collapse chevron direction#3466
Astro-Han merged 4 commits into
apache:mainfrom
1625567290:fix/agent-graph-collapse-chevron

Conversation

@1625567290

Copy link
Copy Markdown
Contributor

Summary

  • keep the Agent Graph chevron pointing down while the panel is expanded
  • rotate the chevron only when aria-expanded is false so the collapsed state points up
  • cover disclosure state, collapsed state, and controlled content synchronization

Testing

  • npm --workspace @maka/desktop run build:main
  • node --test --test-name-pattern=AgentGraphPanel\ collapse apps/desktop/dist/main/tests/agent-graph-panel.test.js
  • npm run build
  • npm run lint
  • npm run format:check
  • npm run typecheck
  • real Chrome computed-style verification for expanded and collapsed states

The concurrent Desktop suite reached 1059/1061. The unrelated Git Review and MCP runtime failures both passed when rerun independently.

Closes #3407.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — this is the smallest correct fix at the existing disclosure-state seam. I reviewed exact head e3225248f02d675029971801a9385482fb15a002; aria-expanded, rendered content, and the collapsed data attribute stay under one state owner, and the current-head test check is green. I found no P0–P2 issues; one optional visual-regression hardening note is inline.

AI-assisted review disclosure: OpenAI Codex performed an independent exact-head review. I verified the state/CSS mapping, focused tests, live review state, mergeability, and current-head CI, and I independently made the approval decision.

Comment thread apps/desktop/src/main/__tests__/agent-graph-panel.test.ts Outdated
@1625567290
1625567290 force-pushed the fix/agent-graph-collapse-chevron branch from e322524 to 78911a8 Compare August 22, 2026 10:48

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for chasing this down — the chevron pointing the wrong way is one of those things that quietly makes a panel feel broken, and the actual fix is exactly right: the rotation belongs on the collapsed state, not the expanded one.

My comments are entirely about the 122 lines of test added around that one-line change, not about the change.

The short version is that CI is currently red on this PR, and what is failing is the new e2e itself — electron e2e/agent-graph-chevron-smoke.mjs exits non-zero in the Desktop e2e job. So as it stands the instrument added to protect a one-line CSS fix is the thing keeping the fix out of the tree. That is worth weighing directly rather than debugging around.

There is also a deeper problem with that smoke test that I would raise even if it were green, and it is the one I would most like you to look at: it loads agent-graph.css on its own into a bare data: URL with a hand-written <button>, so it verifies the rule in isolation. The regression it exists to catch — this rule losing to something else, or the markup drifting — happens in the real cascade with the app's full stylesheet and the real component. A test that cannot fail for the scenario it is guarding against is not paying for its cost, and this one costs a real Electron process per run.

getComputedStyle(...).transform === 'matrix(-1, 0, 0, -1, 0, 0)' also pins Chromium's matrix serialization rather than the intent. Rewriting the rule as rotate(-180deg) would be visually identical and would fail this assertion.

I am not asking you to add heavier coverage — the opposite. For a one-line CSS direction fix, I think the honest options are to keep the small jsdom assertion, or to accept that this class of bug is caught by looking at it. Both seem better than an Electron process that is red today and blind to the real failure mode.

No [P0]/[P1] — the product change is correct.

Review assisted by AI (Claude Opus 5). Findings were verified against the files and the failing CI run at this head; the reviewer is accountable for them.

Comment thread apps/desktop/e2e/agent-graph-chevron-smoke.mjs Outdated
Comment thread apps/desktop/e2e/agent-graph-chevron.spec.ts Outdated
Comment thread apps/desktop/src/main/__tests__/agent-graph-panel.test.ts Outdated
Comment thread apps/desktop/e2e/agent-graph-chevron-smoke.mjs Outdated
@1625567290
1625567290 force-pushed the fix/agent-graph-collapse-chevron branch from 78911a8 to 2e3f300 Compare August 23, 2026 02:35
@1625567290

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and reduced the PR to the one-line CSS selector correction. The isolated Electron smoke, its Playwright wrapper, and the unrelated disclosure-state test have been removed, addressing the four review threads and eliminating the Linux SUID sandbox failure path.

Local validation: Desktop workspace dependencies and main process build passed, the existing Agent Graph panel suite passed 14/14 before the unrelated added case was removed, Desktop typecheck passed, and lint, format, ASF header, and diff checks are clean. New CI is now pending on head 608251142.

@1625567290

Copy link
Copy Markdown
Contributor Author

Update: the rebased head is mergeable and has no unresolved review threads. Its new CI run is currently action_required, so it needs maintainer approval before the replacement check can execute.

@Astro-Han
Astro-Han merged commit 09e459b into apache:main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(desktop): Agent Graph panel collapse chevron points up when expanded and down when collapsed

2 participants