# LinkSyncExtension - Task List ## Project Setup - [x] Create project directory structure - [x] Write README.md - [x] Write TODOs.txt - [x] Write design.md - [x] Write tasks.md - [x] Write AGENTS.md - [x] Create manifest.json (with all permissions, content scripts, options page) - [x] Add icon files (48x48, 96x96) ## Core Development ### Extension Manifest - [x] Create manifest.json with Firefox-specific settings - [x] Add icon files (48x48, 96x96) - [x] Configure permissions (bookmarks, storage, activeTab, tabs, ) - [x] Set browser ID (linksync@example.com) - [x] Add content scripts registration - [x] Add options page registration ### Background Script - [x] Create background.js service worker - [x] Implement init() on install/update - [x] Implement sync loop with interval (5 min) - [x] Add event handlers (message, bookmark changes) - [x] Implement sync mode switching - [x] Manage collection mapping - [x] Auto-sync timer - [x] Error handling ### Popup Script - [x] Create popup.html with tabs (Bookmarks, Collections, Query) - [x] Create popup.css with full styling - [x] Create popup.js with all functionality - [x] Bookmark form UI with auto-fill - [x] Bookmark list view with search - [x] Collections panel - [x] Query builder with parse/execute - [x] Settings modal - [x] Sync button handler - [x] Toast notifications ### Utility Modules - [x] utils/bookmark.js - Bookmark manipulation (parse, merge, format) - [x] utils/collection.js - Collection management (CRUD, query execution) - [x] utils/query-engine.js - Query parsing (tokenizer, recursive descent parser) - [x] utils/sync.js - Sync logic (3 modes, conflict detection) - [x] utils/api.js - API client (auth, retries, error handling, all endpoints) ### Content Script - [x] content/content.js - Extract page title, description, favicon - [x] Handle browser.runtime.onMessage for getPageData ### API Integration - [x] /api/auth/login - Authentication - [x] /api/links/ - Bookmark CRUD (GET, POST, PUT, DELETE) - [x] /api/collections/ - Collection CRUD - [x] /api/queries/parse/ - Query parsing - [x] /api/queries/execute/ - Query execution - [x] /api/sync/ - Sync endpoint - [x] /api/admin/stats - Admin stats - [x] /health - Connection test ### Sync Logic - [x] Implement bi-directional sync - [x] Implement browser-authoritative sync - [x] Implement server-authoritative sync - [x] Handle deletions checkbox - [x] Conflict detection (title mismatches) ### UI Components - [x] Tabbed interface (Bookmarks, Collections, Query) - [x] Bookmark list view with search filter - [x] Collection list - [x] Query builder with syntax help - [x] Sync status indicator (syncing/synced/error) - [x] Settings modal - [x] Toast notifications - [x] Options page (dedicated settings) ### Storage Management - [x] Store API key in browser.storage.local - [x] Store server URL - [x] Store sync settings (mode, deletions, auto-sync) - [x] Sync timestamp tracking - [x] Pending changes tracking - [x] Syncing state flag ## Options Page - [x] Create options.html - [x] Create options.js - [x] Server URL configuration - [x] API key input (password field) - [x] Sync mode dropdown - [x] Deletions checkbox - [x] Auto-sync checkbox - [x] Test connection button - [x] Sync now button - [x] Last sync display ## Security - [x] API key stored in browser.storage.local (not localStorage) - [x] Bearer token authentication - [x] Input sanitization (escapeHtml) - [x] Request timeout handling - [x] Rate limit handling (429 retry) ## Testing - [x] Manual testing checklist (tests/README.md) - [ ] Test sync modes (manual) - [ ] Test conflict resolution (manual) - [ ] Test query execution (manual) - [ ] Test offline handling (manual) - [ ] Test error handling (manual) ## Documentation - [x] API reference (README.md) - [x] User guide (README.md) - [x] Troubleshooting guide (README.md) - [x] Query syntax guide (README.md) - [x] Architecture docs (AGENTS.md, design.md) ## Future Enhancements - [ ] Background sync notifications - [ ] Keyboard shortcuts - [ ] Dark theme toggle - [ ] Bookmark edit/delete from popup - [ ] Batch operations - [ ] Conflict resolution UI - [ ] Offline queue for pending changes