Skip to content

feat(hub): edit prototype metadata - #258

Merged
nshki merged 2 commits into
nshki/feat/hub/register-prototype-on-editfrom
nshki/feat/hub/edit-prototype-metadata
Nov 16, 2026
Merged

nshki merged 2 commits into
nshki/feat/hub/register-prototype-on-editfrom
nshki/feat/hub/edit-prototype-metadata

Conversation

@nshki

@nshki nshki commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Why

Prototypes need a description and a start page even before hosted previews are available.

What changes

Members can edit a prototype's name, description, and local start page through the API. Editing any of those fields registers a draft without replacing its Builds. Blank descriptions are cleared, and a missing start page uses /.

Storybook screenshots

No story presentation changes.

nshki and others added 2 commits November 14, 2026 07:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1bb10333-1d49-4426-896d-d9a04178b836
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1bb10333-1d49-4426-896d-d9a04178b836
@nshki
nshki added this pull request to stack #255 November 14, 2026 16:19
@nshki
nshki requested an adaptive review from Copilot November 14, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The interacting metadata API, draft-registration, cross-writer database constraint, and recursive path-validation changes require broader review of persistence and security contracts.

No open issues 🎉

What changed in this PR

Extends Hub’s prototype metadata API so members can edit descriptions and local start pages alongside names, before hosted previews are available. The frontend editor remains separate work.

Changes:

  • Supports partial metadata edits that register drafts while preserving existing authorship, registration history, and Builds.
  • Adds start-page validation, a / default, and database guards for metadata.
  • Adds API, migration, and seed regression coverage and updates the canonical guides.
File Description
hub/​test/​database/​prototype-metadata-migration/​index.db.test.ts Tests legacy cleanup and preservation of prototype and Build identity.
hub/​server/​utils/​trim-prototype-metadata/​index.ts Shares Unicode whitespace trimming.
hub/​server/​utils/​normalize-start-page/​index.ts Validates local paths, encoding, reserved routes, and byte limits.
hub/​server/​scripts/​seed-prototype-index/​seed-prototype-index-data/​index.ts Resets seeded start pages.
hub/​server/​scripts/​seed-prototype-index/​index.db.test.ts Tests metadata restoration when seeding again.
hub/​server/​routes/​api/​repositories/​prototypes/​show/​patch/​index.ts Accepts description and start-page edits.
hub/​server/​routes/​api/​repositories/​prototypes/​show/​patch/​index.db.test.ts Covers metadata edits, draft registration, and invalid inputs.
hub/​server/​repositories/​prototypes/​update-prototype-metadata/​index.ts Supports partial metadata updates.
hub/​server/​repositories/​prototypes/​lock-editable-prototype/​index.ts Reads names needed for draft registration.
hub/​server/​repositories/​prototype-index/​find-prototype-detail/​index.ts Returns saved start pages or /.
hub/​server/​domains/​prototypes/​edit-prototype-metadata/​index.ts Validates edits and registers drafts on their first metadata edit.
hub/​schema/​prototype.prisma Adds optional start-page storage.
hub/​schema/​migrations/​20261114150000_prototype_metadata/​migration.sql Adds the column, cleans legacy blanks, and enforces database guards.
hub/​docs/​frontend.md Documents the metadata API and frontend limitations.
hub/​docs/​database.md Documents metadata storage invariants.
hub/​docs/​architecture.md Updates the supported API capabilities.
hub/​AGENTS.md Updates Hub’s documented metadata-editing scope.

Review effort: Balanced (dynamic)

@nshki
nshki marked this pull request as ready for review November 16, 2026 15:34
@nshki
nshki requested a review from a team as a code owner November 16, 2026 15:34
@nshki
nshki merged commit 35db0d6 into build/hub/new Nov 16, 2026
51 checks passed
@nshki
nshki deleted the nshki/feat/hub/edit-prototype-metadata branch November 16, 2026 17:48
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.

3 participants