Skip to content

fix(pages): render migrated 1.x images with inline thumbnail preview#34

Merged
bigin merged 1 commit into
imanager-2.0from
fix/legacy-images-preview
May 3, 2026
Merged

fix(pages): render migrated 1.x images with inline thumbnail preview#34
bigin merged 1 commit into
imanager-2.0from
fix/legacy-images-preview

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 3, 2026

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

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
@bigin bigin merged commit de7e42c into imanager-2.0 May 3, 2026
@bigin bigin deleted the fix/legacy-images-preview branch May 15, 2026 05:23
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