generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 33
feat(timer): add comprehensive task timer functionality #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Collaborator
Quorafind
commented
Jul 28, 2025
- Add TaskTimer editor extension with start/stop/pause controls
- Implement TaskTimerManager for timer state management
- Add TaskTimerExporter for data export capabilities
- Create TaskTimerFormatter for time display formatting
- Add TaskTimerMetadataDetector for task metadata parsing
- Include task timer CSS styling and UI components
- Integrate timer settings into plugin configuration
- Support timer persistence and session management
- Add TaskTimer editor extension with start/stop/pause controls - Implement TaskTimerManager for timer state management - Add TaskTimerExporter for data export capabilities - Create TaskTimerFormatter for time display formatting - Add TaskTimerMetadataDetector for task metadata parsing - Include task timer CSS styling and UI components - Integrate timer settings into plugin configuration - Support timer persistence and session management
Replace ViewPlugin with StateField to resolve CodeMirror block decoration error. Use editorInfoField for proper editor access and replace innerHTML with Obsidian's native DOM APIs. - Replace ViewPlugin with StateField for block-level decorations - Use state.field(editorInfoField) to access editor and app instances - Remove innerHTML usage in favor of createEl/createDiv/createSpan - Fix "Block decorations may not be specified via plugins" error - Improve CSS with proper width and box-sizing for block display - Maintain all existing timer functionality (start/pause/complete)
Add detailed console logging throughout timer decoration creation to help diagnose rendering issues. Fix global configuration access by properly setting timerConfig instead of undefined global variables. - Add debug logs for each step of decoration creation process - Log file processing, task detection, and decoration count - Fix timerConfig initialization in taskTimerExtension function - Add test file with proper frontmatter for timer functionality - Enable troubleshooting of timer widget display issues
Fix TypeError by using correct method name isTaskTimerEnabled instead of isTimerEnabledForFile, and remove extra app parameter from TaskTimerMetadataDetector constructor. - Use correct method name isTaskTimerEnabled() - Remove app parameter from TaskTimerMetadataDetector constructor - Resolves "metadataDetector.isTimerEnabledForFile is not a function"
Replace complex button-based UI with simple text links for better integration and cleaner appearance. Improve subtask detection logic to only show timers on actual parent tasks. - Replace buttons with underlined text links for all actions - Remove complex CSS styling in favor of minimal text styling - Fix subtask detection to stop at same/lower indentation levels - Update real-time display to refresh every second - Add click event propagation prevention - Simplify UI to show "⏱ time | action | action" format - Remove 280+ lines of unnecessary CSS styling
- Fix timer not starting after block ID insertion - Improve parent task detection to find all subtasks, not just immediate next line - Add proper state updates to refresh widget after block ID creation - Fix TypeScript errors with generateBlockId visibility and elapsed property - Ensure timer controls update correctly after inserting block reference
Replace global variable configuration with CodeMirror 6's recommended Facet pattern for passing configuration to StateField. This provides better type safety, reactive updates, and follows CodeMirror architecture best practices. Changes: - Replace globalTimerConfig with taskTimerConfigFacet - Update all config access to use state.facet() pattern - Return array of [facet, statefield] from extension function - Maintain compatibility with existing functionality
Priority values containing spaces (e.g., '⏰ 2025-06-05 14:25' or 'Invitation to meeting') were causing InvalidCharacterError when used in CSS class names. This fix adds a utility function to sanitize priority values by removing spaces and invalid characters. - Add priorityUtils module with sanitizePriorityForClass() function - Update all components that use priority in CSS classes: - kanban-card.ts (3 locations) - gantt/task-renderer.ts (2 locations) - quadrant-card.ts (1 location) - InlineEditor.ts (1 location) - listItem.ts (1 location) - treeItem.ts (1 location) - Preserve numeric priorities (1-5) as-is - Replace spaces with hyphens for text priorities - Remove special characters invalid in CSS tokens Fixes: Failed to execute 'add' on 'DOMTokenList' errors in kanban, gantt, and quadrant views
Quorafind
added a commit
that referenced
this pull request
Aug 27, 2025
feat(timer): add comprehensive task timer functionality
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.