OffLine Implementation Standards
This skill defines the development guidelines for the OffLine project.
Tech Stack
- •Framework: React 18 + TypeScript + Vite
- •Styling: Native CSS Modules
[name].csswith CSS Variablesvar(--color-primary) - •State Management: React Hooks (
useState,useMemo,useCallback,useTransition) - •Virtualization:
react-window(Required for lists > 50 items)
Core Coding Rules
1. Memory Management (Critical)
- •Avoid
string.spliton large content: Never usesplit('\n')on the entire file string. It causes immediate OOM on large files. - •Use Iterative Parsing: Use
indexOfloops to scan for delimiters line-by-line. - •Browser Compatibility: Safely access
performance.memory(Chrome only). Handleundefinedfor Safari/Firefox.
2. File Handling
- •Size Parsing: Always work with
Fileobjects directly. - •Warning Thresholds: Check for files > 50MB and warn the user.
3. UI/UX Patterns
- •Glassmorphism: Use the
.glassutility class or established CSS variables for transparency effects. - •Native Look: Font stack should prioritize San Francisco (Apple) standards.
- •Responsive: Support dynamic sidebar resizing and mobile views.
Implementation Workflow
- •Analyze: Understand the feature scope.
- •Plan: Check against "Privacy First" principles (No external calls).
- •Code: Implement using TypeScript strict mode.
- •Document: Update
CHANGELOG.mdandREADME.md(Refer tooffline-documentation).