Commit Graph

422 Commits

Author SHA1 Message Date
Mo Tarbin
86b8bbfb5f show API version on navbar 2025-09-28 18:46:56 -04:00
Mo Tarbin
7658b4c9fe feat: add 'Anyone' option for assignees and disable Limited option when no assignees are selected 2025-09-28 02:46:15 -04:00
Mo Tarbin
f1384eef34 enhance chore management with status updates and default assignee settings 2025-09-28 02:24:08 -04:00
Mo Tarbin
c7c4a011ef Refactor chore management components to centralize action handling
- Removed individual chore action handlers from ChoreCard and CompactChoreCard.
- Introduced a unified `onAction` prop to handle various chore actions (approve, reject, complete, start, pause, delete, etc.) in a centralized manner.
- Updated ChoreActionMenu to utilize the new `onAction` prop for performing actions on chores.
- Simplified state management and notification handling for chore updates.
- Cleaned up unused imports and state variables across affected components.
2025-09-28 02:20:18 -04:00
Mo Tarbin
bdd73135f0 feat: integrate impersonated user handling for task completion 2025-09-27 20:29:28 -04:00
Mo Tarbin
b367410aaf fix: adjust transition timeout and add UNASSIGNED color constant 2025-09-27 13:48:20 -04:00
Mo Tarbin
c27404cc3a Refactor chore management modals and actions for centralized handling
- Removed individual modal states and handlers from ChoreCard and CompactChoreCard components.
- Introduced a centralized modal state and handler in MyChores component to manage modals for changing due dates, completing with past dates, changing assignees, adding notes, writing NFC, and nudging.
- Updated action handlers to utilize the new centralized approach for better maintainability and readability.
- Cleaned up unused imports and code related to modal management in ChoreCard and CompactChoreCard components.
2025-09-27 13:47:41 -04:00
Mo Tarbin
9ff2359b4c Remove Websocket code since we are only using SSE 2025-09-27 13:38:45 -04:00
Mohamad Tarbin
d28ecb509e Performance optimization 09 24 (#6)
* perf: optimize MyChores component performance and fix timer errors

## Fixed Issues
-  Timer error: `Timer '🏁 Main useEffect processing' does not exist`
-  Reduced 1049ms and 613ms message handler violations
-  Fixed 1+ second blank screen before chores display
-  Eliminated multiple redundant `getFilteredChores` calculations

## Performance Optimizations

### 1. Fixed Timer Execution Issue
**Problem**: React strict mode was causing timer mismatch between `console.time` and `console.timeEnd`
**Solution**: Restructured async useEffect to ensure proper timer lifecycle
```javascript
// Before: Timer in async IIFE caused double-execution issues
;(async () => {
  console.time('🏁 Main useEffect processing')
  // ...
  console.timeEnd('🏁 Main useEffect processing')
})()

// After: Proper async function structure
const processEffectAsync = async () => {
  // ... async operations
  console.timeEnd('🏁 Main useEffect processing')
}
processEffectAsync()
```

### 2. Optimized useState Lazy Initialization
**Problem**: `JSON.parse()` called on every render for state initialization
```javascript
// Before: Expensive operation on each render
const [openChoreSections, setOpenChoreSections] = useState(
  JSON.parse(localStorage.getItem('openChoreSections')) || {},
)

// After: Lazy initialization with error handling
const [openChoreSections, setOpenChoreSections] = useState(() => {
  try {
    return JSON.parse(localStorage.getItem('openChoreSections')) || {}
  } catch {
    return {}
  }
})
```

### 3. Reduced useEffect Dependencies
**Problem**: useEffect running too frequently due to object reference dependencies
```javascript
// Before: Full objects cause frequent re-runs
}, [choresData, membersData, userProfile, impersonatedUser, ...]

// After: Only specific properties that matter
}, [choresData?.res, membersData?.res, userProfile?.id, impersonatedUser?.userId, ...]
```

### 4. Added Memoization for Section Updates
**Problem**: `choreSections` updated even when data hadn't actually changed
```javascript
// Before: Always updating sections
setChoreSections(processedSections)

// After: Only update if data actually changed
setChoreSections(prevSections => {
  if (JSON.stringify(prevSections) === JSON.stringify(processedSections)) {
    return prevSections
  }
  return processedSections
})
```

### 5. Optimized localStorage Access
**Problem**: Multiple `localStorage.getItem()` calls and repeated parsing
```javascript
// Before: Multiple localStorage calls
if (localStorage.getItem('openChoreSections') === null) {
  // ...localStorage operations
}

// After: Single cached read
const storedSections = localStorage.getItem('openChoreSections')
if (storedSections === null) {
  // ...operations
}
```

### 6. Added useMemo/useCallback for Heavy Computations
- `processedChores` - Memoized chore sorting and filtering
- `processedSections` - Memoized section grouping
- `getFilteredChores` - Memoized filtered chore calculations
- `handleChoreUpdated`, `handleChoreDeleted`, `updateChores` - useCallback for stable references

## Performance Results
**Before**: 1+ second loading delay, timer errors, frequent violations
**After**:
- `processedChores calculation: ~0.002ms` (was much slower)
- `processedSections calculation: ~0.001ms` (was much slower)
- `getFilteredChores: ~0.022ms` (down from multiple slow calls)
- `Main useEffect processing: ~0.298ms` (reasonable time)
- `Auto-update sections: ~0.007ms` (very fast)

🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update package.json to remove deprecated @vitejs/plugin-react dependency and add wrangler.toml for build configuration

* Revert vite.config.js to it's original state

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-26 02:21:07 -04:00
Mo Tarbin
048e7d0ef6 Merge branch 'dev' of https://github.com/Donetick/frontend into dev 2025-09-24 02:19:33 -04:00
Mo Tarbin
1b49a6f3f7 feat: add @vitejs/plugin-react dependency for improved React support 2025-09-21 16:52:53 -04:00
Mo Tarbin
fd6e4880d2 refactor: remove unused safe area utility and simplify layout structure 2025-09-21 13:04:30 -04:00
Mo Tarbin
f27bbd318f Refactor chore management to use React Query hooks for timer and chore actions
- Replaced direct API calls with React Query hooks in ChoreView, ChoreCard, CompactChoreCard, and TimerDetails components for better state management and error handling.
- Updated ArchivedTasks to utilize useUnArchiveChore hook for restoring archived chores.
- Enhanced NotificationSetting to include device registration logic and improved user feedback for push notifications.
- Refactored TimerEditModal and TimerDetails to streamline timer session updates and deletions using hooks.
- Improved ChoreActionMenu to handle archiving and unarchiving chores with hooks.
- Adjusted various components to use getSafeBottomStyles for consistent bottom padding.
- Cleaned up unused imports and optimized loading states across components.
2025-09-21 12:46:03 -04:00
Mo Tarbin
79dfb11fa4 feat: add device token management and safe area utilities; enhance notification settings and chore components 2025-09-20 22:20:02 -04:00
Mo Tarbin
3bf9126595 refactor: replace NotificationSettings component with NotificationSetting in RouterContext 2025-09-20 19:07:26 -04:00
Mo Tarbin
a5a90dfbdd refactor NotificationSetting component to use SettingsLayout; remove NotificationSettings wrapper 2025-09-20 18:45:40 -04:00
Mo Tarbin
ac767f63ae Fix: pass the right user id when impersonating a user to chorefilter
implement experimental offline mode; add toggle in StorageSettings and update chore filters
2025-09-20 18:15:52 -04:00
Mo Tarbin
782862294d feat: integrate Firebase Messaging for push notifications; update AppDelegate and add Info.plist for widget support 2025-09-20 17:32:50 -04:00
Mo Tarbin
eded4b2e16 feat: add nudge functionality to chore cards and action menu; enhance user notifications
fix Filtering when imposing user to respect the sort and grouping order
2025-09-18 01:14:51 -04:00
Mo Tarbin
707ba55e1d feat: implement push notification registration and nudge feature; enhance user settings and notification handling 2025-09-18 01:13:37 -04:00
Mo Tarbin
b71a533024 enhance impersonation context and user profile handling; improve UI interactions in chore history and timer details 2025-09-15 23:52:28 -04:00
Mo Tarbin
36093b9199 refactor: update hero text in HomeHero component for clarity and engagement 2025-09-14 22:05:51 -04:00
Mo Tarbin
bd14a35e23 add terms and privacy policy agreement message to SignupView 2025-09-14 21:56:53 -04:00
Mo Tarbin
406da9732c Fix broken access to term and privacy pages 2025-09-14 21:55:14 -04:00
Mo Tarbin
219aa06835 chore: bump version to 0.1.111 2025-09-11 01:18:39 -04:00
Mo Tarbin
43decb21f4 Refactor StorageSettings to use SettingsLayout and improve layout structure; add ThemeSettings component; update TermsView with new terms and structure; enhance ThingsView styling; clean up AddTaskModal by removing experimental feature chip; create CalendarCard component for calendar overview; optimize CustomParsers for repeat parsing; update NavBar for improved navigation and search parameter handling. 2025-09-11 01:17:27 -04:00
Mo Tarbin
b152da9d21 feat: add ipad screenshot asset and update TabletInstallationSection to use it 2025-09-04 09:16:32 -04:00
Mo Tarbin
14ce2305ce refactor: remove open source badge from footer 2025-09-04 03:01:42 -04:00
Mo Tarbin
a65cb92f37 feat: update TabletInstallationSection to use imported image asset 2025-09-04 02:59:50 -04:00
Mo Tarbin
4a54115e31 remove option dependency 2025-09-04 02:49:30 -04:00
Mo Tarbin
3a80838b4c chore: remove architecture-specific dependencies for darwin arm64 2025-09-04 02:43:24 -04:00
Mo Tarbin
bb16da0f4a feat: add TabletInstallationSection component with responsive design and features 2025-09-04 02:41:54 -04:00
Mo Tarbin
714ae7b9f0 chore: add rollup and swc core dependencies for darwin arm64 architecture 2025-09-04 02:40:27 -04:00
Mo Tarbin
f5f60cc9eb Update dependencies and move architecture-specific packages to optionalDependencies 2025-09-04 02:27:50 -04:00
Mo Tarbin
057c5f7ec8 feat: Add notification types and enhance color management
- Introduced NOTIFICATION_TYPE constants for pre-due, due date, and post-due notifications in Colors.jsx.
- Updated HistoryCard.jsx to utilize TASK_COLOR for chip colors based on task status.
- Created DemoCalendar.jsx to showcase a visual task calendar with sample chore data.
- Enhanced DemoMyChore.jsx to include status for demo tasks.
- Added DemoNotificationTemplate.jsx for demonstrating smart notification scheduling.
- Revamped FeaturesSection.jsx to reflect updated feature descriptions and icons.
- Updated Footer.jsx to link to the correct API reference documentation.
- Improved GettingStarted.jsx with new mobile app download options and enhanced layout.
- Integrated TabletInstallationSection into Landing.jsx for better user guidance.
2025-09-04 01:49:19 -04:00
Mo Tarbin
d704588624 Update Feature Section 2025-09-03 22:56:12 -04:00
Mo Tarbin
c82a6cc0e1 feat: Add Discord and Reddit icon components 2025-09-02 22:41:21 -04:00
Mo Tarbin
603d83ba1b Revamp Footer component with enhanced layout, social links, and updated styling 2025-09-02 22:40:28 -04:00
Mo Tarbin
fd15235124 Enhance UI with section headers and descriptions for Archived Tasks, Labels, Settings, Things, User Activities, and update NavBar 2025-09-02 17:39:05 -04:00
Mo Tarbin
0c1e5a9628 chore: Bump version to 0.1.110 2025-09-02 01:50:49 -04:00
Mo Tarbin
6403d135ea feat: Implement User Switcher and add subscription cancellation modal 2025-09-02 01:50:06 -04:00
Mo Tarbin
a7b33c48b3 fix: Update navigation path after saving chore to remove trailing slash 2025-09-01 23:58:14 -04:00
Mo Tarbin
4e31190291 Add Capacitor Browser dependency and update safe area handling in components 2025-08-30 01:35:38 -04:00
Mo Tarbin
e99a06654e chore: Bump version to 0.1.109 and update dependencies 2025-08-29 00:54:27 -04:00
Mo Tarbin
cf4d0565c5 feat: Enhance Signup and Chores functionality
- Added query invalidation on signup to refresh user profile data.
- Improved MyChores component to ensure data is loaded before rendering.
- Introduced dynamic sidepanel configuration with drag-and-drop functionality.
- Created TasksByAssigneeCard to visualize tasks assigned to users.
- Updated MFASettings and Settings components for better structure and usability.
- Implemented SettingsOverview for a comprehensive settings navigation experience.
- Added SidepanelSettings for customizing sidepanel card visibility and order.
- Refactored NavBar to include user profile avatar and improved layout.
2025-08-29 00:50:54 -04:00
Mo Tarbin
6b5a874db5 Refactor ChoreCard to remove unused circle members data and update approval logic to use performers 2025-08-26 22:11:10 -04:00
Mo Tarbin
defc7a8fa4 Remove unused icon import and comment out 'Upgrade to Plus' ListItemButton in NavBar 2025-08-25 23:58:49 -04:00
Mo Tarbin
06d568e61d Bump version to 0.1.108 in package.json 2025-08-25 23:41:56 -04:00
Mo Tarbin
6064c88f2c Refactor navigation paths to use '/chores' instead of '/my/chores' across multiple components for consistency 2025-08-25 20:21:06 -04:00
Mo Tarbin
77b3430339 Adjust BottomSheetModal minHeight and add margin to toggle button; add 'Upgrade to Plus' option in NavBar 2025-08-23 17:17:02 -04:00