Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9bdb6ed
feat: Convert web clipper to Manifest V3 with UX enhancements
Octech2722 Sep 29, 2025
2e9327b
fix: update PULL_REQUEST.md for formatting and clarity improvements
Octech2722 Sep 30, 2025
a503826
Merge branch 'main' into feature/manifest-v3-update
Octech2722 Sep 30, 2025
8616a65
Merge branch 'main' into feature/manifest-v3-update
Octech2722 Sep 30, 2025
4c43f67
Merge branch 'main' into feature/manifest-v3-update
Octech2722 Oct 3, 2025
43cf3ac
Merge branch 'main' into feature/manifest-v3-update
Octech2722 Oct 3, 2025
10d8437
Merge branch 'main' into feature/manifest-v3-update
Octech2722 Oct 5, 2025
0c1de7e
Address maintainer feedback: Clean up documentation and remove develo…
Octech2722 Oct 6, 2025
a00ea2e
Reset web-clipper to origin/main baseline for MV3 migration
Octech2722 Oct 12, 2025
acbd5c8
feat: initialize MV3 project structure
Octech2722 Oct 18, 2025
6811b91
feat: implement centralized logging system
Octech2722 Oct 18, 2025
c28add1
feat: implement comprehensive theme system
Octech2722 Oct 18, 2025
4c53f8b
feat: implement service worker with capture handlers
Octech2722 Oct 18, 2025
b51f835
feat: implement content scripts for page interaction
Octech2722 Oct 18, 2025
90c5814
feat: implement popup interface
Octech2722 Oct 18, 2025
a392f22
feat: implement settings page
Octech2722 Oct 18, 2025
57c155e
docs: add architecture and migration pattern documentation
Octech2722 Oct 18, 2025
1f444eb
docs: add comprehensive development workflow documentation
Octech2722 Oct 18, 2025
5736afc
assets: add extension icons and static assets
Octech2722 Oct 18, 2025
c707af2
fix: update .gitignore to include specific development documentation …
Octech2722 Oct 18, 2025
022c697
feat: add HTML sanitization module using DOMPurify
Octech2722 Oct 18, 2025
2efb472
docs: add README for Trilium Web Clipper with features, installation,…
Octech2722 Oct 18, 2025
08dea6d
feat: add type declarations for turndown-plugin-gfm
Octech2722 Oct 18, 2025
068be15
feat: update .gitignore to include PR preparation files and reference…
Octech2722 Oct 18, 2025
a0cc8cb
chore: update .gitignore to include reference/github directory for PR…
Octech2722 Oct 18, 2025
d54c987
Merge branch 'TriliumNext:main' into feat/web-clipper-manifest-v3-update
Octech2722 Oct 18, 2025
7fbf79b
docs: added codeblock preservation as an objective to handle #2092
Octech2722 Oct 18, 2025
1c7d578
docs: Added Meta Note Popup option as an objective to solve #5350
Octech2722 Oct 18, 2025
beb760a
docs: moved Meta Not popup to QoL Section from Content Processing Sec…
Octech2722 Oct 18, 2025
6314e07
docs: added custom keyboard shortcut handling as an objective for #53…
Octech2722 Oct 18, 2025
de571dc
docs: added link to issue #2092 in codeblock handling objective
Octech2722 Oct 18, 2025
54bd1e8
docs: update .gitignore to include PR preparation files directory
Octech2722 Oct 18, 2025
e7607cc
docs: remove current development focus section from copilot instructions
Octech2722 Oct 18, 2025
c1e865e
docs: trilium_issues to .gitignore
Octech2722 Oct 19, 2025
9a6cb5e
docs remove outdated context-aware prompting and copilot task templates
Octech2722 Oct 28, 2025
e4833ce
docs: add copilot templates to .gitignore
Octech2722 Oct 28, 2025
b3184cb
docs: update feature parity checklist with new meta note and keyboard…
Octech2722 Oct 28, 2025
e183d49
feat: Screenshot Capture (Full screen & Cropped) - Added Screenshot C…
Octech2722 Nov 8, 2025
342b9a9
feat: Add offscreen document build and content script injection handling
Octech2722 Nov 8, 2025
d19e475
feat: Enhance image processing with error handling and success metrics
Octech2722 Nov 8, 2025
c2cbca2
feat: Update context menu titles and improve popup styles for better …
Octech2722 Nov 8, 2025
8bd1e82
feat: Add functionality to save links with custom notes and save all …
Octech2722 Nov 8, 2025
f1b3016
feat: add customizable date/time format options in settings
Octech2722 Nov 8, 2025
8715793
feat: implement "already visited" detection in popup with UI indication
Octech2722 Nov 8, 2025
1f32e24
feat: Add code block preservation settings and readability extraction…
Octech2722 Nov 9, 2025
e892975
feat: Add customizable toast notification duration setting and intera…
Octech2722 Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions apps/web-clipper-manifestv3/.github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# GitHub Copilot Instructions - Trilium Web Clipper MV3

## Project Identity
**Working Directory**: `apps/web-clipper-manifestv3/` (active development)
**Reference Directory**: `apps/web-clipper/` (MV2 legacy - reference only)
**Goal**: Feature-complete MV3 migration with architectural improvements

## Quick Context Links
- Architecture & Systems: See `docs/ARCHITECTURE.md`
- Feature Status: See `docs/FEATURE-PARITY-CHECKLIST.md`
- Development Patterns: See `docs/DEVELOPMENT-GUIDE.md`
- Migration Patterns: See `docs/MIGRATION-PATTERNS.md`

## Critical Rules

### Workspace Boundaries
- ✅ Work ONLY in `apps/web-clipper-manifestv3/`
- ✅ Reference `apps/web-clipper/` for feature understanding
- ❌ DO NOT suggest patterns from other monorepo projects
- ❌ DO NOT copy MV2 code directly

### Code Standards (Non-Negotiable)
1. **No Emojis in Code**: Never use emojis in `.ts`, `.js`, `.json` files, string literals, or code comments
2. **Use Centralized Logging**: `const logger = Logger.create('ComponentName', 'background')`
3. **Use Theme System**: Import `theme.css`, use CSS variables `var(--color-*)`, call `ThemeManager.initialize()`
4. **TypeScript Everything**: Full type safety, no `any` types
5. **Error Handling**: Always wrap async operations in try-catch with proper logging

### Development Mode
- **Current Phase**: Active development (use `npm run dev`)
- **Build**: Watch mode with live reload
- **Focus**: Debugging, rapid iteration, feature implementation
- ⚠️ Only use `npm run build` for final validation

## Essential Patterns

### Message Passing Template
```typescript
// Background service worker
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
(async () => {
try {
const result = await handleMessage(message);
sendResponse({ success: true, data: result });
} catch (error) {
logger.error('Handler error', error);
sendResponse({ success: false, error: error.message });
}
})();
return true; // Required for async
});
```

### Storage Pattern
```typescript
// Use chrome.storage, NEVER localStorage in service workers
await chrome.storage.local.set({ key: value });
const { key } = await chrome.storage.local.get(['key']);
```

### Component Structure
```typescript
import { Logger } from '@/shared/utils';
import { ThemeManager } from '@/shared/theme';

const logger = Logger.create('ComponentName', 'background');

async function initialize() {
await ThemeManager.initialize();
logger.info('Component initialized');
}
```

## When Suggesting Code

### Checklist for Every Response
1. [ ] Verify API usage against `reference/chrome_extension_docs/`
2. [ ] Include proper error handling with centralized logging
3. [ ] Use TypeScript with full type annotations
4. [ ] If UI code: integrate theme system
5. [ ] Reference legacy code for functionality, not implementation
6. [ ] Explain MV2→MV3 changes if applicable

### Response Format
```
**Task**: [What we're implementing]
**Legacy Pattern** (if migrating): [Brief description]
**Modern Approach**: [Show TypeScript implementation]
**Files Modified**: [List affected files]
**Testing**: [How to verify it works]
```

## Common MV3 Patterns

### Service Worker Persistence
```typescript
// State must be stored, not kept in memory
const getState = async () => {
const { state } = await chrome.storage.local.get(['state']);
return state || defaultState;
};
```

### Content Script Communication
```typescript
// Inject scripts programmatically
await chrome.scripting.executeScript({
target: { tabId },
files: ['content.js']
});
```

### Manifest V3 APIs
- `chrome.action` (not browserAction)
- `chrome.storage` (not localStorage)
- `chrome.alarms` (not setTimeout in service worker)
- `declarativeNetRequest` (not webRequest blocking)

## Feature Development Workflow

### Before Starting Work
1. Check `docs/FEATURE-PARITY-CHECKLIST.md` for feature status
2. Review legacy implementation in `apps/web-clipper/`
3. Check if feature needs manifest permissions
4. Plan which files will be modified

### During Development
1. Use centralized logging liberally for debugging
2. Test frequently with `npm run dev` + Chrome reload
3. Check console in both popup and service worker contexts
4. Update feature checklist when complete

### Before Committing
1. Run `npm run type-check`
2. Test all related functionality
3. Verify no console errors
4. Update `FEATURE-PARITY-CHECKLIST.md`

## What NOT to Include in Suggestions

❌ Long explanations of basic TypeScript concepts
❌ Generic Chrome extension tutorials
❌ Detailed history of MV2→MV3 migration
❌ Code from other monorepo projects
❌ Placeholder/TODO comments without implementation
❌ Overly defensive coding for edge cases not in legacy version

## What TO Focus On

✅ Concrete, working code that solves the task
✅ Feature parity with legacy extension
✅ Modern TypeScript patterns
✅ Proper error handling and logging
✅ Clear migration explanations when relevant
✅ Specific file paths and line references
✅ Testing instructions

## Documentation References

- **Chrome APIs**: `reference/chrome_extension_docs/`
- **Readability**: `reference/Mozilla_Readability_docs/`
- **DOMPurify**: `reference/cure53_DOMPurify_docs/`
- **Cheerio**: `reference/cheerio_docs/`

---

**Remember**: This is an active development project in an existing codebase. Be specific, be practical, and focus on getting features working efficiently. When in doubt, check the architecture docs first.
149 changes: 149 additions & 0 deletions apps/web-clipper-manifestv3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Build outputs
dist/
build/
*.tsbuildinfo

# Environment files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Google Extension Docs
chrome_extension_docs/

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Logs
*.log

# Runtime data
pids/
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt

# Storybook build outputs
.out
.storybook-out

# Temporary folders
tmp/
temp/

# Extension specific
web-ext-artifacts/
*.zip
*.crx
*.pem

# Development documentation (exclude from PR)
reference/dev_notes/
reference/NotebookLM/
.dev/
development/
docs/ARCHIVE/

# Scripts that are development-only
scripts/create-icons.ps1
scripts/dev-*

# Test files (if any)
test/
tests/
*.test.js
*.test.ts
*.spec.js
*.spec.ts

# ============================================
# PR Preparation Files (Keep Private)
# ============================================
docs/PR/
.gitmessage
/reference/github/

# Copilot configuration (development only)
.github/copilot-instructions.md

# Copilot templates (development only)
/docs/COPILOT/

# Development documentation (not for end users)
/reference/context-aware_prompting_templates.md
/reference/copilot_task_templates.md
/reference/end_of_session.md
/reference/optimized_copilot_workflow_guide.md

# Reference materials (reduce repo size)
reference/chrome_extension_docs/
reference/Mozilla_Readability_docs/
reference/cure53_DOMPurify_docs/
reference/cheerio_docs/
reference/trilium_issues/
7 changes: 7 additions & 0 deletions apps/web-clipper-manifestv3/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Disable workspace functionality for this project
# Make it work as a standalone npm project
workspaces=false
legacy-peer-deps=true

# Use npm instead of pnpm for this specific project
package-lock=true
Loading