feat/paged-reader #10

Open
morten-olsen wants to merge 2 commits from feat/paged-reader into main
Owner
No description provided.
feat: read editions as pages, not as a scroll
Some checks failed
ci/woodpecker/push/compliance Pipeline was successful
ci/woodpecker/push/deploy Pipeline failed
ci/woodpecker/push/quality Pipeline was successful
ci/woodpecker/push/build Pipeline failed
Release / tag (push) Has been cancelled
Release / build (linux/amd64, ubuntu-24.04) (push) Has been cancelled
Release / build (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Release / merge (push) Has been cancelled
Release / release (push) Has been cancelled
Release / deploy (push) Has been cancelled
Deploy Website / build (push) Has been cancelled
Deploy Website / deploy (push) Has been cancelled
512cadb0cc
The magazine now typesets articles into pages that fit the screen exactly
and the only interaction is turning them. Opening a page, reading it without
touching anything, and turning is the interaction a print magazine has, and
the one the mission asks for.

A desktop window opens into a two-page spread with the cover alone on the
first turn; a tablet gets a full page; a phone gets one sized for a hand.
The engine lays out pages of whatever box it is given, so how many are shown
at once stays a reading decision rather than a layout one.

Vendors incubator/layout-engine as packages/layout-engine and extends it.
Verifying it against pretext turned up two bugs that were silently wrong:

- LayoutCursor.graphemeIndex is relative to its segment, but the engine
  sliced source text with it as a global offset. That happens to work for
  ASCII in the first segment, which is why it survived.
- Pretext's default whitespace mode collapses newlines into spaces, so
  paragraph breaks never fired and segment offsets drifted from the source.
  'pre-wrap' is what makes inline markup sound at all.

Also adds inline markup spans with rendered-width justification, sequential
column filling, honouring a container's own border and padding in the
measure, and paginate() so callers stop hand-rolling the page loop.

The look is unchanged by construction: the engine measures by reading
computed styles off a live element, so the paged renderer is handed the same
Tailwind classes React would use. One style vocabulary, not two.

Removes both dormant paged engines, the scrolling magazine article path and
the now-unused EditionFooter. Scrolling remains on the standalone article
route as a separate renderer.

Engine tests run in a real browser (canvas + computed styles), so they are
`task test:engine` rather than part of `task test`.
fix: repair the website and image builds after the paged reader
Some checks failed
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/compliance Pipeline was successful
ci/woodpecker/push/quality Pipeline was successful
Release / tag (push) Has been cancelled
Release / build (linux/amd64, ubuntu-24.04) (push) Has been cancelled
Release / build (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Release / merge (push) Has been cancelled
Release / release (push) Has been cancelled
Release / deploy (push) Has been cancelled
ci/woodpecker/pr/compliance Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
Deploy Website / build (push) Has been cancelled
Deploy Website / deploy (push) Has been cancelled
dd57eec20e
The marketing site imports app components by relative path, and the paged
migration deleted two of them — MagazineLayout and MagazineArticle — so the
Astro build failed to resolve them. `task check` only covered server and web,
which is why this reached CI rather than the working tree.

The interactive demo is now built on the real reader: articles are typeset
into pages by the layout engine exactly as they are in the app, so a visitor
turning pages on the marketing site is trying the product rather than a
mock-up of it. It opts out of keyboard turning, since arrow keys belong to
the page it is embedded in — a new `keyboard` prop on PagedSurface.

The demo captions promised arrow keys and Prev/Next buttons that no longer
exist; they now describe what the reader actually does.

Drops page-style-previews.tsx. It illustrated the Hero/Editorial/Compact
article variants, which no longer exist, and nothing imported it.

Also fixes two latent breaks in the image build: the Dockerfile enumerated
workspace manifests and didn't know about packages/layout-engine, and the
root tsconfig it extends was never copied in.

Adds apps/website to `task check` so a moved component fails locally instead
of in CI, which needed @astrojs/check and a cast for a pre-existing Vite
plugin type clash. Astro's generated .astro/ cache is now gitignored, since
running the check would otherwise dirty the tree every time.
Some checks failed
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/compliance Pipeline was successful
ci/woodpecker/push/quality Pipeline was successful
Release / tag (push) Has been cancelled
Release / build (linux/amd64, ubuntu-24.04) (push) Has been cancelled
Release / build (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Release / merge (push) Has been cancelled
Release / release (push) Has been cancelled
Release / deploy (push) Has been cancelled
ci/woodpecker/pr/compliance Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
Deploy Website / build (push) Has been cancelled
Deploy Website / deploy (push) Has been cancelled
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/paged-reader:feat/paged-reader
git switch feat/paged-reader

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/paged-reader
git switch feat/paged-reader
git rebase main
git switch main
git merge --ff-only feat/paged-reader
git switch feat/paged-reader
git rebase main
git switch main
git merge --no-ff feat/paged-reader
git switch main
git merge --squash feat/paged-reader
git switch main
git merge --ff-only feat/paged-reader
git switch main
git merge feat/paged-reader
git push origin main
Sign in to join this conversation.
No description provided.