json output format and json edit tab - #77
Merged
Merged
Conversation
Adds a JSON serialization option for sidecar metadata files, selectable via a Format combo (independent of the suffix), and a raw JSON editor tab that mirrors the whole document and syncs with the Form and YAML views. Tour gains steps for the output format selector and the JSON editor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment on lines
+65
to
+66
| if fmt == "json": | ||
| json.dump(parameters, metadata_file, indent=2, ensure_ascii=False) |
Member
There was a problem hiding this comment.
in yaml_utils.py you have a json dump, but not to file. I remeber that there were some datetime issues with json dump in svgdigitizer.
DunklesArchipel
approved these changes
Jul 11, 2026
Co-authored-by: Albert Engstfeld <albert.engstfeld@gmail.com>
YAML parses timestamps (e.g. `2026-07-12 06:36:55`) into datetime objects, which json.dump cannot encode — writing a JSON sidecar with such a field crashed. Add a shared json_default in yaml_utils that renders datetime/date/time as ISO 8601, and wire it into both dump_json (JSON tab) and write_metadata's json.dump (sidecar writer). Replace the "yaml"/"json" magic strings with a str-based MetadataFormat enum (single source of truth, typed). Being a str subclass keeps it backward-compatible with existing TOML configs and Qt userData. The format dropdown is now generated by iterating the enum. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Annotate every remaining function (returns and the params that go with them) so the codebase is fully typed: core/ business logic, Config accessors, the AutotagApp controller, and the ui/ widgets (Qt event overrides typed with their concrete event classes). Also fix the pixi `typecheck` task, which failed before checking any code when a stale VIRTUAL_ENV from another project was inherited: pass the interpreter explicitly via `ty check --python $CONDA_PREFIX`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Add support for json output and json edit tab.