Two random words as the name of anonymous collaborators; no z-order change when read-only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wkh
2026-09-28 20:50:16 +02:00
co-authored by Claude Opus 5.5
parent 5871524421
commit ed099cfbda
3 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -39,7 +39,9 @@ const CHANNEL = 'numolus:library';
const DEFAULT_TITLE = 'Unbenannt';
const APP_TITLE = 'numolus';
const ANON_COLORS = ['#e67e22', '#2980b9', '#27ae60', '#8e44ad', '#c0392b', '#16a085'];
const ANON_NAMES = ['Fuchs', 'Dachs', 'Luchs', 'Otter', 'Eule', 'Biber', 'Reh', 'Igel'];
/** Anonymous people are shown as two random words, e.g. "Kiesel Komet". */
const ANON_WORDS_A = ['Kiesel', 'Wolke', 'Anker', 'Nebel', 'Kompass', 'Laterne', 'Moos', 'Feder', 'Bernstein', 'Brise', 'Quelle', 'Funke'];
const ANON_WORDS_B = ['Komet', 'Fuchs', 'Welle', 'Ahorn', 'Leuchtturm', 'Otter', 'Gipfel', 'Mond', 'Dachs', 'Birke', 'Falke', 'Stern'];
export type DocSource = 'local' | 'server';
export interface DocRef {
@@ -84,7 +86,7 @@ function writeLinks(links: LinkDoc[]) {
function presenceIdentity(user: { name: string; color: string } | null) {
if (user) return { name: user.name, color: user.color };
const pick = <T>(a: T[]) => a[Math.floor(Math.random() * a.length)];
return { name: `Anonym (${pick(ANON_NAMES)})`, color: pick(ANON_COLORS) };
return { name: `${pick(ANON_WORDS_A)} ${pick(ANON_WORDS_B)}`, color: pick(ANON_COLORS) };
}
function createLibrary() {