ui: clipboard emoji for invite button, movie emoji for audible tab indicator

This commit is contained in:
Koala
2026-05-25 23:49:32 +02:00
parent 42b73bb97f
commit c0a6f0adc2
3 changed files with 24 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "KoalaSync", "name": "KoalaSync",
"version": "1.8.3", "version": "1.8.4",
"description": "Watch party extension to synchronize video playback on YouTube, Twitch, Netflix, and HTML5 sites in real-time with friends.", "description": "Watch party extension to synchronize video playback on YouTube, Twitch, Netflix, and HTML5 sites in real-time with friends.",
"permissions": [ "permissions": [
"storage", "storage",
+1 -1
View File
@@ -378,7 +378,7 @@
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;"> <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
<label style="margin: 0;">Remote Control</label> <label style="margin: 0;">Remote Control</label>
<button id="syncTabCopyInvite" title="Copy Invite Link" style="background:transparent; border:none; padding:4px; font-size:14px; cursor:pointer; opacity:0.8; transition: opacity 0.2s;">🔗</button> <button id="syncTabCopyInvite" title="Copy Invite Link" style="background:transparent; border: 1px solid #334155; border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor:pointer; opacity:0.8; transition: opacity 0.2s; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap;">📋 Invite Link</button>
</div> </div>
<div style="display: flex; gap: 8px; margin-bottom: 12px;"> <div style="display: flex; gap: 8px; margin-bottom: 12px;">
<button id="playBtn" class="primary" style="flex:1; background: var(--success);" title="Send a Play command to everyone">▶ Play</button> <button id="playBtn" class="primary" style="flex:1; background: var(--success);" title="Send a Play command to everyone">▶ Play</button>
+22 -5
View File
@@ -47,7 +47,8 @@ const elements = {
lobbyTitle: document.getElementById('lobbyTitle'), lobbyTitle: document.getElementById('lobbyTitle'),
lobbyPeerStatus: document.getElementById('lobbyPeerStatus'), lobbyPeerStatus: document.getElementById('lobbyPeerStatus'),
browserNotifications: document.getElementById('browserNotifications'), browserNotifications: document.getElementById('browserNotifications'),
autoCopyInvite: document.getElementById('autoCopyInvite') autoCopyInvite: document.getElementById('autoCopyInvite'),
syncTabCopyInvite: document.getElementById('syncTabCopyInvite')
}; };
let localPeerId = null; let localPeerId = null;
@@ -608,7 +609,7 @@ async function populateTabs(providedPeers = null, providedTargetTabId = null) {
} }
if (tab.audible) { if (tab.audible) {
label = `[🔊] ${label}`; label = `[🎬] ${label}`;
} }
option.textContent = label; option.textContent = label;
@@ -1067,13 +1068,15 @@ elements.forceSyncBtn.addEventListener('click', async () => {
elements.forceSyncBtn.disabled = true; elements.forceSyncBtn.disabled = true;
elements.forceSyncBtn.textContent = mode === 'jump-to-others' ? `Syncing to group (${formatTime(targetTime)})...` : 'Syncing...'; elements.forceSyncBtn.textContent = mode === 'jump-to-others' ? `Syncing to group (${formatTime(targetTime)})...` : 'Syncing...';
forceSyncDone = false; forceSyncDone = false;
const peerCount = (status.peers || []).filter(p => (typeof p === 'object' ? p.peerId : p) !== localPeerId).length;
const syncTimeoutMs = peerCount === 0 ? 3000 : 12000;
const forceSyncReset = () => { const forceSyncReset = () => {
if (!forceSyncDone) { if (!forceSyncDone) {
elements.forceSyncBtn.disabled = false; elements.forceSyncBtn.disabled = false;
elements.forceSyncBtn.textContent = originalText; elements.forceSyncBtn.textContent = originalText;
} }
}; };
forceSyncResetTimer = setTimeout(forceSyncReset, 12000); forceSyncResetTimer = setTimeout(forceSyncReset, syncTimeoutMs);
const tabId = parseInt(status.targetTabId); const tabId = parseInt(status.targetTabId);
const sendForceSync = (time) => { const sendForceSync = (time) => {
@@ -1119,13 +1122,20 @@ elements.playBtn.addEventListener('click', () => {
showToast('Please select a video first!', 'warning'); showToast('Please select a video first!', 'warning');
return; return;
} }
elements.playBtn.textContent = 'Playing...'; elements.playBtn.textContent = 'Playing...';
elements.playBtn.disabled = true; elements.playBtn.disabled = true;
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'CONTENT_EVENT', type: 'CONTENT_EVENT',
action: EVENTS.PLAY, action: EVENTS.PLAY,
payload: {} payload: {}
}); });
// Safety reset: restore button after 2.5s in case no peers respond
setTimeout(() => {
if (elements.playBtn.disabled) {
elements.playBtn.textContent = '▶ Play';
elements.playBtn.disabled = false;
}
}, 2500);
}); });
elements.pauseBtn.addEventListener('click', () => { elements.pauseBtn.addEventListener('click', () => {
@@ -1133,13 +1143,20 @@ elements.pauseBtn.addEventListener('click', () => {
showToast('Please select a video first!', 'warning'); showToast('Please select a video first!', 'warning');
return; return;
} }
elements.pauseBtn.textContent = 'Pausing...'; elements.pauseBtn.textContent = 'Pausing...';
elements.pauseBtn.disabled = true; elements.pauseBtn.disabled = true;
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'CONTENT_EVENT', type: 'CONTENT_EVENT',
action: EVENTS.PAUSE, action: EVENTS.PAUSE,
payload: {} payload: {}
}); });
// Safety reset: restore button after 2.5s in case no peers respond
setTimeout(() => {
if (elements.pauseBtn.disabled) {
elements.pauseBtn.textContent = '⏸ Pause';
elements.pauseBtn.disabled = false;
}
}, 2500);
}); });
elements.clearLogs.addEventListener('click', () => { elements.clearLogs.addEventListener('click', () => {