[PR #223] [MERGED] feat(application): build complete pages from stored posts #221

Closed
opened 2026-10-13 19:49:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/223
Author: @Glitchy-Sheep
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: feat/build-stored-post-pages


📝 Commits (4)

  • 3e6db63 feat(html): preserve stored paragraphs and inline line breaks
  • 01c07c2 feat(html): explain missing media in stored post pages
  • 269601d feat(html): render retained media removed by the author
  • 48312f9 feat(application): build complete pages from stored posts

📊 Changes

18 files changed (+2288 additions, -44 deletions)

View changed files

➕ boosty_downloader/application/_page_text.py (+100 -0)
📝 boosty_downloader/application/mappers/html_converter.py (+32 -23)
➕ boosty_downloader/application/page_builder.py (+191 -0)
📝 boosty_downloader/infrastructure/html_generator/__init__.py (+10 -1)
📝 boosty_downloader/infrastructure/html_generator/models.py (+68 -7)
📝 boosty_downloader/infrastructure/html_generator/renderer.py (+96 -13)
📝 boosty_downloader/infrastructure/html_generator/templates/base.html (+20 -0)
➕ boosty_downloader/infrastructure/html_generator/templates/deleted.html (+7 -0)
➕ boosty_downloader/infrastructure/html_generator/templates/not_downloaded.html (+10 -0)
➕ boosty_downloader/infrastructure/html_generator/templates/removed_media.html (+5 -0)
➕ boosty_downloader/infrastructure/html_generator/templates/structured_text.html (+16 -0)
📝 boosty_downloader/infrastructure/html_generator/templates/unavailable.html (+7 -0)
➕ test/unit/application/page_builder_media_test.py (+444 -0)
➕ test/unit/application/page_builder_test.py (+238 -0)
➕ test/unit/application/page_text_test.py (+368 -0)
➕ test/unit/html_generator/missing_media_test.py (+314 -0)
➕ test/unit/html_generator/removed_media_test.py (+193 -0)
➕ test/unit/html_generator/structured_text_test.py (+169 -0)

📄 Description

📝 Summary

Add the page-building core needed to keep a complete post page when media arrives across separate download runs. It reads StoredPost; connecting it to the download commands comes in a later PR.

🔧 What changes

  • Preserve author order, paragraphs, inline line breaks, headings and nested lists from the stored record.
  • Render saved media from stored relative paths, including names containing spaces, Unicode or URL punctuation.
  • Show pending media with a Boosty link, failed or unavailable media with a reason, and deleted files with a restore hint.
  • Append downloaded copies removed by the author in a separate section, ordered by their stored position.
  • Keep page building free of network and filesystem access, and leave the input record unchanged.
  • Add a page-template version marker and mark new service text for the future viewer's search.

The four commits separate text handling, missing-media cards, retained media and the complete builder. Existing download commands keep their current page-building flow.

🖼️ Screenshots

  • Checked local HTML examples for missing-media cards, retained media and a complete page built from a stored record.

🧪 Tests

  • task ci passed: 852 tests, Ruff, formatting, strict Pyright, import-layer checks and wheel/source builds.
  • GitHub CI passed all seven checks, including Python 3.10, 3.12 and 3.14 on Ubuntu and Python 3.12 on Windows.
  • Added 151 tests covering text boundaries, every media state, removed copies, escaping, path encoding and invalid records.
  • Composed tests cover API mapping, reconciliation across partial runs, page building and HTML rendering together.
  • A fresh independent review of the full branch found no material issues.
  • Authenticated API tests were skipped because the worktree has no .env; no live-blog test was run for this pure builder.

The first CI attempt exceeded the existing parallel-download test's 1.3-second limit on Python 3.14 (1.85 seconds). The repeat passed on the same commit; the test and download scheduler are unchanged.

⏭️ Next

  • Add storage ports and persistence, then connect this builder to downloads and offline rendering.
  • Verify the complete download flow on a real blog when that integration is ready.

✅ Checklist

  • Tested live on a real blog (feature or fix)
  • Updated CLI --help and README if needed
  • Updated docs/ if the download flow or dev process changed
  • Added a line to ## Unreleased in CHANGELOG.md (or the ci/skip-changelog label if not user-facing)

CLI/help and download-flow documentation changes are not needed at this stage. ci/skip-changelog applies to this internal preparation; the new builder is not yet used by download commands.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/223 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `feat/build-stored-post-pages` --- ### 📝 Commits (4) - [`3e6db63`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/3e6db63ae0232ff54cd86db922a1c5dd5c82259e) feat(html): preserve stored paragraphs and inline line breaks - [`01c07c2`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/01c07c26c49b6a881e1b4d6e3be3a7c9d721b233) feat(html): explain missing media in stored post pages - [`269601d`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/269601df6d03abd48ee52da1513f8611d7724220) feat(html): render retained media removed by the author - [`48312f9`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/48312f9d21f24a5afee4977de0dad4b4cc8f3c44) feat(application): build complete pages from stored posts ### 📊 Changes **18 files changed** (+2288 additions, -44 deletions) <details> <summary>View changed files</summary> ➕ `boosty_downloader/application/_page_text.py` (+100 -0) 📝 `boosty_downloader/application/mappers/html_converter.py` (+32 -23) ➕ `boosty_downloader/application/page_builder.py` (+191 -0) 📝 `boosty_downloader/infrastructure/html_generator/__init__.py` (+10 -1) 📝 `boosty_downloader/infrastructure/html_generator/models.py` (+68 -7) 📝 `boosty_downloader/infrastructure/html_generator/renderer.py` (+96 -13) 📝 `boosty_downloader/infrastructure/html_generator/templates/base.html` (+20 -0) ➕ `boosty_downloader/infrastructure/html_generator/templates/deleted.html` (+7 -0) ➕ `boosty_downloader/infrastructure/html_generator/templates/not_downloaded.html` (+10 -0) ➕ `boosty_downloader/infrastructure/html_generator/templates/removed_media.html` (+5 -0) ➕ `boosty_downloader/infrastructure/html_generator/templates/structured_text.html` (+16 -0) 📝 `boosty_downloader/infrastructure/html_generator/templates/unavailable.html` (+7 -0) ➕ `test/unit/application/page_builder_media_test.py` (+444 -0) ➕ `test/unit/application/page_builder_test.py` (+238 -0) ➕ `test/unit/application/page_text_test.py` (+368 -0) ➕ `test/unit/html_generator/missing_media_test.py` (+314 -0) ➕ `test/unit/html_generator/removed_media_test.py` (+193 -0) ➕ `test/unit/html_generator/structured_text_test.py` (+169 -0) </details> ### 📄 Description ## 📝 Summary Add the page-building core needed to keep a complete post page when media arrives across separate download runs. It reads `StoredPost`; connecting it to the download commands comes in a later PR. ## 🔧 What changes - Preserve author order, paragraphs, inline line breaks, headings and nested lists from the stored record. - Render saved media from stored relative paths, including names containing spaces, Unicode or URL punctuation. - Show pending media with a Boosty link, failed or unavailable media with a reason, and deleted files with a restore hint. - Append downloaded copies removed by the author in a separate section, ordered by their stored position. - Keep page building free of network and filesystem access, and leave the input record unchanged. - Add a page-template version marker and mark new service text for the future viewer's search. The four commits separate text handling, missing-media cards, retained media and the complete builder. Existing download commands keep their current page-building flow. ## 🖼️ Screenshots - Checked local HTML examples for missing-media cards, retained media and a complete page built from a stored record. ## 🧪 Tests - `task ci` passed: 852 tests, Ruff, formatting, strict Pyright, import-layer checks and wheel/source builds. - [GitHub CI](https://github.com/Glitchy-Sheep/boosty-downloader/actions/runs/37681930914) passed all seven checks, including Python 3.10, 3.12 and 3.14 on Ubuntu and Python 3.12 on Windows. - Added 151 tests covering text boundaries, every media state, removed copies, escaping, path encoding and invalid records. - Composed tests cover API mapping, reconciliation across partial runs, page building and HTML rendering together. - A fresh independent review of the full branch found no material issues. - Authenticated API tests were skipped because the worktree has no `.env`; no live-blog test was run for this pure builder. The first CI attempt exceeded the existing parallel-download test's 1.3-second limit on Python 3.14 (1.85 seconds). The repeat passed on the same commit; the test and download scheduler are unchanged. ## ⏭️ Next - Add storage ports and persistence, then connect this builder to downloads and offline rendering. - Verify the complete download flow on a real blog when that integration is ready. ## ✅ Checklist - [ ] Tested live on a real blog (feature or fix) - [x] Updated CLI `--help` and README if needed - [x] Updated `docs/` if the download flow or dev process changed - [x] Added a line to `## Unreleased` in CHANGELOG.md (or the `ci/skip-changelog` label if not user-facing) CLI/help and download-flow documentation changes are not needed at this stage. `ci/skip-changelog` applies to this internal preparation; the new builder is not yet used by download commands. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:49:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#221
No description provided.