mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-10 01:39:25 +00:00
fix(kimi-code): reduce /btw panel max height to one-third of terminal (#802)
This commit is contained in:
parent
c48e823f61
commit
aa1896ca74
3 changed files with 9 additions and 4 deletions
5
.changeset/reduce-btw-panel-height.md
Normal file
5
.changeset/reduce-btw-panel-height.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@moonshot-ai/kimi-code": patch
|
||||
---
|
||||
|
||||
Reduce the maximum height of the /btw side panel from half to one-third of the terminal.
|
||||
|
|
@ -185,7 +185,7 @@ export class BtwPanelComponent implements Component {
|
|||
private collapsedBodyLimit(): number | undefined {
|
||||
const terminalRows = this.options.terminalRows();
|
||||
if (!Number.isFinite(terminalRows) || terminalRows <= 0) return undefined;
|
||||
const maxPanelLines = Math.max(MIN_COLLAPSED_PANEL_LINES, Math.floor(terminalRows / 2));
|
||||
const maxPanelLines = Math.max(MIN_COLLAPSED_PANEL_LINES, Math.floor(terminalRows / 3));
|
||||
return Math.max(1, maxPanelLines - 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1762,10 +1762,10 @@ command = "vim"
|
|||
expect(finalLines.at(-1)).toMatch(/^│\s+│$/);
|
||||
});
|
||||
|
||||
it('caps /btw height to half the terminal and supports scrolling', async () => {
|
||||
it('caps /btw height to one-third of the terminal and supports scrolling', async () => {
|
||||
const session = makeSession();
|
||||
const { driver } = await makeDriver(session);
|
||||
setTerminalRows(driver, 12);
|
||||
setTerminalRows(driver, 15);
|
||||
await openBtwPanel(driver, session, 'question 1');
|
||||
|
||||
const panel = getMountedBtwPanel(driver);
|
||||
|
|
@ -1778,7 +1778,7 @@ command = "vim"
|
|||
}
|
||||
|
||||
const collapsed = panel.render(80).map(stripSgr);
|
||||
expect(collapsed).toHaveLength(6);
|
||||
expect(collapsed).toHaveLength(5);
|
||||
expect(collapsed.join('\n')).toContain('BTW ─ Esc close · ↑↓ scroll');
|
||||
expect(collapsed.join('\n')).not.toContain('ctrl+o expand');
|
||||
expect(collapsed.join('\n')).toContain('question 8');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue