Milestone 7: the app normal people install (macOS)
A Tauri menu-bar app runs the same sync engine as `lunesync run`. It connects from the website with no code typed (lune://join and lune://pair links), shows status in the menu bar, and lets a person resolve held secrets, held big changes and kept-both notes side by side. Uninstall shares and hands over first, then removes only what Lune created. Releases are signed on the hub that holds the key (`lunehub release keygen/publish`); other hubs `release import` them. Apps verify the signature and the signed version. Clients older than the previous release are asked to update and keep saving locally. A device can now be on several hubs at once (own and workplace), each with its own key; the CLI takes --team when it matters. The supervisor and status summary moved into core, shared by the CLI and the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// also has a button in the details panel (X3).
|
||||
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { MacSection } from './MacApp';
|
||||
import { api, type CanvasData, type Comparison, type Health, type LogEntry, type Member, type Person, type Role, type Status, type Vault } from './api';
|
||||
import {
|
||||
HANDLE_T, W, boardHeight, circle, easeBack, lerp, personColor, positions, ribbon, roundRect, vaultColor,
|
||||
@@ -668,6 +669,7 @@ function Overview({ data, members, log, open, close, newVault, signOut }: {
|
||||
</ol>
|
||||
</section>
|
||||
)}
|
||||
<MacSection />
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
|
||||
<span className="muted">Signed in as {data.me.person}</span>
|
||||
<button className="btn btn-small" onClick={signOut}>Sign out</button>
|
||||
|
||||
58
web/src/MacApp.tsx
Normal file
58
web/src/MacApp.tsx
Normal file
@@ -0,0 +1,58 @@
|
||||
// Getting the Mac app (M7): download it from this hub, then hand it the invite or a fresh pairing code through a
|
||||
// lune:// link, so nobody copies a code by hand.
|
||||
import { useEffect, useState } from 'react';
|
||||
import { api } from './api';
|
||||
|
||||
interface Release { version: string | null; mac: string | null }
|
||||
|
||||
function useRelease() {
|
||||
const [r, setR] = useState<Release | null>(null);
|
||||
useEffect(() => { fetch('/api/release').then((x) => x.json()).then(setR).catch(() => setR({ version: null, mac: null })); }, []);
|
||||
return r;
|
||||
}
|
||||
|
||||
const FIRST_OPEN = 'This pilot build isn’t signed by Apple yet: the first time, macOS may say it can’t check Lune. Open System Settings → Privacy & Security and choose Open Anyway.';
|
||||
|
||||
/** On an invite page: download, then join from the app with this link. */
|
||||
export function JoinWithApp({ link }: { link: string }) {
|
||||
const r = useRelease();
|
||||
return (
|
||||
<>
|
||||
<ol className="steps">
|
||||
<li>
|
||||
{r?.mac ? <a className="btn btn-primary" href={r.mac}>Download Lune for Mac</a> : <span className="muted">The Mac app isn't published on this hub yet.</span>}
|
||||
{r?.mac && <span className="muted">Open the download and drag Lune to Applications, then open it. {FIRST_OPEN}</span>}
|
||||
</li>
|
||||
<li>
|
||||
<a className="btn" href={`lune://join?link=${encodeURIComponent(link)}`}>Open Lune to join</a>
|
||||
<span className="muted">Lune asks for a name for this Mac and where shared vaults should go. This link works once.</span>
|
||||
</li>
|
||||
</ol>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/** On the canvas: get the app, or connect a Mac that has it, without typing a code. */
|
||||
export function MacSection() {
|
||||
const r = useRelease();
|
||||
const [error, setError] = useState('');
|
||||
const connect = async () => {
|
||||
setError('');
|
||||
try {
|
||||
const { code } = await api.pair();
|
||||
location.href = `lune://pair?hub=${encodeURIComponent(location.origin)}&code=${encodeURIComponent(code)}`;
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<section className="ov-sec">
|
||||
<div className="ov-head"><h3>Lune for Mac{r?.version ? ` · ${r.version}` : ''}</h3></div>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, padding: '0 6px 4px' }}>
|
||||
{r?.mac && <a className="btn btn-small" href={r.mac}>Get the Mac app</a>}
|
||||
<button className="btn btn-small" onClick={connect}>Connect this Mac</button>
|
||||
</div>
|
||||
{error && <p className="error" style={{ padding: '0 6px' }}>{error}</p>}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -90,6 +90,7 @@ async function call<T>(method: string, path: string, body?: unknown): Promise<T>
|
||||
export const api = {
|
||||
canvas: () => call<CanvasData>('GET', '/api/canvas'),
|
||||
log: (count = 8) => call<LogEntry[]>('GET', `/api/log?count=${count}`),
|
||||
pair: () => call<{ code: string }>('POST', '/api/pair'),
|
||||
signin: (code: string) => call<object>('POST', '/api/web/signin', { code }),
|
||||
signout: () => call<object>('POST', '/api/web/signout'),
|
||||
grant: (person: string, vault: string, role: Role) => call<object>('POST', '/api/grants', { person, vault, role }),
|
||||
|
||||
48
web/src/desktop/desktop.css
Normal file
48
web/src/desktop/desktop.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/* The Lune window: same ink-on-lavender as the canvas, sized for a small menu-bar window. Status colours as X6. */
|
||||
:root {
|
||||
--current: #2E8B5F;
|
||||
--behind: #E09A2B;
|
||||
--offline: #A9A5B6;
|
||||
--secret: #C8323B;
|
||||
}
|
||||
body { background: var(--paper); user-select: none; -webkit-user-select: none; }
|
||||
input, pre { user-select: text; -webkit-user-select: text; }
|
||||
.app { min-height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
|
||||
.top { display: flex; align-items: center; gap: 10px; }
|
||||
.top-text { display: flex; flex-direction: column; min-width: 0; }
|
||||
.top-text b { font-size: 18px; }
|
||||
.moon-small { width: 32px; height: 32px; }
|
||||
.moon { width: 64px; height: 64px; align-self: center; }
|
||||
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: baseline; }
|
||||
.dot-current { background: var(--current); }
|
||||
.dot-behind { background: var(--behind); }
|
||||
.dot-offline { background: var(--offline); }
|
||||
.dot-secret { background: var(--secret); }
|
||||
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); border: 1px solid var(--accent-tint); border-radius: 14px; padding: 8px 8px 8px 14px; font-size: 14px; }
|
||||
.welcome { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.welcome h1 { margin: 0; font-size: 22px; line-height: 1.2; }
|
||||
.welcome p { margin: 0; line-height: 1.5; }
|
||||
.welcome label { font-weight: 700; font-size: 14px; margin-top: 4px; }
|
||||
.folder-row { display: flex; align-items: center; gap: 8px; }
|
||||
.folder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; font-size: 14px; background: #F8F6FC; border: 1px solid #ECE8F5; border-radius: 10px; padding: 7px 10px; }
|
||||
.vaults { display: flex; flex-direction: column; gap: 10px; }
|
||||
.vault { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.vault-head { display: flex; align-items: center; gap: 10px; }
|
||||
.vault-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
|
||||
.vault-name .muted { overflow-wrap: anywhere; }
|
||||
.need { background: #F8F6FC; border: 1px solid #ECE8F5; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
|
||||
.need-secret { background: #FBEDED; border-color: #F0CDCF; }
|
||||
.need .lbl { font-size: 13px; font-weight: 700; margin-top: 4px; }
|
||||
.need .field { font-size: 14px; padding: 8px 10px; }
|
||||
.need .actions { margin-top: 2px; }
|
||||
.center { text-align: center; padding: 24px 8px; }
|
||||
.foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
|
||||
.foot > .actions { justify-content: flex-start; }
|
||||
.recent summary { cursor: pointer; font-size: 13px; color: var(--muted); }
|
||||
.recent pre { font-size: 11px; line-height: 1.5; white-space: pre-wrap; color: var(--muted); max-height: 160px; overflow-y: auto; }
|
||||
.cmp-body { max-height: 22vh; }
|
||||
.dialog .actions { position: sticky; bottom: -24px; background: #FFFFFF; padding: 10px 0 2px; }
|
||||
.team-tag { font-weight: 400; font-size: 12px; color: var(--muted); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
|
||||
.teams { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
|
||||
.teams li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px 4px 2px 12px; }
|
||||
.toast-d { position: fixed; left: 16px; right: 16px; bottom: 16px; background: var(--ink); color: #FFFFFF; border-radius: 14px; padding: 10px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(34, 30, 51, 0.25); }
|
||||
318
web/src/desktop/main.tsx
Normal file
318
web/src/desktop/main.tsx
Normal file
@@ -0,0 +1,318 @@
|
||||
// The Lune window in the Mac app: connect this Mac, see each vault plainly, and make the few decisions only a person
|
||||
// can (a held big change, a possible secret, a note changed in two places). Talks to the app, not to the hub.
|
||||
import { StrictMode, useCallback, useEffect, useState } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import '../styles.css';
|
||||
import './desktop.css';
|
||||
import moon from './moon.svg';
|
||||
|
||||
type Level = 'current' | 'behind' | 'offline' | 'secret';
|
||||
|
||||
interface VaultStatus {
|
||||
name: string;
|
||||
path: string;
|
||||
team: string | null;
|
||||
level: Level;
|
||||
headline: string;
|
||||
last_synced: number | null;
|
||||
waiting: number;
|
||||
read_only: boolean;
|
||||
running: boolean;
|
||||
held: { message: string; removed: number; rewritten: number; total: number }[];
|
||||
secrets: { path: string; found: string[] }[];
|
||||
tidy: { note: string; copy: string; label: string }[];
|
||||
case_clashes: string[];
|
||||
}
|
||||
|
||||
interface Overview {
|
||||
version: string;
|
||||
connected: boolean;
|
||||
teams: string[];
|
||||
device: string;
|
||||
folder: string;
|
||||
level: Level;
|
||||
summary: string;
|
||||
vaults: VaultStatus[];
|
||||
pending: { kind: 'join' | 'pair'; hub: string } | null;
|
||||
update: string | null;
|
||||
recent: string[];
|
||||
}
|
||||
|
||||
interface Comparison {
|
||||
note: string;
|
||||
copy: string;
|
||||
label: string;
|
||||
copy_is_mine: boolean;
|
||||
note_text: string | null;
|
||||
copy_text: string | null;
|
||||
}
|
||||
|
||||
const host = (url: string | null) => (url ? url.replace(/^https?:\/\//, '') : '');
|
||||
const plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
||||
|
||||
function Dot({ level }: { level: Level }) {
|
||||
return <span className={`dot dot-${level}`} aria-hidden="true" />;
|
||||
}
|
||||
|
||||
/** Connecting: from the link the website opened (no code), or a hub address and code typed by hand. */
|
||||
function Connect({ o, done, cancel }: { o: Overview; done: (msg: string) => void; cancel?: () => void }) {
|
||||
const [name, setName] = useState(o.device);
|
||||
const [folder, setFolder] = useState(o.folder);
|
||||
const [hubUrl, setHubUrl] = useState('');
|
||||
const [code, setCode] = useState('');
|
||||
const [manual, setManual] = useState(!!cancel && !o.pending);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const fromLink = o.pending && !manual;
|
||||
|
||||
const submit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setBusy(true);
|
||||
setError('');
|
||||
try {
|
||||
done(await invoke<string>('connect', { name, folder, hubUrl: fromLink ? null : hubUrl, code: fromLink ? null : code }));
|
||||
} catch (err) {
|
||||
setError(String(err));
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
const pick = async () => {
|
||||
const path = await invoke<string | null>('choose_folder');
|
||||
if (path) setFolder(path);
|
||||
};
|
||||
|
||||
if (!o.pending && !manual) {
|
||||
return (
|
||||
<section className="welcome">
|
||||
<img className="moon" src={moon} alt="" />
|
||||
<h1 className="disp">Connect this Mac to your team</h1>
|
||||
<p>Open your invite link and choose <b>Open Lune to join</b>. Already on the team? Open the team canvas in your browser and choose <b>Connect this Mac</b>.</p>
|
||||
<button className="btn btn-ghost" onClick={() => setManual(true)}>I have a pairing code instead</button>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<form className="welcome" onSubmit={submit}>
|
||||
<span className="eyebrow">{fromLink ? (o.pending!.kind === 'join' ? 'Invite' : 'Connect') : 'Pairing code'}</span>
|
||||
<h1 className="disp">
|
||||
{fromLink ? (o.pending!.kind === 'join' ? `Join the team at ${host(o.pending!.hub)}` : `Connect to ${host(o.pending!.hub)}`) : 'Connect with a code'}
|
||||
</h1>
|
||||
{!fromLink && (
|
||||
<>
|
||||
<label htmlFor="hub">Team address</label>
|
||||
<input id="hub" className="field" value={hubUrl} onChange={(e) => setHubUrl(e.target.value)} placeholder="lune.example.com" autoFocus />
|
||||
<label htmlFor="code">Code from one of your devices</label>
|
||||
<input id="code" className="field code" value={code} onChange={(e) => setCode(e.target.value)} placeholder="K7QD-4MXA" />
|
||||
</>
|
||||
)}
|
||||
<label htmlFor="name">This Mac's name</label>
|
||||
<input id="name" className="field" value={name} onChange={(e) => setName(e.target.value)} maxLength={40} />
|
||||
<p className="muted">Your team sees it next to your changes.</p>
|
||||
<label>Shared vaults go in</label>
|
||||
<div className="folder-row">
|
||||
<span className="folder" title={folder}><bdi>{folder}</bdi></span>
|
||||
<button type="button" className="btn btn-small" onClick={pick}>Change…</button>
|
||||
</div>
|
||||
{error && <p className="error" role="alert">{error}</p>}
|
||||
<button className="btn btn-primary" type="submit" disabled={busy || !name.trim() || (!fromLink && (!hubUrl.trim() || !code.trim()))}>
|
||||
{busy ? 'Connecting…' : fromLink && o.pending!.kind === 'join' ? 'Join' : 'Connect'}
|
||||
</button>
|
||||
{fromLink ? (
|
||||
<button type="button" className="btn btn-ghost" onClick={() => setManual(true)}>Use a pairing code instead</button>
|
||||
) : o.pending ? (
|
||||
<button type="button" className="btn btn-ghost" onClick={() => setManual(false)}>Back to the link</button>
|
||||
) : (
|
||||
<button type="button" className="btn btn-ghost" onClick={() => (cancel ? cancel() : setManual(false))}>Back</button>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
function SecretCard({ vault, s, act }: { vault: string; s: VaultStatus['secrets'][number]; act: (cmd: string, args: Record<string, unknown>, msg: string) => void }) {
|
||||
const [pointer, setPointer] = useState('');
|
||||
return (
|
||||
<div className="need need-secret">
|
||||
<b>{s.path} wasn't shared: it may contain a secret</b>
|
||||
{s.found.map((f) => <span key={f} className="muted">{f}</span>)}
|
||||
<label className="lbl" htmlFor={`p-${s.path}`}>Replace it with where to find it</label>
|
||||
<input id={`p-${s.path}`} className="field" value={pointer} onChange={(e) => setPointer(e.target.value)} placeholder='e.g. "search prod-deploy in Secrets Manager"' />
|
||||
<div className="actions">
|
||||
<button className="btn btn-small" onClick={() => act('not_a_secret', { vault, path: s.path }, `OK — ${s.path} will be shared`)}>Not a secret</button>
|
||||
<button className="btn btn-small btn-primary" disabled={!pointer.trim()} onClick={() => act('secret_pointer', { vault, path: s.path, pointer }, 'Replaced — sharing now')}>Replace</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function VaultCard({ v, several, act, compare }: { v: VaultStatus; several: boolean; act: (cmd: string, args: Record<string, unknown>, msg: string) => void; compare: (vault: string, copy: string) => void }) {
|
||||
return (
|
||||
<article className="vault" data-vault={v.name}>
|
||||
<div className="vault-head">
|
||||
<Dot level={v.level} />
|
||||
<div className="vault-name">
|
||||
<b>{v.name}{several && v.team && <span className="team-tag">{host(v.team)}</span>}</b>
|
||||
<span className="muted">{v.headline}</span>
|
||||
</div>
|
||||
<button className="btn btn-small btn-ghost" onClick={() => act('open_folder', { vault: v.name }, '')}>Open folder</button>
|
||||
</div>
|
||||
{v.held.map((h) => (
|
||||
<div key={h.message} className="need">
|
||||
<b>A big change is waiting for you</b>
|
||||
<span className="muted">"{h.message}" removes {h.removed} and rewrites {h.rewritten} of {plural(h.total, 'note')}. Nothing from this Mac is shared until you decide.</span>
|
||||
<div className="actions">
|
||||
<button className="btn btn-small" onClick={() => act('held_undo', { vault: v.name }, 'Brought everything back')}>Undo</button>
|
||||
<button className="btn btn-small btn-primary" onClick={() => act('held_share', { vault: v.name }, 'Sharing it')}>Share anyway</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{v.secrets.map((s) => <SecretCard key={s.path} vault={v.name} s={s} act={act} />)}
|
||||
{v.tidy.map((t) => (
|
||||
<div key={t.copy} className="need">
|
||||
<b>{t.note} was changed in two places</b>
|
||||
<span className="muted">Both versions are kept; pick one when you have a moment.</span>
|
||||
<div className="actions">
|
||||
<button className="btn btn-small btn-primary" onClick={() => compare(v.name, t.copy)}>Compare</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
/** Side by side (stacked in this narrow window); differing lines tinted. */
|
||||
function CompareSheet({ vault, copy, close, done }: { vault: string; copy: string; close: () => void; done: (msg: string) => void }) {
|
||||
const [c, setC] = useState<Comparison | null>(null);
|
||||
const [error, setError] = useState('');
|
||||
useEffect(() => { invoke<Comparison>('compare', { vault, copy }).then(setC).catch((e) => setError(String(e))); }, [vault, copy]);
|
||||
const keep = async (which: 'note' | 'copy' | 'both') => {
|
||||
try {
|
||||
await invoke('tidy', { vault, copy, keep: which });
|
||||
done(which === 'both' ? 'Kept both as separate notes' : 'Tidied — every device gets it shortly');
|
||||
} catch (e) {
|
||||
setError(String(e));
|
||||
}
|
||||
};
|
||||
const column = (title: string, text: string | null, other: string | null, tint: string) => {
|
||||
const others = new Set((other ?? '').split('\n'));
|
||||
return (
|
||||
<div className="cmp-col">
|
||||
<div className="cmp-head">{title}</div>
|
||||
<div className="cmp-body">
|
||||
{text === null ? <span className="muted">Not shown (not a text note, or very large).</span>
|
||||
: text.split('\n').map((line, i) => <div key={i} style={others.has(line) ? undefined : { background: tint, margin: '0 -14px', padding: '0 14px' }}>{line || ' '}</div>)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const mine = c?.copy_is_mine;
|
||||
return (
|
||||
<div className="scrim" onPointerDown={(e) => { if (e.target === e.currentTarget) close(); }}>
|
||||
<div className="dialog" role="dialog" aria-modal="true" aria-label="Compare two versions">
|
||||
<div><span className="eyebrow">{vault} · {c?.note ?? ''}</span><h2 className="disp">Two versions of the same lines</h2></div>
|
||||
{error && <p className="error">{error}</p>}
|
||||
{c && (
|
||||
<div className="cmp">
|
||||
{column(mine ? 'The other version (in place)' : 'In place', c.note_text, c.copy_text, '#FBEBD3')}
|
||||
{column(mine ? "This Mac's version" : `${c.label}'s version`, c.copy_text, c.note_text, '#E8E1FB')}
|
||||
</div>
|
||||
)}
|
||||
<div className="actions">
|
||||
<button className="btn" onClick={close}>Not now</button>
|
||||
{c && (
|
||||
<>
|
||||
<button className="btn" onClick={() => keep('both')}>Keep both</button>
|
||||
<button className="btn" onClick={() => keep('note')}>{mine ? 'Keep the other' : 'Keep the one in place'}</button>
|
||||
<button className="btn btn-primary" onClick={() => keep('copy')}>{mine ? "Keep this Mac's" : `Keep ${c.label}'s`}</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function App() {
|
||||
const [o, setO] = useState<Overview | null>(null);
|
||||
const [error, setError] = useState('');
|
||||
const [toast, setToast] = useState('');
|
||||
const [comparing, setComparing] = useState<{ vault: string; copy: string } | null>(null);
|
||||
const [joining, setJoining] = useState(false);
|
||||
|
||||
const load = useCallback(() => invoke<Overview>('overview').then(setO).catch((e) => setError(String(e))), []);
|
||||
useEffect(() => {
|
||||
load();
|
||||
const t = setInterval(load, 2000);
|
||||
return () => clearInterval(t);
|
||||
}, [load]);
|
||||
useEffect(() => {
|
||||
if (!toast) return;
|
||||
const t = setTimeout(() => setToast(''), 4000);
|
||||
return () => clearTimeout(t);
|
||||
}, [toast]);
|
||||
|
||||
const act = async (cmd: string, args: Record<string, unknown>, msg: string) => {
|
||||
try {
|
||||
await invoke(cmd, args);
|
||||
if (msg) setToast(msg);
|
||||
load();
|
||||
} catch (e) {
|
||||
setToast(String(e));
|
||||
}
|
||||
};
|
||||
|
||||
if (!o) return <main className="app">{error && <p className="error">{error}</p>}</main>;
|
||||
return (
|
||||
<main className="app">
|
||||
<header className="top">
|
||||
<img className="moon-small" src={moon} alt="" />
|
||||
<div className="top-text">
|
||||
<b className="disp">Lune</b>
|
||||
<span className="muted"><Dot level={o.level} /> {o.summary}</span>
|
||||
</div>
|
||||
</header>
|
||||
{o.update && (
|
||||
<div className="banner">
|
||||
<span>Lune {o.update} is ready.</span>
|
||||
<button className="btn btn-small btn-primary" onClick={() => invoke('restart')}>Restart to update</button>
|
||||
</div>
|
||||
)}
|
||||
{!o.connected || o.pending || joining ? (
|
||||
<Connect o={o} done={(msg) => { setJoining(false); setToast(msg); load(); }} cancel={o.connected ? () => setJoining(false) : undefined} />
|
||||
) : (
|
||||
<>
|
||||
<section className="vaults">
|
||||
{o.vaults.length === 0 && <p className="muted center">Your vaults are on their way. They'll appear in {o.folder}.</p>}
|
||||
{o.vaults.map((v) => <VaultCard key={v.path} v={v} several={o.teams.length > 1} act={act} compare={(vault, copy) => setComparing({ vault, copy })} />)}
|
||||
</section>
|
||||
<footer className="foot">
|
||||
<span className="muted">{o.device} · Lune {o.version}</span>
|
||||
<ul className="teams">
|
||||
{o.teams.map((t) => (
|
||||
<li key={t}>
|
||||
<span>{host(t)}</span>
|
||||
<button className="btn btn-small btn-ghost" onClick={() => act('open_canvas', { team: t }, '')}>Open canvas</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<div className="actions">
|
||||
<button className="btn btn-small" onClick={() => act('share_now', {}, 'Sharing now')}>Share now</button>
|
||||
<button className="btn btn-small" onClick={() => setJoining(true)}>Join another team</button>
|
||||
</div>
|
||||
{o.recent.length > 0 && (
|
||||
<details className="recent">
|
||||
<summary>Recent activity</summary>
|
||||
<pre>{o.recent.join('\n')}</pre>
|
||||
</details>
|
||||
)}
|
||||
</footer>
|
||||
</>
|
||||
)}
|
||||
{comparing && <CompareSheet {...comparing} close={() => setComparing(null)} done={(msg) => { setComparing(null); setToast(msg); load(); }} />}
|
||||
{toast && <div className="toast-d" role="status">{toast}</div>}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<StrictMode><App /></StrictMode>);
|
||||
1
web/src/desktop/moon.svg
Normal file
1
web/src/desktop/moon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><mask id="m"><rect width="64" height="64" fill="#fff"/><circle cx="38" cy="26" r="16" fill="#000"/></mask></defs><rect x="2" y="2" width="60" height="60" rx="14" fill="#1F2A4D"/><circle cx="30" cy="34" r="17" fill="#F1E6C8" mask="url(#m)"/></svg>
|
||||
|
After Width: | Height: | Size: 313 B |
@@ -2,6 +2,7 @@ import { StrictMode, useEffect, useState } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { api, SignedOut, type CanvasData } from './api';
|
||||
import { Canvas } from './Canvas';
|
||||
import { JoinWithApp } from './MacApp';
|
||||
import './styles.css';
|
||||
|
||||
/** Sign in with a code from one of your devices (no passwords, §8). */
|
||||
@@ -34,7 +35,7 @@ function SignIn({ onDone }: { onDone: () => void }) {
|
||||
);
|
||||
}
|
||||
|
||||
/** What an invite link shows in a browser: how to join with the app. */
|
||||
/** What an invite link shows in a browser: get the Mac app and join from it, or join a server from the terminal. */
|
||||
function Join() {
|
||||
const link = location.href;
|
||||
return (
|
||||
@@ -42,9 +43,11 @@ function Join() {
|
||||
<div className="card">
|
||||
<span className="eyebrow">Lune · invite</span>
|
||||
<h1 className="disp">You're invited to a team</h1>
|
||||
<p>Install the sync app, then join from the device you'll use (this link works once):</p>
|
||||
<pre className="cmd">lunesync join {link} --name "My laptop"</pre>
|
||||
<p className="muted">Pick any name for the device; your team sees it next to your changes. Shared vaults arrive in <code>~/Vaults</code>.</p>
|
||||
<JoinWithApp link={link} />
|
||||
<details>
|
||||
<summary className="muted">Joining from a server or the terminal instead</summary>
|
||||
<pre className="cmd">lunesync join {link} --name "My server"</pre>
|
||||
</details>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -141,3 +141,10 @@ button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid
|
||||
.panel { animation: none; }
|
||||
.stage, .bottombar, .fade { transition: none; }
|
||||
}
|
||||
|
||||
/* Getting the Mac app */
|
||||
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
|
||||
.steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
|
||||
.steps a.btn { text-decoration: none; display: inline-flex; align-items: center; }
|
||||
.ov-sec a.btn { text-decoration: none; display: inline-flex; align-items: center; }
|
||||
details summary { cursor: pointer; }
|
||||
|
||||
1
web/src/vite-env.d.ts
vendored
Normal file
1
web/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
Reference in New Issue
Block a user