Repository navigation
fix(richtext): default Upload align to center (closes #318) - #335
Merged
Merged
Conversation
The `align` field on the rich-text Upload feature was `required: true` with no default. Inserting an Upload node in a Page leaves `node.fields.align` undefined unless the user opens the extra-fields drawer and picks a value, so the server-side validator failed with "upload node failed to validate: The following fields are invalid: align" — both for newly-added blocks and any previously-saved page that contained one. Adding `defaultValue: 'center'` lets `fieldSchemasToFormState` populate the field before the required-field check, fixing both cases without a DB migration. Also adds a regression test and a `createLexicalWithUploadNode` test helper.
Ardnived
pushed a commit
that referenced
this pull request
Nov 4, 2026
`refuseDuplicateClass` ran on every update, so a class that already had a twin could never be saved again — a manager's edit, or the bookkeeping write a registration triggers, which took the registration down with it. The rehearsal lost 10 registrations to it, and production holds such pairs today. An update is now checked only when its region or class key moves. The atlas importer also skips, by name, an inactive listing with neither a phone nor an email, which Events refuses (#335's only contact is a Meetup page), and the events floor mirrors it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Nov 5, 2026
…it (#1079) * feat(atlas): repeatable re-sync pipeline, with the data kept out of git The Atlas seed data was a one-off extraction whose grooming lived only in a committed events.json, so refreshing it meant redoing the curation by hand — and the files carried registrant and manager personal data into this public repository. This makes the refresh a repeatable, local pipeline. - `pnpm atlas:sync` (seeds/atlas/sync/): fetch captures a Heroku backup of the legacy Atlas, restores and extracts it; build lays a grooming overlay and the merge decisions over it and writes the importer's input, a delta report and a grooming worksheet; groom applies a mechanical clean plus a hand-written patch; check enforces the grooming and write-contract invariants; record turns the groomed data into the next overlay. A rebuild reproduces the groomed data byte for byte. - seeds/atlas/data/ is gitignored and removed from the tree; the CLI already uploads it as inlineData. Its data specs move into `check`. - Verification floors are derived from the data on every build and ride in the uploaded manifest (`from-data` floors), so no refresh leaves a stale constant. Merge decisions move to sync/merges.ts and apply locally, so a new one needs no deploy. - `pnpm seed atlas-reset` empties events, regions, users and user-submissions in one transaction below the Local API, refusing if a RESTRICT key appears; `--update` now prunes managers Atlas deleted, keeping any SahajCloud gave something to. - extract.ts reads Atlas's `timestamp without time zone` columns as UTC and dates as dates: every timestamp was shifted by the operator's UTC offset, and the same dump extracted in two zones disagreed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): atlas-reset refuses while a non-Atlas client points at a region Deleting regions nulls every client's region, and the import re-links only the clients Atlas created, so a SahajCloud-made client would lose its region. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): import one-offs as one-offs, and keep Atlas's unmerged pairs The preview rehearsal's clean import fell 16 events short of its floor. - Atlas stores a single session or a concert as `type: daily` with no end, so the importer listed every past concert as repeating daily forever. `isAtlasOneOff` maps it to a schedule that does not repeat. - `refuseDuplicateClass` (#912) shipped after production was seeded and refused every pair the grooming passes left unmerged on purpose (two managers, one slot), plus the concerts above. The seed now skips it through `context.skipDuplicateClassCheck`: Atlas's duplicates are decided by evidence in sync/merges.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(events): check a class for repeats only when its identity changes `refuseDuplicateClass` ran on every update, so a class that already had a twin could never be saved again — a manager's edit, or the bookkeeping write a registration triggers, which took the registration down with it. The rehearsal lost 10 registrations to it, and production holds such pairs today. An update is now checked only when its region or class key moves. The atlas importer also skips, by name, an inactive listing with neither a phone nor an email, which Events refuses (#335's only contact is a Meetup page), and the events floor mirrors it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): reuse an earlier upload of each event picture Storage renames an upload, so MediaUploader's filename match never found the earlier copy, and every run uploaded all 130 Atlas pictures again — a re-sync keeps images through atlas-reset, so each one would have doubled them. Match on the picture-<legacyId>- stem the renaming keeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(seed): the seed route accepts every script, atlas-reset included Its own hand-kept list had drifted from the CLI's. Derive it from EXPECTED_COUNTS, which the type system makes complete. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): atlas-reset shows the operator what it counted and deleted Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(seed): a draft upsert is a draft save, so parked rows import Payload skips validation only for a call passing `draft`, and `upsert` never passed it — so `_status: 'draft'` alone was refused like a publish, and the atlas importer's "re-import as a draft for an admin to fix" fallback could never land a row that failed validation. `upsert` now takes `draft`. The atlas importer uses it to park an inactive listing with neither a phone nor an email (Events refuses to publish one) as a draft, rather than skipping it, so a manager can complete it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Devindra <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Nov 5, 2026
…it (#1079) * feat(atlas): repeatable re-sync pipeline, with the data kept out of git The Atlas seed data was a one-off extraction whose grooming lived only in a committed events.json, so refreshing it meant redoing the curation by hand — and the files carried registrant and manager personal data into this public repository. This makes the refresh a repeatable, local pipeline. - `pnpm atlas:sync` (seeds/atlas/sync/): fetch captures a Heroku backup of the legacy Atlas, restores and extracts it; build lays a grooming overlay and the merge decisions over it and writes the importer's input, a delta report and a grooming worksheet; groom applies a mechanical clean plus a hand-written patch; check enforces the grooming and write-contract invariants; record turns the groomed data into the next overlay. A rebuild reproduces the groomed data byte for byte. - seeds/atlas/data/ is gitignored and removed from the tree; the CLI already uploads it as inlineData. Its data specs move into `check`. - Verification floors are derived from the data on every build and ride in the uploaded manifest (`from-data` floors), so no refresh leaves a stale constant. Merge decisions move to sync/merges.ts and apply locally, so a new one needs no deploy. - `pnpm seed atlas-reset` empties events, regions, users and user-submissions in one transaction below the Local API, refusing if a RESTRICT key appears; `--update` now prunes managers Atlas deleted, keeping any SahajCloud gave something to. - extract.ts reads Atlas's `timestamp without time zone` columns as UTC and dates as dates: every timestamp was shifted by the operator's UTC offset, and the same dump extracted in two zones disagreed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): atlas-reset refuses while a non-Atlas client points at a region Deleting regions nulls every client's region, and the import re-links only the clients Atlas created, so a SahajCloud-made client would lose its region. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): import one-offs as one-offs, and keep Atlas's unmerged pairs The preview rehearsal's clean import fell 16 events short of its floor. - Atlas stores a single session or a concert as `type: daily` with no end, so the importer listed every past concert as repeating daily forever. `isAtlasOneOff` maps it to a schedule that does not repeat. - `refuseDuplicateClass` (#912) shipped after production was seeded and refused every pair the grooming passes left unmerged on purpose (two managers, one slot), plus the concerts above. The seed now skips it through `context.skipDuplicateClassCheck`: Atlas's duplicates are decided by evidence in sync/merges.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(events): check a class for repeats only when its identity changes `refuseDuplicateClass` ran on every update, so a class that already had a twin could never be saved again — a manager's edit, or the bookkeeping write a registration triggers, which took the registration down with it. The rehearsal lost 10 registrations to it, and production holds such pairs today. An update is now checked only when its region or class key moves. The atlas importer also skips, by name, an inactive listing with neither a phone nor an email, which Events refuses (#335's only contact is a Meetup page), and the events floor mirrors it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): reuse an earlier upload of each event picture Storage renames an upload, so MediaUploader's filename match never found the earlier copy, and every run uploaded all 130 Atlas pictures again — a re-sync keeps images through atlas-reset, so each one would have doubled them. Match on the picture-<legacyId>- stem the renaming keeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(seed): the seed route accepts every script, atlas-reset included Its own hand-kept list had drifted from the CLI's. Derive it from EXPECTED_COUNTS, which the type system makes complete. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(atlas): atlas-reset shows the operator what it counted and deleted Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(seed): a draft upsert is a draft save, so parked rows import Payload skips validation only for a call passing `draft`, and `upsert` never passed it — so `_status: 'draft'` alone was refused like a publish, and the atlas importer's "re-import as a draft for an admin to fix" fallback could never land a row that failed validation. `upsert` now takes `draft`. The atlas importer uses it to park an inactive listing with neither a phone nor an email (Events refuses to publish one) as a draft, rather than skipping it, so a manager can complete it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Devindra <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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
alignfield wasrequired: truewith no default, so inserting an Upload node into a Page (or saving an existing one) failed withupload node failed to validate: The following fields are invalid: alignwhenever the user didn't open the extra-fields drawer.defaultValue: 'center'sofieldSchemasToFormStatepopulates the field before the required-field check runs. Verified against the PayloadCMS source:calculateDefaultValuesalways runs (create and update), and the default-value promise fills anyundefinedvalue before validation.node.fieldsis stored inline in the rich-text JSON, and old rows withoutalignsimply get the default applied at validation/save time.Closes #318
Test Results
access-performance.int.spec.ts > completes 10,000 visibility checks in under 150ms— passes in isolation at ~7ms; only fails under full-suite CPU contention; not introduced by this PR).tests/e2e/)New regression coverage
tests/int/pages.int.spec.ts > Lexical Upload Node > saves an upload node without an explicit align value (defaults to "center")tests/int/pages.int.spec.ts > Lexical Upload Node > preserves an explicitly-set align valuecreateLexicalWithUploadNode(imageId, fields?)helper intests/utils/lexicalTestHelpers.ts.Test plan
fields.align === 'center'.alignvia the extra-fields drawer toLeft/Right/Wide→ persists as chosen.