feat(desktop): port v0.11.4-v0.15.2 from Tauri to Electron + Discord-parity audio (v0.16.0)
Chronological port of every Tauri release commit (v0.11.4 -> v0.15.2)
into the Electron rebuild, plus Discord-style audio handling that goes
beyond the Tauri original.
Highlights:
- All 17 Tauri release commits ported (audio fixes, custom notification
sound, Discord-style chat UX, profile banner, changelog page,
Discord-parity call UX, screen-share echo + re-watch UX, audio-loop
fix).
- Native napi-rs audio-loopback addon with WASAPI process-loopback:
* EXCLUDE_TARGET_PROCESS_TREE for full-screen shares -> peers
never hear themselves echoed back through the capture.
* INCLUDE_TARGET_PROCESS_TREE for window shares -> only the
picked window's audio is captured, not the whole OS mixer
(Discord parity).
* HWND -> PID resolution via Win32 GetWindowThreadProcessId.
- Discord-style screen-source picker (thumbnail grid, screens vs
apps tabs, live-refreshing thumbnails).
- Hash routing fix for packaged builds (file:// can't resolve
BrowserRouter paths).
- Tauri sources removed (apps/desktop/src-tauri).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ export interface Profile {
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarUrl: string | null;
|
||||
bannerUrl: string | null;
|
||||
statusMessage: string | null;
|
||||
presenceState: PresenceState;
|
||||
showReadReceipts: boolean;
|
||||
@@ -22,6 +23,7 @@ type ProfileRow = {
|
||||
username: string;
|
||||
display_name: string;
|
||||
avatar_url: string | null;
|
||||
banner_url: string | null;
|
||||
status_message: string | null;
|
||||
presence_state: PresenceState;
|
||||
show_read_receipts: boolean;
|
||||
@@ -31,7 +33,7 @@ type ProfileRow = {
|
||||
};
|
||||
|
||||
const PROFILE_COLS =
|
||||
'user_id, username, display_name, avatar_url, status_message, presence_state, show_read_receipts, allow_dms_from_strangers, is_admin, locale';
|
||||
'user_id, username, display_name, avatar_url, banner_url, status_message, presence_state, show_read_receipts, allow_dms_from_strangers, is_admin, locale';
|
||||
|
||||
function toSupportedLocale(raw: string): SupportedLocale {
|
||||
return raw === 'de' ? 'de' : 'en';
|
||||
@@ -43,6 +45,7 @@ function mapProfile(row: ProfileRow): Profile {
|
||||
username: row.username,
|
||||
displayName: row.display_name,
|
||||
avatarUrl: row.avatar_url,
|
||||
bannerUrl: row.banner_url,
|
||||
statusMessage: row.status_message,
|
||||
presenceState: row.presence_state,
|
||||
showReadReceipts: row.show_read_receipts,
|
||||
@@ -95,6 +98,7 @@ export async function isUsernameAvailable(
|
||||
export interface UpdateProfileParams {
|
||||
displayName?: string;
|
||||
avatarUrl?: string | null;
|
||||
bannerUrl?: string | null;
|
||||
statusMessage?: string | null;
|
||||
presenceState?: PresenceState;
|
||||
showReadReceipts?: boolean;
|
||||
@@ -112,6 +116,7 @@ export async function updateOwnProfile(
|
||||
const patch: ProfileUpdate = {};
|
||||
if (params.displayName !== undefined) patch.display_name = params.displayName;
|
||||
if (params.avatarUrl !== undefined) patch.avatar_url = params.avatarUrl;
|
||||
if (params.bannerUrl !== undefined) patch.banner_url = params.bannerUrl;
|
||||
if (params.statusMessage !== undefined) patch.status_message = params.statusMessage;
|
||||
if (params.presenceState !== undefined) patch.presence_state = params.presenceState;
|
||||
if (params.showReadReceipts !== undefined) patch.show_read_receipts = params.showReadReceipts;
|
||||
|
||||
@@ -53,7 +53,20 @@ export interface CallEventPayload {
|
||||
durationSec: number;
|
||||
}
|
||||
|
||||
export type MessagePayload = TextMessagePayload | CallEventPayload;
|
||||
export interface PollOption {
|
||||
id: string;
|
||||
emoji: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface PollPayload {
|
||||
v: 1;
|
||||
type: 'poll';
|
||||
question: string;
|
||||
options: PollOption[];
|
||||
}
|
||||
|
||||
export type MessagePayload = TextMessagePayload | CallEventPayload | PollPayload;
|
||||
|
||||
export type ParsedMessagePayload =
|
||||
| {
|
||||
@@ -67,6 +80,11 @@ export type ParsedMessagePayload =
|
||||
status: CallEventStatus;
|
||||
mediaKind: CallEventKind;
|
||||
durationSec: number;
|
||||
}
|
||||
| {
|
||||
kind: 'poll';
|
||||
question: string;
|
||||
options: PollOption[];
|
||||
};
|
||||
|
||||
export function serializeMessagePayload(payload: MessagePayload): string {
|
||||
@@ -95,6 +113,34 @@ export function parseMessagePayload(raw: string | null): ParsedMessagePayload {
|
||||
durationSec: typeof p.durationSec === 'number' ? p.durationSec : 0,
|
||||
};
|
||||
}
|
||||
if (obj.type === 'poll') {
|
||||
const p = obj as Partial<PollPayload>;
|
||||
const options = Array.isArray(p.options)
|
||||
? p.options
|
||||
.map((option, idx) => {
|
||||
const candidate = option as Partial<PollOption>;
|
||||
const text = typeof candidate.text === 'string' ? candidate.text.trim() : '';
|
||||
if (!text) return null;
|
||||
return {
|
||||
id:
|
||||
typeof candidate.id === 'string' && candidate.id.trim()
|
||||
? candidate.id.trim()
|
||||
: 'option-' + (idx + 1),
|
||||
emoji:
|
||||
typeof candidate.emoji === 'string' && candidate.emoji.trim()
|
||||
? candidate.emoji.trim()
|
||||
: String(idx + 1),
|
||||
text,
|
||||
};
|
||||
})
|
||||
.filter((option): option is PollOption => option !== null)
|
||||
: [];
|
||||
return {
|
||||
kind: 'poll',
|
||||
question: typeof p.question === 'string' ? p.question.trim() : '',
|
||||
options,
|
||||
};
|
||||
}
|
||||
const t = obj as TextMessagePayload;
|
||||
return {
|
||||
kind: 'text',
|
||||
|
||||
@@ -2,19 +2,21 @@ import type { ProfileBrief } from '../friends/index.js';
|
||||
import type { AppSupabaseClient } from '../supabase/client.js';
|
||||
import type { ConversationSummary } from './types.js';
|
||||
|
||||
const PROFILE_BRIEF_COLS = 'user_id, username, display_name, avatar_url';
|
||||
const PROFILE_BRIEF_COLS = 'user_id, username, display_name, avatar_url, banner_url';
|
||||
|
||||
function mapBrief(row: {
|
||||
user_id: string;
|
||||
username: string;
|
||||
display_name: string;
|
||||
avatar_url: string | null;
|
||||
banner_url: string | null;
|
||||
}): ProfileBrief {
|
||||
return {
|
||||
userId: row.user_id,
|
||||
username: row.username,
|
||||
displayName: row.display_name,
|
||||
avatarUrl: row.avatar_url,
|
||||
bannerUrl: row.banner_url,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface ProfileBrief {
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarUrl: string | null;
|
||||
bannerUrl: string | null;
|
||||
}
|
||||
|
||||
export type FriendDirection = 'outgoing' | 'incoming';
|
||||
@@ -19,19 +20,21 @@ export interface Friendship {
|
||||
acceptedAt: string | null;
|
||||
}
|
||||
|
||||
const PROFILE_BRIEF_COLS = 'user_id, username, display_name, avatar_url';
|
||||
const PROFILE_BRIEF_COLS = 'user_id, username, display_name, avatar_url, banner_url';
|
||||
|
||||
function mapProfileBrief(row: {
|
||||
user_id: string;
|
||||
username: string;
|
||||
display_name: string;
|
||||
avatar_url: string | null;
|
||||
banner_url: string | null;
|
||||
}): ProfileBrief {
|
||||
return {
|
||||
userId: row.user_id,
|
||||
username: row.username,
|
||||
displayName: row.display_name,
|
||||
avatarUrl: row.avatar_url,
|
||||
bannerUrl: row.banner_url,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -106,6 +109,7 @@ export async function listFriendships(client: AppSupabaseClient): Promise<Friend
|
||||
username: '?',
|
||||
displayName: '?',
|
||||
avatarUrl: null,
|
||||
bannerUrl: null,
|
||||
};
|
||||
return {
|
||||
peer,
|
||||
|
||||
Reference in New Issue
Block a user