Moved disable microphone into the menu you get when clicking on your own name.

This commit is contained in:
Storm Dragon
2026-07-07 16:02:59 -04:00
parent 19e03e8708
commit 400174d618
5 changed files with 32 additions and 17 deletions
+4 -2
View File
@@ -37,11 +37,13 @@ controls expose the user list, chat, and settings.
### Buttons ### Buttons
There are up to three buttons at the top. The most important is the There are up to two buttons at the top. *Enable* starts the microphone
*Enable*/*Disable* button, which switches the microphone on or off. when no local microphone stream is active.
The *Mute* button mutes or unmutes the microphone; the microphone can be The *Mute* button mutes or unmutes the microphone; the microphone can be
muted remotely by the hall moderator, but it cannot be unmuted remotely. muted remotely by the hall moderator, but it cannot be unmuted remotely.
To stop and release the local microphone stream, use *Turn microphone off*
from the menu opened from your own name.
### Side menu ### Side menu
+2 -2
View File
@@ -705,7 +705,7 @@ h1 {
vertical-align: middle; vertical-align: middle;
} }
#presentbutton, #unpresentbutton { #presentbutton {
white-space: nowrap; white-space: nowrap;
margin-right: 0.4em; margin-right: 0.4em;
margin-top: .1em; margin-top: .1em;
@@ -1112,7 +1112,7 @@ header .collapse:hover {
@media only screen and (max-width: 1024px) { @media only screen and (max-width: 1024px) {
#presentbutton, #unpresentbutton { #presentbutton {
width: auto; width: auto;
} }
.nav-link { .nav-link {
-5
View File
@@ -40,11 +40,6 @@
<i class="fas fa-play" aria-hidden="true"></i><span class="nav-text"> Enable</span> <i class="fas fa-play" aria-hidden="true"></i><span class="nav-text"> Enable</span>
</button> </button>
</li> </li>
<li>
<button id="unpresentbutton" class="invisible btn btn-cancel" aria-label="Disable microphone">
<i class="fas fa-stop" aria-hidden="true"></i><span class="nav-text"> Disable</span>
</button>
</li>
<li> <li>
<button id="mutebutton" class="nav-link nav-button" aria-pressed="false" aria-label="Mute microphone"> <button id="mutebutton" class="nav-link nav-button" aria-pressed="false" aria-label="Mute microphone">
<span><i class="fas fa-microphone-slash" aria-hidden="true"></i></span> <span><i class="fas fa-microphone-slash" aria-hidden="true"></i></span>
+6 -8
View File
@@ -651,11 +651,6 @@ getButtonElement('presentbutton').onclick = async function(e) {
} }
}; };
getButtonElement('unpresentbutton').onclick = function(e) {
e.preventDefault();
closeUpMedia('audio');
};
/** /**
* @param {string} id * @param {string} id
* @param {boolean} visible * @param {boolean} visible
@@ -693,7 +688,6 @@ function setButtonsVisibility() {
// don't allow multiple presentations // don't allow multiple presentations
setVisibility('presentbutton', canPresent && !local); setVisibility('presentbutton', canPresent && !local);
setVisibility('unpresentbutton', local);
setVisibility('mutebutton', !connected || canPresent); setVisibility('mutebutton', !connected || canPresent);
@@ -1785,7 +1779,11 @@ function userMenu(elt) {
inviteMenu(); inviteMenu();
}}); }});
} }
items.push({label: 'Restart media', onClick: renegotiateStreams}); if(findUpMedia('audio'))
items.push({label: 'Turn microphone off', onClick: () => {
closeUpMedia('audio');
}});
items.push({label: 'Restart audio connection', onClick: renegotiateStreams});
} else { } else {
items.push({label: 'Send file', onClick: () => { items.push({label: 'Send file', onClick: () => {
sendFile(id); sendFile(id);
@@ -3420,7 +3418,7 @@ function renegotiateStreams() {
} }
commands.renegotiate = { commands.renegotiate = {
description: 'renegotiate media streams', description: 'restart audio connections',
f: (c, r) => { f: (c, r) => {
renegotiateStreams(); renegotiateStreams();
} }
+20
View File
@@ -23,6 +23,13 @@ func requireContains(t *testing.T, text, want, context string) {
} }
} }
func requireNotContains(t *testing.T, text, unwanted, context string) {
t.Helper()
if strings.Contains(text, unwanted) {
t.Fatalf("%s unexpectedly contains %q", context, unwanted)
}
}
func requireFunctionContains(t *testing.T, source, functionName, want string) { func requireFunctionContains(t *testing.T, source, functionName, want string) {
t.Helper() t.Helper()
start := strings.Index(source, "function "+functionName+"(") start := strings.Index(source, "function "+functionName+"(")
@@ -86,3 +93,16 @@ func TestGlobalShortcutAliasesStayDocumented(t *testing.T) {
requireContains(t, js, "if(isGlobalShortcut(e, 'c'))", "chat shortcut") requireContains(t, js, "if(isGlobalShortcut(e, 'c'))", "chat shortcut")
requireContains(t, js, "if(isGlobalShortcut(e, 't'))", "microphone shortcut") requireContains(t, js, "if(isGlobalShortcut(e, 't'))", "microphone shortcut")
} }
func TestMicrophoneHardStopLivesInSelfMenu(t *testing.T) {
html := readStaticFile(t, "skald.html")
js := readStaticFile(t, "skald.js")
requireNotContains(t, html, `id="unpresentbutton"`, "toolbar")
requireNotContains(t, html, `aria-label="Disable microphone"`, "toolbar")
requireNotContains(t, js, "getButtonElement('unpresentbutton')", "toolbar handler")
requireNotContains(t, js, "setVisibility('unpresentbutton'", "toolbar visibility")
requireFunctionContains(t, js, "userMenu", "Turn microphone off")
requireFunctionContains(t, js, "userMenu", "closeUpMedia('audio')")
requireFunctionContains(t, js, "userMenu", "Restart audio connection")
}