Skip to content

Commit bba5baf

Browse files
committed
docs: update GEMINI.md for v1.0.1 milestones
1 parent 2b4d5f0 commit bba5baf

1 file changed

Lines changed: 102 additions & 0 deletions

File tree

.gemini/GEMINI.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<p align="center">
2+
<img src="public/icons/logo-github.svg" width="80" alt="PaperKnife Logo">
3+
</p>
4+
5+
# 🧠 GEMINI.md - The PaperKnife "Chameleon" Brain
6+
7+
> [!IMPORTANT]
8+
> **CRITICAL MAINTENANCE PROTOCOL:**
9+
> 1. DONT ADD UNLESS ITS SOMETHING IMPORTANT OR WOULD BE USEFUL FOR THE FUTURE YOU.
10+
> 2. THINK TWICE BEFORE REMOVING/REPLACING INFO; YOU MIGHT DELETE IMPORTANT DATA.
11+
> 3. NEVER use `grep` via `run_shell_command`. Always use the provided `search_file_content` tool for searching code.
12+
13+
## 🛡️ 1. Privacy Protocol (THE GOLDEN RULE)
14+
* **Zero-Server Architecture:** PaperKnife is 100% client-side. No PDF data ever leaves the device.
15+
* **No Analytics/Telemetry:** The app must never include tracking scripts or external pings.
16+
* **Local Processing:** All PDF manipulation (Merging, Splitting, Compression) is performed via `pdf-lib` in the browser's memory or the APK's WebView.
17+
* **Data Persistence:** If the user "saves" progress, it must be stored in the browser's `IndexedDB` or `LocalStorage`, never a cloud database.
18+
19+
## 🎭 2. Chameleon Mode & Previews
20+
* **One Codebase, Two Souls:**
21+
* **Web View:** A "Bento Grid" dashboard. High-density information, desktop-optimized. Hosted on GitHub Pages.
22+
* **Android View:** A "Native-Style" app. Bottom navigation bar, thumb-friendly buttons, full-screen focus. Built as an APK.
23+
* **Live Simulation:** The project includes a `viewMode` state (`web` | `android`).
24+
* In `npm run dev`, a floating toggle (bottom-right) allows switching views instantly to test the "Chameleon" shift. This toggle is protected by `import.meta.env.DEV` and is invisible in production.
25+
26+
## 🚀 3. Final Products & Deployment
27+
1. **Web Version:** Built via Vite and auto-pushed to the `gh-pages` branch on GitHub via `.github/workflows/deploy.yml`.
28+
2. **Android APK:** Wrapped via Capacitor. The APK is compiled using GitHub Actions (`create-android.yml`) so the user can download it from GitHub "Releases."
29+
30+
## 📈 4. Evolution Log (Milestones Only)
31+
*Instruction: Gemini must append a brief line here only when a major feature is completed. Do not log small fixes.*
32+
33+
- **[2026-01-29]:** Initialized project in Termux Root. Setup React + Vite + Tailwind.
34+
- **[2026-01-29]:** Implemented Chameleon Mode (Web/Android views) and Dark/Light theme engine with persistence.
35+
- **[2026-01-29]:** Revamped UI with Rose (#F43F5E) accent and custom PaperKnife airplane logo.
36+
- **[2026-01-30]:** Migrated to React Router for SEO and unique URLs (e.g., /merge, /about).
37+
- [2026-01-30]: Implemented functional Merge PDF tool with local processing via `pdf-lib`.
38+
- [2026-01-31]: Implemented Visual Splitter (Split PDF) with support for single-file extraction and individual-page ZIP export.
39+
- [2026-01-31]: Added functional client-side encryption to Protect PDF tool using `@pdfsmaller/pdf-encrypt-lite`.
40+
- [2026-01-31]: Added Compress PDF tool with multi-level quality presets (Low, Medium, High).
41+
- [2026-01-31]: Resolved critical `pdf-lib` encryption loading bug with "Last Resort" retry strategy.
42+
- [2026-02-01]: Completed implementation of all 15 professional tools (Signature, Repair, Metadata, etc.).
43+
- [2026-02-01]: Standardized UI with shared components (`ToolHeader`, `SuccessState`, `PrivacyBadge`) and `sonner` toasts.
44+
- [2026-02-01]: Implemented Dashboard 2.0: Category-based bento colors, tool search, recent activity history, and global "Quick Drop" zone.
45+
- [2026-02-01]: Integrated Web Workers (`pdfWorker.ts`) for non-blocking background PDF merging.
46+
- [2026-02-01]: Refined PDF Preview quality using `devicePixelRatio` and high-quality rendering scale.
47+
- **[2026-02-02]:** Integrated PWA support, Tool Pipelines, and Batch Processing capabilities.
48+
- **[2026-02-02]:** Redesigned "About" page as a professional Technical Specification Protocol.
49+
- **[2026-02-02]:** Reverted custom theme engine and Supporter Keys. Standardized on clean Light/Dark modes with trademark Rose accents.
50+
- **[2026-02-06]:** Implemented Direct Tool Drop (Dashboard), Smart Pipeline Chaining, and Visual Quality Comparison slider.
51+
- **[2026-02-06]:** Integrated Workspace Persistence (Privacy Vault), Background Web Workers (Multi-threading), and Privacy Deep Clean sanitizer. Added refined Micro-Interactions and Offline status indicators.
52+
- **[2026-02-06]:** Refined Android View to Material Design 3 standards: Collapsing large headers, category chips, touch-optimized list items, and native navigation patterns (FAB, back buttons).
53+
- **[2026-02-06]:** Finalized Android APK UI with a pro-grade 5-tab bottom navigation (Home, Tools, Process FAB, History, Privacy) and dedicated sub-views for a truly native multi-activity feel.
54+
- **[2026-02-07]:** Set up automated GitHub Actions workflow for building and signing production APKs. Updated project version to v0.5.0-beta.
55+
- **[2026-02-07]:** Implemented dedicated "Special Thanks" page with acknowledgments for Termux, OpenCode, and Gemini CLI. Integrated links across Web and Android views.
56+
- **[2026-02-08]:** Migrated from MIT to GPL v3 license to prevent proprietary forks and clones.
57+
- **[2026-02-08]:** Implemented "Titan" Android UI overhaul: Compact headers, grounded navigation, and Smart Quick-Pick FAB.
58+
- **[2026-02-08]:** Integrated Capacitor Haptics for tactile feedback and implemented a native Pro-Grade Settings Dashboard with system theme and auto-wipe persistence.
59+
- **[2026-02-08]:** Comprehensive "Titan" UI refinement: Fixed settings toggles, history UI, drag-and-drop, global pipeline handoff, and resolved multiple Android layout overlaps. Resolved 10+ build-time TypeScript errors regarding unused variables and structural integrity.
60+
- **[2026-02-09]:** Major Milestone: v1.0.0-beta. Overhauled Home and About pages for professional-grade "Titan" aesthetic. Migrated to static imports for all core tools and views to eliminate "Failed to fetch" dynamic import errors on Android. Implemented pipeline file-type validation (PDF vs ZIP) and enhanced the Quick-Pick FAB with full colorized catalog access.
61+
- **[2026-02-09]:** Upgraded to **GNU AGPL v3** license to close the "Web Loophole" and ensure absolute transparency for both Web and Android versions.
62+
- **[2026-02-09]:** Finalized v1.0.0-beta "Titan" Release: Implemented high-density compact UI, theme-aware dynamic icons, and a humanized About specification. Perfected the "Deep Clean" metadata protocol (purging Producer/Creator/XMP). Integrated an airtight internal PDF Preview system triggered directly from task completion states. Solidified legal protection with AGPL v3 headers in all core source files.
63+
- **[2026-02-10]:** Humanized "Titan" UI Phase: Redesigned Home and About heros for high-impact professional messaging ("Stop Uploading Your Privacy"). Implemented a high-density "Bento" footer for Web. Standardized Lucide icon aliasing (GHIcon, HeartIcon) to prevent global namespace collisions. Re-integrated tool-level privacy badges for on-device processing assurance.
64+
- **[2026-02-10]:** Implemented Simplified Bug Reporting: Added direct links to the GitHub Issues tracker in both Settings and About pages for community-driven bug tracking and feedback.
65+
- **[2026-02-10]:** Differentiated "About" Experience: Created a high-density "Technical Specification" landing page for Web version and preserved the thumb-friendly Material Design view for the Android APK.
66+
- **[2026-02-10]:** Implemented High-Fidelity Lazy Rendering (1200px) in PDF Preview and optimized Grid Thumbnails for large-scale document handling (200+ pages). Standardized background-aware Branding Protocol and refined Core Engine subtitles for APK Home. Resolved multiple `ReferenceError` bugs and header cropping issues.
67+
- **[2026-02-10]:** Official v1.0.0 "Titan" Stable Release. Finalized all versioning across Web and APK distributions.
68+
- **[2026-02-10]:** Polished "Titan" UI Evolution: Comprehensive overhaul of About, Settings, and Privacy pages with high-density technical specifications. Fixed critical APK bug in file selection logic and refined Home View with History Clipboard and Secure Status indicators. Standardized internal asset naming and optimized memory usage for 100+ page documents.
69+
- **[2026-02-11]:** Finalized "Titan" UI Polish: Overhauled PDF Preview with Immersion Mode and floating page tracking. Redesigned web version into a modern SaaS-style multi-column footer. Implemented intelligent "GET APK" CTAs for mobile web users. Refined APK branding with "Secure Engine" Rose accents and pulsing indicators. Completed global README overhaul for dual-platform focus.
70+
- **[2026-02-11]:** Humanized Branding & Stability: Simplified README to use honest, human language and removed gimmicky branding. Integrated GitHub Sponsors via FUNDING.yml. Fixed critical isNative ReferenceError in AndroidView. Added social badges and direct support call-to-actions to the project homepage.
71+
- **[2026-02-11]:** F-Droid Ready: Removed proprietary Google Play Services logic from Gradle, implemented Fastlane metadata structure, and created an AGPL-compliant `fdroid.yml` build recipe for community-driven inclusion.
72+
- **[2026-02-11]:** Official v1.0.0 Stable Release: Finalized all versioning, metadata, and production assets. Submitted to F-Droid and IzzyOnDroid. Implemented professional "Dark Engineering" branding and high-res social preview generators. Ready for community-driven growth.
73+
- **[2026-02-12]:** Official v1.0.1 Maintenance Release: Addressed IzzyOnDroid feedback for repository inclusion. Hardened "Zero-Server" architecture by removing all network permissions (INTERNET). Standardized Fastlane metadata, optimized store descriptions, and updated the icon for better visibility and compliance. Updated technical credits to acknowledge upstream engines (PDF.js, Tesseract.js).
74+
75+
## 🏗️ 5. Architectural Notes
76+
* **Chameleon Engine:** Uses `viewMode` state in `App.tsx` to hot-swap between `WebView.tsx` and `AndroidView.tsx`.
77+
* **Routing:** Uses `react-router-dom` with a `/PaperKnife/` basename for GitHub Pages compatibility.
78+
* **PDF Core:** `pdf-lib` handles all manipulation. **Note:** Always use the `degrees()` helper for rotation.
79+
* **Background Workers:** Use `src/utils/pdfWorker.ts` for CPU-intensive PDF tasks to keep the UI responsive.
80+
* **UI Components:**
81+
* `src/components/tools/shared/`: Centralized Tool UI components.
82+
* `src/utils/pdfHelpers.ts`: High-level wrappers for pdf-lib and pdfjs-dist.
83+
* **State Management:** IndexedDB (via `recentActivity.ts`) stores the last 10 processed file metadata locally.
84+
85+
## 🧱 6. Tool Development Checklist (For Future Gemini)
86+
* **Base Layout:** Wrap tools in `<div className="flex-1">` and use `<main className="max-w-4xl mx-auto px-6 py-6 md:py-10">`.
87+
* **Shared UI:** Use `<ToolHeader>`, `<SuccessState>`, and `<PrivacyBadge>` in every tool.
88+
* **Toasts:** Use `toast` from `sonner` instead of standard alerts.
89+
* **Security:** If a tool processes a locked file, display a "Security Note" (amber box) regarding unprotected output.
90+
91+
## 🛠️ 7. Technical Quirks (CRITICAL)
92+
* **pdf-lib Encryption Bug:** Use a `try/catch` retry pattern. If the first load fails, retry with `{ password, ignoreEncryption: true }`.
93+
* **PDF.js Worker:** Import via: `import pdfWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url'`.
94+
* **CMap Paths:** Always point `cMapUrl` to `/PaperKnife/cmaps/` for local font support.
95+
96+
## ⚠️ 8. Critical Dev Notes (Maintenance)
97+
* **TypeScript Strictness:** Project uses `--max-warnings 0`. Unused imports or props WILL break the build.
98+
* **Rollup Chunking:** `vite.config.ts` uses `manualChunks` to split `pdf-lib` and `pdfjs-dist`.
99+
* **Worker URL:** Always use `new URL('../../utils/pdfWorker.ts', import.meta.url)` for worker instantiation in Vite.
100+
101+
---
102+
**Current Goal:** Maintenance of v1.0.0 and gathering community feedback for the final v1.1 evolution.

0 commit comments

Comments
 (0)