feat: integrate better-sqlite3 for clipboard history management#19
Conversation
mberrishdev
commented
Dec 11, 2025
- Added DatabaseManager class for handling clipboard item storage and retrieval.
- Implemented methods to add, get, delete, and clear clipboard items in the database.
- Updated ClipboardManager to load history from the database on initialization.
- Enhanced clipboard item saving with error handling for database operations.
- Introduced loadMore functionality in ClipboardManager to fetch additional items.
- Updated IPC communication to support loading more clipboard history.
- Modified ClipboardHistory component to include a "Load More" button for fetching additional items.
- Added styles for the "Load More" button in ClipboardHistory.css.
- Updated ClipboardItem model to include an optional id field.
- Added postinstall script for electron-rebuild in package.json.
- Updated build scripts in package.json to include better-sqlite3 as an external dependency.
- Added DatabaseManager class for handling clipboard item storage and retrieval. - Implemented methods to add, get, delete, and clear clipboard items in the database. - Updated ClipboardManager to load history from the database on initialization. - Enhanced clipboard item saving with error handling for database operations. - Introduced loadMore functionality in ClipboardManager to fetch additional items. - Updated IPC communication to support loading more clipboard history. - Modified ClipboardHistory component to include a "Load More" button for fetching additional items. - Added styles for the "Load More" button in ClipboardHistory.css. - Updated ClipboardItem model to include an optional id field. - Added postinstall script for electron-rebuild in package.json. - Updated build scripts in package.json to include better-sqlite3 as an external dependency.
there was extra logging, that was for development purpose, we dont need to much logging anymore Also, readme was not correct. i fixed it
There was a problem hiding this comment.
Pull request overview
This PR integrates better-sqlite3 for persistent clipboard history storage, replacing the previous in-memory-only approach. The changes introduce a DatabaseManager class for CRUD operations, update ClipboardManager to use database persistence, and add pagination functionality to load clipboard history incrementally.
Key Changes:
- Introduced DatabaseManager class with SQLite database for persistent clipboard history storage
- Updated ClipboardManager to save clipboard items to database and load initial history on startup
- Added pagination support with "Load More" functionality in the UI and corresponding IPC handlers
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/database.ts | New DatabaseManager class providing SQLite-based storage with CRUD operations, indexing, and search functionality |
| src/main/clipboardManager.ts | Updated to integrate with DatabaseManager, persisting clipboard items and loading history from database on initialization |
| src/main/main.ts | Added DatabaseManager initialization, IPC handler for loadMoreHistory, and removed verbose logging statements |
| src/main/preload.ts | Exposed loadMoreHistory IPC method to renderer process |
| src/renderer/types.d.ts | Added loadMoreHistory method signature to ElectronAPI interface |
| src/renderer/pages/ClipboardHistory.tsx | Implemented pagination UI with "Load More" button and state management for loading/hasMore |
| src/renderer/pages/ClipboardHistory.css | Added styling for "Load More" button and container |
| src/models/ClipboardItem.ts | Added optional id field to ClipboardItem interface for database tracking |
| package.json | Added better-sqlite3 dependencies, electron-rebuild postinstall script, and asarUnpack configuration |
| package-lock.json | Updated with better-sqlite3 and related dependency entries |
| bun.lock | Updated with better-sqlite3 and related dependency entries |
| README.md | Enhanced with installation instructions, log file locations, and updated project structure documentation |
Comments suppressed due to low confidence (1)
src/renderer/pages/ClipboardHistory.tsx:1
- Unused imports useCallback, useRef.
import { useState, useEffect, useRef, useCallback } from "react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ic search Add sqlite-verc to save embedings integrate openapi to generate embedings todo: need improvement, current openai model is not working in good way. need improvement
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 19 changed files in this pull request and generated 16 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace text input with interactive key capture for global shortcut - Display shortcuts with friendly symbols (⌘/Ctrl, ⇧, ⌥) - Add animated recording indicator with pulsing dot - Fix EPIPE error handling for stdout/stderr pipes - Improve button styles with gradient, hover effects, and disabled states - Add shortcut recorder CSS with glow animations - Update toggle switch with smooth gradient transitions - Enhance glass-morphism styling for settings cards - Add modern scrollbar styling
- remove unused imports - remove unused methods
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/renderer/pages/ClipboardHistory.tsx:1
- Unused imports useCallback, useRef.
import { useState, useEffect } from "react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b4c2ef0 to
4c08957
Compare
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@mberrishdev I've opened a new pull request, #27, to work on those changes. Once the pull request is ready, I'll request review from you. |