feat: add font size toggle functionality
- Implemented a FontSizeToggle component in HomePageClient for adjusting task font sizes in kanban views. - Updated TaskCard to apply dynamic font size classes based on user preferences. - Enhanced user preferences to include font size settings, defaulting to 'medium'. - Modified TODO.md to mark the font size toggle task as complete.
This commit is contained in:
@@ -16,6 +16,7 @@ interface UserPreferencesContextType {
|
||||
toggleObjectivesCollapse: () => Promise<void>;
|
||||
toggleTheme: () => Promise<void>;
|
||||
setTheme: (theme: 'light' | 'dark') => Promise<void>;
|
||||
toggleFontSize: () => Promise<void>;
|
||||
|
||||
// Column Visibility
|
||||
updateColumnVisibility: (updates: Partial<ColumnVisibility>) => Promise<void>;
|
||||
@@ -90,6 +91,14 @@ export function UserPreferencesProvider({ children, initialPreferences }: UserPr
|
||||
await updateViewPreferences({ theme });
|
||||
}, [updateViewPreferences]);
|
||||
|
||||
const toggleFontSize = useCallback(async () => {
|
||||
const fontSizes: ('small' | 'medium' | 'large')[] = ['small', 'medium', 'large'];
|
||||
const currentIndex = fontSizes.indexOf(preferences.viewPreferences.fontSize);
|
||||
const nextIndex = (currentIndex + 1) % fontSizes.length;
|
||||
const newFontSize = fontSizes[nextIndex];
|
||||
await updateViewPreferences({ fontSize: newFontSize });
|
||||
}, [preferences.viewPreferences.fontSize, updateViewPreferences]);
|
||||
|
||||
// === COLUMN VISIBILITY ===
|
||||
|
||||
const updateColumnVisibility = useCallback(async (updates: Partial<ColumnVisibility>) => {
|
||||
@@ -129,6 +138,7 @@ export function UserPreferencesProvider({ children, initialPreferences }: UserPr
|
||||
toggleObjectivesCollapse,
|
||||
toggleTheme,
|
||||
setTheme,
|
||||
toggleFontSize,
|
||||
updateColumnVisibility,
|
||||
toggleColumnVisibility,
|
||||
isColumnVisible
|
||||
|
||||
Reference in New Issue
Block a user