Commit graph

71 commits

Author SHA1 Message Date
Callum Alpass
39da2627e7 release: 0.7.0
- Add daily note template system with Obsidian variable support
- Implement customizable task filename formats with live preview
- Enhance Pomodoro timer with native task selection and persistence
- Improve UI consistency and accessibility
- Fix calendar selection visual issues
- Remove redundant zettelid functionality
2025-06-01 21:58:08 +10:00
Callum Alpass
d215f381c2 Enhance Daily Note Functionality and Template Processing
• Introduce support for a custom daily note template:
 – In settings.ts, add a new setting (dailyNoteTemplate) with a default empty string.
 – Update the settings UI to include an input for specifying the daily note template file path.

• Update initialization of FileIndexer:
 – Modify the TaskNotesPlugin constructor to pass the dailyNoteTemplate setting along with other daily note settings.
 – In main.ts, update the file indexer without always recreating it: first update the daily note template path via a new updateDailyNoteTemplatePath() method, and only destroy and reinitialize the indexer if core settings (taskTag or excludedFolders) have changed.

• Change daily note generation to async:
 – Convert generateDailyNoteTemplate() to an async method that reads the custom template file from the vault.
 – If a valid custom template is set and found, process it using Obsidian template variables; otherwise, fall back to the built-in template.
 – The plugin now awaits the template generation before creating daily note files.

• Update FileIndexer to handle the daily note template:
 – Add a new property dailyNoteTemplatePath to FileIndexer.
 – Extend the constructor to accept the daily note template path.
 – Implement updateDailyNoteTemplatePath(newPath) to update the template path when settings change.
 – Modify isExcluded() in FileIndexer to exclude the template file from being indexed.

• Improve template processing in helpers.ts:
 – Modify generateDailyNoteTemplate() to optionally accept template content.
 – If provided, process the template using the new processObsidianTemplateVariables() helper, which supports variables like {{title}}, {{date}}, and {{time}} with optional formatting.
 – Add a utility function convertMomentToDateFnsFormat() to convert Obsidian/Moment.js style date/time formats into date-fns formats for proper rendering.
 – Keep the default built-in template as fallback, embedding YAML frontmatter and a header with the formatted date.

These combined changes provide a robust way for users to specify custom templates for daily notes with proper handling of Obsidian template variables, while improving the dynamic update of file indexing settings.
2025-06-01 11:43:35 +10:00
Callum Alpass
ae68cd0bdb Commit: Introduce customizable task filename generation with live preview
• Added new filename generation utilities in utils/filenameGenerator.ts:
  – Implements multiple filename formats (title, zettel, timestamp, custom) using a FilenameContext.
  – Provides helper functions for sanitizing filenames, generating unique filenames (appending a counter if needed), and validating filenames.
  – Supports a custom template with various available variables (e.g., {title}, {date}, {priority}, etc.).

• Updated TaskCreationModal.ts to integrate filename generation:
  – Imported and utilized generateTaskFilename and generateUniqueFilename.
  – Removed legacy task ID (zettelid) generation in favor of filename-based identification.
  – Added a live filename preview element that updates as the user enters a title or changes task properties (priority/status).
  – Implemented the updateFilenamePreview() method to reflect current input in the UI.

• Modified settings in settings.ts:
  – Extended TaskNotesSettings with taskFilenameFormat and customFilenameTemplate options.
  – Added UI controls (dropdown and text input) for choosing the filename format and specifying a custom template.
  – Provided conditional visibility for the custom template setting based on the selected format.

• Adjusted related styles in styles.css:
  – Defined CSS for the filename preview with valid/error indicators.
  – Made minor adjustments to focus and selection styling for calendar days.

Overall, these changes allow users to customize how task filenames are generated (including live preview in the task creation modal), improving task organization and consistency based on user-defined configuration.
2025-06-01 11:20:05 +10:00
Callum Alpass
ed0e86cfd6 feat: Introduce task selection modal and persistent task assignment in Pomodoro
• Added a new file (TaskSelectorModal.ts) implementing a fuzzy-search modal for selecting tasks.
  - The modal filters out completed and archived tasks.
  - It sorts tasks by due date, priority, and title.
  - The modal renders each task with title, due date (with overdue/due-today indicators), contexts, and status.
  - It supports keyboard navigation and selection callbacks.

• Enhanced PomodoroService:
  - Added saveLastSelectedTask() to persist the last selected task path.
  - Added getLastSelectedTaskPath() to load the persisted task path.
  - This persistence supports restoration of the task selection across sessions.

• Updated PomodoroView:
  - Replaced the select dropdown with a button that opens the new TaskSelectorModal.
  - Added a "Clear" button to remove any currently selected task.
  - Implemented functions to update the displayed task button text, save selections, and update tasks for a current work session.
  - Restored the last selected task on view load by checking persistent data and updating the UI accordingly.
  - Adjusted session start and work session handlers to pass the current selected task (if available).

• Extended styles.css:
  - Added CSS styles for the Task Selector Modal and related components.
  - Defined styles for task suggestions (including title, metadata, due date indicators, and context tags).
  - Styled the Pomodoro task selector button and clear button for a consistent UI experience.

This commit refactors the task selection workflow in the Pomodoro view to improve usability by enabling fuzzy task search, persistent selection, and a more interactive UI.
2025-06-01 10:43:01 +10:00
Callum Alpass
9e4b702795 Enhance Pomodoro functionality with improved state validation, error handling, UI loading states, and timer visuals
• In PomodoroService.ts:
  - Added a document "visibilitychange" listener that resumes the timer when the app becomes visible, ensuring sessions are correctly resumed after suspension.
  - Enhanced state validation in loadState(): ensures fields like pomodorosCompleted, currentStreak, totalMinutesToday, and timeRemaining are non-negative; resets stale sessions (e.g., sessions older than 24 hours) or those from a new day.
  - Prevents starting a new session if a paused session is pending by checking currentSession and isRunning flags before initiating pomodoros or breaks.
  - Validates duration settings for work, short break, and long break durations by clamping values within acceptable ranges.
  - Improves startTimer() by immediately saving state, emitting tick events with UI updates, and saving state periodically (every 10 seconds) to persist progress.
  - Refactors resumeTimer() to account for both paused and running sessions, recalculating timeRemaining based on elapsed time and handling future start times by resetting the session.
  - Enhances playCompletionSound() with robust error handling using try/catch blocks, ensuring both beeps play safely and cleaning up the audio context after use.
  - Saves final state on cleanup to persist any pending changes.

• In PomodoroView.ts:
  - Clears all cached element references (timerDisplay, statusDisplay, start/pause/stop buttons, task display, stats display) on view cleanup to prevent memory leaks.
  - Updates the start button event listener to prevent double clicks by adding a loading state (is-loading CSS class) during asynchronous operations and ensures proper removal of the class afterward.
  - Uses optional chaining and improved error handling when obtaining the selected task from the file indexer.
  - Initializes the timer display based on the current state upon view setup so the UI reflects the accurate timer value from the start.
  - Refines updateTimer() by validating seconds input (ensuring non-negative values) and applying a warning style (pomodoro-timer-warning) when less than or equal to 60 seconds remain.

• In styles.css:
  - Added the is-loading class with reduced opacity and disabled pointer events to visually indicate loading states on buttons.
  - Defined the pomodoro-timer-warning CSS class and a pulse-warning animation to alert users as the timer nears completion, improving overall UX.

This commit significantly enhances the robustness and user experience of the Pomodoro module by ensuring state consistency, preventing erroneous session starts, and providing clear visual feedback.
2025-06-01 10:35:47 +10:00
Callum Alpass
3f1b8bb1f4 Refactor UI labels, visibility toggling, and logging comments for improved consistency and maintainability
• Updated various UI label texts and descriptions:
 – Changed ribbon icon tooltip texts (“TaskNotes” → “Open …”) for calendar, grid, and tabs layouts
 – Updated command names (e.g. “Open Pomodoro timer” → “Open pomodoro timer”, “In Progress” → “In progress”, etc.) for consistent capitalization
 – Revised notices and status messages to drop “TaskNotes” prefix (e.g. “TaskNotes views created” → “Views created”)
 – Adjusted labels in TaskCreationModal and TaskListView for better wording (“New Task” → “New task”, “Due Date” → “Due date”, etc.)

• Replaced inline style display toggling (style.display = …) with adding/removing the “is-hidden” utility class to improve code consistency and maintainability

• Modified file existence check in daily note creation by using getAbstractFileByPath instead of adapter.exists for clarity

• Removed redundant code during plugin deactivation (detaching leaves for internal views), as view clean-up is handled elsewhere

• Updated logging calls in PomodoroService and FileIndexer:
 – Converted console.log statements to comments for production readiness and clarity
 – Simplified messages to focus on functionality instead of verbose debug output

• Small adjustments in view code (AgendaView, CalendarView, PomodoroView, TaskListView, etc.) to use workspace.getActiveViewOfType for determining active views instead of checking current leaf

• Updated CSS to introduce the “is-hidden” utility class for consistent show/hide operations

Overall, the commit standardizes UI text, improves state toggling via CSS classes, cleans up debug logging, and slightly simplifies view lifecycle management for a more cohesive user experience and easier maintenance.
2025-06-01 09:02:37 +10:00
Callum Alpass
bdfc6be2f8 exclude spec 2025-06-01 08:15:31 +10:00
Callum Alpass
6c35e670af feat: Add comprehensive Pomodoro Timer feature
• Added a detailed specification document (POMODORO_SPEC.md) outlining the Pomodoro Timer feature, including timer intervals (work, short break, long break), UI components, settings, data model, events, and implementation details.
• Introduced a new Pomodoro view type (POMODORO_VIEW_TYPE) and corresponding view (src/views/PomodoroView.ts) to display the timer, session status, task assignment, and statistics.
• Created the PomodoroService (src/services/PomodoroService.ts) to manage timer state, handle interval logic, persist state across sessions, integrate with task time tracking, and emit events (start, complete, interrupt, tick) for UI updates and notifications.
• Updated main.ts to:
  - Initialize the PomodoroService on plugin load
  - Register the Pomodoro view and new commands for starting, pausing, and stopping a Pomodoro session
  - Clean up PomodoroService on unload and detach corresponding views.
• Extended the TaskNotesSettings interface (in src/settings/settings.ts) with new Pomodoro-related settings (durations, break intervals, auto-start options, notification and sound settings) and added corresponding UI components in the settings tab.
• Expanded type definitions (src/types.ts) to include PomodoroSession, PomodoroState, and new Pomodoro event constants.
• Refined time entry handling across the codebase by updating property names (from startTime/endTime to start/end) in FileIndexer (src/utils/FileIndexer.ts) and helper functions (src/utils/helpers.ts) to support consistent data mapping with Pomodoro time entries.
• Performed minor UI adjustments in TaskListView to integrate the Pomodoro icon and visual indicators for active Pomodoro sessions.
• Updated styles.css with dedicated styles for the Pomodoro view, including layout, timer display, buttons, status badges, task selector, and statistics panels.

These changes integrate the Pomodoro timer as an opt-in feature into the existing TaskNotes plugin, allowing users to time their work sessions, track progress, and seamlessly integrate with task time tracking while maintaining existing functionality.
2025-06-01 08:15:06 +10:00
Callum Alpass
9cc0f37f27 Add Agenda View & Remove Timeblock Functionality
• Updated README.md to remove references to timeblock tables and related descriptions, streamlining plugin documentation.
• Removed timeblock configuration options from settings (start/end times, interval, auto-add flag) in settings.ts and eliminated associated UI in the settings tab.
• Modified helper functions in helpers.ts and daily note template generation to no longer include timeblock tables.
• Introduced a new view type AGENDA_VIEW_TYPE in types.ts and updated main.ts to:
  – Import and register the new AgendaView,
  – Add commands to activate the agenda view and open it in a new window,
  – Ensure cleanup of the agenda view on workspace detach.
• Added a comprehensive AgendaView (src/views/AgendaView.ts) that:
  – Displays tasks and notes grouped by date or in a flat list,
  – Provides navigation controls (previous/next periods, today button, period selector, and toggling of completed tasks),
  – Implements keyboard navigation, context menus, hover previews, and task-status toggling.
• Updated CalendarView.ts to remove switching to "agenda" display mode:
  – Now always defaults to month view and simplifies date navigation,
  – Consolidated colorize mode selector updates.
• Appended new CSS rules in styles.css to style the Agenda view interface, including controls, lists, badges, and responsiveness.

This commit refactors and streamlines the plugin by removing unused timeblock features and adding a robust agenda view to enhance task and note organization.
2025-05-31 17:48:12 +10:00
Callum Alpass
1be4fb0329 Rename ChronoSync Plugin to TaskNotes Plugin and Remove Legacy Daily Metadata Commands
• Renamed the main plugin class from ChronoSyncPlugin to TaskNotesPlugin and updated all related types, settings, and UI elements accordingly.
• Updated settings interface and default folder paths from "ChronoSync" to "TaskNotes", and renamed ChronoSyncSettingTab to TaskNotesSettingTab.
• Modified all ribbon icon labels, command names, group identifiers, and user notices to reflect the new "TaskNotes" branding.
• In view types (CalendarView, NotesView, TaskListView), updated container classes and hover sources from "chronosync-*" to "tasknotes-*" for consistent styling and identification.
• Changed the view type constants in types.ts to use "tasknotes" prefixes.
• In task creation modal and helper functions, adjusted import and instance type to reference TaskNotesPlugin.
• Removed legacy daily note metadata commands (incrementPomodoros, toggle-workout, toggle-meditate, and associated update logic) from the main plugin as they are no longer part of TaskNotes functionality.
• Cleaned up YAML frontmatter generation in helpers by removing default values for pomodoros, workout, and meditate.

This commit ensures branding consistency across the codebase and removes unused functionality, paving the way for continued development of TaskNotes features.
2025-05-31 11:29:32 +10:00
Callum Alpass
6c6184d402 Update readme 2025-05-31 10:55:32 +10:00
Callum Alpass
16462e4413 release 0.6.3 2025-05-31 10:42:39 +10:00
Callum Alpass
71d1563a6d Allow task titles to wrap 2025-05-31 10:41:41 +10:00
Callum Alpass
a0abe13464 Remove duplicated divider 2025-05-31 10:39:00 +10:00
Callum Alpass
8ce22512a3 update license 2025-05-30 00:49:39 +10:00
Callum Alpass
dcc49dba56 release 0.6.2 2025-05-30 00:10:26 +10:00
Callum Alpass
52b0aa3e15 Fix styling 2025-05-30 00:10:18 +10:00
Callum Alpass
40458173fc update 2025-05-29 23:37:08 +10:00
Callum Alpass
5114b3ee28 release 0.6.1 2025-05-29 23:26:43 +10:00
Callum Alpass
6b42f86fee Refactor Task UI interactions, optimistic updates, and style rules
• In ChronoSyncPlugin (src/main.ts):
  - Implemented optimistic UI updates by creating local modified copies of tasks when starting or stopping time tracking.
  - Instead of a full refresh using notifyDataChanged, the code now updates the file index cache and emits a granular EVENT_TASK_UPDATED event with the updated task.
  - Added safeguards to initialize timeEntries when absent and recalc total time spent upon stopping a time entry.

• In TaskListView (src/views/TaskListView.ts):
  - Removed extraneous console logging from task element tracking.
  - Improved the priority indicator: now rendered as a clickable button with proper aria attributes and an event listener to cycle through priorities.
  - Updated the status badge similarly for non-recurring tasks to allow status cycling via clicks, with appropriate accessibility attributes and error rollback handling.
  - Enhanced the time tracking icon to reflect active versus idle states.
  - Added a dedicated task footer that contains a due date input and recurring task toggle:
      • The due date input now appears with a label, proper aria attributes, and an event listener to update and revert changes on error.
      • The recurring task toggle button updates the task's complete instances and applies optimistic UI changes.
  - Introduced a helper method getTaskFromCache to avoid stale task data and ensure interactions always work on the freshest copy.
  - Minor adjustments to DOM update logic for status badges and priority indicators to include updated clickable classes.

• In styles.css:
  - Revised task layout spacing for a cleaner, more modern appearance (e.g., increased gap in .task-item).
  - Updated styles for the task footer, due date input, recurring section, and clickable elements (priority indicator, status badge, toggle button).
  - Added transition and hover effects for interactive elements to provide better visual feedback.

These changes improve the responsiveness and accessibility of task interactions while reducing full refreshes by handling granular updates optimistically.
2025-05-29 23:25:55 +10:00
Callum Alpass
a41ef0d632 release 0.6.0
Add time tracking functionality
2025-05-29 22:21:30 +10:00
Callum Alpass
0644e3a9e5 Refactor TaskListView DOM Updates & Tweak Task Item Styling
• Removed the clearing of the task elements map during task list re-rendering. This change preserves existing element references, ensuring updates occur on the correct DOM elements without unintended resets.

• Enhanced diagnostic logging in updateTaskElementInDOM:
  – Added logs to track when a task element is looked up, displaying available task paths.
  – Logged when updating task elements along with current status, classes, and HTML snippets.
  – Provided warnings when essential elements such as the status badge or priority indicator are missing.

• Updated task status and visual cues:
  – Enhanced the status badge update by formatting display text for “in-progress” as “In Progress” and capitalizing statuses appropriately.
  – Introduced detailed logging for the priority indicator update.

• Improved completed date badge behavior:
  – For non-recurring tasks marked as done, dynamically update the completed date badge with formatted dates and tooltips.
  – If the badge doesn’t exist, create and insert it into the task metadata container.

• Updated time metadata handling:
  – Updated time estimates and time spent displays using the plugin formatter.
  – Enhanced progress-dot updates to reflect time completion status (in progress, complete, or over-estimate) with relevant classes and tooltips.

• Tweaked task item styling in styles.css:
  – Increased padding, gap, and bottom margin from small (xs) to medium (md) values to ensure consistent and improved spacing.

These changes collectively improve the debugging, user feedback, and overall UI responsiveness when updating tasks in the list view.
2025-05-29 22:20:45 +10:00
Callum Alpass
e270dd6146 Add comprehensive time tracking feature and UI enhancements for task management
• Introduced new time tracking functionality in the plugin by adding methods in main.ts:
  – startTimeTracking: Starts a new time tracking session for a task by appending a time entry in the file’s frontmatter, while preventing duplicate active sessions.
  – stopTimeTracking: Ends an active time tracking session, calculates the duration (in minutes), updates the corresponding time entry, and recalculates the total time spent.
  – getActiveTimeSession: Retrieves the currently running time entry for a given task.
  – formatTime: Utility method for converting minutes into a human-readable format (e.g., “1h 30m”).

• Updated Task Creation Modal (TaskCreationModal.ts) to support time estimates:
  – Added a “Time Estimate” input group that allows users to specify an estimated duration in minutes.
  – Dynamically updates the input label to reflect hours and minutes when values exceed 60 minutes.
  – Saves the provided time estimate (along with initializing timeSpent and timeEntries) in the task’s YAML frontmatter upon creation.

• Enhanced the task type definitions in types.ts:
  – Added timeEstimate, timeSpent, and timeEntries properties to TaskInfo and TaskFrontmatter.
  – Defined a TimeEntry interface capturing startTime, optional endTime, duration, and an optional description.

• Modified helper functions in helpers.ts to extract the new time tracking fields from frontmatter, ensuring backward compatibility.

• Improved the Calendar and Task List Views:
  – CalendarView.ts now displays formatted time estimate and time spent alongside tasks.
  – TaskListView.ts adds a time tracking icon next to task titles. The icon toggles between “start” (▶) and “stop” (⏸) states based on whether a session is active.
  – Provides a compact time metadata display with progress indicators (using a progress dot) to visually represent the ratio of time spent versus time estimated.

• Updated styles.css to include new styles for time tracking UI elements:
  – Custom styles for the time estimation input in the creation modal.
  – Style rules for the new time-icon, including idle and tracking states.
  – Visual styling for time estimate and time spent labels in both the agenda and compact metadata displays.
  – Additional styles for progress dots to indicate task progress (in-progress, complete, or over-estimate).

This commit significantly enhances task management by providing robust time tracking capabilities, allowing users to monitor and visualize their work sessions against estimated durations.
2025-05-29 22:03:41 +10:00
Callum Alpass
290e14be2e release 0.5.0 2025-05-29 21:31:02 +10:00
Callum Alpass
f28ca39509 feat: Enhance TaskCreationModal with status field, autocomplete inputs, and improved UX
• Add a new "status" property (with options "open", "in-progress", "done") to the task model.
  - This is reflected in the TaskFrontmatter update and properly set during task creation.
  - A completedDate is now added when the task status is marked as "done".

• Introduce autocomplete functionality for "Contexts" and "Tags":
  - Create async helper methods getExistingContexts() and getExistingTags() that scan tasks across a 60-day window (±30 days) to collect existing contexts/tags.
  - Build a generic createAutocompleteInput() function to manage input events, suggestion filtering, keyboard navigation, and selection of suggestions.
  - Add fallback suggestions if no suggestions are retrieved.
  - The input field updates on suggestion click and Enter key selection.

• Improve form UX in the TaskCreationModal:
  - Add a character counter with visual warning for the Title field, with dynamic feedback when approaching the 200-character limit.
  - Pre-populate the "Due date" field with a selected date from the calendar or default to today.
  - Implement keyboard navigation: Escape key closes the modal; Ctrl+Enter (or Cmd+Enter) triggers task creation; proper tab order is assigned to all focusable fields.

• Update styles.css for a cohesive visual improvement:
  - Add styles for the autocomplete container, suggestions dropdown, and selected state.
  - Add styles for the input field with character counter, ensuring proper position, warnings, and overall modal aesthetics.

These changes collectively improve the task creation workflow by providing seamless autocomplete capabilities, better accessibility, faster input feedback, and enhanced styling.
2025-05-29 21:30:33 +10:00
Callum Alpass
cf99b46d61 Add support for displaying and managing task completion dates
This commit introduces a new "completedDate" attribute to better track when non-recurring tasks are marked as done, alongside several UI updates to display this information. The changes include:

1. Updates to Task Status Handling (src/main.ts):
   - When the task status is updated (via frontmatter processing), the code now checks for "status" changes on non-recurring tasks.
   - If the status is set to "done", the completedDate property is set to the current date using the format "yyyy-MM-dd".
   - Conversely, if the status is changed back to "open" or "in-progress", the completedDate is cleared.
   - The same handling is applied both to the local task copy and within the frontmatter update.

2. Updating Type Definitions (src/types.ts):
   - Added an optional "completedDate" property to both TaskInfo and TaskFrontmatter interfaces.
   - This enables consistent type-checking and ensures that tasks can carry a completion date if marked as done.

3. Enhancements to Helper Functions (src/utils/helpers.ts):
   - Modified the YAML extraction logic to include the "completedDate" field from the frontmatter.
   - This ensures that the parsed task info includes the completion date when present.

4. Calendar View Enhancements (src/views/CalendarView.ts):
   - Updated the calendar view to render the completed date for tasks that are done and non-recurring.
   - The completed date is formatted (displayed as “Completed: MMM d”) so users can quickly see when the task was completed.

5. Task List View Enhancements (src/views/TaskListView.ts):
   - Added a new UI element to display the completed date for non-recurring tasks that are marked as done.
   - The completion date is formatted with a tooltip showing the full date (“MMMM d, yyyy”), enhancing the visual feedback in the task list.

6. Styling Updates (styles.css):
   - Introduced a new CSS class (.task-completed-date) for styling the completion date display.
   - Made adjustments to due-date and added a dedicated style for completed-date to ensure a visually consistent presentation.

These changes provide clear visual feedback about task completion dates, improve data consistency, and enhance the overall user experience when managing tasks within the application.
2025-05-29 21:10:09 +10:00
Callum Alpass
e1ec361e9d fix release bump 0.4.2 2025-05-27 22:11:18 +10:00
Callum Alpass
6c29229e15 release 0.4.1 2025-05-27 22:10:41 +10:00
Callum Alpass
9225d041c8 Add collapsible toggle 2025-05-27 22:08:12 +10:00
Callum Alpass
f44f4cf0d3 Refactor task grouping logic and header rendering in TaskListView
- Update group header condition:
  • Previously, the header was skipped if grouping was not "none" OR groupName wasn’t "all". This commit changes the condition to skip the header only when the grouping is "none" AND the groupName is "all". This clearer logic ensures the header renders in all cases except the intended scenario.

- Enhance "None" grouping behavior:
  • Instead of returning a single group ("all") for a "none" grouping, tasks are now subdivided into three distinct categories:
      ▸ "Recurring Tasks" – tasks with a recurrence property.
      ▸ "Due Today" – tasks whose due date matches the currently selected date.
      ▸ "Other Tasks" – remaining tasks.
  • The new grouping logic iterates through the sorted tasks, distributing each task into its corresponding bucket.
  • Groups are conditionally added to the final map only if they contain tasks, ensuring a clean and meaningful task display.

These changes improve the clarity of header logic and provide more detailed task categorization when no grouping is specified.
2025-05-27 21:59:12 +10:00
Callum Alpass
041d533033 release 0.4.0 2025-05-27 21:49:26 +10:00
Callum Alpass
7ca777cad2 Refactor toggle button UI for recurring tasks and update button styling
Changes:
• In TaskListView.ts:
  - Simplified the toggle button for recurring tasks by removing extra theme-specific classes (removed "chronosync-button" variants).
  - Replaced the long text labels ("Mark Complete"/"Mark Incomplete") with compact symbols ("✓" for marking complete and "✗" for marking incomplete) to streamline the UI.
  - Maintained appropriate aria-labels to ensure accessibility by dynamically reflecting the task’s effective status and selected date.

• In styles.css:
  - Reduced the toggle button’s padding (from 0.1rem 0.3rem to 0.05rem 0.2rem) and decreased the font size (from 0.7rem to 0.6rem) for a more compact appearance.
  - Updated border-radius to use the variable (--cs-radius-sm) and set a fixed height of 22px to make the button size consistent.
  - Adjusted line-height, text-transform, letter-spacing, and opacity (opacity lowered from 0.8 to 0.6) for improved visual balance.
  - Modified the hover state to apply a subtle background color (var(--background-secondary)), adjust opacity (0.8), and use consistent border styling.

These changes enhance the UI by providing a cleaner, more responsive and accessible button design for managing recurring tasks.
2025-05-27 21:49:18 +10:00
Callum Alpass
1c07362c38 Enhance Daily Note Verification, Path Normalization, and Task Filtering in CalendarView
- Modified daily note preview logic by ensuring the file exists and is an instance of TFile. This extra type check helps prevent unintended behavior if the file isn’t the expected type.
- Updated the daily note path construction in getDailyNotePath by wrapping the path with normalizePath. This change ensures file paths are correctly formatted across different operating systems.
- Refactored the task filtering logic in CalendarView. Instead of combining both due-date matching and recurring-task conditions in one statement, the new implementation clearly separates concerns: recurring tasks are only shown if they pass the isRecurringTaskDueOn check, while non-recurring tasks are displayed based on a direct due date match.

These changes improve code clarity, reliability, and cross-platform compatibility in handling calendar entries.
2025-05-27 20:40:48 +10:00
Callum Alpass
2d8cc39895 Enhance CalendarView Task/Note Interactivity with Click & Hover Handlers
• In CalendarView.ts, added click event listeners for task items:
  - Clicking on a task now retrieves its file from the vault and opens it in a new workspace leaf if it is a valid file.

• Added mouseover event listeners for tasks to trigger hover preview:
  - When hovering over a task, a 'hover-link' event is triggered, providing a preview of the task file.

• Applied similar interactivity for note items:
  - A click event listener now opens the corresponding note file.
  - A mouseover event listener triggers the hover preview functionality for the note.

• Updated styles.css:
  - Added a 'cursor: pointer;' style to the processing button to visually indicate that it is clickable.

These changes improve the user experience by enabling direct navigation and preview for tasks and notes from the CalendarView.
2025-05-27 20:28:01 +10:00
Callum Alpass
e48d94eccf Remove week view support and refine calendar navigation behavior
• Update CalendarDisplayMode type in src/types.ts by removing the "week" option, ensuring only "month" and "agenda" modes are supported.
• Remove week view-specific logic from CalendarView.ts:
  – Eliminate the "week" case from the display mode switch in the render method.
  – Refactor navigateToPreviousPeriod and navigateToNextPeriod methods to handle:
   • Agenda view: always navigate by ±7 days followed by a full refresh.
   • Month view: adjust the month and, if the month/year changes, trigger a daily notes cache rebuild (when in daily colorize mode) and a full refresh; otherwise, just update the selected date.
  – Update navigateToToday to detect a change in month or view and conditionally rebuild the daily notes cache (for month view) before refreshing.
  – Adjust date navigation in event handlers to check for month transitions before deciding between a full refresh or an in-place update.
• Remove the helper methods and view rendering for the week grid:
  – Delete the getWeekStartDate and renderWeekGrid methods, as they are no longer needed.
• Remove associated CSS styles for the week grid view from styles.css to clean up unused style declarations.

These changes streamline calendar functionality by removing the deprecated week view and ensuring that navigation between periods in the remaining calendar views works reliably with proper refreshes and cache handling.
2025-05-27 20:18:33 +10:00
Callum Alpass
908b0f0d15 Enhance Calendar & Task List Views with Week/Aggregate Modes and Improved Filter UI
• Update CalendarView.ts:
  - Modify navigation methods (navigateToPreviousPeriod, navigateToNextPeriod) to adjust the date based on the current view mode. When in 'week' or 'agenda' display mode, the view now shifts by 7 days; otherwise, it continues to shift by one month.
  - Constrain daily notes cache rebuilds to occur only in month view when the colorize mode is set to 'daily'.
  - Augment the weekly view rendering by adding an all-day section above the time grid. This section creates columns for each day, displaying tasks and notes that are due for the entire day.
  - Filter tasks such that recurring tasks are determined via the helper function isRecurringTaskDueOn, ensuring tasks with recurrence rules render on appropriate days.
  - Likewise, the agenda view now filters tasks (and comments on notes filtering) to show only items for the specific day.

• Update TaskListView.ts:
  - Revamp the filter layout by splitting filters into two rows: primary filters (including status, contexts, and a refresh button) and organization filters (grouping and sorting options). This restructuring enhances clarity and ease of use.
  - Remove the redundant right-side refresh button in favor of the primary row refresh button.
  - Improve filtering UI semantics with updated class names and layout adjustments.

• Update styles.css:
  - Introduce new CSS classes for the calendar all-day section (e.g., .week-all-day-section, .all-day-header, .all-day-label, .all-day-column) to visually separate all-day events from the time grid.
  - Clean up obsolete styles (removing the old .all-day-section) and adjust the day-column styles.
  - Add comprehensive styling for the improved task filters in TaskListView, defining styles for .task-filters, .filters-row, .primary-filters, .organization-filters, .filter-group, and responsive adjustments to ensure consistent behavior on smaller screens.
  - Enhance the context dropdown styling to align with the overall UI improvements.

Overall, this commit refines user navigation in CalendarView, introduces robust handling for recurring tasks and all-day events in week/agenda modes, and significantly improves the filter interface in TaskListView with a responsive design.
2025-05-27 20:09:13 +10:00
Callum Alpass
ac8bbfbcb4 Enhance task update granularity, calendar view modes, and task list filtering
Detailed Description:
• Introduced a new event (EVENT_TASK_UPDATED) in types.ts and updated the export list to support granular task updates. This allows simple property changes (priority, status, due) to trigger targeted DOM updates without full refresh.

• In main.ts, refactored the task update code:
  – Added conditional logic to emit EVENT_TASK_UPDATED for simple changes versus falling back to the existing full refresh mechanism for complex updates.

• Updated FileIndexer.ts:
  – Removed caching of notes query results to always ensure current data. This simplifies the data retrieval flow and avoids potential stale states.

• Extended CalendarView.ts:
  – Added CalendarDisplayMode type and introduced a displayMode property to allow switching between 'month', 'week', and 'agenda' views.
  – Implemented view switcher controls that update the displayMode when clicked, with associated UI changes and refreshes.
  – Provided helper methods to compute current period text (for week, agenda, or month) and methods to render a week grid and an agenda list view.

• Improved TaskListView.ts:
  – Modified event listeners to subscribe to the new EVENT_TASK_UPDATED event so that individual task updates can be reflected via cache and DOM element updates.
  – Added sorting and grouping state management with new types (TaskSortKey, TaskGroupKey) and UI selectors for user filtering.
  – Refactored renderTaskItems to support both array and grouped data formats, displaying tasks according to selected group (e.g., priority, context, due date).
  – Introduced a method (getSortedAndGroupedTasks) to sort tasks based on due date, priority, or title and then group them based on the selected grouping key.

• Updated styles.css:
  – Enhanced the task update animation with a subtle highlight effect and fade transition.
  – Added new styles for the calendar view switcher buttons and active states.
  – Defined layout and styling for the new week grid view and agenda list view, including headers, time labels, day columns, and event blocks.
  – Improved overall UI consistency with new CSS classes for group headers, task cards, and agenda items.

These changes provide a better user experience by enabling more efficient UI updates, richer calendar views, and flexible task filtering/grouping options within the plugin.
2025-05-27 19:44:47 +10:00
Callum Alpass
2135e2e711 release 0.3.0 2025-05-27 19:31:01 +10:00
Callum Alpass
38f0291a65 Refactor Task Update Handling and Improve UI Refresh Consistency
• Updated the task caching and UI refresh logic in both main.ts and TaskListView.ts to follow a consistent pattern similar to recurring tasks.
• Replaced manual file content reading and caching with direct use of updated task objects and full index rebuilds.
• Simplified and centralized UI updates and error handling across task archive, status, priority, and due date changes.

Details:
1. In src/main.ts:
   - Removed the previous method of reading file content and extracting task information before updating the file indexer's cache.
   - Now, the plugin uses the manually constructed updated task (as used in recurring tasks) directly with updateTaskInfoInCache.
   - Replaced a direct update of the single file index with a full index rebuild via rebuildIndex() to ensure complete data consistency.
   - Modified notifyDataChanged() parameters to force full UI refresh, aligning task refresh behavior with that of recurring tasks.

2. In src/views/TaskListView.ts:
   - For toggling task archive status:
     • Removed local task object mutation and immediate partial DOM updates.
     • Instead, trigger a full view refresh by calling refresh() after backend updates, ensuring UI consistency.
   - For recurring task status updates:
     • Updated the backend call to pass the updated task object (instead of the original) when toggling recurring statuses.
   - For status, priority, and due date changes:
     • Adopted an optimistic UI update approach: immediately update DOM and cache with a locally modified task object.
     • Removed the previous input disabling logic and setTimeout re-enabling, simplifying the update workflow.
     • Introduced explicit error handling that reverts the UI updates by restoring original values and updating the cache.
     • Streamlined code structure by using localized variables (e.g., select/input, original values) for clarity.

This commit aligns the task update operations with recurring tasks' behavior, leading to cleaner, more consistent state handling and user interface refresh across the application.
2025-05-27 19:30:21 +10:00
Callum Alpass
0e2dca47c7 Fix recurring badge 2025-05-27 18:27:07 +10:00
Callum Alpass
675398712e Enhance Task Update Handling with Immediate UI Feedback and Silent Update Options
This commit introduces several improvements to the task management flow by refining both backend update functions and frontend UI behavior. The main changes include:

• Update of the task property updater:
  - Modified the updateTaskProperty method in main.ts to accept an optional options parameter ({ silent?: boolean }).
  - When silent mode is enabled, the method suppresses user notifications to prevent duplicate notices during rapid updates.

• Improvements in TaskListView for dynamic task updates:
  - Introduced a taskElements Map to track task DOM elements. This allows selective, immediate updates to task items without forcing a full re-render.
  - Added two helper functions:
    ▸ updateTaskElementInDOM: Updates DOM elements (status badge, priority indicator, archive button, and overall item classes), and initiates a brief visual flash animation to indicate that the task has been updated.
    ▸ updateTaskInCache: Synchronizes changes with the cached tasks array.
  - Updated event handlers for interactions such as toggling archive status, recurring task status, updating status, priority, and due date. Each handler now:
    ▸ Applies local task object updates.
    ▸ Invokes corresponding backend update functions (often with the silent option to avoid duplicate notices).
    ▸ Immediately refreshes the UI using the new helper functions.
    ▸ Catches errors to revert UI changes and logs errors for debugging.

• CSS enhancements:
  - Added styling for the .task-title-container to accommodate the new priority indicator layout.
  - Defined styles for the .task-priority-indicator with distinct visuals for high, normal, and low priorities.
  - Updated task-status badges to use background colors, including a special style for recurring tasks.
  - Introduced a new .task-updated animation in CSS to provide visual feedback when a task element is updated.

Overall, this refactoring improves responsiveness and user experience by eliminating unnecessary full refreshes and providing immediate visual feedback for task updates while still maintaining synchronization with backend data.
2025-05-27 18:19:21 +10:00
Callum Alpass
84ee6437bb feat: add context filtering support for tasks with UI enhancements
This commit introduces a new "contexts" feature to the tasks module. The changes span across type definitions, helper functions, the task list view UI, and styling, enabling users to filter tasks based on associated contexts.

Key changes:
• Update Task Types:
  - Added an optional "contexts" array to the TaskInfo interface in src/types.ts.
  - Updated the extractTaskInfo() function in src/utils/helpers.ts to extract the "contexts" property from the task’s YAML metadata, treating missing contexts as an empty array.

• Enhance TaskListView UI:
  - Introduced filter state management for contexts by adding "selectedContexts" (as a Set) and "availableContexts" (as an array).
  - Developed a new context dropdown menu with checkboxes in the task filter area alongside the status filter.
  - Added methods "updateAvailableContexts()" to collect unique contexts from tasks, "renderContextMenu()" to dynamically render the dropdown with filtering options, and "updateContextButtonText()" to update the dropdown button text based on the selected contexts.
  - Refactored the filtering logic by centralizing both status and context filtering in the new "applyFilters()" method. This method first applies status filters (including archived tasks) and then narrows results based on selected contexts.

• CSS Styling Updates:
  - Added new styles in styles.css to support the context filter dropdown UI, including styles for the dropdown button, menu, menu items, and hover states, ensuring consistency with the existing design.

Overall, these changes empower users to better organize and view their tasks by context, enhancing productivity and clarity when managing tasks with multiple categorical associations.
────────────────────────────
This commit lays the groundwork for further improvements in task categorization and filtering.
2025-05-27 17:59:48 +10:00
Callum Alpass
662ccd552a release 0.2.4 2025-05-26 06:03:18 +10:00
Callum Alpass
17c9ec055d Fix hover preview for calendar view 2025-05-26 06:02:58 +10:00
Callum Alpass
82ba623236 Update styles.css for Denser, More Compact UI and Improved Responsiveness
This commit refines the overall design system to achieve a denser and more compact user interface that enhances responsiveness and clarity. Major changes include updated spacing scales, border radii, indicator sizes, typing scales, and hover effects across various components (calendar, tasks, notes, cards, etc.). Details are as follows:

1. Design System Variables:
   • Reduced the spacing scale (base changed from 4px to 3px) and updated spacing variables (--cs-spacing-xs through --cs-spacing-xl) to support tighter layouts.
   • Decreased border radii for a minimal, modern look (values adjusted for --cs-radius-sm, --cs-radius-md, --cs-radius-lg).
   • Adjusted the touch target minimum size for a more compact interaction area.
   • Updated indicator sizes for various elements with smaller dimensions.
   • Modified transition timings to faster values (e.g., --cs-transition-fast and --cs-transition-normal).
   • Introduced new typography variables (--cs-text-xs, --cs-text-sm, --cs-text-base, etc.) for more consistent and information-dense text styling.

2. Layout Adjustments:
   • Main container now uses reduced padding (switching from medium to small spacing) and introduces a gap between child elements.
   • Headers (detail view and calendar sections) include subtle borders and padding for clearer separation while maintaining a compact look.
   • Card components (chronosync-card) received updates:
     - Added rounded borders, subtle box-shadow, and border for a consistent card look.
     - Applied a slight transform on hover for an elevated feel.
   • Task and note items now have updated padding, borders, and spacing to better align with the new compact design aesthetic.

3. Calendar and Date Components:
   • Calendar grid and day components are re-styled to use denser padding, smaller gap sizes, and consistent border styles (e.g., border-left for note and task indicators).
   • Replaced thin indicator bars with a stronger visual border indicator and gradient backgrounds for notes and tasks.
   • Enhanced hover effects on calendar days by increasing border width and applying subtle transforms.

4. Responsive Adjustments:
   • Updated media queries improve layout on screen widths ≤768px and ≤480px:
     - Adjusted padding, font sizes, grid column min-widths, and gaps to maintain density and readability on smaller screens.
     - Calendar day sizes and interactive elements are fine-tuned for better touch and visual clarity on mobile devices.

Overall, these changes aim to improve information density and visual hierarchy while keeping a modern, responsive, and compact UI design across the application.

─────────────────────────────────────────────

Reviewed by: [Your Name]
Closes: [Issue/Task reference if applicable]
2025-05-26 05:57:14 +10:00
Callum Alpass
76ba898059 release 0.2.3 2025-05-25 19:52:11 +10:00
Callum Alpass
15fe2c3b4e Refactor UI styles for a flatter, minimalistic look
• Adjust button and card components to remove excessive padding, borders, and box shadows
 – In button.processing::after, reduce bottom margin, remove padding & border
 – In .refresh-tasks-button and .refresh-notes-button, switch from colored backgrounds and borders to transparent backgrounds with subtle opacity transitions and updated padding/font enlargements
 – Update .chronosync-card and header/footer elements by reducing padding, removing borders, and simplifying hover effects

• Revise detail-view and header styling for improved clarity
 – In .detail-view-actions, reduce gap spacing and add vertical alignment
 – Add .detail-view-header h2 styles: smaller font size, light font weight, uppercase letters and letter spacing with a muted color

• Update task list and grid layout
 – Modify .tasks-container grid settings: reduce min-width, gap, and remove extra padding
 – Adjust .task-section-header styling to use transparent backgrounds, lighter fonts, uppercase text, and thinner left borders for selected and recurring sections

• Simplify task item aesthetics
 – Reduce padding and border radii in .task-item, remove excessive borders and shadows, and add subtle bottom/side borders
 – Remove transform animations on hover in favor of a simple background change using a modifier hover color
 – Update task status, priority, and due date input controls with reduced font size, padding, and a transparent background with opacity transitions

• Tweak extra elements for consistency
 – Reduce the border sizes for task highlighting (.task-item.task-due-today), adjust text styling (e.g., normalizing font-weight for due dates and recurring icons) and set uniform opacity values
 – Update archive badge and toggle buttons to remove rounded corners, use transparent backgrounds, and implement smooth opacity transitions
 – Ensure all interactive elements have a clear hover state (changing opacity and text color) without unnecessary transforms or shadows

These changes aim to achieve a cleaner, more modern UI by reducing visual clutter and emphasizing subtle transitions and transparency across the interface.
2025-05-25 19:51:57 +10:00
Callum Alpass
c8797edf17 Add hover preview functionality for calendar daily notes, notes, and tasks
This commit introduces hover-based preview support across multiple views, enabling users to preview content quickly by hovering over daily notes in the calendar, individual notes, and tasks.

Changes include:

• CalendarView Enhancements:
  - Added a 'mouseover' event listener for each day element to trigger a hover preview.
  - Implemented the showDayPreview helper method that checks for Ctrl/Cmd key press before showing the preview.
  - Introduced a helper getDailyNotePath method to generate the path for daily notes based on the date.
  - Now, when a user hovers over a day while holding Ctrl/Cmd, the corresponding daily note preview is triggered via the workspace's hover-link event.

• NotesView Enhancements:
  - Added a 'mouseover' event listener on each note item.
  - When hovered, it triggers the preview for the associated note through the hover-link event of the workspace.

• TaskListView Enhancements:
  - Added a 'mouseover' event listener on task info elements.
  - This handler triggers a hover preview for tasks, again leveraging the hover-link event provided by the workspace.

These improvements streamline previewing functionality in the application, making it easier to access details quickly without fully opening notes or tasks.
2025-05-25 19:39:13 +10:00
Callum Alpass
077452efb4 Commit: Adjust UI spacing and font sizing across task elements
• Reduced margin, padding, and gap values for task list and container components to produce a more compact layout:
 - Task list gap reduced from 0.75rem to 0.5rem.
 - Tasks container grid adjusted: column min-width changed from 360px to 320px and gap from 0.75rem to 0.5rem.

• Updated task section header styling:
 - Updated padding from 0.75rem to 0.5rem and margin adjusted from 0.5rem to 0.4rem.
 - Slightly reduced font-size for improved visual balance.

• Modified task-item adjustments:
 - Reduced padding (from 0.85rem to 0.6rem) and gap (from 0.65rem to 0.4rem) for a denser appearance.
 - Consistent gap update for nested task-item elements (e.g., header info) ensuring cohesive spacing.

• Tweaked typography for input controls and badges:
 - Reduced font sizes on task status, due date, and priority inputs along with adjustments to padding and added a line-height for consistent text rendering.
 - Task archived badge now has slightly smaller font-size and adjusted padding with line-height improvements.

• Fine-tuned additional UI elements:
 - Updated task item title font-size and line-height for better readability.
 - Adjusted task metadata typography: reduced gap and font-size, adding line-height for improved text clarity.
 - Task toggle button padding, font-size, and line-height were decreased to provide a more consistent and compact control appearance.
 - Minor font-size adjustment for task item title within nested elements.

These changes aim to streamline the overall UI, making the task elements appear more compact and cohesive while ensuring usability and visual consistency across the application.
2025-05-25 19:31:46 +10:00
Callum Alpass
cbe1fe5782 This commit refactors and cleans up the notes view while also removing local configuration files that shouldn’t be included in version control. The main changes include:
• Removing the local Claude settings file (.claude/settings.local.json). This file is no longer tracked so that local configuration overrides aren’t accidentally shared.

• Updating .gitignore to ignore the entire .claude directory. This prevents local developer settings from being committed in the future.

• In the NotesView component (src/views/NotesView.ts):
  - Removed the “New Note” button and its click handler, which previously displayed a “not yet implemented” notice. This simplifies the view by eliminating placeholder functionality.
  - Consolidated the refresh button logic by moving its creation into the appropriate container.
  - Introduced logic to differentiate daily notes from regular notes:
      • Daily note items now receive an additional CSS class and a left border styling.
      • A “Daily” badge is appended before the note title if a note belongs to the daily notes folder.
  - Adjusted the filtering logic during note refresh to include both regular and daily notes, instead of filtering out daily notes. Notes are sorted alphabetically by title afterward.

• In styles.css:
  - Added styling for daily note items, including a left border and a badge style for the “Daily” indicator.
  - Minor tweaks to the refresh button formatting to ensure proper alignment and spacing.

These changes improve clarity in the UI by making daily notes distinct and clean up dead code related to unimplemented features while avoiding committing local config files.
2025-05-25 19:26:13 +10:00