mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
Add server navigation controls across modes
This commit is contained in:
1 parent
c6eeb49f44
commit
319a16f384
18 files changed
+372
-63
No files matched your search
@@ -100,19 +100,27 @@ test("replacing a built-in public page requires an explicit user approval capabi
|
||||
assert.deepEqual(parseSkinPluginDocument(document).components[0].permissions, ["ui.surface.replace"]);
|
||||
});
|
||||
|
||||
test("custom surfaces can safely render and switch unified favorite and recent server entries", () => {
|
||||
const document = validDocument();
|
||||
document.components[0].permissions = ["servers.quickList.read", "servers.quickList.switch"];
|
||||
test("custom surfaces can safely render and switch unified favorite and recent server entries", () => {
|
||||
const document = validDocument();
|
||||
document.schemaVersion = 3;
|
||||
document.components[0].permissions = ["servers.quickList.read", "servers.quickList.switch"];
|
||||
document.components[0].actions = {
|
||||
switch: { type: "quickServers.switch", args: { quickServerId: "{{server.id}}" } },
|
||||
};
|
||||
document.components[0].root = {
|
||||
tag: "nav",
|
||||
repeat: { path: "servers.quickList", as: "server" },
|
||||
children: [{ tag: "button", events: { dblclick: "switch" }, children: [{ text: "{{server.label}}" }] }],
|
||||
children: [{
|
||||
tag: "button",
|
||||
attributes: { "aria-disabled": "{{server.switchRestricted}}", title: "{{server.switchTitle}}" },
|
||||
events: { dblclick: "switch" },
|
||||
children: [{ text: "{{server.label}}" }],
|
||||
}],
|
||||
};
|
||||
const parsed = parseSkinPluginDocument(document).components[0];
|
||||
assert.equal(parsed.root.repeat?.path, "servers.quickList");
|
||||
assert.equal(parsed.root.repeat?.path, "servers.quickList");
|
||||
assert.equal(parsed.root.children?.[0].attributes?.["aria-disabled"], "{{server.switchRestricted}}");
|
||||
assert.equal(parsed.root.children?.[0].attributes?.title, "{{server.switchTitle}}");
|
||||
assert.equal(parsed.actions.switch.type, "quickServers.switch");
|
||||
|
||||
document.components[0].permissions = ["servers.quickList.read"];
|
||||
|
||||
@@ -250,7 +250,7 @@ const COLLECTION_FIELDS: Record<string, ReadonlySet<string>> = {
|
||||
"session.channels": new Set(["id", "name", "parentId", "depth", "memberCount", "memberCountLabel", "maxClients", "maxClientsLimited", "current"]),
|
||||
"session.members": new Set(["id", "name", "avatarInitial", "channelId", "status", "speaking", "self", "screenSharing", "screenShareStreamId"]),
|
||||
"favorites.items": new Set(["id", "label", "current", "kind"]),
|
||||
"servers.quickList": new Set(["id", "label", "monogram", "icon", "tone", "current", "kind", "favorite"]),
|
||||
"servers.quickList": new Set(["id", "label", "monogram", "icon", "tone", "current", "switchRestricted", "switchTitle", "kind", "favorite"]),
|
||||
"chat.messages": new Set(["id", "author", "text", "time", "kind", "channelId"]),
|
||||
"screenShare.streams": new Set(["streamId", "source", "ownerClientId", "ownerNickname", "name", "audio", "viewerCount"]),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user