Commit graph

141 commits

Author SHA1 Message Date
Johannes Millan
ae40f0ba2e feat(sync): add comprehensive timeout handling for large operations
Implement coordinated timeout strategy across all layers:

**Client-side (90s total):**
- HTTP requests: 75s timeout with AbortController
- Sync wait timeout: 90s (exceeds all server timeouts)
- Restore service: Retry logic for network errors (2s, 4s backoff)
- Better error messages for timeout scenarios

**Server-side:**
- Caddy proxy: 85s timeout (exceeds Fastify)
- Fastify server: 80s request timeout (exceeds DB timeout)
- Database operations: 60s (unchanged)

**Rationale:**
Each timeout layer exceeds the one below it, allowing inner operations
to complete and report errors properly. The 90s client timeout ensures
large operations (snapshot generation, imports) can complete without
premature abortion.

**Monitoring:**
- Log slow requests >30s for visibility
- Detailed error logging with duration tracking
- Android WebView timeout support via CapacitorHttp
2026-01-20 17:07:24 +01:00
Michael Chang
222b3474b8 fix(sync): restore missing force upload button in new config UI 2026-01-19 13:58:23 +01:00
Johannes Millan
213d0ec010 chore(plugins): remove debug logging from procrastination-buster i18n 2026-01-16 22:34:50 +01:00
Johannes Millan
9be6bf7c27 fix(plugins): initialize current language on plugin mount
Fixed i18n to fetch and use the current language when the plugin
initializes, instead of always defaulting to English. Now the plugin
will show the correct language immediately on first load, and also
update reactively when the language changes.

Changes:
- Added getCurrentLanguage() call in useTranslate initialization
- Changed onMount to createEffect for reactive language loading
- Updated both App.tsx and ProcrastinationInfo.tsx to use createEffect
- Applied fixes to both procrastination-buster and boilerplate
- Added debug logging to troubleshoot language change events

This fixes the issue where plugins always started in English regardless
of the user's selected language.
2026-01-16 22:34:50 +01:00
Johannes Millan
fb05e7be3e chore(plugins): remove debug logging from procrastination-buster 2026-01-16 22:34:50 +01:00
Johannes Millan
de264aff48 fix(plugins): fix i18n message protocol for iframe communication
Fixed the message passing between plugin iframes and plugin.ts to use
the proper PLUGIN_MESSAGE/PLUGIN_MESSAGE_RESPONSE protocol instead of
custom messages. This ensures translations and other messages are
correctly routed through the plugin bridge.

Changes:
- Updated useTranslate to use PLUGIN_MESSAGE type
- Listen for PLUGIN_MESSAGE_RESPONSE instead of custom response
- Wrap message in { type, payload } structure
- Updated plugin.ts to read from message.payload
- Added debug logging for troubleshooting
- Applied fixes to both procrastination-buster and boilerplate
2026-01-16 22:34:50 +01:00
Johannes Millan
1df40ab02d fix(plugins): fix translation loading in procrastination-buster
Changed message.data to message.payload in the onMessage handler
to match the structure sent by useTranslate hook. This fixes the
issue where translations were not loading in the UI.
2026-01-16 22:34:50 +01:00
Johannes Millan
92fd9301fe fix(plugins): remove duplicate side panel registration in procrastination-buster
Remove manual registerSidePanelButton() call since the side panel button
is already automatically registered via manifest.json with 'sidePanel: true'.

This fixes:
- Duplicate side panel button warning
- Plugin loading in both side panel and main view simultaneously

The manifest-based registration is sufficient and avoids duplication.
2026-01-16 22:34:50 +01:00
Johannes Millan
91fe3652dc fix(plugins): copy directories recursively in build script
Add copyRecursive() helper function to handle both files and directories
when copying plugin builds to bundled-plugins. This ensures i18n folders
and other directories are properly copied.

Previously, only files were copied (checking isFile()), which caused i18n
folders to be skipped. Now all three plugin build commands (procrastination-
buster, sync-md, ai-productivity-prompts) properly copy directory trees.

Fixes: 404 errors for i18n/de.json and other directory contents
2026-01-16 22:34:50 +01:00
Johannes Millan
ba0e9ce002 fix(plugins): resolve PluginHooks runtime error in procrastination-buster
Replace PluginHooks.LANGUAGE_CHANGE enum reference with string literal
'languageChange' to fix runtime error. The type-only import of PluginHooks
was not available at runtime, causing "PluginHooks is not defined" error
when installing the plugin.

The hook registration now uses the string value directly:
- Before: plugin.registerHook(PluginHooks.LANGUAGE_CHANGE, ...)
- After: plugin.registerHook('languageChange', ...)
2026-01-16 22:34:50 +01:00
Johannes Millan
ce17c00690 feat(plugins): add German translations to procrastination-buster
- Add comprehensive de.json with 80 German translation keys
- Update manifest.json to include German language support
- Translate all UI strings: home, navigation, strategies, info
- Translate all 8 procrastination types with emotions and strategies
- Translate educational content for understanding procrastination

All translation keys match between en.json and de.json for consistency.
2026-01-16 22:34:50 +01:00
Johannes Millan
2550f91cb7 feat(plugins): add i18n support to procrastination-buster plugin
- Add comprehensive English translations (en.json) for all UI strings
- Add useTranslate() hook for reactive translations
- Update manifest.json with i18n configuration
- Add i18n message handlers to plugin.ts
- Create getProcrastinationTypes() for dynamic translation loading
- Update App.tsx to use translations throughout
- Update ProcrastinationInfo.tsx with full translation support
- All 8 procrastination types, strategies, and info content now translatable

The plugin now supports internationalization with complete English translations
and can easily be extended to support additional languages.
2026-01-16 22:34:50 +01:00
Johannes Millan
eb120baf1b feat(plugins): add i18n support to boilerplate-solid-js
- Add useTranslate() hook for reactive translations in SolidJS
- Include example translation files (en.json, de.json)
- Update Vite plugin to copy i18n folder during build
- Add i18n message handlers to plugin.ts
- Demonstrate i18n usage in App.tsx with ~10 translation keys
- Update documentation with comprehensive i18n guide
- Add i18n to features list in main plugin-dev README

The boilerplate now provides a complete working example of multi-language
plugin support, making it easy for developers to create internationalized
plugins.
2026-01-16 22:34:50 +01:00
Johannes Millan
5bb8b24c82 docs(plugins): add comprehensive i18n documentation
Phase 7: Create documentation

- Create PLUGIN_I18N.md with complete i18n guide
  - Quick start guide with file structure
  - Manifest configuration details
  - Translation file format and best practices
  - Complete API documentation (translate, formatDate, getCurrentLanguage)
  - Language change hook documentation
  - Full list of supported languages (24 languages)
  - Complete working example with multi-language support
  - Best practices and troubleshooting sections
  - Migration guide from hard-coded strings
  - Testing and performance considerations

- Update README.md with i18n section
  - Add i18n API methods to Plugin API section
  - Add languageChange hook to hooks list
  - Add i18n example to usage section
  - Add i18n files to optional files list
  - Add i18n best practice
  - Link to comprehensive PLUGIN_I18N.md guide

Documentation provides complete guide for plugin developers to add
multi-language support to their plugins with working examples.
2026-01-16 17:55:34 +01:00
Johannes Millan
59292abacb refactor(date): use getDbDateStr() utility for consistent date formatting
Replace inline `.toISOString().split('T')[0]` pattern with getDbDateStr()
utility across production code, tests, and plugin examples.

Changes:
- Production: 6 files (plugin-bridge, metrics, counters, task-repeat-cfg)
- Tests: 4 spec files (helper functions and direct uses)
- Plugin example: Added formatDateStr() helper matching main app pattern

This ensures consistent local timezone handling for all user-facing date
operations and provides a single source of truth for date string formatting.
2026-01-16 13:28:05 +01:00
Johannes Millan
f9fd8454cc fix(sync-md): prevent crash when adding subtasks to markdown file directly
Fixes #6021

When users manually added subtasks to markdown files that referenced
non-existent parent tasks, the plugin would crash due to unsafe null
assertions and missing validation. This made the plugin permanently
disabled and required creating a new markdown file to recover.

Changes:
- Added parent ID validation before creating operations
- Orphaned subtasks are now converted to root tasks with warnings
- Added comprehensive error handling with user notifications
- Plugin stays enabled even after sync errors
- Added 15 new tests (689 lines) for orphaned subtask scenarios
- Fixed all existing tests to support new error notifications

The fix implements defense-in-depth:
1. Validation layer: Check parent IDs exist before operations
2. Error handling: Catch and report errors without crashing
3. User feedback: Clear notifications about issues
4. Data preservation: No data loss, orphans become root tasks
2026-01-16 13:28:05 +01:00
Johannes Millan
a1d736010c fix(plugins): fix empty side panel for AI Productivity Prompts plugin
The plugin was using a custom vite.config.ts that generated separate
JS/CSS files with broken relative paths. When loaded in a blob URL
iframe, these paths couldn't resolve.

- Switch to @super-productivity/vite-plugin which inlines assets
- Fix title from "Procrastination Buster" to "AI Productivity Prompts"
2026-01-15 11:04:12 +01:00
Johannes Millan
63d11b3ac8 fix(build): add missing vite-plugin-solid dep and fix Uint8Array body type
- Add vite-plugin-solid to procrastination-buster plugin dependencies
- Wrap Uint8Array in Blob for fetch body to fix TypeScript error with newer @types/node
2026-01-10 17:17:57 +01:00
Johannes Millan
e6da7ced37 chore(deps): upgrade ESLint to v9 with flat config
- Upgrade eslint from v8 to v9.39.2
- Upgrade typescript-eslint to v8.52.0 (unified package)
- Add angular-eslint package for flat config support
- Migrate from .eslintrc.json to eslint.config.js (flat config)
- Update package configs for sync-md, automations, boilerplate-solid-js
- Remove unused eslint-disable directives
- Fix lint errors (empty interface, template eqeqeq)

BREAKING: Requires Node.js 18.18+ (ESLint 9 requirement)
2026-01-10 16:08:11 +01:00
Johannes Millan
1a79592aca build: update links to match our new organization 2026-01-05 14:45:06 +01:00
Johannes Millan
386c636e5f feat(effects): consolidate task update actions in PluginHooksEffects 2026-01-04 13:03:28 +01:00
Johannes Millan
092d32a39e 16.8.0 2026-01-02 19:26:41 +01:00
timhuynhwork@gmail.com
4eafe2086a Disable play button and show tooltip when no tasks available 2025-12-31 20:02:22 -08:00
Johannes Millan
e268076332 test(e2e): try to fix e2e tests 2025-12-10 21:26:48 +01:00
dependabot[bot]
fb73837e48
chore(deps-dev): bump glob
Bumps the npm_and_yarn group with 1 update in the /packages/plugin-dev/automations directory: [glob](https://github.com/isaacs/node-glob).


Updates `glob` from 10.4.5 to 10.5.0
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.4.5...v10.5.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 10.5.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-09 13:28:48 +00:00
Johannes Millan
cb41b600cf fix(e2e): include missing assets for api-test-plugin build
Copies config-schema.json and icon.svg to bundled assets, ensuring the plugin loads correctly in e2e tests. Also updates package-lock.json to resolve missing dependencies.
2025-12-04 11:50:25 +01:00
Johannes Millan
7add7d3b47 feat(automationPlugin): update background color to transparent and simplify button class 2025-12-02 13:30:37 +01:00
Johannes Millan
6042df7822 feat(automationPlugin): update meta 2025-12-02 13:30:37 +01:00
Johannes Millan
f1c71ec84f feat(automationPlugin): improve
weekday condition logic and fix memory management
2025-12-02 13:30:37 +01:00
Johannes Millan
47512fdf25 feat(automationPlugin): improve error handling for corrupted and invalid automation rules 2025-12-02 13:30:37 +01:00
Johannes Millan
1c17f548ff feat(automationPlugin): validate webhook URLs and sanitize event data before sending 2025-12-02 13:30:37 +01:00
Johannes Millan
74a31b187a feat(automationPlugin): add rule validation and improve task creation handling 2025-12-02 13:30:37 +01:00
Johannes Millan
b87632566d feat(automationPlugin): implement rule validation logic and integrate it into the import process 2025-12-02 13:30:37 +01:00
Johannes Millan
55b27728dc feat(automationPlugin): enhance error handling and improve rate limiting for automation rules 2025-12-02 13:30:37 +01:00
Johannes Millan
997d497824 feat(automationPlugin): update rule retrieval methods to support async operations 2025-12-02 13:30:37 +01:00
Johannes Millan
a14baa2061 feat(automationPlugin): integrate DataCache for improved project and tag retrieval 2025-12-02 13:30:37 +01:00
Johannes Millan
9d9de85793 test(automationPlugin): add tests for our automation plugin 2025-12-02 13:30:37 +01:00
Johannes Millan
d752ef3eb8 feat(automationPlugin): add import and export functionality for automation rules 2025-12-02 13:30:37 +01:00
Johannes Millan
46b9fbcbe1 feat(automationPlugin): streamline condition section layout in RuleEditor 2025-12-02 13:30:37 +01:00
Johannes Millan
4c00ae4ec9 refactor(automationPlugin): implement action and condition registries for improved extensibility 2025-12-02 13:30:37 +01:00
Johannes Millan
1e6f4daf78 feat(automationPlugin): add new actions for snack, dialog, and webhook 2025-12-02 13:30:37 +01:00
Johannes Millan
43d2946bc5 feat(automationPlugin): add time based triggers 2025-12-02 13:30:37 +01:00
Johannes Millan
3a8ffb8b5d feat(automationPlugin): add warning box for plugin usage and clear default rules 2025-12-02 13:30:37 +01:00
Johannes Millan
870b22fbf8 refactor(automationPlugin): move and rename 2025-12-02 13:30:37 +01:00
Johannes Millan
8460d894e1 feat(automationPlugin): improve button styles and add copyTo option for plugin output 2025-12-02 13:30:37 +01:00
Johannes Millan
0561f826a2 feat(automationPlugin): implement rate limiting and dialog prompts for high-frequency rule execution 2025-12-02 13:30:37 +01:00
Johannes Millan
94743a0eb7 feat(automationPlugin): add project and tag fetching to enhance rule editing experience 2025-12-02 13:30:37 +01:00
Johannes Millan
0b0693a7ec feat(automationPlugin): enhance theme handling and task event logging for improved integration and debugging 2025-12-02 13:30:37 +01:00
Johannes Millan
becd1694d5 feat(automationPlugin): implement rule management features including save, delete, and toggle status 2025-12-02 13:30:37 +01:00
Johannes Millan
297f7308b9 feat(automationPlugin): update placeholders in ActionDialog and ConditionDialog for better user guidance 2025-12-02 13:30:37 +01:00