feat: modularize scanner, enhance carousel preloading, and improve PWA updates
Summary of changes: - Extracted archive scanning logic into a modular 'useArchiveScanner' hook for better maintainability and performance. - Refined PostModal carousel with intelligent media preloading and smoother, jitter-free transitions. - Optimized image rendering with 'decoding=async' and removed 'black flashes' between slide changes. - Updated PWA configuration to 'autoUpdate' with hourly periodic checks for fresh content. - Fixed several bugs including stories sorting, permalink parameter cleanup, and profile metadata cache restoration. - Comprehensive updates to documentation (README.md and GEMINI.md) reflecting the new architecture.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
export interface MediaFile {
|
||||
name: string;
|
||||
url: string;
|
||||
type: 'image' | 'video';
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface Post {
|
||||
id: string;
|
||||
date: string;
|
||||
username: string;
|
||||
caption: string;
|
||||
media: MediaFile[];
|
||||
thumbnail: string;
|
||||
isStory?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Common interface for both local File objects and remote server-side files.
|
||||
*/
|
||||
export interface ArchiveFile {
|
||||
name: string;
|
||||
webkitRelativePath: string;
|
||||
size: number;
|
||||
text(): Promise<string>;
|
||||
arrayBuffer(): Promise<ArrayBuffer>;
|
||||
stream(): ReadableStream<Uint8Array>;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface ServerArchive {
|
||||
name: string;
|
||||
thumbnail: string;
|
||||
path: string;
|
||||
fileCount: number;
|
||||
}
|
||||
Reference in New Issue
Block a user