[FEATURE] import and export feature#1
Open
dotH3 wants to merge 1 commit into
Open
Conversation
Author
|
@russellashby hi, i have coded an import and export feature to save/continue editing a project :p |
russellashby
requested changes
May 13, 2026
Owner
russellashby
left a comment
There was a problem hiding this comment.
Great contribution — the implementation is clean, follows all project conventions, tests are thorough, and the use case doc is well structured. One small fix needed before merge, plus two observations for your awareness.
Fix needed
index.html — null checks for optional fields
parseProjectJson signals "field not present" by returning null for gridSize and scaleFactor. The import handler currently checks truthiness, which is inconsistent with that contract:
// current — falsy for 0 (not a real bug, but imprecise)
if (parsed.gridSize) { ... }
if (parsed.scaleFactor) { ... }
// preferred — matches what parseProjectJson returns for "missing"
if (parsed.gridSize !== null) { ... }
if (parsed.scaleFactor !== null) { ... }Observations (no action needed)
- No range validation on imported values — a corrupted file could set
gridSize: 9999orscaleFactor: -5. Low risk since these are the user's own files, but something to consider if the format ever becomes shareable. versionfield is written but never read — fine for now, but worth a note: if a v2 format is added later, old code will silently apply it. A version check inparseProjectJsonwould future-proof this.
Fix the null checks and this is good to merge. Thanks!
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.