fix(app): keep diff rows aligned for blank lines

This commit is contained in:
Mohamed Boudra
2026-04-10 16:55:04 +07:00
parent 2f77674c55
commit b9a8ba054d
5 changed files with 187 additions and 37 deletions
+16
View File
@@ -0,0 +1,16 @@
interface HighlightLikeToken {
text: string;
}
// Preserve row height when a gutter or diff cell is intentionally blank.
export function formatDiffGutterText(lineNumber: number | null): string {
return lineNumber == null ? " " : String(lineNumber);
}
export function formatDiffContentText(content: string | null | undefined): string {
return content && content.length > 0 ? content : " ";
}
export function hasVisibleDiffTokens(tokens: HighlightLikeToken[] | null | undefined): boolean {
return Boolean(tokens?.some((token) => token.text.length > 0));
}