Source
This app’s code and revision history are public. Download a copy or explore the files below.
Public
The app’s code and revision history are public.
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 20ace674a35b849ffda63b30
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
src/lib/mine.ts
// What this browser remembers: the groups it opened and which person it is in each. Nothing leaves the device.
const GROUPS = "split:groups";
export interface SavedGroup { id: string; name: string; at: number }
function read<T>(key: string, fallback: T): T {
try {
const raw = localStorage.getItem(key);
return raw ? (JSON.parse(raw) as T) : fallback;
} catch {
return fallback;
}
}
function write(key: string, value: unknown) {
try { localStorage.setItem(key, JSON.stringify(value)); } catch { /* storage full or blocked: the app still works */ }
}
export function savedGroups(): SavedGroup[] {
const list = read<SavedGroup[]>(GROUPS, []);
return Array.isArray(list) ? list.filter((g) => g && typeof g.id === "string").sort((a, b) => b.at - a.at) : [];
}
export function rememberGroup(id: string, name: string) {
write(GROUPS, [{ id, name, at: Date.now() }, ...savedGroups().filter((g) => g.id !== id)].slice(0, 100));
}
export function forgetGroup(id: string) {
write(GROUPS, savedGroups().filter((g) => g.id !== id));
}
/** Which person in the group this browser is (a plain person id). */
export function myPersonId(groupId: string): string | null {
try { return localStorage.getItem(`split:me:${groupId}`); } catch { return null; }
}
export function setMyPersonId(groupId: string, personId: string | null) {
try {
if (personId) localStorage.setItem(`split:me:${groupId}`, personId);
else localStorage.removeItem(`split:me:${groupId}`);
} catch { /* blocked storage: the choice lasts until the page closes */ }
}
Change history
Publish quality pass from owner chat
Bind agent address in policy constants
Quality pass: cleaner group page, phone polish, fuller API, sourced comparison
Bounded source sync
Bounded source sync