Skip to content

feat(hub): connect read-only prototype details - #246

Merged
nshki merged 4 commits into
nshki/feat/hub/build-metadatafrom
nshki/feat/hub/prototype-detail-read
Nov 12, 2026
Merged

nshki merged 4 commits into
nshki/feat/hub/build-metadatafrom
nshki/feat/hub/prototype-detail-read

Conversation

@nshki

@nshki nshki commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Members can browse the real prototype index, but its cards lead nowhere. This connects each card to a read-only prototype page so members can see a prototype and its Builds before hosted previews and review exist.

What changes

Hub adds GET /api/repositories/:repositoryId/prototypes/:prototypeId for signed-in members. It returns the prototype, its Builds, and the latest successful Build. A build query pins another successful Build. A malformed, missing, or unsuccessful Build returns 404. Preview and screenshot URLs stay empty because Hub does not host Builds yet.

In real mode, index cards now open this page. It shows a "no preview" state and offers only successful Builds. Build history, Build details, and sharing links stay hidden until they work. Authors who signed in with another provider, such as Entra, appear by name without a GitHub link. Mock mode keeps its existing navigation.

Build author details come from the provider-neutral author_* columns added in #230.

Storybook screenshots

Hub/Pages/Prototype Review › Preview Hosting Unavailable (light theme, 1200×1279)

Prototype page showing "Build 3 has no preview" with a Build selector and no history or sharing actions

Hub/Pages/Prototype Review › Empty (light theme, 1200×1279; updated empty-state copy)

Prototype page showing "No successful Build yet" with the message "This prototype has no successful Build yet."

nshki and others added 2 commits November 12, 2026 14:32
Members can read one prototype with its Builds and a selected successful Build. Preview URLs stay empty until Hub hosts Builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
Index cards now open real prototype details. Unavailable history, Build detail, and sharing actions stay hidden in real mode, and non-GitHub authors are shown without GitHub links.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
@nshki
nshki requested a review from a team as a code owner November 12, 2026 22:35
Copilot AI dynamic review requested due to automatic review settings November 12, 2026 22:35
@nshki
nshki added this pull request to stack #247 November 12, 2026 22:35

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.

🟡 Changes recommended

Real detail pages still use mock sign-out and administrator links, and minimized mode can hide navigation without a restore control.

3 open issues
What changed in this PR

Connects Hub’s real repository index to read-only prototype details, using the provider-neutral Build metadata introduced in #230. Hosted previews and live review remain unavailable.

Changes:

  • Adds a member-only detail API with successful Build selection and invalid-selection handling.
  • Enables index-to-detail navigation, hides unavailable actions, and supports missing metadata and non-GitHub authors.
  • Adds API and frontend coverage, a no-preview story, and updated guides.
File Description
hub/​server/​routes/​index.ts Registers the prototype detail endpoint.
hub/​server/​routes/​api/​repositories/​prototypes/​show/​get/​index.ts Validates requests and rechecks membership.
hub/​server/​routes/​api/​repositories/​prototypes/​show/​get/​index.db.test.ts Covers selection, visibility, authors, and access.
hub/​server/​routes/​api/​product/​types.ts Adds the detail lookup dependency.
hub/​server/​routes/​api/​product/​create-product-route-dependencies/​index.ts Connects the detail lookup to Prisma.
hub/​server/​repositories/​prototype-index/​find-prototype-detail/​index.ts Reads prototype metadata and selects successful Builds.
hub/​docs/​frontend.md Documents real detail behavior and limitations.
hub/​docs/​development.md Updates the local browsing workflow.
hub/​docs/​architecture.md Records read-only detail availability.
hub/​client/​pages/​prototypes-show-page/​stories.tsx Adds the preview-unavailable story and updates empty copy.
hub/​client/​pages/​builds-show-page/​types.ts Allows unknown commit SHAs.
hub/​client/​pages/​builds-show-page/​index.tsx Displays a missing-commit fallback.
hub/​client/​pages/​builds-index-page/​types.ts Allows nullable history commit metadata.
hub/​client/​pages/​builds-index-page/​index.tsx Handles nullable commit tooltips.
hub/​client/​features/​prototype-workspace-header/​types.ts Supports optional history and explicit Build selection.
hub/​client/​features/​prototype-workspace-header/​index.tsx Updates selection and hides unavailable menu actions.
hub/​client/​application/​hub/​view-models/​repository-show-data/​index.ts Enables prototype card links.
hub/​client/​application/​hub/​view-models/​prototype-workspace/​index.ts Adapts author identity and Build navigation.
hub/​client/​application/​hub/​view-models/​prototype-show-data/​index.ts Filters real Build choices and hides unavailable actions.
hub/​client/​application/​hub/​view-models/​build-show-data/​index.ts Presents provider-neutral Build authors.
hub/​client/​application/​hub/​view-models/​build-history-data/​index.ts Handles unknown commits and provider-neutral authors.
hub/​client/​application/​hub/​screens/​repository-screen/​index.tsx Removes the detail-navigation restriction.
hub/​client/​application/​hub/​screens/​prototype-screen/​index.tsx Passes real-mode settings to the detail adapter.
hub/​client/​application/​hub/​routes/​real-prototype-index.test.tsx Covers real detail navigation and Build selection.
hub/​client/​application/​hub/​routes/​journey.test.tsx Extends mock navigation and author coverage.
hub/​client/​application/​hub/​requests/​get-prototype/​index.test.ts Expects 404 for invalid Build selections.
hub/​client/​application/​hub/​read-prototype-query/​index.ts Maps invalid Build queries to 404.
hub/​client/​application/​hub/​mocks/​create-mock-store/​index.ts Permits unknown authors in fixtures.
hub/​client/​application/​hub/​contracts/​index.ts Adds nullable metadata and stricter detail queries.

Review effort: Balanced (auto)

nshki and others added 2 commits November 12, 2026 14:57
Real prototype pages still used mock workspace navigation, so signing out did not end the Hub session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
The restore button only appears on a preview. Real Builds have no hosted preview yet, so a minimized link left members without navigation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 335a01a0-881c-4159-bcf9-5f19b9b66bd4
@nshki
nshki merged commit 21bbfc1 into build/hub/new Nov 12, 2026
47 checks passed
@nshki
nshki deleted the nshki/feat/hub/prototype-detail-read branch November 12, 2026 23:17
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.

2 participants