@davmash/bygone 0.8.8 → 0.8.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.
@@ -9210,7 +9210,7 @@ var require_package = __commonJS({
9210
9210
  displayName: "Bygone",
9211
9211
  desktopName: "com.davidmashburn.bygone.desktop",
9212
9212
  description: "See how change happened. Visual diff and file history for VS Code.",
9213
- version: "0.8.8",
9213
+ version: "0.8.9",
9214
9214
  author: "David Mashburn",
9215
9215
  license: "MIT",
9216
9216
  private: false,
@@ -9418,6 +9418,7 @@ var require_package = __commonJS({
9418
9418
  "bundle:check": "node ./scripts/check-bundle-size.mjs",
9419
9419
  "security:audit": "npm audit --audit-level=high",
9420
9420
  "dev:sync": "node ./scripts/dev-sync.mjs",
9421
+ reinstall: "node ./scripts/dev-sync.mjs --install-only",
9421
9422
  "release:check": "npm run security:audit && npm test && npm run bundle:check && npm run lint && npm run package:vsix && npm run package:npm && npm run package:npm:dry-run",
9422
9423
  "release:build": "node ./scripts/release.mjs",
9423
9424
  "release:publish": "node ./scripts/release.mjs --publish",
@@ -24733,7 +24734,8 @@ async function sendCurrentDirectoryHistoryEntry() {
24733
24734
  activePairIndex: pairs.length > 0 ? pairs.length - 1 : null,
24734
24735
  history: { ...history, fileName: relativePath },
24735
24736
  fileNavigation: buildDirectoryHistoryFileNavigationState(session.dirHistory, entry),
24736
- canReturnToDirectory: true
24737
+ canReturnToDirectory: true,
24738
+ revealFirstChangeInEachPanel: true
24737
24739
  });
24738
24740
  refreshSessionWindowTitle();
24739
24741
  if (launchArguments.kind === "smoke-directory-history") {
@@ -25937,11 +25939,12 @@ async function sendCurrentMultiDiff() {
25937
25939
  canReturnToDirectory: Boolean(session.returnDirectory),
25938
25940
  directoryNavigation: buildDirectoryDrilldownNavigationState(),
25939
25941
  fileNavigation: buildStandaloneFileNavigationState(),
25940
- mutationEnabled: !isDirectoryDrilldown
25942
+ mutationEnabled: !isDirectoryDrilldown,
25943
+ revealFirstChangeInEachPanel: isDirectoryDrilldown
25941
25944
  });
25942
25945
  refreshSessionWindowTitle();
25943
25946
  if (mainWindow && !mainWindow.isDestroyed()) {
25944
- setTimeout(() => {
25947
+ const inspectMultiDiff = () => {
25945
25948
  void mainWindow.webContents.executeJavaScript(`(() => ({
25946
25949
  fileInfo: document.getElementById('file-info')?.textContent,
25947
25950
  panelCount: document.querySelectorAll('.multi-pane').length,
@@ -25955,6 +25958,11 @@ async function sendCurrentMultiDiff() {
25955
25958
  inlineAdjacentEdgeCount: document.querySelectorAll('.view-line span.bygone-paired-edge-left, .view-line span.bygone-one-sided-edge-left').length
25956
25959
  }))()`).then((snapshot) => {
25957
25960
  if (smokeTestMode) {
25961
+ const diffReady = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0;
25962
+ if (!diffReady) {
25963
+ setTimeout(inspectMultiDiff, 100);
25964
+ return;
25965
+ }
25958
25966
  finalizeSmokeTest(snapshot);
25959
25967
  return;
25960
25968
  }
@@ -25968,7 +25976,8 @@ async function sendCurrentMultiDiff() {
25968
25976
  app.exit(1);
25969
25977
  }
25970
25978
  });
25971
- }, 400);
25979
+ };
25980
+ setTimeout(inspectMultiDiff, smokeTestMode ? 100 : 400);
25972
25981
  }
25973
25982
  }
25974
25983
  async function sendCurrentSession() {
@@ -26054,10 +26063,15 @@ async function compareDirectoryHistoryTestFiles() {
26054
26063
  runGit(["init"], root);
26055
26064
  runGit(["config", "user.name", "Bygone Smoke Test"], root);
26056
26065
  runGit(["config", "user.email", "bygone-smoke@example.invalid"], root);
26057
- fs7.writeFileSync(filePath, "const alpha = 1;\nconst stable = true;\n", "utf8");
26066
+ const unchangedPrefix = Array.from({ length: 80 }, (_, index) => `const context${index} = true;`).join("\n");
26067
+ fs7.writeFileSync(filePath, `${unchangedPrefix}
26068
+ const alpha = 1;
26069
+ `, "utf8");
26058
26070
  runGit(["add", "history-smoke.js"], root);
26059
26071
  runGit(["commit", "-m", "initial"], root);
26060
- fs7.writeFileSync(filePath, "const alpha = 2;\nconst stable = false;\n", "utf8");
26072
+ fs7.writeFileSync(filePath, `${unchangedPrefix}
26073
+ const alpha = 2;
26074
+ `, "utf8");
26061
26075
  runGit(["add", "history-smoke.js"], root);
26062
26076
  runGit(["commit", "-m", "change history smoke fixture"], root);
26063
26077
  await openDirectoryHistory(root, false, { skipConfirm: true, source: { kind: "synthetic" } });
@@ -26072,9 +26086,11 @@ function pollDirectoryHistoryDrilldownSmoke() {
26072
26086
  changePosition: document.getElementById('change-position')?.textContent,
26073
26087
  panelPositions: [...document.querySelectorAll('.multi-pane-position')].map((element) => element.textContent),
26074
26088
  decoratedLineCount: document.querySelectorAll('.bygone-paired-line, .bygone-one-sided-line').length,
26089
+ visibleChangePaneCount: [...document.querySelectorAll('.multi-pane-content .view-lines')]
26090
+ .filter((element) => element.textContent.includes('alpha')).length,
26075
26091
  diffWorkerUrl: window.__BYGONE_HOST__?.diffWorkerUrl
26076
26092
  }))()`).then((snapshot) => {
26077
- const ready = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0;
26093
+ const ready = /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && snapshot.visibleChangePaneCount === 2;
26078
26094
  if (ready) {
26079
26095
  finalizeSmokeTest(snapshot);
26080
26096
  return;
@@ -27457,7 +27473,7 @@ function shellQuote(value) {
27457
27473
  function finalizeSmokeTest(snapshot) {
27458
27474
  clearTimeout(smokeTimeout);
27459
27475
  smokeTimeout = void 0;
27460
- const passed = Boolean(snapshot && (snapshot.fileInfo === "Comparing test-file-1.js and test-file-2.js" && snapshot.file1 === "test-file-1.js" && snapshot.file2 === "test-file-2.js" && /^1 \/ \d+$/.test(snapshot.changePosition) && snapshot.pairedLineCount > 0 && snapshot.oneSidedLineCount > 0 && snapshot.inlineHighlightCount > 0 && snapshot.activeDiffCount === 0 && isVisibleBackground(snapshot.pairedLineBackground) && isVisibleBackground(snapshot.inlineHighlightBackground) && snapshot.pairedLineBackground !== snapshot.inlineHighlightBackground || snapshot.fileInfo === `Comparing ${snapshot.panelCount} files` && snapshot.panelCount >= 2 && snapshot.gutterCount === snapshot.panelCount - 1 && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl) && snapshot.activeDiffCount === 0 && snapshot.adjacentEdgeCount === 0 && snapshot.inlineAdjacentEdgeCount === 0 || snapshot.directoryRailVisible === true && snapshot.directoryRailItemCount === 2 && snapshot.directoryReturnVisible === true && snapshot.directorySidebarToggleVisible === true && snapshot.directorySidebarToggleWorked === true && snapshot.nextFileEnabled === true || snapshot.directoryHistoryDrilldown === true && snapshot.fileInfo === "Comparing 2 files" && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl)));
27476
+ const passed = Boolean(snapshot && (snapshot.fileInfo === "Comparing test-file-1.js and test-file-2.js" && snapshot.file1 === "test-file-1.js" && snapshot.file2 === "test-file-2.js" && /^1 \/ \d+$/.test(snapshot.changePosition) && snapshot.pairedLineCount > 0 && snapshot.oneSidedLineCount > 0 && snapshot.inlineHighlightCount > 0 && snapshot.activeDiffCount === 0 && isVisibleBackground(snapshot.pairedLineBackground) && isVisibleBackground(snapshot.inlineHighlightBackground) && snapshot.pairedLineBackground !== snapshot.inlineHighlightBackground || snapshot.fileInfo === `Comparing ${snapshot.panelCount} files` && snapshot.panelCount >= 2 && snapshot.gutterCount === snapshot.panelCount - 1 && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl) && snapshot.activeDiffCount === 0 && snapshot.adjacentEdgeCount === 0 && snapshot.inlineAdjacentEdgeCount === 0 || snapshot.directoryRailVisible === true && snapshot.directoryRailItemCount === 2 && snapshot.directoryReturnVisible === true && snapshot.directorySidebarToggleVisible === true && snapshot.directorySidebarToggleWorked === true && snapshot.nextFileEnabled === true || snapshot.directoryHistoryDrilldown === true && snapshot.fileInfo === "Comparing 2 files" && /^1 \/ [1-9]\d*$/.test(snapshot.changePosition) && snapshot.panelPositions.some((position) => /^1 \/ [1-9]\d*$/.test(position)) && snapshot.decoratedLineCount > 0 && snapshot.visibleChangePaneCount === 2 && /\/media\/diff\.worker\.js$/.test(snapshot.diffWorkerUrl)));
27461
27477
  if (!passed) {
27462
27478
  console.error(`Bygone smoke test failed: unexpected diff DOM snapshot ${JSON.stringify(snapshot)}`);
27463
27479
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davmash/bygone",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "See how change happened. Visual diff and file history.",
5
5
  "author": "David Mashburn",
6
6
  "license": "MIT",