diff --git a/src/main/index.ts b/src/main/index.ts index 18d6479..d66e61c 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1,6 +1,7 @@ // First: in sandbox mode this moves every path the app uses (see sandbox.ts). import { SANDBOX, seedDemo } from './sandbox' -import { app, BrowserWindow, clipboard, ClipboardItem, dialog, ipcMain, nativeTheme, net, protocol, safeStorage, shell } from 'electron' +import { app, BrowserWindow, clipboard, ClipboardItem, dialog, ipcMain, nativeTheme, net, protocol, safeStorage, screen, shell } from 'electron' +import { execFileSync } from 'node:child_process' import crypto from 'node:crypto' import fs from 'node:fs' import path from 'node:path' @@ -8,7 +9,7 @@ import os from 'node:os' import { pathToFileURL } from 'node:url' import { charCount, groupMembers, isGroup, normalizeNumber, SMS_TEXT_LIMIT } from '@shared/phone' import type { ChatExport, IconStyle, Credentials, Did, MediaRef, Message, NewContact, OutgoingAttachment, Provider, Settings, SyncStatus, Theme } from '@shared/types' -import type { AppState } from '@shared/api' +import type { AppState, WindowAction, WindowState } from '@shared/api' import { addToAddressBook, ContactDirectory, listAddressBooks } from './contacts' import { localDay, MessageDb, type NewMessage } from './db' import { MediaStore } from './media' @@ -337,8 +338,42 @@ function applyTheme(): void { win?.setBackgroundColor(windowBackground()) } +// The window itself stays transparent: the page paints its rounded tile. function windowBackground(): string { - return nativeTheme.shouldUseDarkColors ? '#121212' : '#ffffff' + return '#00000000' +} + +// ---- the window's own frame (design.html#window, #titlebar) ---- +// Square corners when maximized, fullscreen or tiled. Wayland doesn't tell +// us about tiling, so a window within 64 px of the screen's full height +// counts as tiled. +function windowState(): WindowState { + if (!win) return { square: false, maximized: false, focused: true } + const maximized = win.isMaximized() + const full = screen.getDisplayMatching(win.getBounds()).bounds + const tiled = full.height - win.getBounds().height <= 64 + return { square: maximized || win.isFullScreen() || tiled, maximized, focused: win.isFocused() } +} + +function sendWindowState(): void { + if (win && !win.isDestroyed()) win.webContents.send('windowState', windowState()) +} + +// GNOME's button-layout ("appmenu:minimize,maximize,close"): which side +// the window buttons go on, and in what order. +let buttonLayout: string | undefined +function windowButtons(): string { + if (buttonLayout === undefined) { + try { + buttonLayout = execFileSync('gsettings', ['get', 'org.gnome.desktop.wm.preferences', 'button-layout'], { encoding: 'utf8' }) + .trim() + .replace(/^'|'$/g, '') + } catch { + buttonLayout = '' + } + if (!buttonLayout.includes(':')) buttonLayout = 'appmenu:minimize,maximize,close' + } + return buttonLayout } const ZOOM_STEP = 0.5 @@ -534,6 +569,20 @@ function registerIpc(): void { gvSync?.resetBackfill() } }) + ipcMain.handle('windowState', () => windowState()) + ipcMain.handle('windowButtons', () => windowButtons()) + ipcMain.handle('windowControl', (_e, action: WindowAction) => { + if (!win) return + if (action === 'zoomIn') setZoom(win.webContents.getZoomLevel() + ZOOM_STEP) + else if (action === 'zoomOut') setZoom(win.webContents.getZoomLevel() - ZOOM_STEP) + else if (action === 'zoomReset') setZoom(0) + else if (action === 'minimize') win.minimize() + else if (action === 'maximize') { + if (win.isMaximized()) win.unmaximize() + else win.maximize() + } else if (action === 'close') win.close() + else app.quit() + }) ipcMain.handle('setIcon', (_e, icon: IconStyle) => { settings = { ...settings, icon } saveSettings(settings) @@ -688,8 +737,11 @@ function createWindow(): void { minWidth: 760, minHeight: 480, title: SANDBOX ? 'bubble (sandbox)' : 'bubble', - backgroundColor: windowBackground(), - autoHideMenuBar: true, + // design.html#window: frameless and see-through; the page paints the + // rounded tile, its own title bar (#titlebar) and menu bar (#menubar). + frame: false, + transparent: true, + backgroundColor: '#00000000', icon: iconFile(settings.icon), webPreferences: { preload: path.join(__dirname, '../preload/index.js'), @@ -724,6 +776,8 @@ function createWindow(): void { win.webContents.on('did-finish-load', () => win!.webContents.setZoomLevel(loadZoom())) // The hidden Google Voice window would otherwise keep 'window-all-closed' // from firing, leaving a windowless process holding the single-instance lock. + for (const ev of ['maximize', 'unmaximize', 'enter-full-screen', 'leave-full-screen', 'resize', 'focus', 'blur'] as const) + win.on(ev as 'resize', sendWindowState) win.on('closed', () => { win = undefined app.quit() diff --git a/src/preload/index.ts b/src/preload/index.ts index 8dbda6b..bf5e185 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -13,6 +13,10 @@ const api: Api = { saveSetup: (creds, settings) => ipcRenderer.invoke('saveSetup', creds, settings), updateSettings: (settings) => ipcRenderer.invoke('updateSettings', settings), setTheme: (theme) => ipcRenderer.invoke('setTheme', theme), + windowState: () => ipcRenderer.invoke('windowState'), + onWindowState: (cb) => on('windowState', cb), + windowButtons: () => ipcRenderer.invoke('windowButtons'), + windowControl: (action) => ipcRenderer.invoke('windowControl', action), setIcon: (icon) => ipcRenderer.invoke('setIcon', icon), signOut: () => ipcRenderer.invoke('signOut'), connectGoogleVoice: () => ipcRenderer.invoke('connectGoogleVoice'), diff --git a/src/renderer/index.html b/src/renderer/index.html index 8ca6458..1249535 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -1,5 +1,5 @@ - + bubble diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 3e818bc..761e757 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useState } from 'react' +import { useCallback, useEffect, useMemo, useState, type JSX, type ReactNode } from 'react' import type { AppState } from '@shared/api' import type { ContactInfo, Conversation, SyncStatus } from '@shared/types' import { Sidebar, type SidebarMode } from './components/Sidebar' @@ -8,6 +8,8 @@ import { SettingsDialog } from './components/SettingsDialog' import { ConversationInfo } from './components/ConversationInfo' import { AddContact, AddContactContext } from './components/AddContact' import { ExportChat } from './components/ExportChat' +import { Frame, onCommand, runCommand } from './components/Frame' +import { setTooltipsEnabled } from './tooltips' export interface ConvKey { did: string @@ -19,8 +21,7 @@ export interface Jump { nonce: number } -export const sameConv = (a?: ConvKey | null, b?: ConvKey | null): boolean => - !!a && !!b && a.did === b.did && a.contact === b.contact +export const sameConv = (a?: ConvKey | null, b?: ConvKey | null): boolean => !!a && !!b && a.did === b.did && a.contact === b.contact export function App() { const [state, setState] = useState() @@ -86,17 +87,47 @@ export function App() { // The list currently shown in the sidebar (for Alt+↑/↓). const listed = useMemo(() => conversations.filter((c) => c.archived === archiveView), [conversations, archiveView]) - // Keyboard shortcuts (Signal-like). + useEffect(() => setTooltipsEnabled(state?.settings.showTooltips !== false), [state?.settings.showTooltips]) + // Which look the stylesheet draws (styles.css): the house look unless Signal vibes are chosen. + useEffect(() => { + if (state) document.documentElement.dataset.look = state.settings.look ?? 'trave' + }, [state]) + + // The menu bar's commands (they work with the bar hidden too). + useEffect( + () => + onCommand((c) => { + if (!state?.configured) return + if (c === 'find') { + setMode('search') + document.getElementById('sidebar-search')?.focus() + } else if (c === 'newChat') setMode('compose') + else if (c === 'preferences') setSettingsOpen(true) + else if (c === 'archived') setArchiveView((v) => !v) + else if (c === 'checkNow') void window.api.pollNow() + }), + [state?.configured] + ) + + // Keyboard shortcuts (Signal-like, plus the menu bar's). useEffect(() => { const onKey = (e: KeyboardEvent): void => { const mod = e.ctrlKey || e.metaKey if (mod && !e.shiftKey && e.key.toLowerCase() === 'f') { e.preventDefault() - setMode('search') - document.getElementById('sidebar-search')?.focus() + runCommand('find') } else if (mod && e.key.toLowerCase() === 'n') { e.preventDefault() - setMode('compose') + runCommand('newChat') + } else if (mod && e.key === ',') { + e.preventDefault() + runCommand('preferences') + } else if (mod && e.key.toLowerCase() === 'q') { + e.preventDefault() + void window.api.windowControl('quit') + } else if (e.key === 'F5') { + e.preventDefault() + runCommand('checkNow') } else if (e.altKey && (e.key === 'ArrowDown' || e.key === 'ArrowUp') && listed.length) { e.preventDefault() const i = listed.findIndex((c) => sameConv(c, selected)) @@ -108,73 +139,77 @@ export function App() { return () => window.removeEventListener('keydown', onKey) }, [listed, selected, open]) - if (!state) return
- if (!state.configured) return + const frame = (body: ReactNode): JSX.Element => ( + + {body} + + ) + if (!state) return frame(
) + if (!state.configured) return frame() - return ( + return frame( -
- 1} - smsDids={smsDids} - gvNumber={state.gvoiceNumber} - defaultDid={state.settings.defaultDid ?? smsDids[0]?.did} - onSettings={() => setSettingsOpen(true)} - archiveView={archiveView} - setArchiveView={setArchiveView} - onMarkUnread={onMarkUnread} - onInfo={setInfo} - onExport={setExporting} - /> - {selected ? ( - + setInfo(selected)} - onExport={() => setExporting(selected)} - gvNumber={state.gvoiceNumber} - jump={jump} - highlight={mode === 'search' ? query : ''} - version={msgVersion} - smsDids={smsDids} - onChangeDid={(did) => setSelected({ ...selected, did })} - /> - ) : ( -
-
-
bubble
-
-
- )} - {info && ( - setInfo(null)} /> - )} - {exporting && setExporting(null)} />} - {settingsOpen && ( - setSettingsOpen(false)} - onChanged={refreshState} + multiDid={smsDids.length > 1} + smsDids={smsDids} + gvNumber={state.gvoiceNumber} + defaultDid={state.settings.defaultDid ?? smsDids[0]?.did} + onSettings={() => setSettingsOpen(true)} + archiveView={archiveView} + setArchiveView={setArchiveView} + onMarkUnread={onMarkUnread} + onInfo={setInfo} + onExport={setExporting} /> - )} - {adding && setAdding(null)} />} -
+ {selected ? ( + setInfo(selected)} + onExport={() => setExporting(selected)} + gvNumber={state.gvoiceNumber} + jump={jump} + highlight={mode === 'search' ? query : ''} + version={msgVersion} + smsDids={smsDids} + onChangeDid={(did) => setSelected({ ...selected, did })} + /> + ) : ( +
+
+
bubble
+
+
+ )} + {info && ( + setInfo(null)} + /> + )} + {exporting && setExporting(null)} />} + {settingsOpen && setSettingsOpen(false)} onChanged={refreshState} />} + {adding && setAdding(null)} />} +
) } diff --git a/src/renderer/src/components/ChatView.tsx b/src/renderer/src/components/ChatView.tsx index ec38d1b..5010040 100644 --- a/src/renderer/src/components/ChatView.tsx +++ b/src/renderer/src/components/ChatView.tsx @@ -274,12 +274,14 @@ export function ChatView({ conv, contact, contactMap, conversations, onOpen, nam }} /> {q.trim() ? (hits.length ? `${hitIdx + 1} of ${hits.length}` : 'No results') : ''} - - +
+ + +
])}
diff --git a/src/renderer/src/components/Frame.tsx b/src/renderer/src/components/Frame.tsx new file mode 100644 index 0000000..d6fe5ba --- /dev/null +++ b/src/renderer/src/components/Frame.tsx @@ -0,0 +1,326 @@ +import { useEffect, useRef, useState, type ReactNode } from 'react' +import type { WindowAction, WindowState } from '@shared/api' +import { ContextMenu, type MenuItem } from './ContextMenu' + +// The window's own frame, after design.html: one rounded tile (#window), a +// title bar in the window gray (#titlebar) and a menu bar that can hide +// until Alt is tapped (#menubar). The page asks for commands by name; the +// app listens with onCommand. + +export type Command = 'newChat' | 'find' | 'preferences' | 'archived' | 'checkNow' + +export function runCommand(c: Command): void { + window.dispatchEvent(new CustomEvent('bubble-command', { detail: c })) +} + +export function onCommand(cb: (c: Command) => void): () => void { + const listener = (e: Event): void => cb((e as CustomEvent).detail) + window.addEventListener('bubble-command', listener) + return () => window.removeEventListener('bubble-command', listener) +} + +const control = (a: WindowAction) => () => void window.api.windowControl(a) +const edit = (cmd: string) => () => { + document.execCommand(cmd) +} + +interface Menu { + label: string + key: string // its Alt+letter + items: MenuItem[] +} + +function menus(configured: boolean): Menu[] { + const app: Menu['items'] = configured + ? [ + { + label: 'New chat', + shortcut: 'Ctrl+N', + onSelect: () => runCommand('newChat') + }, + { + label: 'Check for new messages', + shortcut: 'F5', + onSelect: () => runCommand('checkNow') + } + ] + : [] + return [ + { + label: 'File', + key: 'f', + items: [ + ...app, + { + label: 'Quit', + shortcut: 'Ctrl+Q', + onSelect: control('quit'), + separator: configured + } + ] + }, + { + label: 'Edit', + key: 'e', + items: [ + { label: 'Undo', shortcut: 'Ctrl+Z', onSelect: edit('undo') }, + { label: 'Redo', shortcut: 'Ctrl+Shift+Z', onSelect: edit('redo') }, + { + label: 'Cut', + shortcut: 'Ctrl+X', + onSelect: edit('cut'), + separator: true + }, + { label: 'Copy', shortcut: 'Ctrl+C', onSelect: edit('copy') }, + { label: 'Paste', shortcut: 'Ctrl+V', onSelect: edit('paste') }, + { + label: 'Select all', + shortcut: 'Ctrl+A', + onSelect: edit('selectAll') + }, + ...(configured + ? [ + { + label: 'Find…', + shortcut: 'Ctrl+F', + onSelect: () => runCommand('find'), + separator: true + }, + { + label: 'Preferences…', + shortcut: 'Ctrl+,', + onSelect: () => runCommand('preferences'), + separator: true + } + ] + : []) + ] + }, + { + label: 'View', + key: 'v', + items: [ + ...(configured + ? [ + { + label: 'Archived chats', + onSelect: () => runCommand('archived') + } + ] + : []), + { + label: 'Zoom in', + shortcut: 'Ctrl++', + onSelect: control('zoomIn'), + separator: configured + }, + { label: 'Zoom out', shortcut: 'Ctrl+−', onSelect: control('zoomOut') }, + { + label: 'Actual size', + shortcut: 'Ctrl+0', + onSelect: control('zoomReset') + } + ] + } + ] +} + +function useWindowState(): WindowState { + const [st, setSt] = useState({ + square: false, + maximized: false, + focused: true + }) + useEffect(() => { + void window.api.windowState().then(setSt) + return window.api.onWindowState(setSt) + }, []) + return st +} + +export function Frame({ + title, + configured, + hideMenuBar, + children +}: { + title: string + configured: boolean + hideMenuBar: boolean + children: ReactNode +}) { + const st = useWindowState() + return ( +
+ + +
{children}
+ {/* The soft emboss and outline, painted last over everything. */} +
+
+
+
+
+
+ ) +} + +// ---- title bar ---- + +function WindowButton({ kind, maximized }: { kind: string; maximized: boolean }) { + const glyph = + kind === 'close' ? ( + + ) : kind === 'minimize' ? ( + + ) : maximized ? ( + <> + + + + ) : ( + + ) + const label = kind === 'close' ? 'Close' : kind === 'minimize' ? 'Minimize' : maximized ? 'Restore' : 'Maximize' + return ( + + ) +} + +function TitleBar({ title, maximized }: { title: string; maximized: boolean }) { + const [layout, setLayout] = useState<[string[], string[]]>([[], ['minimize', 'maximize', 'close']]) + useEffect(() => { + void window.api.windowButtons().then((l) => { + const known = (side: string): string[] => side.split(',').filter((b) => ['minimize', 'maximize', 'close'].includes(b)) + const [left, right = ''] = l.split(':') + setLayout([known(left), known(right)]) + }) + }, []) + const side = (names: string[]): ReactNode => ( +
+ {names.map((n) => ( + + ))} +
+ ) + return ( +
+ {side(layout[0])} +
{title}
+ {side(layout[1])} +
+ ) +} + +// ---- menu bar ---- + +function MenuBar({ configured, autoHide }: { configured: boolean; autoHide: boolean }) { + const [shown, setShown] = useState(!autoHide) + const [open, setOpen] = useState() + const [anchor, setAnchor] = useState({ x: 0, y: 0 }) + const bar = useRef(null) + const list = menus(configured) + const visible = !autoHide || shown || open !== undefined + + useEffect(() => setShown(!autoHide), [autoHide]) + + const openMenu = (i: number): void => { + setShown(true) + // Wait a frame so a bar that was hidden has laid out its labels. + requestAnimationFrame(() => { + const el = bar.current?.children[i] as HTMLElement | undefined + const r = el?.getBoundingClientRect() + if (r) setAnchor({ x: r.left, y: r.bottom }) + setOpen(i) + }) + } + + const close = (): void => { + setOpen(undefined) + if (autoHide) setShown(false) + } + + // Tap Alt (pressed and released with nothing in between) shows or hides + // the bar; Alt+letter opens that menu. + useEffect(() => { + let armed = false + const onDown = (e: KeyboardEvent): void => { + if (e.key === 'Alt') { + armed = !e.ctrlKey && !e.shiftKey && !e.metaKey && !e.repeat + return + } + armed = false + if (e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) { + const i = list.findIndex((m) => m.key === e.key.toLowerCase()) + if (i >= 0) { + e.preventDefault() + openMenu(i) + } + } else if (e.key === 'Escape' && autoHide && shown && open === undefined) { + setShown(false) + } + } + const onUp = (e: KeyboardEvent): void => { + if (e.key !== 'Alt' || !armed) return + armed = false + e.preventDefault() + if (open !== undefined) close() + else if (autoHide) setShown((s) => !s) + } + const cancel = (): void => { + armed = false + } + const onClick = (e: MouseEvent): void => { + armed = false + if (autoHide && shown && open === undefined && !bar.current?.contains(e.target as Node)) setShown(false) + } + window.addEventListener('keydown', onDown, true) + window.addEventListener('keyup', onUp, true) + window.addEventListener('mousedown', onClick, true) + window.addEventListener('blur', cancel) + return () => { + window.removeEventListener('keydown', onDown, true) + window.removeEventListener('keyup', onUp, true) + window.removeEventListener('mousedown', onClick, true) + window.removeEventListener('blur', cancel) + } + }) + + if (!visible) return null + return ( + <> +
+ {list.map((m, i) => ( + + ))} +
+ {open !== undefined && } + + ) +} diff --git a/src/renderer/src/components/SettingsDialog.tsx b/src/renderer/src/components/SettingsDialog.tsx index d866d38..06c67c6 100644 --- a/src/renderer/src/components/SettingsDialog.tsx +++ b/src/renderer/src/components/SettingsDialog.tsx @@ -1,7 +1,7 @@ -import { useEffect, useState } from 'react' +import { useEffect, useState, type ReactNode } from 'react' import type { AppState, RabbitStatus, RelayStatus } from '@shared/api' import { didName, formatNumber } from '@shared/phone' -import type { AddressBook, GvStatus, IconStyle, Settings, SyncStatus, Theme } from '@shared/types' +import type { AddressBook, GvStatus, IconStyle, Look, Settings, SyncStatus, Theme } from '@shared/types' import { CloseIcon } from './Icons' interface Props { @@ -11,14 +11,15 @@ interface Props { onChanged: () => void } +// Laid out like VLC's preferences (design.html#prefs): categories on the +// left, the chosen page on the right, a Close button. Every change applies +// as it's made. export function SettingsDialog({ state, sync, onClose, onChanged }: Props) { const [s, setS] = useState(state.settings) const [note, setNote] = useState() - // voip.ms numbers; Google Voice has its own section. + const [page, setPage] = useState('Appearance') + // voip.ms numbers; Google Voice has its own page. const smsDids = state.dids.filter((d) => d.smsEnabled && d.provider !== 'gvoice') - // Theme and icon are saved on click, so they never make the dialog dirty. - const clicked = { theme: undefined, icon: undefined } - const dirty = JSON.stringify({ ...s, ...clicked }) !== JSON.stringify({ ...state.settings, ...clicked }) useEffect(() => { const onKey = (e: KeyboardEvent): void => { @@ -28,30 +29,47 @@ export function SettingsDialog({ state, sync, onClose, onChanged }: Props) { return () => window.removeEventListener('keydown', onKey) }, [onClose]) - const save = async (): Promise => { - await window.api.updateSettings(s) - onChanged() - onClose() + const change = (next: Settings): void => { + setS(next) + void window.api.updateSettings(next).then(onChanged) } const synced = s.dids.length ? s.dids : smsDids.map((d) => d.did) - const sendFrom = [...synced, ...(state.gvoiceNumber ? [state.gvoiceNumber] : []), ...state.dids.filter((d) => d.provider === 'sim').map((d) => d.did)] + const sendFrom = [ + ...synced, + ...(state.gvoiceNumber ? [state.gvoiceNumber] : []), + ...state.dids.filter((d) => d.provider === 'sim').map((d) => d.did) + ] - return ( -
e.target === e.currentTarget && onClose()}> -
-
-

Settings

- -
- -
-

Appearance

+ const pages: Record = { + Appearance: ( + <> +
+

Look

+
+ Style +
+ {( + [ + ['signal', 'Signal vibes'], + ['trave', 'travewave'] + ] as [Look, string][] + ).map(([l, label]) => ( + + ))} +
+
Theme -
+
{(['system', 'light', 'dark'] as Theme[]).map((t) => (
-

Zoom with Ctrl + / Ctrl −, and Ctrl 0 to reset.

- -
-

Account

-
- voip.ms user - {state.username} -
-
- Messages stored - {sync?.total.toLocaleString() ?? '—'} -
-
- History import - {sync?.backfillDone ? 'Complete' : sync?.backfillCursor ? `In progress (back to ${sync.backfillCursor})` : 'Pending'} -
-
- Password stored in - {state.keyringBackend.startsWith('gnome') || state.keyringBackend.includes('libsecret') ? 'GNOME Keyring' : state.keyringBackend} -
+
+

Window

+ + + +
+ + ), + Account: ( +
+

voip.ms

+
+ voip.ms user + {state.username} +
+
+ Messages stored + {sync?.total.toLocaleString() ?? '—'} +
+
+ History import + {sync?.backfillDone ? 'Complete' : sync?.backfillCursor ? `In progress (back to ${sync.backfillCursor})` : 'Pending'} +
+
+ Password stored in + + {state.keyringBackend.startsWith('gnome') || state.keyringBackend.includes('libsecret') + ? 'GNOME Keyring' + : state.keyringBackend} + +
+
+
+
+ ), + 'Google Voice': , + Contacts: change({ ...s, contactBook })} />, + ...(smsDids.length > 0 && { + Numbers: ( +
+

Numbers to sync

+ {smsDids.map((d) => ( + + ))} + {sendFrom.length > 1 && ( + + )}
- - - - setS({ ...s, contactBook })} /> - + ) + }), + Sync: ( +
+

Checking

+ + +
+ ), + Rabbit: ( + <> + + ), + Storage: ( +
+

Storage & backups

+

+ Your message history lives here. A dated snapshot is written daily and on quit (last 7 kept in snapshots/) so backups + always contain a clean copy. +

+ {state.dataDir} +
+ + + +
+ {note &&

{note}

} +
+ ) + } - {smsDids.length > 0 && ( -
-

Numbers

- {smsDids.map((d) => ( - + return ( +
e.target === e.currentTarget && onClose()}> +
+
+

Preferences

+
+
+
+ {Object.keys(pages).map((name) => ( + ))} - {sendFrom.length > 1 && ( - - )} -
- )} - -
-

Sync

- - -
- -
-

Storage & backups

-

- Your message history lives here. A dated snapshot is written daily and on quit (last 7 kept in snapshots/) so - backups always contain a clean copy. -

- {state.dataDir} -
- - -
- {note &&

{note}

} -
- +
+ {pages[page]} +
+
- -
@@ -215,7 +285,12 @@ function gvStatusText(st?: GvStatus): string { if (st.phase === 'signedOut') return 'Signed out' if (st.phase === 'error') return `Error: ${st.error ?? 'unknown'}` if (!st.backfillDone) return 'Importing history…' - return st.lastPoll ? `Up to date (checked ${new Date(st.lastPoll).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' })})` : 'Connected' + return st.lastPoll + ? `Up to date (checked ${new Date(st.lastPoll).toLocaleTimeString([], { + hour: 'numeric', + minute: '2-digit' + })})` + : 'Connected' } function GoogleVoiceSection({ number, status, onChanged }: { number?: string; status?: GvStatus; onChanged: () => void }) { @@ -236,19 +311,27 @@ function GoogleVoiceSection({ number, status, onChanged }: { number?: string; st
Sign-in window not working?

- Google sometimes refuses sign-ins inside apps. Instead, sign in at voice.google.com in Firefox, open the developer tools - (F12) → Network, reload, right-click any request to clients6.google.com → Copy → Copy as cURL, and paste it here. - It holds your Google sign-in, so only paste it here. + Google sometimes refuses sign-ins inside apps. Instead, sign in at voice.google.com in Firefox, open the developer tools (F12) → + Network, reload, right-click any request to clients6.google.com → Copy → Copy as cURL, and paste it here. It holds your + Google sign-in, so only paste it here.

-