✨ Feature: add global url rewrite support#1377
Merged
Molunerfinn merged 4 commits intodevfrom Jan 12, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a global URL rewrite feature to replace the existing "change host" functionality. The feature allows users to define regex-based rules to rewrite image URLs both globally (in settings) and on-demand (in the gallery). This addresses user requests from issues #1255 and #1281 for more flexible URL manipulation beyond simple domain changes.
Changes:
- Adds a new URL Rewrite settings page with regex-based rule management (add, edit, delete, reorder, preview)
- Replaces the gallery "change host" feature with a more flexible "URL rewrite" toolbox option supporting both global rules and temporary rules
- Upgrades the PicGo dependency from v1.6.4 to v1.8.1 to support the new URL rewrite functionality
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/universal/types/types.d.ts | Adds originImgUrl field to ImgInfo interface to track original URLs |
| src/universal/types/i18n.d.ts | Adds 50+ new translation keys for URL rewrite UI and gallery integration |
| src/renderer/utils/dataSender.ts | Ensures raw data extraction when saving single config values |
| src/renderer/utils/common.ts | Improves getRawData recursion to handle null and deeply nested reactive objects |
| src/renderer/router/index.ts | Adds route for the new URL Rewrite settings page |
| src/renderer/router/config.ts | Exports URL_REWRITE_PAGE constant |
| src/renderer/pages/components/settings/buttonArea/ButtonAreaSettings.vue | Adds button to navigate to URL Rewrite settings |
| src/renderer/pages/UrlRewrite.vue | New 595-line component implementing the URL rewrite rule management UI |
| src/renderer/components/form/BaseConfigForm.vue | Removes unreachable return statement and adds unused import |
| src/main/events/rpc/routes/galleryToolbox/builtIn/index.ts | Updates to import changeURL instead of changeHost |
| src/main/events/rpc/routes/galleryToolbox/builtIn/changeURL.ts | New file replacing changeHost.ts with flexible regex-based URL rewriting |
| src/main/events/rpc/routes/galleryToolbox/builtIn/changeHost.ts | Deleted file - replaced by changeURL.ts |
| public/i18n/zh-TW.yml | Adds Traditional Chinese translations for URL rewrite feature |
| public/i18n/zh-CN.yml | Adds Simplified Chinese translations for URL rewrite feature |
| public/i18n/en.yml | Adds English translations for URL rewrite feature |
| pnpm-lock.yaml | Updates dependencies for PicGo v1.8.1 |
| package.json | Upgrades PicGo from ^1.6.4 to ^1.8.1 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 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.
ISSUES CLOSED: #1255, #1281