Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase by removing the custom ConfigStore (db) wrapper and migrating to using the PicGo core library's native configuration methods directly. This simplifies the configuration management layer and reduces code duplication.
- Replaced all
db.get()calls withpicgo.getConfig<T>()with proper type annotations - Replaced all
db.set()calls withpicgo.saveConfig()using object notation - Removed the
ConfigStoreclass entirely fromdatastore/index.ts, keeping only theGalleryDBclass
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/utils/updateChecker.ts | Migrated from db methods to picgo.getConfig/saveConfig for update tip settings |
| src/main/utils/privacyManager.ts | Updated privacy check to use picgo.getConfig for privacy ensure flag |
| src/main/utils/handleI18n.ts | Changed language initialization to use picgo.getConfig for language settings |
| src/main/utils/dataReport.ts | Updated data reporting to retrieve picBed configuration via picgo.getConfig |
| src/main/utils/common.ts | Migrated URL copy and encoding functions to use picgo.getConfig; contains unintended clipboard.writeText addition |
| src/main/migrate/index.ts | Refactored migration functions to work directly with picgo instance instead of db |
| src/main/lifeCycle/index.ts | Updated lifecycle hooks to use picgo.saveConfig and removed db import |
| src/main/events/rpc/routes/toolbox/checkFile.ts | Changed to use getGalleryDBPath() function instead of exported constant |
| src/main/events/ipcList.ts | Migrated IPC handlers to use picgo.getConfig for paste style and custom link settings |
| src/main/apis/gui/index.ts | Updated GUI API to use picgo.getConfig for paste template configuration |
| src/main/apis/core/picgo/index.ts | Commented out debounced DB flush logic (no longer needed with direct picgo usage) |
| src/main/apis/core/datastore/index.ts | Removed entire ConfigStore class, keeping only GalleryDB implementation |
| src/main/apis/app/window/windowList.ts | Updated window configuration to use picgo.getConfig for startup and display settings |
| src/main/apis/app/uploader/index.ts | Migrated uploader configuration reads to use picgo.getConfig |
| src/main/apis/app/uploader/apis.ts | Changed upload APIs to retrieve settings via picgo.getConfig |
| src/main/apis/app/system/index.ts | Updated system tray and context menu to use picgo.getConfig/saveConfig |
| src/main/apis/app/shortKey/shortKeyHandler.ts | Refactored shortkey management to use picgo methods; uses potentially unavailable removeConfig method |
| package.json | Added check script and integrated lint:dpdm into main lint command |
| AGENTS.md | Updated documentation to mention new check command |
| .gitignore | Added .cache/ directory to ignored files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.