super-productivity/docs/ai
Johannes Millan 4d22a64955
Feat/plugin UI kit (#6362)
* fix(e2e): stabilize undo task delete sync test

Two flakiness sources fixed:
- Click on task element could activate title inline editor, causing
  Backspace to edit text instead of triggering delete. Now clicks the
  drag handle which calls focusSelf() without entering edit mode.
- Replaced deleteTask helper with inline sequence to avoid wasting
  2s of the 5s undo snackbar window on dialog-detection timeout.

* refactor: address code review findings from 2026-02-03

- Extract getBreakCycle helper to replace error-prone `cycle - 1 || 1`
  pattern at 3 call sites
- Add clarifying comment on intentionally broad 'timed out' match
- Reduce Pomodoro E2E test from 9 to 5 sessions (sufficient coverage)
- Remove dead _isTransientNetworkError wrapper from DropboxApi
- Extract stubWindowConfirm helper in task reducer tests

* fix(sync): prevent Formly from clearing provider config on show (#6345)

resetOnHide: true caused Formly to reset field values when provider
fieldGroups transitioned from hidden to visible, discarding user input
if sync was enabled before selecting a provider.

* fix(tasks): fix huge space between emoji and text in tag/project menus

Use matMenuItemIcon attribute on emoji spans so they project into the
icon slot of mat-menu-item instead of the text slot. Update emoji icon
sizing to 24x24px to match mat-icon and add overflow: hidden.

Closes #5977

* fix(tasks): guard against undefined task entities in selectors and archive (#6359)

Prevent TypeError crashes (reading 'dueWithTime', 'dueDay', 'issueProviderId') caused
by orphaned IDs in NgRx state. Fix archive merge to deduplicate IDs, filter orphans,
and use correct entity precedence (young over old). Add defensive null guards to
selectors and archive/task service methods.

* fix(tasks): guard against undefined task in mainListTasksInProject$ (#6360)

* fix(tasks): detect and sanitize orphaned task IDs to prevent startup crashes (#6359, #6360)

Orphaned task IDs (entries in task.ids without matching entities) caused
TypeError on app startup. Fix addresses three layers: validation now
flags orphaned IDs instead of silently skipping them, loadAllData
sanitizes IDs on load as a safety net, and data repair no longer crashes
when encountering orphaned IDs it's trying to fix.

* fix(sync): prevent recurring task duplication across clients

Remove SuperSync special-case that bypassed initial sync wait, causing
repeatable task effects to fire before sync completed. Add post-sync
cleanup effect that detects and removes stale duplicate repeat instances
when multiple active instances exist for the same repeat config.

* fix(sync): restore WebDAV provider compatibility warning text

* feat(sync): mark WebDAV and LocalFile sync options as experimental

* feat(plugins): add UI Kit with inject-first CSS strategy for iframe plugins

Introduce a lightweight CSS reset (UI Kit) that auto-styles basic HTML
elements in plugin iframes to match the host app theme. Injected after
<head> so plugin styles always win by source order.

UI Kit provides: element resets (body, headings, buttons, inputs, tables,
links, code, lists, hr), .btn-primary/.btn-outline button variants, and
.card/.card-clickable components.

All bundled plugins updated to use UI Kit classes, removing redundant
custom CSS (-542 lines net). Pico CSS removed from automations plugin.
sync-md converted from hardcoded colors to host theme variables.

* feat(plugins): extract shared CSS utilities into UI Kit

Move .text-muted, .text-primary, .page-fade and @keyframes fadeIn from
plugin CSS into the UI Kit so all iframe plugins get them automatically.
Add box-shadow focus ring to input:focus for better accessibility.
Remove per-plugin focus overrides now covered by the UI Kit.
2026-02-04 18:18:22 +01:00
..
adding-new-entity-type-checklist.md refactor: reorganize operation-log files into src/app/op-log/ 2025-12-27 17:52:11 +01:00
dueDay-dueWithTime-mutual-exclusivity.md refactor(op-log): merge LWWOperationFactory into ConflictResolutionService 2026-01-29 18:24:15 +01:00
file-based-oplog-sync-implementation-plan.md docs: fix outdated file paths and types in diagrams 2026-01-08 11:10:29 +01:00
issue-providers-to-plugins-evaluation.md docs: add cool new plans 2025-12-07 13:41:55 +01:00
plugin-ui-consistency-plan.md Feat/plugin UI kit (#6362) 2026-02-04 18:18:22 +01:00
README.md refactor(op-log): merge LWWOperationFactory into ConflictResolutionService 2026-01-29 18:24:15 +01:00
today-tag-architecture.md refactor(op-log): merge LWWOperationFactory into ConflictResolutionService 2026-01-29 18:24:15 +01:00

AI/Developer Architecture Documentation

This directory contains architectural documentation, design patterns, and guides specifically written for AI assistants and developers working on the Super Productivity codebase.

Core Patterns & Architecture

Task Scheduling & Date Management

  • dueDay/dueWithTime Mutual Exclusivity Pattern CRITICAL

    • Explains how dueDay and dueWithTime fields interact on tasks
    • Why it matters: These fields are mutually exclusive; setting one clears the other
    • When to read: Before working with task scheduling, planner, or date selectors
    • Related commit: 400ca8c1 (2026-01-29)
  • TODAY_TAG Architecture CRITICAL

    • Explains the virtual tag pattern for the TODAY_TAG
    • Why it matters: TODAY_TAG behaves fundamentally differently from regular tags
    • When to read: Before working with today's task list, planner, or tag operations
    • Related: Uses the dueDay/dueWithTime mutual exclusivity pattern

Entity Management

  • Adding New Entity Type Checklist
    • Step-by-step guide for adding new entity types to the app
    • When to use: When adding a new feature that requires persistent state

Sync & Operation Log

Plugin System

Documentation Conventions

Document Types

  1. Architecture Docs - Explain fundamental patterns (e.g., virtual tags, mutual exclusivity)
  2. Implementation Plans - Detailed technical plans for features
  3. Checklists - Step-by-step guides for common tasks
  4. Evaluations - Analysis of technical decisions

Criticality Markers

  • CRITICAL: Must read before working in related areas
  • 📋 REFERENCE: Useful reference material
  • 📝 DRAFT: Work in progress, may be incomplete

When to Update

  • After architectural changes: Document new patterns immediately
  • When patterns emerge: If you notice repeated code patterns, document them
  • When questions arise: If developers ask the same question twice, document the answer
  • After major refactors: Especially when behavior changes (like 400ca8c1)

Contributing

When adding new documentation to this directory:

  1. Use clear titles that describe the pattern/feature
  2. Add a summary section explaining what, why, and when to read
  3. Include code examples showing correct and incorrect usage
  4. Link related files using relative paths
  5. Update this README with your new document
  6. Reference related commits when documenting a specific change