Skip to content

feat(web): add now planner mvp#1238

Merged
tyler-dane merged 21 commits intomainfrom
feat/1237-now-mvp
Nov 15, 2025
Merged

feat(web): add now planner mvp#1238
tyler-dane merged 21 commits intomainfrom
feat/1237-now-mvp

Conversation

@tyler-dane
Copy link
Contributor

@tyler-dane tyler-dane commented Nov 14, 2025

Screenshot 2025-11-15 at 11 55 14 AM

Adds a minimal implementation of the Now view. Lots of this code will be cleaned up in the sub-issues in #1237

  • Removed the redundant test for rendering the main content in NowView.
  • Introduced new unit tests for AvailableTasks and FocusedTask components, covering rendering, task selection, and accessibility features.
  • Enhanced overall test coverage for task management functionality in the Now view.

Closes #1243

Copilot AI review requested due to automatic review settings November 14, 2025 23:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the MVP for the Now view's task management functionality. It introduces components for displaying available tasks and focused tasks, along with supporting hooks and utilities for state management and localStorage persistence.

Key Changes:

  • Added task selection and focus functionality with localStorage persistence
  • Created comprehensive test coverage for new components (AvailableTasks, FocusedTask, TaskSelector) and hooks (useAvailableTasks)
  • Refactored NowView to remove placeholder animation code and integrate the new task selector

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/web/src/views/Now/view/NowViewContent.tsx New component wrapping the TaskSelector in a centered layout
packages/web/src/views/Now/utils/focused-task-storage.util.ts Utility functions for managing focused task ID in localStorage with error handling
packages/web/src/views/Now/hooks/useFocusedTask.ts Hook managing focused task state with storage persistence and cross-tab synchronization
packages/web/src/views/Now/hooks/useAvailableTasks.ts Hook loading and filtering available tasks from today's task list
packages/web/src/views/Now/hooks/useAvailableTasks.test.ts Comprehensive test coverage for useAvailableTasks hook
packages/web/src/views/Now/components/TaskSelector/TaskSelector.tsx Component conditionally rendering either FocusedTask or AvailableTasks based on state
packages/web/src/views/Now/components/TaskSelector/TaskSelector.test.tsx Comprehensive test coverage for TaskSelector component
packages/web/src/views/Now/components/FocusedTask/FocusedTask.tsx Component displaying the currently focused task title
packages/web/src/views/Now/components/FocusedTask/FocusedTask.test.tsx Comprehensive test coverage for FocusedTask component
packages/web/src/views/Now/components/AvailableTasks/AvailableTasks.tsx Component displaying list of available tasks with keyboard accessibility
packages/web/src/views/Now/components/AvailableTasks/AvailableTasks.test.tsx Comprehensive test coverage for AvailableTasks component
packages/web/src/views/Now/NowView.tsx Refactored to replace placeholder content with NowViewContent component
packages/web/src/views/Now/NowView.test.tsx Removed redundant test for placeholder content
packages/web/src/common/constants/storage.constants.ts Added FOCUSED_TASK_ID constant for localStorage key

@tyler-dane tyler-dane changed the title Feat/1237-now-mvp feat(web): add now planner Nov 15, 2025
Copilot AI review requested due to automatic review settings November 15, 2025 09:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings November 15, 2025 11:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.

Copilot AI review requested due to automatic review settings November 15, 2025 16:51
…ge key

- Added `FocusedTask`, `AvailableTasks`, and `TaskSelector` components to improve task selection and display in the Now view.
- Introduced `NowViewContent` to encapsulate task-related UI elements.
- Updated storage constants to include `FOCUSED_TASK_ID` for managing focused task state.
- Refactored `NowView` to utilize the new components, streamlining the rendering logic and enhancing user experience.
- Added useAvailableTasks hook to manage and filter tasks based on their status and creation date.
- Implemented unit tests for useAvailableTasks to ensure correct functionality, including loading tasks, filtering out completed tasks, and handling storage changes.
- Enhanced task management by ensuring tasks are sorted by creation date and reloaded upon relevant storage events.
- Added useFocusedTask hook to manage the focused task state, including loading from and saving to local storage.
- Introduced utility functions for getting, setting, and clearing the focused task ID in local storage.
- Enhanced task management by ensuring the focused task is updated based on storage changes and task availability.
…ehavior

- Introduced comprehensive tests for the TaskSelector component to validate its rendering based on focused and available tasks.
- Implemented scenarios for task selection via mouse and keyboard interactions, ensuring correct state updates.
- Added tests for handling empty states when no tasks are available, enhancing overall test coverage for task management functionality.
…edTask tests

- Removed the redundant test for rendering the main content in NowView.
- Introduced new unit tests for AvailableTasks and FocusedTask components, covering rendering, task selection, and accessibility features.
- Enhanced overall test coverage for task management functionality in the Now view.
…lection

- Added tests to verify auto-focus functionality on the first incomplete task when no task is focused.
- Implemented scenarios to ensure no auto-focus occurs when a task is already focused or when no tasks are available.
- Updated existing tests to validate task selection behavior through user interactions, ensuring correct state updates.
- Enhanced overall test coverage for the TaskSelector component, improving reliability in task management functionality.
- Implemented onCompleteTask prop in FocusedTask component to handle task completion.
- Enhanced FocusedTask tests to verify rendering and completion behavior.
- Updated TaskSelector to manage task completion and navigation to the next task.
- Added tests for task completion scenarios, ensuring correct state updates and storage interactions.
…lify hook

- Deleted focused-task-storage utility functions to streamline focused task management.
- Updated useFocusedTask hook to eliminate unnecessary storage interactions and improve clarity.
- Adjusted tests to reflect changes in focused task handling, ensuring accurate behavior when no task is focused.
- Introduced useTaskFocus hook to manage auto-focusing on the first incomplete task when no task is currently focused.
- Updated TaskSelector component to utilize the new hook, simplifying the focus management logic.
- Added comprehensive tests for useTaskFocus to validate auto-focus behavior under various scenarios, ensuring correct task selection and state updates.
…e with TaskSelector

- Introduced AllTasksCompleted component to display a message when all tasks are completed.
- Updated TaskSelector to render AllTasksCompleted when there are no available tasks but completed tasks exist.
- Enhanced useAvailableTasks hook to track all tasks and determine if all tasks are completed.
- Added tests for AllTasksCompleted and updated TaskSelector tests to verify new behavior.
…ted tests

- Deleted AvailableTasks component and its test file to streamline task management.
- Updated TaskSelector to remove dependency on AvailableTasks, simplifying the component structure.
- Ensured that task selection logic is maintained while enhancing overall code clarity.
…ronization

- Implemented a custom event to facilitate same-tab synchronization when tasks are saved to local storage.
- Updated useAvailableTasks hook to listen for the new custom event, ensuring tasks are reloaded appropriately for the current date.
- Enhanced cross-tab synchronization by maintaining the existing storage event listener for task updates.
- Updated NowView to include shortcuts for navigating between tasks, displaying nowShortcuts alongside global shortcuts.
- Enhanced FocusedTask component to support previous and next task navigation through new props.
- Implemented task cycling functionality in TaskSelector, allowing users to navigate tasks seamlessly.
- Introduced useNowViewShortcuts hook to manage keyboard shortcuts for task navigation.
- Added tests for the new task cycling functionality and ensured existing tests reflect the updated behavior.
…ection

- Added AvailableTasks component to display a list of selectable tasks.
- Integrated AvailableTasks into TaskSelector for improved task management.
- Updated useAvailableTasks hook to track all tasks and filter available tasks for today.
- Enhanced TaskSelector tests to cover new AvailableTasks functionality and ensure correct rendering behavior.
@tyler-dane tyler-dane marked this pull request as ready for review November 15, 2025 16:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

- Enhanced button styles in FocusedTask component for better visual feedback.
- Changed button classes to include rounded-full, padding, and transition effects for hover and focus states.
- Improved accessibility with consistent focus ring and background effects.
@tyler-dane tyler-dane changed the title feat(web): add now planner feat(web): add now planner mvp Nov 15, 2025
- Introduced unit tests for the AvailableTasks component to verify rendering and interaction behavior.
- Ensured tests cover scenarios for rendering task buttons, handling task selection, and displaying appropriate messages when no tasks are available.
- Improved accessibility by validating aria-labels for task buttons.
…anagement

- Updated TaskSelector to filter incomplete tasks and determine navigation direction based on fresh data.
- Improved logic for focusing on the next or previous task, ensuring correct task selection even with array order differences.
- Added fallbacks for task focus to enhance user experience when navigating through tasks.
- Introduced a constant for the custom event name "compass.tasks.saved" to improve code readability.
- Defined an interface for the event detail to facilitate same-tab synchronization when tasks are saved to localStorage.
- Updated the saveTasksToStorage function to use the new event structure for dispatching the custom event.
- Modified the useAvailableTasks hook to utilize the new event type for handling task synchronization.
- Updated test cases in TaskSelector.test.tsx to use getByRole for selecting task elements, improving accessibility and code clarity.
- Removed unnecessary chaining of methods for task element retrieval, streamlining the test logic.
…props

- Modified AllTasksCompleted tests to include future props in MemoryRouter for improved compatibility with upcoming React features.
- Ensured that the tests accurately reflect the rendering behavior of the AllTasksCompleted component with the new router configuration.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

…e into TaskSelector

- Implemented getIncompleteTasksSorted function to filter and sort incomplete tasks by creation date, using array index as a tie-breaker for identical timestamps.
- Updated TaskSelector and useAvailableTasks hook to utilize the new sorting function, improving code clarity and reducing redundancy.
- Removed outdated filtering logic from TaskSelector and useAvailableTasks, enhancing maintainability.
@tyler-dane tyler-dane merged commit ea580bd into main Nov 15, 2025
5 checks passed
@tyler-dane tyler-dane deleted the feat/1237-now-mvp branch November 15, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create baseline Now workflow

2 participants