pinokiod 7.5.53 → 8.0.0
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
CHANGED
package/server/public/style.css
CHANGED
|
@@ -1433,6 +1433,17 @@ body.main-sidebar-page main > .task-container {
|
|
|
1433
1433
|
margin-top: 8px;
|
|
1434
1434
|
padding-top: 0;
|
|
1435
1435
|
}
|
|
1436
|
+
.main-sidebar .main-sidebar-section-connect {
|
|
1437
|
+
margin-top: auto;
|
|
1438
|
+
padding-top: 10px;
|
|
1439
|
+
}
|
|
1440
|
+
.main-sidebar .main-sidebar-section-connect::before {
|
|
1441
|
+
content: "";
|
|
1442
|
+
display: block;
|
|
1443
|
+
height: 1px;
|
|
1444
|
+
margin-bottom: 10px;
|
|
1445
|
+
background: var(--pinokio-sidebar-separator);
|
|
1446
|
+
}
|
|
1436
1447
|
.main-sidebar-section-title {
|
|
1437
1448
|
min-height: 20px;
|
|
1438
1449
|
display: flex;
|
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
<a href="/connect" class="tab <%= sidebarSelected === 'connect' ? 'selected' : '' %>"><i class="fa-solid fa-plug"></i><div class='caption'>Login</div></a>
|
|
41
41
|
<a class="tab <%= sidebarSelected === 'settings' ? 'selected' : '' %>" href="/home?mode=settings"><i class="fa-solid fa-gear"></i><div class='caption'>Settings</div></a>
|
|
42
42
|
</div>
|
|
43
|
+
|
|
44
|
+
<div class='main-sidebar-section main-sidebar-section-connect' aria-label="Community links">
|
|
45
|
+
<a class="tab" href="https://x.com/cocktailpeanut" target="_blank" rel="noopener noreferrer" data-main-sidebar-browser-link><i class="fa-brands fa-x-twitter"></i><div class='caption'>Updates</div></a>
|
|
46
|
+
<a class="tab" href="https://discord.gg/TQdNwadtE4" target="_blank" rel="noopener noreferrer" data-main-sidebar-browser-link><i class="fa-brands fa-discord"></i><div class='caption'>Discord</div></a>
|
|
47
|
+
<a class="tab" href="https://pinokiocomputer.substack.com" target="_blank" rel="noopener noreferrer" data-main-sidebar-browser-link><i class="fa-solid fa-newspaper"></i><div class='caption'>Newsletter</div></a>
|
|
48
|
+
</div>
|
|
43
49
|
</nav>
|
|
44
50
|
</aside>
|
|
45
51
|
<script>
|
|
@@ -50,6 +56,23 @@
|
|
|
50
56
|
const sidebar = document.getElementById("main-sidebar");
|
|
51
57
|
const peekTrigger = document.querySelector("[data-main-sidebar-peek-trigger]");
|
|
52
58
|
|
|
59
|
+
if (sidebar) {
|
|
60
|
+
sidebar.querySelectorAll("[data-main-sidebar-browser-link]").forEach((link) => {
|
|
61
|
+
link.addEventListener("click", (event) => {
|
|
62
|
+
const href = link.getAttribute("href") || "";
|
|
63
|
+
if (!href) return;
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
const agent = document.body ? document.body.getAttribute("data-agent") : null;
|
|
67
|
+
if (agent === "electron") {
|
|
68
|
+
window.open(href, "_blank", "browser");
|
|
69
|
+
} else {
|
|
70
|
+
window.open(href, "_blank");
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
53
76
|
const initHomeServerStatusBadge = () => {
|
|
54
77
|
if (!sidebar || window.__pinokioMainSidebarHomeServerStatusInit) return;
|
|
55
78
|
const homeServerTab = sidebar.querySelector("[data-main-sidebar-home-server-tab]");
|
|
@@ -59,3 +59,26 @@ test('main sidebar no longer renders peer rows or phone access modal', async ()
|
|
|
59
59
|
assert.doesNotMatch(source, /peer_access_router_installed/)
|
|
60
60
|
assert.doesNotMatch(style, /main-sidebar-peer/)
|
|
61
61
|
})
|
|
62
|
+
|
|
63
|
+
test('main sidebar renders external community links as a footer cluster', async () => {
|
|
64
|
+
const source = await fs.readFile(sidebarFile, 'utf8')
|
|
65
|
+
const style = await fs.readFile(path.resolve(__dirname, '..', 'server', 'public', 'style.css'), 'utf8')
|
|
66
|
+
|
|
67
|
+
const configureIndex = source.indexOf('aria-label="Configure"')
|
|
68
|
+
const connectedIndex = source.indexOf('aria-label="Community links"')
|
|
69
|
+
|
|
70
|
+
assert.notEqual(configureIndex, -1)
|
|
71
|
+
assert.notEqual(connectedIndex, -1)
|
|
72
|
+
assert.ok(configureIndex < connectedIndex)
|
|
73
|
+
assert.match(source, /main-sidebar-section-connect/)
|
|
74
|
+
assert.doesNotMatch(source, /main-sidebar-section-connect[\s\S]*main-sidebar-section-title/)
|
|
75
|
+
assert.doesNotMatch(source, />Stay Connected</)
|
|
76
|
+
assert.match(source, /href="https:\/\/x\.com\/cocktailpeanut"[^>]*target="_blank"[^>]*rel="noopener noreferrer"[^>]*data-main-sidebar-browser-link[\s\S]*fa-brands fa-x-twitter[\s\S]*Updates/)
|
|
77
|
+
assert.match(source, /href="https:\/\/discord\.gg\/TQdNwadtE4"[^>]*target="_blank"[^>]*rel="noopener noreferrer"[^>]*data-main-sidebar-browser-link[\s\S]*fa-brands fa-discord[\s\S]*Discord/)
|
|
78
|
+
assert.match(source, /href="https:\/\/pinokiocomputer\.substack\.com"[^>]*target="_blank"[^>]*rel="noopener noreferrer"[^>]*data-main-sidebar-browser-link[\s\S]*fa-solid fa-newspaper[\s\S]*Newsletter/)
|
|
79
|
+
assert.doesNotMatch(source, /main-sidebar-section-connect[\s\S]*features="browser"/)
|
|
80
|
+
assert.match(source, /window\.open\(href, "_blank", "browser"\)/)
|
|
81
|
+
assert.match(source, /window\.open\(href, "_blank"\)/)
|
|
82
|
+
assert.match(style, /\.main-sidebar \.main-sidebar-section-connect \{[\s\S]*margin-top:\s*auto/)
|
|
83
|
+
assert.match(style, /\.main-sidebar \.main-sidebar-section-connect::before \{[\s\S]*background:\s*var\(--pinokio-sidebar-separator\)/)
|
|
84
|
+
})
|