Problem
Editor changes are currently persisted only in localStorage through
setMDContent. The bundled guide asks users to export a Markdown file and
import it again later.
This causes the browser content and a local Markdown source file to diverge.
It is especially confusing during local development: editing a resume in the
browser does not update the .md file used by the template, while editing the
file does not resolve an existing browser cache override.
Reproduction
- Start the current
master branch with npm run dev.
- Open any resume template in the editor.
- Edit its Markdown content in the browser.
- Check the corresponding local
.md source file.
Actual behavior
- The source file is unchanged.
- The edited content exists only under
markdown-content-<template> in localStorage.
- Keeping a durable local copy requires repeated manual export/import.
Expected behavior
Users should be able to explicitly link a local Markdown file and have later
editor changes written back to that file.
Proposed scope
Add an opt-in Sync local MD action using the browser File System Access
API:
- require the user to select and grant access to a
.md file;
- handle differing editor/file content without silently overwriting either;
- debounce subsequent editor writes to the selected file;
- show whether local sync is active;
- keep the existing import/export workflow as the fallback for unsupported
browsers.
The browser cannot write arbitrary local paths without a user-granted file
handle, so automatic source-file discovery is intentionally out of scope.
Environment
- CodeCV
master at c06cb364
- Reproduced in local development
- Chromium-based browser
Problem
Editor changes are currently persisted only in
localStoragethroughsetMDContent. The bundled guide asks users to export a Markdown file andimport it again later.
This causes the browser content and a local Markdown source file to diverge.
It is especially confusing during local development: editing a resume in the
browser does not update the
.mdfile used by the template, while editing thefile does not resolve an existing browser cache override.
Reproduction
masterbranch withnpm run dev..mdsource file.Actual behavior
markdown-content-<template>inlocalStorage.Expected behavior
Users should be able to explicitly link a local Markdown file and have later
editor changes written back to that file.
Proposed scope
Add an opt-in Sync local MD action using the browser File System Access
API:
.mdfile;browsers.
The browser cannot write arbitrary local paths without a user-granted file
handle, so automatic source-file discovery is intentionally out of scope.
Environment
masteratc06cb364