增量更新#19
Open
4xiaxia wants to merge 36 commits into
Open
Conversation
Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
Fix title typo, corrupted JSDoc, missing ESLint config; add project blueprint
Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
Fix lint errors, undefined references, and hardcoded config found in project analysis
Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
…ode splitting Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
…d rename isMobileUA to isMobile Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
…d-performance perf: Dexie.js caching, Vite code splitting, App.jsx modularization
Fix script path issues, simplify imports, handle permissions, and create initial data files. Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
Generate and document project health check report, fix issues, and create configuration guide. Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
…with local generation Co-authored-by: 4xiaxia <223680169+4xiaxia@users.noreply.github.com>
Migrate hardcoded URLs, enhance CDN support, and add documentation Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
Simplify and rollback recent changes to resolve syntax issues. Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
Optimize image loading and improve configuration management
Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
Co-authored-by: Xia <223680169+4xiaxia@users.noreply.github.com>
Update iOS version requirements and improve Privacy page UI
…c5-46b6-b84a-17561cd6dfa8
…e186ffe-c2c5-46b6-b84a-17561cd6dfa8 Replace hardcoded dev config and external QR API with env-configurable, China-accessible alternatives
|
@4xiaxia is attempting to deploy a commit to the Tanshilong's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors runtime/config behaviors (dev server hosts, API endpoints), introduces new hooks for data sync and image export, and migrates IndexedDB storage to Dexie, alongside UI/link/content adjustments and substantial documentation additions.
Changes:
- Make dev server host allowlist configurable via env var and add Rollup manual chunking.
- Replace manual IndexedDB usage with Dexie and add
useDataSync+useImageExporthooks. - Remove launcher scripts and several UI links/sections; add new modals and expand docs/env guidance.
Reviewed changes
Copilot reviewed 51 out of 57 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.js | Env-driven allowedHosts + Rollup manual chunk splitting. |
| src/utils/db.js | Switch IndexedDB wrapper to Dexie-based implementation. |
| src/hooks/useDataSync.js | New hook to sync templates/banks from cloud/static sources. |
| src/hooks/useImageExport.js | New hook to export a “preview card” as an image with QR/watermark. |
| src/hooks/useShareFunctions.js | Adjust base URL logic and error logging in share flows. |
| scripts/sync-data.js | Rework sync script behavior and root dir detection. |
| src/pages/PrivacyPage.jsx | Remove large privacy policy section content. |
| src/components/modals/* | Add Notice / ExportTemplates / ImageUrl modals and update exports. |
| .env.example + docs/* | Add/expand environment/config and architecture docs. |
Comments suppressed due to low confidence (9)
src/hooks/useDataSync.js:1
- Object literal has a duplicate
cloudkey, so the first entry is overwritten and never used. Rename keys (e.g.,cloudApi/cloud) and update the selection logic accordingly.
src/hooks/useDataSync.js:1 - Version comparison is done with
>on strings (e.g., '0.10.0' vs '0.9.9'), which can select the wrong source/version. Use a semantic version comparator (split by '.' and compare numeric parts) or store/compare versions as monotonically increasing numbers.
src/hooks/useDataSync.js:1 - Version comparison is done with
>on strings (e.g., '0.10.0' vs '0.9.9'), which can select the wrong source/version. Use a semantic version comparator (split by '.' and compare numeric parts) or store/compare versions as monotonically increasing numbers.
src/hooks/useShareFunctions.js:1 isTauriis computed but not used, causing Tauri builds to potentially generate share links based on atauri:origin/path that won't be usable externally. Either use a public base URL in Tauri (as the earlier logic did) or rely on a dedicated env-driven public URL (e.g.,VITE_PUBLIC_URL) for share links.
src/hooks/useImageExport.js:1- In the long-link fallback path (
compressedexists butshortCodeis missing),displayUrlcontains the importable long URL butqrContentUrlis reset to the homepage. This makes the exported QR code inconsistent with the displayed URL and prevents QR-based import. Consider either encoding the long URL into the QR, or explicitly disabling QR generation (and showing a clear message) when no short code is available.
src/hooks/useImageExport.js:1 - This uses
document.writewith unescaped user-controlled strings (activeTemplateName). If template names can contain HTML, this enables injection into a same-origin window. Prefer building DOM nodes and settingtextContent/attributes safely, or escape interpolated values before injecting into HTML.
src/components/modals/NoticeModal.jsx:1 - Modal markup is missing common dialog accessibility primitives (e.g.,
role=\"dialog\",aria-modal=\"true\", and anaria-labelledbypointing to the title). Also consider adding anaria-labelfor the close icon button and ensuring focus is moved into the dialog on open and restored on close.
src/utils/helpers.js:1 - Given the ESLint config ignores unused vars prefixed with
_, theeslint-disable-next-line no-unused-varsis likely unnecessary noise here. Consider removing it and relying on the_templateIdnaming convention for clarity.
src/pages/PrivacyPage.jsx:1 - The main privacy policy content section was removed, leaving the page with little/no policy text. If this page is intended to serve as a privacy policy, it should still render the actual policy sections (or load them from a maintained source). Consider restoring the removed sections or replacing them with a new authoritative policy content block.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+36
to
+40
| const versionData = { | ||
| appVersion: pkg.version, | ||
| dataVersion: "0.9.3", | ||
| updatedAt: new Date().toISOString() | ||
| }; |
Comment on lines
+44
to
+46
| fs.writeFileSync(path.join(dataDir, 'version.json'), JSON.stringify(versionData, null, 2)); | ||
| fs.writeFileSync(path.join(dataDir, 'templates.json'), JSON.stringify({ version: "0.9.3", config: [] }, null, 2)); | ||
| fs.writeFileSync(path.join(dataDir, 'banks.json'), JSON.stringify({ banks: {}, defaults: {}, categories: {} }, null, 2)); |
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.
新的内容合并到旧的但是不要改旧的基础配置 如果遇到冲突,先判断是内容还是配置 内容的丰富功能的完善可以修改