@youtyan/code-viewer 0.1.39 → 0.1.41
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.
- package/package.json +1 -1
- package/web/app.js +15 -5
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -7544,16 +7544,25 @@ ${frontmatter.yaml}
|
|
|
7544
7544
|
deps.setRange(from, to);
|
|
7545
7545
|
deps.syncRefInputs();
|
|
7546
7546
|
deps.cancelActiveSourceLoad("navigation");
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7547
|
+
const needDiffLoad = rangeChanged || !deps.getFiles().length;
|
|
7548
|
+
if (needDiffLoad) {
|
|
7549
|
+
deps.setRoute({ screen: "diff", range, path: entry.path, line });
|
|
7550
|
+
deps.setPageMode();
|
|
7551
7551
|
deps.removeStandaloneSource();
|
|
7552
7552
|
await deps.load();
|
|
7553
7553
|
if (stale())
|
|
7554
7554
|
return;
|
|
7555
7555
|
}
|
|
7556
7556
|
if (deps.getFiles().some((f2) => f2.path === entry.path)) {
|
|
7557
|
+
deps.setRoute({ screen: "diff", range, path: entry.path, line }, needDiffLoad);
|
|
7558
|
+
deps.setPageMode();
|
|
7559
|
+
const hasDiffCards = !!document.querySelector(".gdp-file-shell:not(.gdp-standalone-source)");
|
|
7560
|
+
if (!hasDiffCards) {
|
|
7561
|
+
deps.removeStandaloneSource();
|
|
7562
|
+
await deps.load();
|
|
7563
|
+
if (stale())
|
|
7564
|
+
return;
|
|
7565
|
+
}
|
|
7557
7566
|
deps.removeStandaloneSource();
|
|
7558
7567
|
deps.scrollToFile(entry.path, line);
|
|
7559
7568
|
await expandAnnotationContext(entry);
|
|
@@ -7563,7 +7572,7 @@ ${frontmatter.yaml}
|
|
|
7563
7572
|
const ref = annotationRefForEntry(entry);
|
|
7564
7573
|
const card = document.querySelector(".gdp-standalone-source");
|
|
7565
7574
|
const reusable = prevRoute.screen === "file" && prevRoute.path === entry.path && prevRoute.ref === ref && card?.dataset.path === entry.path && !!card.querySelector(".gdp-source-table");
|
|
7566
|
-
deps.setRoute({ screen: "file", path: entry.path, ref, view: "blob", line, range },
|
|
7575
|
+
deps.setRoute({ screen: "file", path: entry.path, ref, view: "blob", line, range }, needDiffLoad);
|
|
7567
7576
|
deps.setPageMode();
|
|
7568
7577
|
if (reusable && card) {
|
|
7569
7578
|
focusStandaloneSourceLines(card, entry);
|
|
@@ -15649,6 +15658,7 @@ ${frontmatter.yaml}
|
|
|
15649
15658
|
}
|
|
15650
15659
|
if (action === "annotation-next" || action === "annotation-previous") {
|
|
15651
15660
|
ANNOTATIONS_UI?.stepAnnotation(action === "annotation-next" ? 1 : -1);
|
|
15661
|
+
scheduleMainSurfaceFocus();
|
|
15652
15662
|
return true;
|
|
15653
15663
|
}
|
|
15654
15664
|
if (action === "start-g-sequence") {
|