-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
35 lines (26 loc) · 1.62 KB
/
config.ts
File metadata and controls
35 lines (26 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// src/config.ts
export const APP_CONFIG = {
// --- Message Limits ---
maxMessageLength: 3000, // Max characters per message (enforced client-side + security rules)
// --- Cache / Sync ---
cacheExpirationDays: 7, // Messages older than this in IndexedDB are eligible for eviction
messagesPerPage: 50, // Number of messages loaded per batch (initial + load-more)
// --- Typing Indicator ---
typingDebounceMs: 3000, // How long after last keystroke before clearing typing status
typingStalenessMs: 5000, // Ignore typing docs older than this (stale cleanup)
// --- UI ---
topicBarMaxVisiblePills: 5, // Hint for mobile TopicBar; beyond this it scrolls
defaultLocale: 'en', // 'en' | 'zh' — initial language before user overrides
// --- Topics ---
topicMaxLength: 20, // Max characters for a topic name (a-z, A-Z, 0-9, _)
// --- Time Display ---
// Format for messages sent today. Uses Intl.DateTimeFormat option tokens.
timeFormatToday: { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false } as Intl.DateTimeFormatOptions,
// Format for messages sent on a previous day (date + time).
timeFormatPastDay: { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false } as Intl.DateTimeFormatOptions,
// --- Session ---
sessionDurationDays: 7, // Auto sign-out after this many days of inactivity
// --- Firebase ---
firestorePersistence: true, // Enable IndexedDB persistence (set false for debugging)
} as const;
export type AppConfig = typeof APP_CONFIG;