Conversation
- Delete all TWA (Trusted Web Activity) related files including Android project configuration, Gradle wrappers, and Android manifest. - Remove `@ducanh2912/next-pwa` dependency and its configuration from `next.config.ts`. - Delete PWA web manifest and associated icons from the `public` directory. - Remove PWA-specific metadata and manifest link from the root layout. - Update GitHub release workflow to remove Android APK build, signing, and asset upload steps. - Clean up `.gitignore` by removing rules for PWA service workers and TWA build artifacts. - Bump project version to 1.5.0.
- Delete all TWA (Trusted Web Activity) related files including Android project configuration, Gradle wrappers, and Android manifest. - Remove `@ducanh2912/next-pwa` dependency and its configuration from `next.config.ts`. - Delete PWA web manifest and associated icons from the `public` directory. - Remove PWA-specific metadata and manifest link from the root layout. - Update GitHub release workflow to remove Android APK build, signing, and asset upload steps. - Clean up `.gitignore` by removing rules for PWA service workers and TWA build artifacts. - Bump project version to 1.5.0.
This introduces a fully native Kotlin-based client for Tday, replacing the previous web-wrapper approach. The new `android-compose` module implements a mobile-optimized UI inspired by iOS Reminders and includes the following features: - **Authentication & Setup**: Encrypted storage for server URLs and user credentials, supporting a new server-setup workflow, login, and registration. - **Task Management**: Full CRUD support for tasks with filtering for Today, Scheduled, All, Flagged, and Project-specific views. - **Core Features**: Implementation of dashboard summaries, project lists, notes management, and completed task restoration. - **Architecture**: Modern Android stack using Hilt for DI, Retrofit for networking, and ViewModel with StateFlow for reactive UI updates. - **UI/UX**: Custom Material 3 theme with dark mode support, category grids, and specialized screens for settings and calendar previews.
This refactor replaces hardcoded hex colors with `MaterialTheme.colorScheme` across all screens to support both light and dark modes. It also introduces a persistent theme selection mechanism. - Add `AppThemeMode` enum and `ThemePreferenceStore` to manage theme selection (System, Light, Dark). - Update `TdayTheme` to dynamically apply `DarkColorScheme` or `LightColorScheme` based on user preference. - Define a comprehensive light color palette and expand the dark palette in `Color.kt`. - Refactor `TodoListScreen`, `NotesScreen`, `HomeScreen`, `AuthScreen`, and others to use theme-aware colors (e.g., `background`, `primary`, `surfaceVariant`). - Add an "Appearance" section to the `SettingsScreen` with `FilterChip` components for theme switching. - Update several icons to their `AutoMirrored` versions (e.g., `ArrowBack`, `Logout`) for better RTL support. - Wrap the main `NavHost` in `TdayTheme` within `TdayApp` to ensure theme changes propagate globally.
This commit updates the Android Gradle Plugin from 8.5.2 to 8.13.2 and the Gradle wrapper from 8.10.2 to 8.13. - Update AGP version in `build.gradle.kts`. - Update Gradle distribution URL in `gradle-wrapper.properties`. - Add the `foojay-resolver-convention` plugin to `settings.gradle.kts` to manage JDK toolchains.
… improved animations.
This update introduces a more interactive and polished user experience on the Home screen by adding haptic feedback to primary actions, implementing a dynamic search bar, and refining component animations.
- **Search Functionality**: Add an expandable search bar in the top navigation area with smooth width transitions and focus management.
- **Haptic Feedback**: Implement `performGentleHaptic` using `CLOCK_TICK` across FAB, icon buttons, and card clicks.
- **Visual Refinement**:
- Add scale, elevation, and offset animations to `FloatingActionButton`, `CategoryCard`, and `ProjectRow` using `animateFloatAsState` and `animateDpAsState`.
- Introduce custom gradient overlays (`iconSideGlow` and `depthShade`) to `CategoryCard` for a more premium look.
- Replace the static Calendar card with a standard `CategoryCard` for visual consistency.
- **Components**:
- Introduce `PressableIconButton` to handle custom scaling and haptics for navigation icons.
- Refactor `CategoryGrid` layout to use a `Column` with spaced-by arrangement.
- **Infrastructure**: Integrate `MutableInteractionSource` to track press states for reactive UI transforms.
This commit refines the visual appearance of the home screen and overhauls the top search bar's behavior for a smoother user experience. - **Enhanced `CategoryCard`:** - Adds decorative effects including a pearl-like sheen and depth shading using multiple `Brush` layers. - Introduces support for an optional translucent background grid or a large watermark icon. - Updates the "Today" and "Scheduled" cards with `WbSunny` and `Schedule` icons, respectively. - The "Calendar" card now features the new background grid effect. - **Improved Search Bar:** - Replaces the previous width-fraction animation with a smoother `animateDpAsState` that transitions between a fixed collapsed width and the full screen width. - Simplifies the search bar layout by removing the conditional logic that hid action buttons (`Notes`, `More`) when search was active. - Changes the search icon's behavior to toggle the search bar's expanded/collapsed state. - Removes the explicit "Close" button; collapsing the search bar now also clears focus and hides the keyboard.
This update introduces a large, semi-transparent watermark icon in the background of each category card on the `HomeScreen` to improve visual depth and identification. - Update `CategoryCard` to accept and display a `backgroundWatermark` icon. - Pass corresponding `Icons.Rounded` (WbSunny, Schedule, Inbox, Flag, Check) as watermarks for Today, Scheduled, All, Flagged, and Completed cards. - Adjust watermark styling with increased size (132.dp), modified offset, and updated tint blending for better visibility.
…ration.
- **HomeScreen Updates**:
- Implement an expandable search bar that animates its width and replaces the "Tday" title when active.
- Replace `TextField` with `BasicTextField` for a more customized search input UI.
- Add click-outside-to-dismiss logic for the search bar using `pointerInput` and global coordinate tracking.
- Ensure search is automatically closed when navigating to other screens or list items.
- Improve `CategoryCard` layout stability by wrapping background graphics in `Box(modifier = Modifier.matchParentSize())`.
- Refactor top-level layout to use a `Box` container for better gesture handling.
- **Manifest Updates**:
- Update `MainActivity` in `AndroidManifest.xml` to include `configChanges` for common configuration events (orientation, keyboard, screen size, etc.), preventing unnecessary activity recreations.
…coloring. This change replaces hardcoded hex colors for the "Calendar" and "Completed" category cards with colors derived from the `MaterialTheme.colorScheme`. This ensures better visual consistency across different themes and color modes. - Introduce `completedTileColor` and `calendarTileColor` helper functions to calculate colors based on the current `ColorScheme` using `lerp`. - Update `HomeScreen` to apply dynamic colors to the Calendar and Completed category cards. - Replace static grey hex color `0xFFA8B0B7` with theme-derived values.
…server setup and authentication UI.
- **Onboarding Redesign**: Replace the standalone `AuthScreen` with a multi-step `ServerSetupScreen` wizard that guides users through server connection and authentication in a single flow.
- **Enhanced UI/UX**:
- Implement a "Wizard" interface with distinct steps (Server, Login) and status states (Connecting, Authenticating).
- Add sophisticated animations including `AnimatedContent` for state transitions and an infinite rotation animation for loading states.
- Improve visual styling with glassmorphism-inspired effects, linear gradients, and `lerp` color interpolations for cards and tiles.
- Update `AuthScreen` with better elevation, border styling, and clearer copy.
- **Improved Navigation**: Update `TdayApp` to treat `ServerSetup` as the primary entry point for unauthenticated users and handle session refreshing more gracefully.
- **Robust Connection Logic**:
- Update `AppViewModel` to support error callbacks during server URL validation.
- Add a `onConnectServer` callback in the setup screen to handle asynchronous validation and state updates before proceeding to login.
- Auto-populate email and password fields if saved credentials exist in `AuthUiState`.
- **Security Messaging**: Add a footer to the setup screen indicating that credentials and connection data are stored securely.
…lay.
This refactor replaces the standalone `AuthScreen` and `ServerSetupScreen` with a unified `OnboardingWizardOverlay` that appears over a blurred `HomeScreen` when the user is not authenticated. It simplifies the navigation graph and provides a more seamless entry into the application.
- Delete `AuthScreen.kt` and `ServerSetupScreen.kt`.
- Implement `OnboardingWizardOverlay.kt` containing a multi-step setup process (Server and Login) with animated state transitions.
- Update `TdayApp.kt` to:
- Blur the `HomeScreen` and show the onboarding overlay if the user is unauthenticated.
- Provide an `UnauthenticatedHomeUiState` to populate the background with placeholder data during onboarding.
- Simplify navigation logic by removing explicit routes for server setup and login.
- Enhance the onboarding UI with a card-based layout, wizard step chips, and improved loading states using infinite transitions.
- Maintain secure credential and server URL handling via `AppViewModel` and `AuthViewModel` integrations within the overlay.
This update introduces a robust security layer for both the web backend and the Android client. It implements multi-dimensional rate limiting (IP, email, and device-based) and a server-probe mechanism to verify backend compatibility and TLS certificate integrity.
- **Backend Security**:
- Add `AuthThrottle` system to manage request quotas for credentials, registration, and CSRF endpoints.
- Implement exponential lockout for repeated failed sign-in attempts.
- Introduce a `MobileProbe` API at `/api/mobile/probe` for clients to verify server capabilities and versioning.
- Enhance IP resolution to support Cloudflare headers (`CF-Connecting-IP`) and standard proxy headers.
- Add `AuthThrottle` and `EventLog` persistence in Prisma with a new migration.
- **Android Client**:
- Implement server probing and contract validation during onboarding to ensure compatibility.
- Add "Server Trust" mechanism that pins the server's public key fingerprint and alerts users if the certificate changes.
- Refactor `AppViewModel` to handle complex server setup states, including trust resets and specific error messaging for network/security failures.
- Update networking to include client metadata headers (`X-Tday-Device-Id`, `X-Tday-App-Version`).
- **Documentation & Config**:
- Add `docs/security/cloudflare-auth-hardening.md` with recommended edge rules.
- Expand `.env.example` with configurable rate limit and lockout thresholds.
…feedback. This change extracts server connection logic into a reusable lambda and integrates standard IME actions for a smoother onboarding experience. It also adds subtle scale animations to the step indicators to provide better visual feedback for the active state. - Extract `connectToServer` logic to handle focus management, keyboard dismissal, and server validation consistently. - Add `ImeAction.Go` and `KeyboardActions` to the Server URL input field to allow submission via the soft keyboard. - Implement an `animateFloatAsState` scale effect and increased elevation on `StepChip` when active. - Use `LocalFocusManager` and `LocalSoftwareKeyboardController` to manage UI state during the connection process.
This change modifies server URL validation to automatically default to the `http://` scheme for hosts that are likely on a local or private network. This improves the user experience for LAN-only deployments where HTTPS is often not configured. - Add `isLocalDevelopmentHost()` utility to detect common local/private hostnames and IP address ranges (e.g., `localhost`, `10.0.2.2`, `.local`, `192.168.x.x`, etc.). - Update `getServerUrl()` to apply this logic: if a user enters a local hostname without a scheme, it will now correctly resolve to `http://<host>` instead of forcing HTTPS. Public hosts continue to default to HTTPS.
…dalone register screen. This change consolidates the authentication flow by moving account creation logic into the `OnboardingWizardOverlay`, providing a more seamless setup experience. It also adds client-side validation for registration and improves the handling of accounts pending administrator approval. - **UI/UX**: Remove `RegisterScreen.kt` and its associated navigation route; implement `AuthPanelMode` in the onboarding wizard to toggle between Sign In and Create Account views. - **Onboarding**: Add comprehensive registration form validation (email regex, password strength, and matching) to `OnboardingWizardOverlay`. - **State Management**: Update `AppViewModel` to track and display `pendingApprovalMessage` when an account requires admin intervention. - **Data Persistence**: Update `TdayRepository` and `AuthViewModel` to save and cache credentials locally upon successful registration for immediate login. - **API**: Improve error reporting in the registration API route by returning specific validation messages from the server.
This update introduces a dedicated task creation dialog and replaces the standard Floating Action Button with a custom-styled version featuring a gradient "pearl wash" effect. - Replace standard `FloatingActionButton` with a custom `CreateTaskButton` component using a `Card` and custom `drawWithCache` gradients. - Add `showCreateTask` state and an `AlertDialog` to handle new task input on the `HomeScreen`. - Implement `createTask` in `HomeViewModel` to handle repository interaction and state updates. - Wire `onCreateTask` callback through `TdayApp` navigation host. - Fix FAB action which previously triggered "Create List" to now trigger "Create Task".
…gation. This update removes the dedicated "Notes" button from the Home top bar, replacing it with a "Create list" action. It also refactors how the project list section is displayed to improve UI consistency. - Replace "Notes" navigation with a "Create list" action using `Icons.Rounded.Add` in the `HomeTopBar`. - Remove `EmptyProjectCard` and instead hide the "My Lists" header when no projects are present. - Update `HomeScreen` and `TdayApp` navigation logic to remove `onOpenNotes` callbacks. - Simplify `HomeScreen` list rendering by conditionally showing the "My Lists" section based on the presence of projects.
- Adjust the horizontal arrangement of the bottom bar to use `SpaceEvenly` when the search bar is collapsed. - Replace the `Add` icon with `AutoMirrored.Rounded.PlaylistAdd` for the "Create list" action.
…Tags" to "Lists" across the entire stack, including the web frontend, mobile Android client, and backend API.
This architectural change standardizes the terminology used for grouping tasks. It involves significant renaming of database models, API endpoints, types, and UI components to ensure consistency.
- **Database & Backend**:
- Rename `Project` Prisma model to `List`.
- Rename `projectID` fields to `listID` in the `Todo` model and related schemas.
- Update `ProjectColor` enum to `ListColor`.
- Migrate API routes from `/api/project` to `/api/list`.
- **Frontend & UI**:
- Replace the `#` tag icon with a colored `Circle` dot icon for lists.
- Rename feature directories and components from `project` to `list` (e.g., `ProjectContainer` becomes `ListContainer`).
- Update React Query hooks to use `list` query keys and update metadata fetching logic.
- Refactor `NLPTitleInput` and autocomplete logic to support lists instead of hashtag-based projects.
- Update internationalization strings (`en.json`, `es.json`, etc.) to use "List" terminology.
- **Android (Jetpack Compose)**:
- Rename `ProjectSummary` to `ListSummary` and `ProjectTodos` route to `ListTodos`.
- Implement a new list creation flow with support for selecting both colors and specific icons (Inbox, Sun, Calendar, etc.).
- Add `SecureConfigStore` logic to persist custom icon mappings for lists locally.
- Update the home dashboard to display "My Lists" with enhanced visual styling and interaction feedback.
- **Documentation**:
- Update technical blog posts and landing page features to reflect the new "Lists" branding.
…undant features.
This major cleanup deletes overdue task management, PWA/TWA leftovers, custom UI icons, and several unused query hooks and providers. It also streamlines `package.json` by removing unnecessary dependencies and refactors existing components to improve maintainability.
- **Feature Removal**: Delete `overdueTodos` feature, including all associated queries, components, and server actions.
- **Legacy Cleanup**: Remove PWA/TWA configuration files, `auth.config.ts`, `audit-ui.ts`, and `tests/babel.config.js`.
- **UI Refactor**:
- Delete a large set of custom SVG icon components in favor of standard library icons.
- Remove unused Radix UI primitives (`collapsible`, `toast`, `scroll-area`, `separator`) and associated custom wrappers like `Menu.tsx` and `SearchBar.tsx`.
- Simplify `carousel.tsx`, `sheet.tsx`, and `dropdown-menu.tsx` by removing unused sub-components.
- **Provider & Hook Cleanup**: Remove `NotificationProvider`, `PassKeyProvider`, and several utility hooks (`useDebounce`, `useErrorToast`, `useDate`).
- **Dependency Management**:
- Remove `@aws-sdk/client-s3`, `react-hook-form`, and `tailwindcss-animate` from `package.json`.
- Update `@auth/core` and add `@dnd-kit/utilities`.
- **General Refactoring**:
- Consolidate RRULE generation logic in `lib/generateTodosFromRRule.ts` and add `getTodayBoundaries.ts`.
- Transition `jest.config.ts` to use the native `node` environment.
- Update `schema.ts` and `types.ts` to tighten visibility and remove unused interfaces.
This introduces a sequential fade-in and slide-up animation for the "My Lists" section to improve the visual experience when the dashboard loads. - Implement a `LaunchedEffect` to orchestrate a staggered entrance animation for list items using a `visibleListCount` state. - Wrap the "My Lists" header and individual `ListRow` components in `AnimatedVisibility`. - Define `listSectionEnterTransition` to provide a coordinated fade and vertical slide animation. - Switch from `items` to `itemsIndexed` in the `LazyColumn` to control visibility based on the staggered animation index. - Add `hasAnimatedListEntrance` flag to ensure the animation only plays on initial load or after the list is cleared.
- Swap background colors for "Scheduled" (now #DDB37D) and "Flagged" (now #D48A8C) category cards. - Replace dynamic color interpolation with static hex values for "Completed" (#D8E7DC) and "Calendar" (#E9E2F4) tiles.
This update introduces a robust offline sync mechanism for the Android application, allowing users to create, update, and delete tasks and lists without an active internet connection. It also adds support for custom list icons across the web and mobile clients.
- **Offline Sync (Android)**:
- Add `OfflineSyncState` and `PendingMutationRecord` to track local changes and synchronization status.
- Implement a background re-sync loop in `AppViewModel` that triggers every 5 minutes while authenticated.
- Update `TdayRepository` to prioritize local cache for reads and queue mutations for background processing.
- Add conflict resolution logic using `updatedAt` timestamps to merge remote and local snapshots.
- Introduce local-only ID prefixing for entities created while offline.
- Persist sync state securely in `SecureConfigStore`.
- **List Icons & Metadata**:
- Add `iconKey` field to the `Project` (List) model in Prisma and update API routes to support icon selection.
- Update `ListSummary` and `TodoItem` domain models to include `updatedAt` timestamps and `iconKey`.
- Enhance Zod schemas for list creation and updates to validate `iconKey` strings.
- **Database & Backend**:
- Add a migration to include `updatedAt` on the `todos` table and `iconKey` on the `Project` table.
- Update Prisma schema to automatically handle `updatedAt` timestamps for tasks.
- Expose `updatedAt` and `iconKey` in API responses for lists and todos.
This update improves the reliability and performance of the list entrance animation by using a content-based signature to detect changes and reducing animation delays. - Replace simple ID tracking with a comprehensive `listSignature` that tracks changes to name, count, color, and icon. - Introduce `hasCapturedInitialListSnapshot` and `hasShownListDataOnce` flags to better manage animation triggers during initial load versus updates. - Update `LaunchedEffect` to trigger animations only when the list content actually changes. - Reduce animation delays (90ms -> 70ms and 65ms -> 55ms) for a snappier user experience. - Ensure `visibleListCount` is correctly synchronized with the actual list size when animations are bypassed.
This change replaces the "Flagged" terminology with "Priority" and expands the filtering logic to include multiple priority levels (Medium, High, Important, Urgent) rather than just "High".
- **Android (Compose)**:
- Rename `TodoListMode.FLAGGED` to `PRIORITY` and update `AppRoute` accordingly.
- Update `HomeSummary` and `HomeViewModel` to use `priorityCount`.
- Refactor `HomeScreen` categories to display "Priority" with the existing flag icon.
- Implement `isPriorityTodo` helper in `TdayRepository` to filter tasks with Medium, High, Important, or Urgent priorities.
- **Web (Next.js)**:
- Add `/app/priority` route and navigation support in `SidebarContainer` and `SidebarToggleContainer`.
- Update `SidebarContainer` to calculate and display `priorityCount` using a new `isPriorityTodo` utility.
- Refactor `AllTasksTimelineContainer` to support a `scope` prop ("today" or "priority"), allowing it to serve both views with appropriate icons and headings.
- Introduce a new `Priority` page component using the scoped timeline container.
This update replaces the manual "Refresh" text buttons in the top app bars with a more native `PullToRefreshBox` implementation in `NotesScreen`, `CompletedScreen`, and `TodoListScreen`. - Replace `TextButton` refresh actions in `TopAppBar` with `PullToRefreshBox` wrapping the main content. - Bind `PullToRefreshBox` state to `uiState.isLoading` and its `onRefresh` trigger to existing view model refresh logic. - Ensure `LazyColumn` and loading indicators are properly nested within the new refresh containers to maintain consistent scroll and refresh behavior. - Clean up unused `TextButton` imports.
This update replaces the manual "Refresh" text buttons in the top app bars with a more native `PullToRefreshBox` implementation in `NotesScreen`, `CompletedScreen`, and `TodoListScreen`. - Replace `TextButton` refresh actions in `TopAppBar` with `PullToRefreshBox` wrapping the main content. - Bind `PullToRefreshBox` state to `uiState.isLoading` and its `onRefresh` trigger to existing view model refresh logic. - Ensure `LazyColumn` and loading indicators are properly nested within the new refresh containers to maintain consistent scroll and refresh behavior. - Clean up unused `TextButton` imports.
…g manual refreshes. This update introduces a reusable `TdayPullToRefreshBox` component to standardize refresh behavior across the app and ensures that manual refresh actions trigger a remote data sync before updating the UI state. - Replace standard Material 3 `PullToRefreshBox` with a custom `TdayPullToRefreshBox` across `HomeScreen`, `NotesScreen`, `CompletedScreen`, `CalendarScreen`, and `TodoListScreen`. - Update `TdayRepository` sync logic to handle cases with no pending mutations more efficiently and avoid redundant remote fetches. - Modify `HomeViewModel`, `CompletedViewModel`, and `TodoListViewModel` to force a remote cache sync (`repository.syncCachedData(force = true)`) when a user performs a pull-to-refresh action. - Refactor `CalendarScreen` to accept `isRefreshing` as a parameter, delegating refresh state management to the parent `TdayApp` and `appViewModel`. - Ensure repository-level synchronization failures during refresh fall back to local cache gracefully.
This commit refactors the data loading logic in several ViewModels to reduce redundant UI recompositions and improve user experience with optimistic updates. - **Optimized Data Loading**: - Introduce `loadInternal`/`refreshInternal` methods in `HomeViewModel`, `TodoListViewModel`, `CompletedViewModel`, and `NotesViewModel`. - These methods accept `forceSync` and `showLoading` parameters to control network requests and loading indicators. - UI state is now updated only if the new data differs from the current state, preventing unnecessary recompositions. - **Optimistic UI Updates in `TodoListViewModel`**: - Task completion, deletion, and pinning actions now update the UI instantly (optimistically) before the network request completes. - On network failure, the UI reverts the change and displays an error message. - After successful destructive actions (complete, delete), a background refresh is triggered without a loading indicator. - **Improved UX in `TodoListScreen`**: - The "Loading..." text is now displayed inside the main card instead of replacing the entire list, providing a less disruptive loading experience.
This commit introduces swipe-to-reveal actions (edit and delete) for tasks in the Calendar view, replacing the previous simple list with an interactive UI. It also adds the ability to edit tasks directly from this screen.
- **Swipe-to-Reveal Actions**:
- Add a horizontal draggable container to each `CalendarTodoRow`.
- Swiping left reveals "Info" (edit) and "Delete" action buttons.
- Implement animations for offset changes and haptic feedback on action clicks.
- **Task Editing and Deletion**:
- Implement `updateTask` and `delete` methods in `CalendarViewModel` to handle optimistic UI updates and network requests.
- Wire up the new view model methods to the `CalendarScreen` and its `CalendarTodoRow` components.
- Tapping the "Info" icon now opens the `CreateTaskBottomSheet` in editing mode for the selected task.
- Adjust icon and text colors in `CalendarScreen` from a light lavender to a more saturated purple (`0xFF7D67B6`). - Update icon and text colors in `CompletedScreen` from a light sage to a deeper green (`0xFF4E8A67`). - Change the `PRIORITY` mode accent color in `TodoListScreen` from pink to a vibrant red (`0xFFE65E52`).
This change updates how tasks are visually handled when marked as complete. It removes the special "inline" keeping logic for the `ALL` mode in the ViewModel, opting for a consistent filtering approach, and introduces a new fade-out animation capability for completed items in the UI. - Add `useFadeOnCompletion` parameter and `completionAlpha` animation to `TodoItemRow` for a smoother transition when tasks are removed. - Refactor `toggleComplete` in `TodoListViewModel` to consistently filter out completed items regardless of the current `TodoListMode`. - Disable `useDelayedFadeCompletion` by default in `DailyTodoItem`. - Update `TodoItemRow` to use `graphicsLayer` for alpha animations during the completion sequence. - Simplify completion success handling by always triggering an internal refresh.
…e resume. This update introduces a mechanism to reload data when a screen becomes visible again (ON_RESUME), ensuring that the UI reflects the latest local cache or remote state when navigating back to a screen. - Add `OnRouteResume` utility component to observe lifecycle events and trigger actions on the `ON_RESUME` event. - Replace `LaunchedEffect(Unit)` with `OnRouteResume` across `HomeScreen`, `CompletedScreen`, `NotesScreen`, and `CalendarScreen` to ensure data refreshes when returning to these screens. - Implement `OnRouteResume` in `TodoRoute` to trigger a ViewModel load whenever the route is resumed. - Fix a logic error in `TdayRepository` where the "All" view was returning deleted/archived tasks; it now correctly filters for active todos.
This change modifies `HomeViewModel` to synchronously load the initial dashboard summary from the local cache (`fetchDashboardSummarySnapshot`) upon initialization. This ensures the UI displays cached data immediately, improving startup performance and user experience. - The `refreshFromCache` function is also updated to use the same synchronous `fetchDashboardSummarySnapshot` method, removing the previous `viewModelScope` launch.
…edScreen`. - **Calendar**: Remove the redundant `monthLabel` from `CalendarTopBar` and center-align the month title in the calendar navigation header using a `Box` with `weight(1f)`. - **Completed Tasks**: Remove `TdayPullToRefreshBox` from `CompletedScreen`, reverting to a standard `LazyColumn` for displaying completed tasks. - **UI**: Adjust layout parameters in the calendar's month navigation to ensure the title is properly centered between navigation buttons.
This change reverts the pull-to-refresh implementation in `NotesScreen` and `TodoListScreen`, replacing the custom `TdayPullToRefreshBox` wrapper with standard `LazyColumn` layouts. - Remove `TdayPullToRefreshBox` import and usage in `NotesScreen.kt`. - Remove `TdayPullToRefreshBox` import and usage in `TodoListScreen.kt`. - Flatten the UI hierarchy by moving `LazyColumn` to the top level within the `Scaffold` content block in both screens. - Maintain existing list styling, content padding, and item arrangements.
…Screen`. This update enhances the calendar's usability by adding horizontal swipe navigation and preventing users from navigating to months earlier than the current month. - Implement horizontal drag gestures on the calendar card to switch between months. - Introduce `minNavigableMonth` (current month) as a lower bound for calendar navigation. - Update `CalendarMonthCard` to accept and handle a `canGoPrevMonth` flag. - Disable the previous month navigation button and its interaction when the minimum month is reached. - Add validation in `onSelectDate` to prevent selecting dates before the current month. - Apply visual feedback (reduced opacity) to the previous month button when disabled.
…imations.
- **Calendar Navigation**:
- Implement `AnimatedContent` for `CalendarMonthCard` to provide slide-in/out transitions when switching between months.
- Add horizontal drag gesture support to `CalendarMonthCard` for intuitive month switching.
- Introduce a visual drag preview that tracks the user's finger during month-to-month swipes.
- **Task Interaction**:
- Replace spring-based animations with fixed-duration `tween` animations for task row swipes.
- Constrain task row drag distance to the action reveal width to prevent excessive elastic stretching.
- **UI/UX Refinement**:
- Disable the default overscroll effect for the main `LazyColumn` using `LocalOverscrollConfiguration`.
- Improve the responsiveness of task deletion and info actions by adjusting drag thresholds.
- Reorganize the internal structure of `CalendarMonthCard` to support state-aware animations across month changes.
This update introduces a functional search overlay on the Home screen, allowing users to find tasks across all lists. Selecting a search result navigates to the "All Tasks" view and highlights the specific task with a pulse animation.
- **Home Screen Search**:
- Implement a real-time search results overlay with task titles, due dates, and list category icons.
- Add `searchableTodos` to `HomeUiState` to facilitate local filtering of tasks.
- Refactor `TopSearchBar` to support text input and expanded states.
- Improve search bar interaction by closing the overlay when tapping outside.
- **Task Highlighting & Navigation**:
- Update `AppRoute.AllTodos` to support an optional `highlightTodoId` navigation parameter.
- Implement a "flash" highlight effect in `TodoListScreen` that triggers when a task is navigated to from search.
- Add logic to automatically expand collapsed sections and scroll to the highlighted task in `TodoListScreen`.
- Introduce a gradient "glow" brush to visually emphasize highlighted tasks.
- **UI/UX Improvements**:
- Add a snapping effect to the month title in the `CalendarScreen` for a smoother scrolling experience.
- Refactor task row components to support the new highlight animation and improved padding.
- Update `HomeViewModel` to fetch and refresh the searchable task list from the repository.
This change introduces a new feature to generate task summaries using an Ollama-hosted LLM (defaulting to `qwen2.5:0.5b`). It includes a fallback mechanism for deterministic summaries when the AI is unavailable and adds administrative controls to toggle the feature globally.
- **New AI Summary API**: Add `POST /api/todo/summary` to generate task summaries based on different modes (`today`, `scheduled`, `all`, `priority`).
- **Global Configuration**:
- Add `AppConfig` Prisma model to store global feature flags (e.g., `aiSummaryEnabled`).
- Implement `GET` and `PATCH` endpoints in `/api/admin/settings` for administrators to manage global settings.
- Add an "App Settings" public endpoint for clients to check feature availability.
- **Refactoring & Logic**:
- Extract todo fetching logic into `fetchTimelineTodosForUser` to share between the main todo API and the summary generator.
- Implement `todoSummary.ts` to handle AI prompt building, result normalization, and deterministic fallback logic.
- **Admin UI**: Update `AdminUserControl` with a "Feature flags" section to allow admins to toggle AI task summaries.
- **Infrastructure**:
- Add database migration for the `AppConfig` table.
- Add comprehensive unit tests for summary filtering, prompt building, and the API route.
- **Environment Support**: Introduce `OLLAMA_URL`, `OLLAMA_MODEL`, and `OLLAMA_TIMEOUT_MS` environment variables for flexible AI configuration.
This update introduces an AI-powered summarization feature for task lists and provides administrators with the ability to enable or disable this functionality globally.
- **AI Summarization**:
- Add `summarizeTodos` to `TdayRepository` to fetch AI-generated summaries for Today, Scheduled, All, and Priority views.
- Implement `SummaryBottomSheet` in `TodoListScreen` to display summary text, source attribution, and generation timestamps.
- Update `TodoListViewModel` to manage summarization state, including loading indicators and error handling.
- Add a new "AutoAwesome" action button to the top bar for triggering summaries.
- **Admin Settings**:
- Add an "Admin controls" section to the `SettingsScreen` for users with the "ADMIN" role.
- Implement a global toggle for "AI task summaries" to control feature availability for all users.
- Add repository methods (`fetchAdminAiSummaryEnabled`, `updateAdminAiSummaryEnabled`) and API service endpoints to manage these settings.
- **Data & Sync**:
- Update `OfflineSyncState` and `RemoteSnapshot` to include and persist the `aiSummaryEnabled` status.
- Define new API models: `AppSettingsResponse`, `AdminSettingsResponse`, `TodoSummaryRequest`, and `TodoSummaryResponse`.
- Integrate AI summary availability checks into the app's startup and sync workflows.
This introduces a local AI runtime to the Docker stack to enable task summaries. It adds the Ollama service to the compose configuration with GPU support and defines the necessary environment variables for model communication. - Add `ollama` service to `docker-compose.yaml` with health checks, volume persistence, and GPU acceleration. - Update `.env.example` with default Ollama settings (`OLLAMA_URL`, `OLLAMA_MODEL`, `OLLAMA_TIMEOUT_MS`). - Configure the `tday` service to depend on the `ollama` service being healthy. - Update `README.md` with instructions for pulling the recommended model (`qwen2.5:0.5b`) and prerequisites for GPU support.
- Rename "Admin controls" and "Feature flags" sections to "Feature toggle" in both Android and web admin interfaces. - Simplify "AI task summaries" label to "AI task summary" in the Android settings screen. - Remove descriptive subtext for the AI task summary toggle in both `SettingsScreen.kt` and `AdminUserControl.tsx` to streamline the UI.
…re concise plan-based format. This update transitions the Ollama integration from generating free-form prose to producing structured JSON maps. It introduces a "Focus & Sequence" logic that prioritizes high-priority or upcoming tasks to create a clearer roadmap for the user. - **Structured AI Summaries**: Update `normalizeAiSummary` to parse JSON blocks containing task IDs (`startId`, `thenIds`) and map them back to actual task titles. - **Task Candidate Logic**: Implement `buildSummaryTaskCandidates` to select and rank the top 5 most relevant tasks based on priority and due dates. - **Refined Prompts**: Replace the verbose descriptive prompt with a schema-based prompt that instructs the AI to return only valid JSON IDs. - **Unified Fallback**: Update `buildFallbackSummary` to use the same "Start with... Then move through..." format as the AI summary for a consistent UI experience. - **Formatting Improvements**: Add `compactTitle` to truncate long task names and `joinTaskTitles` for natural list joining (Oxford comma support). - **Validation**: Implement ID normalization and length constraints to ensure summaries remain concise (under 320 characters). - **Test Updates**: Align API and unit tests with the new structured response format and the focus-based summary style.
This update introduces Month, Week, and Day views to the calendar, allowing users to switch between different levels of granularity. The navigation logic has been refactored to support seamless date selection and synchronization across all view modes. - Add `CalendarViewMode` enum and `CalendarViewModeTabs` for switching between Month, Week, and Day views. - Implement `CalendarWeekCard` and `CalendarWeekDayCell` to provide a horizontal, swipeable weekly view with task indicators. - Implement `CalendarDayCard` for a focused daily view showing task counts and full date details. - Integrate `AnimatedContent` for smooth horizontal transitions when switching view modes or navigating between dates. - Refactor date selection and "Today" navigation into a shared `selectDate` helper to ensure consistent state updates. - Update the tasks list header and empty state messaging to be more descriptive based on the selected date. - Add horizontal drag gesture detection to allow swiping between weeks and days.
This update introduces a Floating Action Button (FAB) to the `CalendarScreen` that allows users to create new tasks. The creation flow automatically pre-fills the start and due times based on the currently selected date in the calendar. - Implement `createTask` in `CalendarViewModel` to handle task creation via the repository. - Add `CalendarCreateTaskFab` with haptic feedback to trigger the creation flow. - Integrate `CreateTaskBottomSheet` into `CalendarScreen` for inputting new task details. - Add logic to pre-fill task times: uses current time for the current date, and a default 06:00-21:00 range for future/past dates. - Wire the `onCreateTask` callback through `TdayApp` navigation to the `CalendarScreen`.
This update allows users to mark tasks as complete or undo completions directly from the calendar view. It introduces a new UI section for completed tasks and updates the view model to handle the corresponding data persistence and state synchronization.
- **UI Changes**:
- Replace the priority dot in `CalendarTodoRow` with an interactive `CalendarCompletionToggleIcon`.
- Add `CalendarCompletedTodoRow` to display finished tasks with a strikethrough effect.
- Implement a "Completed" section in the calendar list that appears when a selected date has completed items.
- Add subtle haptic feedback and a brief delay when toggling completion for better UX.
- **ViewModel & State**:
- Update `CalendarUiState` to include `completedItems`.
- Implement `complete` and `uncomplete` methods in `CalendarViewModel` with optimistic UI updates and error handling.
- Update `loadInternal` and `hydrateFromCache` to fetch completed tasks alongside pending ones.
- **Plumbing**:
- Wire `onCompleteTask` and `onUncompleteTask` callbacks from `TdayApp` through to the `CalendarScreen`.
This update adjusts the styling of the theme selector to improve its visual consistency and feel. Key changes include: - Update the theme selector container's corner radius from 28dp to 18dp. - Change the container background to a semi-transparent `surfaceVariant` and remove its border. - Replace individual theme mode `Card` components with clipped `Box` components using `clickable` modifiers. - Adjust the internal padding and height of the theme selection row for a more compact layout. - Use a simpler background-only highlight for the selected theme mode instead of a border.
This update standardizes how task priorities are colored and displayed across the Calendar, Completed, and Todo List screens. It replaces hardcoded "high" priority styling with dynamic lookups and expands the set of keywords recognized as high or important. - Update priority icons to use the task's actual priority for tinting instead of defaulting to "high". - Update `priorityColor` to map "urgent" and "important" to the high-priority color (red). - Expand `isHighPriority` to include "medium" priority tasks, ensuring they are flagged in the UI. - Update accessibility descriptions for priority icons from "High priority" to "Priority task".
This update improves the task summary generation by appending human-readable due date labels (e.g., "due today", "due tomorrow", "due 15th Jan") to task titles. This provides better context in both AI-generated and fallback summaries. - Introduce `formatDueLabel` in `lib/todoSummary.ts` to calculate relative date labels based on the user's time zone. - Update `SummaryTaskCandidate` type and `buildSummaryTaskCandidates` to include `dueLabel`. - Refactor summary generation logic in `app/api/todo/summary/route.ts` to use candidate objects instead of just titles, ensuring labels are included in the final output. - Adjust "all" mode filtering in `getSummaryTargetTodos` to exclude tasks older than the start of the current day. - Increase the maximum allowed summary length from 320 to 420 characters to accommodate the additional date information. - Ensure `now` and `timeZone` context is consistently passed through candidate builders and fallback summary generators.
This change ensures that overdue tasks are correctly included in specific summary modes and refactors tests to use dynamic date generation for better reliability. - Update `today` mode to include overdue items from the current day. - Implement `all` mode filtering to include all tasks scheduled from the start of the current day onward. - Add a new test case for the `all` mode summary filter. - Refactor `todoSummaryRoute.test.ts` to use relative timestamps instead of hardcoded date strings. - Add assertions to verify that due date information (e.g., "(due today)") is present in the generated summaries.
…ority indicators. This update improves the `CalendarCompletedTodoRow` by displaying associated list icons and priority flags, making it easier to identify the context and importance of completed tasks at a glance. - Update `CalendarCompletedTodoRow` to accept the user's task lists for metadata resolution. - Implement `resolveListSummary` helper to match completed items with their parent lists. - Add UI logic to display list-specific icons and accent colors for completed tasks. - Include a priority flag icon for high-priority completed tasks. - Refactor the completed task layout to support multiple metadata indicators (time, list icon, and priority flag).
This update improves the task summarization engine by introducing urgency-based ranking and a more robust sentence construction utility. It ensures that summaries remain chronological and readable while better handling AI-generated recommendations. - **Improved Ranking Logic**: Replaced basic priority sorting with an urgency-band system based on day deltas (Overdue, Today, Tomorrow, Week, Month). - **Refined Task Summaries**: Introduced `buildReadableTaskSummary` to generate natural language descriptions, moving away from bullet-pointed lists to prose. - **Enhanced AI Normalization**: Added logic to enforce chronological order for "all" mode, even when the AI suggests a different starting task. - **Expanded Context**: Added `dueLabel` (e.g., "due today") to the AI prompt to help the model understand the temporal context of tasks. - **Fallback Improvements**: Standardized the fallback summary to use the same readable phrasing as the AI-generated version. - **Testing**: Added test cases to verify that near-term tasks are prioritized over future high-priority tasks in "all" mode.
This update improves the task summarization engine by introducing urgency-based ranking and a more robust sentence construction utility. It ensures that summaries remain chronological and readable while better handling AI-generated recommendations. - **Improved Ranking Logic**: Replaced basic priority sorting with an urgency-band system based on day deltas (Overdue, Today, Tomorrow, Week, Month). - **Refined Task Summaries**: Introduced `buildReadableTaskSummary` to generate natural language descriptions, moving away from bullet-pointed lists to prose. - **Enhanced AI Normalization**: Added logic to enforce chronological order for "all" mode, even when the AI suggests a different starting task. - **Expanded Context**: Added `dueLabel` (e.g., "due today") to the AI prompt to help the model understand the temporal context of tasks. - **Fallback Improvements**: Standardized the fallback summary to use the same readable phrasing as the AI-generated version. - **Testing**: Added test cases to verify that near-term tasks are prioritized over future high-priority tasks in "all" mode.
This update refines the behavior of collapsible sections in the todo list, extending support to the `PRIORITY` mode and improving state management for collapsed headers. - Rename `allCollapsedSectionKeys` to `collapsedSectionKeys` and update its initialization to be mode-aware. - Enable section collapsing for `TodoListMode.PRIORITY`, specifically targeting the "earlier" section. - Add a `LaunchedEffect` to automatically collapse the "earlier" section when switching to `PRIORITY` mode. - Update `TimelineSection` rendering logic to determine collapsibility based on both the current `TodoListMode` and the specific section key. - Ensure highlighted tasks trigger an expansion of all collapsed sections to maintain visibility.
…marter grouping.
This update improves the task summary feature by allowing the AI to generate conversational prose instead of just structured IDs. It introduces validation logic to ensure AI-generated summaries maintain context (dates, urgency, and task titles) while falling back to a robust, template-based summary if requirements aren't met.
- **Enhanced AI Summaries**: Update the API route to handle a new `summary` field from the AI. Add `normalizeProseSummary` to clean AI output and `includesDayContext` to verify that the AI correctly mentions due dates (today, tomorrow, or specific dates).
- **Improved Task Grouping**: Refactor `lib/todoSummary.ts` to group "next" tasks by their due date and time-of-day windows (morning, afternoon, night). This prevents repetitive date phrases and creates more readable summaries (e.g., "both due today").
- **Urgency & Priority Logic**: Introduce `summaryPriorityLabel` and `buildUrgencyLead` to convey priority using natural language (e.g., "Handle the most urgent work first") rather than explicit "high priority" labels.
- **Filtering Logic Adjustments**:
- Update `scheduled` mode to include overdue tasks from today.
- Update `all` mode to include all past, present, and future tasks.
- Ensure `priority` mode retains a broader set of qualifying tasks for better summary coverage.
- **Robust Validation**: The AI response now requires mention of all key task titles and their specific due windows. If validation fails or the summary is too short, the system falls back to a deterministic, readable summary.
- **Prompt Engineering**: Refine the AI prompt to encourage natural-sounding English, explicit mention of time-of-day windows, and avoidance of markdown or code fences.
- **Testing**: Add comprehensive test cases for grouped summaries, time-of-day labels, and AI prose validation/fallback scenarios.
This change optimizes the natural language summaries by omitting specific time windows (e.g., "morning", "afternoon") for tasks due more than 3 days in the future, treating them as all-day events instead. This reduces verbosity for long-term planning. - Define `DUE_WINDOW_DAY_RANGE` as 3 days in `todoSummary.ts`. - Update `dueLabel` generation to conditionally include the window phrase based on the day delta from the current time. - Update the summary generation prompt instructions to reflect the new 3-day time-of-day rule. - Fix a potential execution context issue in `todoNlp.ts` by explicitly binding the `parse` method of the Chrono parser. - Add a test case to verify that tasks outside the 3-day window omit time-of-day descriptors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.