refactor: remove video channel type, fix invisible CreateChannel inputs

Voice channels already support video/screen share, so the separate video
type was redundant. Adds migration to convert existing video channels.
Also adds border-border-soft to CreateChannel input fields for visibility.
This commit is contained in:
Jannis Braun
2026-03-12 00:46:15 +01:00
parent fc72e424d6
commit b6d44f1568
11 changed files with 27 additions and 20 deletions
+11
View File
@@ -213,6 +213,9 @@ export function runMigrations(db: Database.Database): void {
// ─── Lowercase all existing usernames ────────────────────────────────────────
migrateLowercaseUsernames(db);
// ─── Convert video channels to voice (video type removed) ─────────────────
migrateVideoChannels(db);
console.log('Migrations complete.');
}
@@ -583,6 +586,14 @@ function migrateLowercaseUsernames(db: Database.Database): void {
}
}
/** Convert any existing video channels to voice (video type removed — voice channels have full video capability) */
function migrateVideoChannels(db: Database.Database): void {
const result = db.prepare("UPDATE channels SET type = 'voice' WHERE type = 'video'").run();
if (result.changes > 0) {
console.log(`Migrating: Converted ${result.changes} video channel(s) to voice`);
}
}
function migrateReplicatedUsernames(db: Database.Database): void {
const rows = db.prepare(
"SELECT id, username, home_instance FROM users WHERE home_instance IS NOT NULL AND username NOT LIKE '%@%'"
+2 -2
View File
@@ -117,8 +117,8 @@ export async function channelRoutes(app: FastifyInstance): Promise<void> {
return reply.code(400).send({ error: 'Channel name must be between 1 and 100 characters', statusCode: 400 });
}
if (!type || !['text', 'voice', 'video'].includes(type)) {
return reply.code(400).send({ error: 'Channel type must be "text", "voice", or "video"', statusCode: 400 });
if (!type || !['text', 'voice'].includes(type)) {
return reply.code(400).send({ error: 'Channel type must be "text" or "voice"', statusCode: 400 });
}
// Get max position for ordering
+1 -1
View File
@@ -1348,7 +1348,7 @@ function handleVoiceMove(event: Record<string, unknown>, userId: string): void {
connectionManager.sendToUser(userId, { type: 'error', message: 'Target channel not found in this space' });
return;
}
if (targetChannel.type !== 'voice' && targetChannel.type !== 'video') {
if (targetChannel.type !== 'voice') {
connectionManager.sendToUser(userId, { type: 'error', message: 'Target channel is not a voice channel' });
return;
}
+1 -1
View File
@@ -923,7 +923,7 @@ function buildReadyPayload(userId: string): {
const voiceStates: Record<string, string[]> = {};
for (const space of spaces) {
for (const ch of space.channels) {
if (ch.type === 'voice' || ch.type === 'video') {
if (ch.type === 'voice') {
const participants = connectionManager.getRoomParticipants(ch.id);
if (participants.size > 0) {
voiceStates[ch.id] = Array.from(participants);