feat(resume): improve create and cloud restore flows - #9
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the resume creation and restore experience by adding a single-resume JSON import option in the create flow, consolidating import appearance normalization logic, and adding a safety prompt when restoring older cloud backups that may overwrite newer local data.
Changes:
- Add optional JSON file selection to the “create resume” modal and route it through a new
onCreateFromJsonhandler. - Reuse a centralized
getImportedResumeAppearancehelper for consistent appearance normalization across import paths. - Warn users during cloud restore when the cloud backup timestamp is older than the newest local resume update.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/components/ResumeManager.tsx | Adds JSON selection + import-create flow to the create modal and wires a new onCreateFromJson callback. |
| src/App.tsx | Implements JSON-to-resume creation, consolidates appearance import normalization, and adds a cloud-restore staleness confirmation prompt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+321
to
+323
| const submit = async (event?: FormEvent<HTMLFormElement>) => { | ||
| event?.preventDefault(); | ||
| onCreate({ | ||
| name: name.trim() || defaultName, | ||
| tags: normalizeResumeTags(tagText), | ||
| const tags = normalizeResumeTags(tagText); |
Comment on lines
+334
to
+346
| setSubmitting(true); | ||
| setJsonError(null); | ||
| const error = await onCreateFromJson({ | ||
| file: jsonFile, | ||
| name: name.trim(), | ||
| tags, | ||
| }); | ||
| setSubmitting(false); | ||
| if (error) { | ||
| setJsonError(error); | ||
| return; | ||
| } | ||
| onClose(); |
| tags: string[]; | ||
| file: File; | ||
| }): Promise<string | null> => { | ||
| if (!input.file.name.endsWith(".json")) return "请选择 .json 文件"; |
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.
Summary
Review notes
Checks