Skip to content

Let the editor build a site of several pages - #427

Merged
singhharsh1708 merged 2 commits into
mainfrom
feat/editor-pages
Oct 3, 2026
Merged

singhharsh1708 merged 2 commits into
mainfrom
feat/editor-pages

Conversation

@singhharsh1708

Copy link
Copy Markdown
Owner

Finishes #412. The exporter could write a site of several pages since #426; now someone can make one.

A page bar sits above the sections list. Plus adds a page and opens it ready to be named, clicking the open page renames it, clicking another opens it, and the cross deletes one after a confirm. The home page cannot be deleted and keeps index.html whatever it is renamed to, because that is the file every host looks for. Addresses stay unique on their own: a second page called About becomes about-2, and a page named 404 or frames steps around the file the export already writes.

The rules live in editorPages.ts as pure functions over a generic section type, so the editor's stricter shape and the exporter's both use them without casting, and they are tested without rendering anything.

Pages persist where the rest of the work does: the saved document carries them, and the project file does too. The file format goes to version 2, and a version 1 file still opens as a single home page.

Verified on a production build by driving the editor in Chrome: added a page, renamed it to Contact, gave it its own heading, switched back and confirmed Home still had its own, exported, and the ZIP held index.html and contact.html. Opened that ZIP from a folder with no server: the nav lists both pages and clicking Contact lands on contact.html with the heading typed into it. Reopened the editor cold and both pages came back from IndexedDB. At 390 wide the bar wraps with nothing off screen and no sideways scroll. Page tabs measure 6.91:1 active and 6.35:1 inactive. No console errors anywhere in that run.

One existing test pinned the exact line that destructures the export response, which now also takes pages. It asserts the same intent against the shape instead: the client takes the audio extension from the server rather than guessing it twice.

tsc and eslint clean, vitest 666 of 666.

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scrollcraft Ready Ready Preview Oct 3, 2026 9:42am UTC

@singhharsh1708
singhharsh1708 merged commit 6828fb2 into main Oct 3, 2026
3 checks passed
@singhharsh1708
singhharsh1708 deleted the feat/editor-pages branch October 3, 2026 09:43

This branch was successfully deployed

1 active deployment
Preview — 1e37a97f Deployed Oct 3, 2026 by vercel[bot]
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