Repository navigation
fix(cli): make the non-VP transcript scrollable during multi-agent runs #6015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
29efac1
fix(cli): stop scroll snap-back during parallel-agent runs (non-VP)
qinqi-ali 94aa6ec
fix(cli): gate SGR mouse tracking to VP mode so non-VP keeps native s…
qinqi-ali 7abe04f
fix(cli): tighten inline parallel-agent windowing and drop redundant …
qinqi-ali 0a2a3e1
fix(cli): cap inline parallel-agents only in the live phase + test gaps
qinqi-ali 0ee8cc2
test(cli): pin live-only height cap and windowing boundary
qinqi-ali 394bc6a
docs(cli): document the 1-line-per-AgentRow invariant the height back…
qinqi-ali dd9f25b
test(cli): pin the windowing `>` boundary at the exact-fit budget
qinqi-ali 58601ae
docs(cli): correct InlineParallelAgentsDisplay docstring to dual-phas…
qinqi-ali 14b4171
fix(cli): enforce 1-line-per-element with wrap="truncate-end" everywhere
qinqi-ali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2025 Qwen Team | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { describe, it, expect, vi, beforeEach } from 'vitest'; | ||
| import { render } from 'ink-testing-library'; | ||
| import { ThinkingViewer } from './ThinkingViewer.js'; | ||
| import { useMouseEvents } from './../hooks/useMouseEvents.js'; | ||
|
|
||
| // The modal viewer owns the wheel for its own scrolling and renders on the | ||
| // alternate screen in non-VP mode (no native scrollback to protect), so it must | ||
| // subscribe WITH `bypassVpGate: true`. Mirror of the HistoryItemDisplay test | ||
| // that pins the OPPOSITE contract for the click-to-expand handler. The gating | ||
| // logic itself lives in useMouseEvents (covered by its own test); here we only | ||
| // pin the option ThinkingViewer passes. | ||
| vi.mock('./../hooks/useMouseEvents.js', () => ({ | ||
| useMouseEvents: vi.fn(), | ||
| })); | ||
|
|
||
| // Avoid the real terminal-size / keypress / frame-flush wiring — they are not | ||
| // part of the contract under test and would otherwise require a TTY + context. | ||
| vi.mock('./../hooks/useTerminalSize.js', () => ({ | ||
| useTerminalSize: () => ({ rows: 24, columns: 80 }), | ||
| })); | ||
| vi.mock('./../hooks/useKeypress.js', () => ({ | ||
| useKeypress: vi.fn(), | ||
| })); | ||
| vi.mock('./../hooks/use-frame-coalesced-flush.js', () => ({ | ||
| useFrameCoalescedFlush: () => ({ schedule: vi.fn(), cancel: vi.fn() }), | ||
| })); | ||
|
|
||
| describe('ThinkingViewer mouse tracking', () => { | ||
| beforeEach(() => { | ||
| vi.mocked(useMouseEvents).mockClear(); | ||
| }); | ||
|
|
||
| it('subscribes the wheel handler WITH bypassVpGate (works in non-VP)', () => { | ||
| render( | ||
| <ThinkingViewer | ||
| data={{ text: 'Inspecting the repository', durationMs: 1200 }} | ||
| onClose={() => {}} | ||
| useAlternateScreen={false} | ||
| />, | ||
| ); | ||
| expect(vi.mocked(useMouseEvents)).toHaveBeenCalled(); | ||
| const opts = vi.mocked(useMouseEvents).mock.calls.at(-1)?.[1]; | ||
| expect(opts?.isActive).toBe(true); | ||
| // Must bypass the VP gate, or wheel scrolling in the modal silently breaks | ||
| // in non-VP mode. | ||
| expect(opts?.bypassVpGate).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The comment says "Click-to-expand" and "the block still expands via Alt+T," but the click handler at line 134 calls
openThinkingViewer(...)— it opens the modal viewer, not inline expansion. Alt+T (AppContainer.tsx:3290) callssetThoughtExpanded— it toggles inline expansion only. These are distinct features. After the VP gate, the ThinkingViewer modal becomes completely inaccessible in non-VP mode: no keyboard shortcut opens it, and the click handler is dormant. The comment's "the block still expands via Alt+T" is misleading because it implies the click's functionality (modal) is covered by Alt+T (inline), when they are different.— glm-5.2 via Qwen Code /review