Skip to content

Commit 2694944

Browse files
committed
Improve commit message abbreviation
Uses different constant depending on monospace vs. sans serif.
1 parent aae91cc commit 2694944

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/desktop/src/components/CommitDetails.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
// Calculate approximately how many characters fit on one line, as a
3636
// function of container width as well as zoom level.
3737
// TODO: Turn this magic formula into something meaningful.
38-
const maxLength = $derived((messageWidthRem - 2) * 1.95 - (Math.pow(zoom, 2) - 1));
38+
const fontFactor = $rewrapCommitMessage ? 2.3 : 2;
39+
const maxLength = $derived((messageWidthRem - 2) * fontFactor - (Math.pow(zoom, 2) - 1));
3940
4041
const message = $derived(commit.message);
4142
const raw = $derived(splitMessage(message).description);

0 commit comments

Comments
 (0)