8 Commits

Author SHA1 Message Date
Octech2722
57c155ea3f docs: add architecture and migration pattern documentation
Architecture Documentation:
- System component overview (logging, theme, build)
- Content processing pipeline details
- File structure and organization
- Message flow diagrams
- Storage strategy (local vs sync)
- MV3 constraints and solutions

Migration Patterns:
- 8 common MV2 → MV3 migration patterns
- TypeScript examples with proper error handling
- Chrome API usage examples
- Best practices for each scenario

Serves as reference to avoid re-explaining systems repeatedly.
2025-10-18 12:17:38 -05:00
Octech2722
a392f22ee3 feat: implement settings page
Configuration Options:
- Trilium server URL with validation
- Authentication token (secure storage)
- Connection testing with detailed feedback
- Save format selection (HTML/Markdown/Both)
- Parent note selection (future enhancement)
- Theme preferences with live preview

Settings Persistence:
- chrome.storage.local for connection config
- chrome.storage.sync for user preferences
- Automatic validation on save

Full theme system integration.
2025-10-18 12:16:58 -05:00
Octech2722
90c58142ce feat: implement popup interface
Features:
- Quick action buttons (Selection, Page, Link, Screenshot, Image)
- Connection status indicator with real-time updates
- Theme toggle (system/light/dark) with visual feedback
- Navigation to Settings and Logs pages
- Keyboard shortcuts display
- Full theme system integration

Entry point for most user interactions.
Initializes theme on load and persists preference.
Uses centralized logging for debugging.
2025-10-18 12:16:35 -05:00
Octech2722
b51f83555b feat: implement content scripts for page interaction
Content Script Features:
- Declarative injection via manifest
- Selection extraction and HTML processing
- Image discovery and base64 conversion
- Message passing to service worker

Duplicate Note Notification
- Gives a large visual notification if an exisitng note is found in Trilium
- Can be toggled on/off via settings
- On by default

Runs in page context with proper CSP compliance.
2025-10-18 12:13:41 -05:00
Octech2722
4c53f8b262 feat: implement service worker with capture handlers
Service Worker Architecture:
- Event-driven, stateless (MV3 compatible)
- Message passing with structured error handling
- Chrome storage for state persistence

Capture Features:
- Save Selection (with image processing and base64 embedding)
- Save Page (Readability → DOMPurify → Cheerio pipeline)
- Save Link (basic URL + title)
- Save Screenshot (full page capture, cropping pending)
- Save Image (download and embed as base64)

Additional Features:
- Duplicate note detection with user choice dialog
- Context menu initialization on install
- Keyboard shortcut handlers
- Trilium API communication (create notes, search)
- Connection testing and validation

Uses centralized logging throughout.
No global state - all persistence via chrome.storage.
2025-10-18 12:09:47 -05:00
Octech2722
c28add177e feat: implement comprehensive theme system
Features:
- ThemeManager with three modes (light/dark/system)
- CSS custom properties for semantic colors
- Persistent storage via chrome.storage.sync
- Real-time OS theme detection and updates
- Event subscription system for theme changes

Provides professional theming across all UI components.
System mode automatically follows OS preference.
2025-10-18 12:09:19 -05:00
Octech2722
6811b91a17 feat: implement centralized logging system
Components:
- CentralizedLogger static class for log aggregation
- Logger class with source context (background/content/popup/options)
- Persistent storage in chrome.storage.local (up to 1000 entries)
- Log viewer UI with filtering, search, and export
- Survives service worker restarts

Critical for MV3 debugging where service workers terminate frequently.
Provides unified debugging across all extension contexts.
2025-10-18 12:08:41 -05:00
Octech2722
acbd5c8bcf feat: initialize MV3 project structure
- Manifest V3 configuration with proper permissions
- TypeScript + esbuild build system
- npm dependencies (Readability, DOMPurify, Cheerio)
- Build configuration (IIFE bundling, watch mode)
- Shared TypeScript type definitions

Foundation for Trilium Web Clipper Manifest V3 migration.
2025-10-18 12:07:37 -05:00