git-watchtower 1.9.7 → 1.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1669,6 +1669,7 @@ async function pollGitChanges() {
1669
1669
  const currentBranches = store.get('branches');
1670
1670
 
1671
1671
  // Detect NEW branches (not seen before)
1672
+ const NEW_BADGE_TTL = 30000; // 30 seconds
1672
1673
  const newBranchList = [];
1673
1674
  for (const branch of allBranches) {
1674
1675
  if (!knownBranchNames.has(branch.name)) {
@@ -1677,9 +1678,9 @@ async function pollGitChanges() {
1677
1678
  addLog(`New branch: ${branch.name}`, 'success');
1678
1679
  newBranchList.push(branch);
1679
1680
  } else {
1680
- // Preserve isNew flag from previous poll cycle for branches not yet switched to
1681
+ // Preserve isNew flag from previous poll cycle, but expire after TTL
1681
1682
  const prevBranch = currentBranches.find(b => b.name === branch.name);
1682
- if (prevBranch && prevBranch.isNew) {
1683
+ if (prevBranch && prevBranch.isNew && (now - prevBranch.newAt) < NEW_BADGE_TTL) {
1683
1684
  branch.isNew = true;
1684
1685
  branch.newAt = prevBranch.newAt;
1685
1686
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
@@ -194,12 +194,12 @@ function renderBranchList(state, write) {
194
194
  const aheadBehind = state.aheadBehindCache ? state.aheadBehindCache.get(branch.name) : null;
195
195
 
196
196
  // Diff stats: two right-justified columns, always reserving space for alignment
197
- // Col 1: "+N/-N commits" right-justified in 16 chars
198
- // Col 2: "+N/-N lines" right-justified in 14 chars
199
- // Total: 16 + 1(gap) + 14 + 1(gap) = 32 chars always reserved
200
- const COL_COMMITS = 16;
201
- const COL_LINES = 14;
202
- const DIFF_TAG_FIXED_LEN = COL_COMMITS + 1 + COL_LINES + 1; // 32 total
197
+ // Col 1: "+N/-N commits" right-justified in 18 chars (accommodates e.g. "+18/-967 commits")
198
+ // Col 2: "+N/-N lines" right-justified in 18 chars (accommodates e.g. "+3.5k/-1.9k lines")
199
+ // Total: 18 + 1(gap) + 18 + 1(gap) = 38 chars always reserved
200
+ const COL_COMMITS = 18;
201
+ const COL_LINES = 18;
202
+ const DIFF_TAG_FIXED_LEN = COL_COMMITS + 1 + COL_LINES + 1; // 38 total
203
203
  let diffTag = ' '.repeat(DIFF_TAG_FIXED_LEN); // blank by default for alignment
204
204
  if (!isBranchBase && !branch.isDeleted && aheadBehind) {
205
205
  const a = aheadBehind.ahead;