fix(pages): render migrated 1.x images with inline thumbnail preview#34
Merged
Conversation
The 14d-2/14d-3 force-pushed amend that updated the legacy-image
section's wording didn't make it into the merged PR, so the editor
still rendered each migrated 1.x image as just `<code>filename.jpg</code>`
with the obsolete "(legacy 1.x — display-only until 14d-3)" tail.
Two fixes in one place:
1. Render the legacy entry as an inline thumbnail. The migrator copied
each asset from `data/uploads/<itemDir>/` to
`data/uploads-2.0/<itemDir>/`, so we rewrite the leading prefix
(foreign / already-modern paths pass through untouched) and emit
the same `<li class="image-list__item">` markup the FileRepository
rows use, just with a `--legacy` modifier and no remove button.
2. Drop the "until 14d-3" tag and update the `<details>` summary to
"Migrated 1.x images on this page (N) — uploads above replace
them on the frontend." Class docblock follows.
`<li>` counter switched from `<li>` to `<li ` so it still matches the
new markup that always carries class attributes.
Manual smoke (PHP built-in server, page id=1 with one migrated image):
GET /editor/pages/edit/?page=1 200, 8.8 KB
summary: "Migrated 1.x images on this page (1) — uploads above
replace them on the frontend"
img src: /data/uploads-2.0/1.1.6/myxa69-…-unsplash.jpeg → HEAD 200
no remaining "until 14d-3" string in the HTML
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.
The 14d-2/14d-3 force-pushed amend that updated the legacy-image section's wording didn't make it into the merged PR, so the editor still rendered each migrated 1.x image as just
<code>filename.jpg</code>with the obsolete "(legacy 1.x — display-only until 14d-3)" tail. Two fixes in one place:data/uploads/<itemDir>/todata/uploads-2.0/<itemDir>/, so we rewrite the leading prefix (foreign / already-modern paths pass through untouched) and emit the same<li class="image-list__item">markup the FileRepository rows use, just with a--legacymodifier and no remove button.<details>summary to "Migrated 1.x images on this page (N) — uploads above replace them on the frontend." Class docblock follows.<li>counter switched from<li>to<liso it still matches the new markup that always carries class attributes.Manual smoke (PHP built-in server, page id=1 with one migrated image):
GET /editor/pages/edit/?page=1 200, 8.8 KB
summary: "Migrated 1.x images on this page (1) — uploads above
replace them on the frontend"
img src: /data/uploads-2.0/1.1.6/myxa69-…-unsplash.jpeg → HEAD 200
no remaining "until 14d-3" string in the HTML