slack status without the slack status.zzstoatzz.io/
quickslice

fix: make map_from_row method private per review feedback

+46 -2
+1 -1
src/db/models.rs
··· 40 40 } 41 41 42 42 /// Helper to map from [Row] to [StatusDb] 43 - pub fn map_from_row(row: &Row) -> Result<Self, async_sqlite::rusqlite::Error> { 43 + fn map_from_row(row: &Row) -> Result<Self, async_sqlite::rusqlite::Error> { 44 44 Ok(Self { 45 45 uri: row.get(0)?, 46 46 author_did: row.get(1)?,
+39
static/settings.js
··· 1 + // Shared font map configuration 2 + const FONT_MAP = { 3 + 'system': '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', 4 + 'mono': '"JetBrains Mono", "Fira Code", "Cascadia Code", monospace', 5 + 'serif': 'ui-serif, Georgia, Cambria, serif', 6 + 'comic': '"Comic Sans MS", "Comic Sans", cursive' 7 + }; 8 + 9 + // Check if user is authenticated by looking for auth-specific data 10 + function isAuthenticated() { 11 + // Check for data attribute that indicates authentication status 12 + return document.body.dataset.authenticated === 'true'; 13 + } 14 + 15 + // Helper to save preferences to API 16 + async function savePreferencesToAPI(updates) { 17 + if (!isAuthenticated()) return; 18 + 19 + try { 20 + await fetch('/api/preferences', { 21 + method: 'POST', 22 + headers: { 'Content-Type': 'application/json' }, 23 + body: JSON.stringify(updates) 24 + }); 25 + } catch (err) { 26 + console.log('Failed to save preferences to server'); 27 + } 28 + } 29 + 30 + // Apply font to the document 31 + function applyFont(fontKey) { 32 + const fontFamily = FONT_MAP[fontKey] || FONT_MAP.mono; 33 + document.documentElement.style.setProperty('--font-family', fontFamily); 34 + } 35 + 36 + // Apply accent color to the document 37 + function applyAccentColor(color) { 38 + document.documentElement.style.setProperty('--accent', color); 39 + }
+6 -1
templates/base.html
··· 26 26 <!-- Shared Timestamp Formatter --> 27 27 <script src="/static/timestamps.js"></script> 28 28 29 + <!-- Shared Settings Module --> 30 + <script src="/static/settings.js"></script> 31 + 29 32 <!-- Apply User Settings --> 30 33 <script> 31 34 // Apply saved settings immediately to prevent flash ··· 33 36 const savedFont = localStorage.getItem('fontFamily') || 'mono'; 34 37 const savedAccent = localStorage.getItem('accentColor') || '#1DA1F2'; 35 38 39 + // Use shared FONT_MAP from settings.js (will be available after load) 40 + // For immediate application, we still need local fontMap to prevent flash 36 41 const fontMap = { 37 42 'system': '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', 38 43 'mono': '"JetBrains Mono", "Fira Code", "Cascadia Code", monospace', ··· 40 45 'comic': '"Comic Sans MS", "Comic Sans", cursive' 41 46 }; 42 47 43 - document.documentElement.style.setProperty('--font-family', fontMap[savedFont] || fontMap.system); 48 + document.documentElement.style.setProperty('--font-family', fontMap[savedFont] || fontMap.mono); 44 49 document.documentElement.style.setProperty('--accent', savedAccent); 45 50 })(); 46 51 </script>