Fix layout line wrapping and scrolling on smaller terminals
This commit is contained in:
parent
524ad77ea6
commit
478c628160
|
|
@ -855,7 +855,7 @@ export class TuiEngine {
|
||||||
let spacesCount = cols - leftLen - rightLen;
|
let spacesCount = cols - leftLen - rightLen;
|
||||||
if (spacesCount < 1) spacesCount = 1;
|
if (spacesCount < 1) spacesCount = 1;
|
||||||
|
|
||||||
console.log(leftHeader + ' '.repeat(spacesCount) + rightHeader);
|
console.log(leftHeader + ' '.repeat(spacesCount - 1) + rightHeader);
|
||||||
console.log(chalk.bold.hex('#4A90E2')('┌' + '─'.repeat(cols - 2) + '┐'));
|
console.log(chalk.bold.hex('#4A90E2')('┌' + '─'.repeat(cols - 2) + '┐'));
|
||||||
|
|
||||||
// Column widths
|
// Column widths
|
||||||
|
|
@ -884,8 +884,8 @@ export class TuiEngine {
|
||||||
);
|
);
|
||||||
console.log(chalk.bold.hex('#4A90E2')('├' + '─'.repeat(cols - 2) + '┤'));
|
console.log(chalk.bold.hex('#4A90E2')('├' + '─'.repeat(cols - 2) + '┤'));
|
||||||
|
|
||||||
// Table Content Height available (rows - 9 ensures total printed lines is rows - 1, preventing terminal scrolling)
|
// Table Content Height available (rows - 10 ensures total printed lines is rows - 2, preventing terminal scrolling)
|
||||||
const tableHeight = rows - 9;
|
const tableHeight = rows - 10;
|
||||||
|
|
||||||
if (this.state.issues.length === 0) {
|
if (this.state.issues.length === 0) {
|
||||||
const msg = this.state.loading ? 'Fetching issues from server...' : (this.state.error ? `Error: ${this.state.error}` : 'No issues found.');
|
const msg = this.state.loading ? 'Fetching issues from server...' : (this.state.error ? `Error: ${this.state.error}` : 'No issues found.');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue