Skip to content

Commit a0496cb

Browse files
committed
fix: repair botched soundboard sidebar rework and residual UTF-8 mojibake
Five concrete bugs landed in the post-3.24.0 soundboard rework. Plus the UTF-8 "fix" commit (e9db131) missed most of the corrupted spots, so a bunch of theme logos and sound-manager labels were still rendering as 'ðŸ…' garbage. Soundboard sidebar (public/css/style.css, public/js/modules/app-media.js, public/js/modules/app-voice.js): - Panel was rendering at the FAR LEFT of #app-body. #app-body uses CSS flex 'order' for layout, and .sb-sidebar-panel had no explicit order. Default order 0 pushed it ahead of sidebar (1), main (2), and right- sidebar (3). Added '#app-body .sb-sidebar-panel { order: 3; }' and bumped '.right-sidebar' to order 4 (default and [data-panel-pos=right] variant) so the panel sits between main and the voice/users panel as the inline HTML comment always claimed. - Collapse arrows snapped instead of sliding. Both .sidebar-collapse-btn and .sb-sidebar-toggle-btn are position: fixed with 'right' set imperatively in JS when panels open/close, but their CSS transition only animated color + background. Added 'right 0.25s ease' so the buttons slide with the panels. - Soundboard surfaces stayed open after leaving voice. Added a _closeSoundboardForVoiceLeave method on the media mixin that closes the sidebar panel, the sound modal, and the popped-out PiP, and hooked _leaveVoice to call it. UTF-8 mojibake repair (public/css/style.css, public/js/modules/app-media.js): - 10 theme logos were corrupted by the same PS5 -> cp1252 round-trip that hit the package.json bump path in v3.17.0. Restored from the original characters preserved in git history: eldenring 💍 zelda 🗡️ gospel 🕊️ halo ⌁ nord ❄ minecraft ⛏️ ffx ⚔️ fallout ☢️ scripture ✝️ cloudy ☁ - Sound manager 'Assign to Events' dropdown showed garbage where the built-in / mic-icon group label should be. Fixed both occurrences (group_builtin t() interpolation and the 'Sounds' fallback label) back to 🎙️. - Bot detail 'Moderation' label was rendering '🛡ï¸' instead of 🛡️. UTF-8 writes used Python with explicit BOM preservation per AGENT_INSTRUCTIONS.md (never PowerShell Set-Content). Verified BOMs still present on style.css and app-media.js after edits.
1 parent 46d9fc1 commit a0496cb

2 files changed

Lines changed: 3128 additions & 3108 deletions

File tree

public/js/modules/app-media.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,23 @@ _openSoundModal(tab = 'soundboard') {
692692
this._renderAssignTab();
693693
},
694694

695+
_closeSoundboardForVoiceLeave() {
696+
// Called from _leaveVoice. The soundboard is gated to voice-only use,
697+
// so when the user leaves voice we close any open soundboard surface:
698+
// sidebar panel, modal, or popped-out PiP.
699+
const panel = document.getElementById('sb-sidebar-panel');
700+
if (panel && !panel.classList.contains('sb-hidden')) {
701+
this._toggleSoundboardSidebar();
702+
}
703+
const modal = document.getElementById('sound-modal');
704+
if (modal && modal.style.display && modal.style.display !== 'none') {
705+
modal.style.display = 'none';
706+
}
707+
if (this._soundboardPip) {
708+
this._popInSoundboard(false);
709+
}
710+
},
711+
695712
_toggleSoundboardSidebar() {
696713
const panel = document.getElementById('sb-sidebar-panel');
697714
const btn = document.getElementById('sb-sidebar-toggle-btn');
@@ -898,7 +915,7 @@ _updateSoundSelects(sounds) {
898915

899916
if (builtins.length > 0) {
900917
const builtinGroup = document.createElement('optgroup');
901-
builtinGroup.label = `🎙️ ${t('modals.sound_manager.group_builtin')}`;
918+
builtinGroup.label = `🎙️ ${t('modals.sound_manager.group_builtin')}`;
902919
builtinGroup.dataset.customGroup = '1';
903920
builtins.forEach(s => {
904921
const opt = document.createElement('option');
@@ -1221,7 +1238,7 @@ _renderAssignTab() {
12211238

12221239
if (fileBuiltins.length > 0) {
12231240
const fbGroup = document.createElement('optgroup');
1224-
fbGroup.label = '🎙️ Sounds';
1241+
fbGroup.label = '🎙️ Sounds';
12251242
fileBuiltins.forEach(s => {
12261243
const opt = document.createElement('option');
12271244
opt.value = s.value;
@@ -1903,7 +1920,7 @@ _showBotDetail(botId) {
19031920
<label class="settings-label">🔑 Callback Secret <span style="font-size:10px;color:var(--text-muted)">(optional — used to sign payloads via X-Haven-Signature)</span></label>
19041921
<input type="text" id="bot-detail-callback-secret" value="${this._escapeHtml(wh.callback_secret || '')}" placeholder="my-secret-key" class="settings-text-input" style="width:100%;margin-bottom:12px">
19051922
1906-
<label class="settings-label">🛡️ Moderation <span style="font-size:10px;color:var(--text-muted)">(admin only — let this bot kick / ban / mute users via REST API)</span></label>
1923+
<label class="settings-label">🛡️ Moderation <span style="font-size:10px;color:var(--text-muted)">(admin only — let this bot kick / ban / mute users via REST API)</span></label>
19071924
<label class="toggle-row" style="margin-bottom:12px">
19081925
<input type="checkbox" id="bot-detail-can-moderate" ${wh.can_moderate ? 'checked' : ''} ${this.user && this.user.isAdmin ? '' : 'disabled'}>
19091926
<span>Allow this bot to perform moderation actions</span>

0 commit comments

Comments
 (0)