Skip to content

Import and show series years, status and summary - #984

Merged
ajslater merged 1 commit into
developfrom
claude/series-fields-23317f
Oct 20, 2026
Merged

ajslater merged 1 commit into
developfrom
claude/series-fields-23317f

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Draft: depends on an unreleased comicbox. The one remaining step is bumping the comicbox pin (pyproject + uv.lock) to the release that ships SeriesStatusEnum and the series.end_year / status / summary schema fields. The pin is ~=5.3.2, so it has to move to 5.4. Until then codex/models/choices.py can't import the enum from PyPI's comicbox 5.3.2, and CI on this branch will fail at import.

What

Series rows gain start_year, end_year, status (choices derived from comicbox.enums.comicbox.SeriesStatusEnum) and summary, imported from comicbox's series block (migration 0058_series_fields).

  • Metadata pane: (1963–1996) / (1963– ) / (1963) and the status, subdued, after the series name; the series summary under a "Series" label below the comic's summary.
  • Tag editor: a "Start Year" field beside Volume Count, MetronInfo-only (MetronInfo Series/StartYear; ComicInfo has no tag), written inside the series object like the volume count. end_year / status / summary get no editor fields because no format codex writes can carry them.

Importer

The single "count field" slot per collection model is now a tuple of attributes (COLLECTION_MODEL_ATTR_FIELDS), which drives MODEL_REL_MAP, the Series create args and the read-phase merge. Within one import batch, comics of a series merge per attribute: earliest start year, latest end year, largest count, first status and summary. Against the stored row the existing rule holds: a proposed non-null value that differs wins.

Pre-existing bug fixed along the way: the read-phase max_none merge for volume_count / issue_count never ran. It looked up the proposals with the collection_list list, and suppress(Exception) swallowed the TypeError. So when comics in one batch disagreed, the query phase picked one by set iteration order. Now every proposal for a collection is rewritten with the merged attributes, so they all agree.

Two other things the new columns needed:

  • Series.summary collides with the comic summary annotation on collection panes. It now takes the existing conflict_ prefix path, like name and path.
  • _value_output_field walks relations, so series__* values resolve on Series instead of raising on Comic.

Tested against

comicbox 5.4.0 from ajslater/comicbox#246 (branch claude/series-fields-35d8cb at 0e9c1e1, its dist/ wheel), installed into the worktree venv without touching the pin. It was also green against the schema-only commit 95749ad. make fix, make lint and make ty are clean, and make test passes: pytest 1691 (1 xfailed), vitest 1003.

Browser check on an isolated dev stack at 375, 800 and 1280 px: header, series summary, and the Start Year field. Start Year is disabled with the usual tooltip under ComicInfo and editable under MetronInfo. That check found a phone-width overflow (the no-wrap series row ran off-screen), fixed by letting #seriesRow wrap and keeping the year range on one line.

New tests:

  • tests/importer/test_series_attrs.py: batch merge, empty defaults, later batch against the stored row, and a round trip from an archive's comicbox.yaml.
  • tests/test_metadata_series_fields.py: the comic and series panes, and that the comic summary survives on the series pane.
  • test_write_series_start_year: the editor's patch lands as MetronInfo StartYear.
  • metron_only in test_format_exclusive_fields now includes start_year.
  • vitest: seriesYears formatting and the Start Year field.

🤖 Generated with Claude Code

Series gains start_year, end_year, status (choices from comicbox's
SeriesStatusEnum) and summary, read from comicbox's series block.
The metadata pane shows the year range and status after the series
name and the series summary below the comic's. The tag editor gets a
MetronInfo-only Start Year beside Volume Count.

The importer's single count slot per collection becomes a tuple of
attributes. Comics of one series in a batch now merge per attribute
(earliest start, latest end, largest count, first status and text).
The old max_none merge for counts never ran: it looked proposals up
with an unhashable list and suppress(Exception) hid the TypeError, so
disagreeing comics resolved by set order.

Series.summary collides with the comic summary annotation on
collection panes, so that field now takes the conflict_ prefix path.

Needs the comicbox release that ships SeriesStatusEnum; the pin is
not bumped yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater marked this pull request as ready for review October 20, 2026 02:15
@ajslater
ajslater merged commit 5d56afc into develop Oct 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant