Skip to content

Commit 54ff1f4

Browse files
committed
fix
1 parent 8ce18c3 commit 54ff1f4

4 files changed

Lines changed: 34 additions & 18 deletions

File tree

‎assets/web/css/application-browser.css‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@
530530
object-fit: cover;
531531
background: #e3ece7;
532532
}
533-
.application-phone[data-application-uid="uid1"] [data-application-phone-type="person"] img,
534533
.application-phone[data-application-uid="uid1"] .application-ai-portal-avatar img,
535534
.application-phone[data-application-uid="uid1"] .application-ai-message-avatar img.is-user {
536535
transform: scale(2.25);
@@ -627,9 +626,8 @@
627626
min-width: 0;
628627
min-height: 0;
629628
}
630-
.application-memory-cluster:nth-child(1) .application-memory-mosaic button:first-child,
631-
.application-memory-cluster:nth-child(4) .application-memory-mosaic button:first-child {
632-
grid-column: 1 / -1;
629+
.application-memory-cluster:nth-child(1) .application-memory-mosaic button {
630+
grid-row: 1 / -1;
633631
}
634632
.application-memory-cluster:nth-child(2) .application-memory-mosaic button:first-child {
635633
grid-row: 1 / -1;
@@ -642,6 +640,17 @@
642640
.application-memory-cluster:nth-child(3) .application-memory-mosaic button:nth-child(3) {
643641
grid-column: 1;
644642
}
643+
.application-memory-cluster:nth-child(4) .application-memory-mosaic button:first-child {
644+
grid-row: 1 / -1;
645+
grid-column: 1;
646+
}
647+
.application-memory-cluster:nth-child(4) .application-memory-mosaic button:nth-child(2),
648+
.application-memory-cluster:nth-child(4) .application-memory-mosaic button:nth-child(3) {
649+
grid-column: 2;
650+
}
651+
.application-memory-cluster:nth-child(4) [data-application-phone-type="person"] img {
652+
object-position: center;
653+
}
645654
.application-phone-apps button {
646655
position: relative;
647656
display: grid;

‎assets/web/js/main.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77

88
// Optional page analytics ---------------------------------------------------
99

10-
if (["http:", "https:"].includes(window.location.protocol)) {
10+
const pageViewCounter = document.querySelector("#busuanzi_value_page_pv");
11+
const isLocalPreview = ["localhost", "127.0.0.1", "::1"].includes(window.location.hostname);
12+
13+
if (["http:", "https:"].includes(window.location.protocol) && !isLocalPreview) {
1114
const busuanziScript = document.createElement("script");
1215
busuanziScript.defer = true;
1316
busuanziScript.src = "https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js";
1417
document.head.appendChild(busuanziScript);
18+
} else if (pageViewCounter) {
19+
pageViewCounter.textContent = "—";
1520
}
1621

1722
const languageToggle = document.querySelector("[data-toggle-lang]");

‎index.html‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -845,16 +845,6 @@ <h2 id="application-title">
845845
alt="" /></span
846846
><b data-lang="zh">动态</b><b data-lang="en">Posts</b>
847847
</button>
848-
<button
849-
type="button"
850-
data-application-phone-type="group_chat_members"
851-
>
852-
<span
853-
><img
854-
src="assets/web/memweb/uid10-group_chat_members-01.png"
855-
alt="" /></span
856-
><b data-lang="zh">群成员</b><b data-lang="en">Members</b>
857-
</button>
858848
</div>
859849
</section>
860850
<section class="application-memory-cluster">
@@ -1278,7 +1268,7 @@ <h2 id="institutions-title">Institutions</h2>
12781268
<span class="counter-item">
12791269
<span data-lang="zh">访问量</span>
12801270
<span data-lang="en">Page views</span>
1281-
<strong id="busuanzi_value_site_pv">--</strong>
1271+
<strong id="busuanzi_value_page_pv">--</strong>
12821272
</span>
12831273
</div>
12841274
</div>

‎tests/test_site_regression.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ def assert_release_metadata(page: Page) -> None:
8989
"Hidden video must not preload on initial page load",
9090
)
9191
require(
92-
page.locator("#busuanzi_value_site_pv").count() == 1,
92+
page.locator("#busuanzi_value_page_pv").count() == 1,
9393
"Required page-view counter target is missing",
9494
)
95+
require(
96+
page.locator("#busuanzi_value_page_pv").inner_text() == "—",
97+
"Local previews must not report production page views",
98+
)
99+
require(
100+
page.locator('script[src*="busuanzi"]').count() == 0,
101+
"Local previews must not load the production analytics script",
102+
)
95103

96104

97105
def assert_application_interactions(page: Page) -> None:
@@ -104,7 +112,11 @@ def assert_application_interactions(page: Page) -> None:
104112

105113
phone = page.locator(".application-phone")
106114
require(phone.get_attribute("data-application-phone-mode") == "home", "Phone must open at home")
107-
require(page.locator("[data-application-phone-type]").count() == 12, "Expected 12 image types")
115+
require(page.locator("[data-application-phone-type]").count() == 11, "Expected 11 image types")
116+
require(
117+
page.locator('[data-application-phone-type="group_chat_members"]').count() == 0,
118+
"Members must not duplicate the person index on the phone home screen",
119+
)
108120

109121
active_profile = page.locator('[data-application-phone-uid][aria-pressed="true"]')
110122
require(active_profile.get_attribute("data-application-phone-uid") == "uid10", "English must use uid10 initially")

0 commit comments

Comments
 (0)