mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-01 02:52:49 +08:00
Add chrome.json slot mode "toolbar" with grouped and per-action recovery buttons, page-specific anchor candidates and sanitized toolbar style tokens. Keep the floating capsule as the bad-anchor fallback, hide the duplicate plugin launcher, and preserve legacy capsule slots. Document the full contract, add a minimal toolbar example package, and cover the new behavior in unit and browser tests.
3.1 KiB
3.1 KiB
Host chrome toolbar example
A minimal schema v3 open skin that docks the trusted recovery entry into the page header as host-owned buttons instead of the floating capsule shell. It is the smallest reference for chrome.json mode: "toolbar", page-specific anchor candidates, toolbar style tokens, application-library de-duplication and the floating-capsule fallback.
- Source: host-chrome-toolbar
- Importable package: host-chrome-toolbar.wskin
- Shared component and permission rules: skin development guide
- Host chrome and toolbar contract: skin development guide (see the
chrome.json#slotsand toolbar-mode sections)
Package layout
host-chrome-toolbar/
manifest.json # schema v3, author WebSpeak Community
chrome.json # one grouped toolbar slot with a home/voice anchor list
skin.css # page theme, toolbar tokens and header space reservation
skin.css uses only public data-ws-part hooks and sets --skin-host-toolbar-* / --skin-recovery-toolbar-* variables. It never targets the host toolbar DOM, the recovery capsule, the authorization dialog or the load-failure banner.
What the declaration does
{
"schemaVersion": 1,
"slots": {
"host.recovery": {
"mode": "toolbar",
"anchor": ["home.header", "voice.header"],
"align": "end"
}
}
}
mode: "toolbar"asks the host to render two plain host buttons (use built-in skin, application library) without the capsule shell.- The anchor list covers both pages; the host picks the first visible one and re-resolves it after a page switch. A missing or hidden anchor returns the complete, visible floating capsule.
- While the library is available, the host hides the ordinary application-library launcher so the page keeps exactly one library entry. The fallback capsule keeps that entry when the anchor fails.
- The host owns the labels, click handlers, focus behaviour, minimum hit target and shortcut handling. The skin only supplies anchor and token values.
- Old slots without
modekeep the capsule presentation; this example opts in explicitly.
Trying it
- Build or import host-chrome-toolbar.wskin in a local WebSpeak instance.
- Allow the third-party skin when the host asks.
- Connect to Demo Server, join Demo Lobby, and check the header as Demo User.
- Confirm the two host buttons appear at the end of the home and voice headers, use the dark toolbar palette, and open the built-in-skin and application-library actions.
- Remove or hide the anchor in the page inspector; the complete floating capsule should appear at a corner. Restore the anchor; the toolbar should re-dock after the anti-flap check.
- Press
Ctrl+Alt+Shift+R(⌘+⌥+⇧+Ron macOS); the toolbar hides, the complete capsule appears and focuses its first button. Press Escape to return to the toolbar.
The example contains no server addresses, member names, chat contents or other real instance data. Public descriptions use only the Demo Server / Demo Lobby / Demo User placeholders.