Skip to content

Commit 0ddbe05

Browse files
fix: remove duplicate pagination text from commit lists
• Remove redundant pagination hints from preview command commit list • Remove redundant pagination hints from revert command commit list • Navigation hints are already displayed separately below the list • Prevents duplicate information and improves readability
1 parent af75ab5 commit 0ddbe05

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

src/cli/commands/preview/prompts.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,14 @@ export function displayCommitList(
8080
// Pagination info
8181
const endIndex = startIndex + displayCount;
8282
console.log();
83-
const paginationHints: string[] = [];
84-
if (hasPreviousPage) {
85-
paginationHints.push(`${textColors.brightYellow("p")} for previous batch`);
86-
}
87-
if (hasMorePages) {
88-
paginationHints.push(`${textColors.brightYellow("n")} for next batch`);
89-
}
90-
const paginationText = paginationHints.length > 0
91-
? ` (press ${paginationHints.join(", ")})`
92-
: "";
9383

9484
if (hasMore) {
9585
console.log(
96-
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}+${paginationText}`,
86+
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}+`,
9787
);
9888
} else {
9989
console.log(
100-
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}${paginationText}`,
90+
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}`,
10191
);
10292
}
10393
console.log();

src/cli/commands/revert/prompts.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,14 @@ export function displayRevertCommitList(
8787
// Pagination info
8888
const endIndex = startIndex + displayCount;
8989
console.log();
90-
const paginationHints: string[] = [];
91-
if (hasPreviousPage) {
92-
paginationHints.push(`${textColors.brightYellow("p")} for previous batch`);
93-
}
94-
if (hasMorePages) {
95-
paginationHints.push(`${textColors.brightYellow("n")} for next batch`);
96-
}
97-
const paginationText = paginationHints.length > 0
98-
? ` (press ${paginationHints.join(", ")})`
99-
: "";
10090

10191
if (hasMore) {
10292
console.log(
103-
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}+${paginationText}`,
93+
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}+`,
10494
);
10595
} else {
10696
console.log(
107-
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}${paginationText}`,
97+
` Showing commits ${startIndex + 1}-${endIndex} of ${totalFetched}`,
10898
);
10999
}
110100
console.log();

0 commit comments

Comments
 (0)