Commit Graph

448 Commits

Author SHA1 Message Date
Mohamad Tarbin
ed595a3815 Merge pull request #37 from lauraneto/bugfix/android-allow-http-requests
Allow HTTP (non secure) requests in Android app
2026-01-17 19:37:01 -05:00
Mo Tarbin
7c8fa27aaf feat: Add unarchive functionality to ChoreView and enhance project management features
- Implemented unarchive button for archived chores in ChoreView.
- Updated chore status handling to disable actions for archived chores.
- Enhanced MyChores component to filter tasks based on project selection, including a default project.
- Improved ProjectModal to streamline project creation and editing with a new footer layout.
- Refactored ProjectView to accurately count tasks for default and user projects.
- Added project selection dropdown in AddTaskModal with default project handling.
- Updated NavBar to handle logout using apiClient.
- Enhanced ProjectSelector to manage projects with a new menu item for project management.
2026-01-17 19:35:36 -05:00
Mo Tarbin
b326b1b3d7 refactor: update localStorage keys for token and expiration in authentication components 2026-01-16 15:04:27 -05:00
Mo Tarbin
f527064e55 implement View Transitions API for smoother page navigation and replace the current implementation 2026-01-16 12:12:36 -05:00
Mo Tarbin
3a074ef6c5 Add Support Project 2026-01-16 12:12:00 -05:00
Mo Tarbin
7fbae16a53 Add Support Project 2026-01-16 12:11:03 -05:00
Mo Tarbin
98018ca590 fix: update SSE message handler to reflect latest userProfile changes
there was issue where userprofile was undefined cause the message being display for same user how make the action.  The new useEffect hook updates the EventSource's handler whenever handleSSEMessage changes
2026-01-10 14:14:45 -05:00
Mo Tarbin
7d5724d8d5 add project filtering to MyChores component 2026-01-01 02:14:19 -05:00
Mo Tarbin
ba17a5592c feat: add ProjectModal component for creating and editing projects 2026-01-01 01:32:23 -05:00
Mo Tarbin
7332e81e6e Fix https://github.com/donetick/donetick/issues/373 compact card not showing the right performer 2025-12-27 16:45:49 -05:00
Mo Tarbin
5aeacef511 fix: enhance SSE error handling and token refresh logic; improve user profile checks in MyChores component 2025-12-26 19:59:39 -05:00
Mo Tarbin
0fd58860a8 Improve the flow for archive screen. Fix https://github.com/donetick/frontend/issues/41 2025-12-25 22:55:09 -05:00
Mo Tarbin
8edd3774d2 Support Refresh token and improve authentication and security.
Refactor authentication handling and API client integration

- Updated UserProfileAvatar to use 'access_token' instead of 'ca_token' for logout.
- Removed SSEProvider from Contexts and adjusted related imports.
- Introduced useAuth hook for centralized authentication logic, including login, logout, and token management.
- Refactored useSSE to utilize the new useAuth hook for token validation.
- Updated UserQueries to check for token validity using the new method.
- Deleted AuthenticationService as its functionality is now handled by useAuth.
- Created a new ApiClient utility for handling API requests and token management.
- Updated various components and views to use the new ApiClient for API interactions.
- Removed TokenManager and migrated its functionality to the new ApiClient.
- Adjusted LoginView and related components to utilize the new authentication flow.
- Cleaned up unused variables and improved code consistency across components.
2025-12-25 22:54:39 -05:00
Mo Tarbin
1123fb3ca6 fix: update onAction handler to accept extra data in ChoreCard component 2025-12-02 18:42:16 -05:00
Mo Tarbin
5bfd340176 Support unicode letter in the parser. Fix https://github.com/donetick/donetick/issues/395 2025-12-02 15:58:06 -05:00
Mo Tarbin
7cb2f203b1 refine platform check for native functionality in AccountSettings and Settings components 2025-12-02 00:23:13 -05:00
Laura Neto
7f65ce0e84 Allow HTTP (non secure) requests in Android app 2025-10-19 19:22:30 +02:00
Mo Tarbin
09f89afe2a fix: update state initialization and improve Grid component usage in ChoreView 2025-10-05 14:24:26 -04:00
Mo Tarbin
d1dcdc2f50 feat: add 'Gentle Nudges' feature with customizable reminders in FeaturesSection 2025-10-05 14:16:25 -04:00
Mo Tarbin
e31a5f705c replace CalendarView with CalendarMonthly and improve chore date formatting 2025-10-04 13:18:25 -04:00
Mo Tarbin
04314d507b Fix: https://github.com/donetick/donetick/issues/127
https://github.com/donetick/donetick/issues/277
2025-10-03 00:42:33 -04:00
Mo Tarbin
409c5a0ba3 enhance user input validation and parsing for usernames, points, and labels 2025-10-02 21:45:25 -04:00
Mo Tarbin
68f09125d4 chore: bump version to 0.1.115 2025-09-28 19:32:40 -04:00
Mo Tarbin
ac2d4911fe feat: update user activity filters to allow selection of last 7 days and improve UI layout 2025-09-28 19:13:38 -04:00
Mo Tarbin
26c2eaddff implement child user management functions and user type utilities 2025-09-28 19:13:28 -04:00
Mo Tarbin
d41d6bd758 feat: add sub user management features including creation, deletion, and password updates 2025-09-28 19:12:26 -04:00
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