fix: layout, hotkeys, skip/switch speaker logic

This commit is contained in:
Mikhail Kiselev
2026-02-10 23:10:02 +03:00
parent fc93ebbd26
commit fe6a41226c
8 changed files with 310 additions and 26 deletions

View File

@@ -7,7 +7,7 @@
import History from './components/History.svelte'
import Setup from './components/Setup.svelte'
import { EventsOn, EventsOff, WindowSetSize, ScreenGetAll } from '../wailsjs/runtime/runtime'
import { GetParticipants, StartMeeting, GetSettings, SkipSpeaker, RemoveFromQueue } from '../wailsjs/go/app/App'
import { GetParticipants, StartMeeting, GetSettings, SkipSpeaker, RemoveFromQueue, SwitchToSpeaker } from '../wailsjs/go/app/App'
import { t, initLocale } from './lib/i18n'
let currentView = 'main'
@@ -192,16 +192,30 @@
currentView = 'main'
}
function handleSettingsLoaded(s) {
settings = s
function handleSettingsLoaded(event) {
settings = event.detail
}
async function handleSkipFromList(event) {
const { speakerId } = event.detail
try {
await RemoveFromQueue(speakerId)
// If this is the current speaker, use SkipSpeaker, otherwise RemoveFromQueue
if (timerState?.currentSpeakerId === speakerId) {
await SkipSpeaker()
} else {
await RemoveFromQueue(speakerId)
}
} catch (e) {
console.error('Failed to remove speaker from queue:', e)
console.error('Failed to skip speaker:', e)
}
}
async function handleSwitchSpeaker(event) {
const { speakerId } = event.detail
try {
await SwitchToSpeaker(speakerId)
} catch (e) {
console.error('Failed to switch to speaker:', e)
}
}
@@ -266,12 +280,12 @@
</button>
</nav>
<div class="content">
<div class="content" class:no-nav={meetingActive}>
{#if currentView === 'main'}
{#if meetingActive && timerState}
<div class="timer-view">
<Timer {timerState} />
<ParticipantList {timerState} on:skip={handleSkipFromList} />
<ParticipantList {timerState} on:skip={handleSkipFromList} on:switch={handleSwitchSpeaker} />
<Controls {timerState} on:stop={() => meetingActive = false} />
</div>
{:else if participants.length > 0}
@@ -333,6 +347,11 @@
}
.nav {
position: fixed;
top: 32px;
left: 0;
right: 0;
z-index: 100;
display: flex;
gap: 4px;
padding: 8px 12px;
@@ -373,10 +392,17 @@
}
.content {
flex: 1;
overflow: auto;
position: fixed;
top: 84px; /* 32px titlebar + 52px nav height */
bottom: 0;
left: 0;
right: 0;
overflow-y: auto;
padding: 12px;
padding-bottom: 64px;
}
.content.no-nav {
top: 32px; /* Only titlebar when nav is hidden */
}
.timer-view {