# Krafthub — Landing page v2

Updated 15 November 2026 (automatic paid/organic feed selection, campaign eligibility and sponsor disclosure). React / TypeScript editorial landing-page preview at `/landing-page-v2/`, linked from Frontend Previews. The original `/frontpage-frontend/review.html` remains available.


## Automatic feed delivery — 15 November 2026 (current)

See [FEED-RULES.md](FEED-RULES.md) for the complete product rules, implementation, tests and server integration contract. Automatic discovery in Inspo and Projects uses at most one paid post per five, four organic posts before/between ads, ten-position advertiser spacing, per-feed creative deduplication, eligibility checks, relevance and stable session rotation. Insufficient inventory never relaxes the caps. Explicit text Search and Saved retrieve requested matches without inserting extra ads.

Paid placements require explicit eligible campaign data, an identified sponsor and a valid buying destination. Their lime bottom-right icon, purchase action and **Sponsored · [Brand]** disclosure use the same eligibility decision. Organic posts keep their material relationships in data but have no shopping CTAs or commercial material links in these views. Distinct creator credits stay visible; matching sponsor/creator credits are combined.

Both Sagene stories and the hero remain non-shoppable and unlabelled, retaining their Craftmode demo actions. The candidate fixtures now contain fourteen organic stories and three illustrative Permin campaigns. The default feed serves fourteen organic posts and two paid placements; one paid candidate is deferred. These are demo campaigns and product pairings, not actual paid endorsements.

The React/TypeScript selector and visual behavior are implemented here. Production campaign/payment/availability validation, feed APIs, analytics and billing remain server integrations; a client cannot establish verified payment. The former automatic catalogue-owner sponsor mapping is removed. Patterns, Yarn and Needles catalogue tabs remain outside this implementation scope.

## Handoff details — updated 15 November 2026

The automatic delivery rules above supersede the earlier all-shoppable sample feed. Other retained details follow.

### 1. Sale-link rule

Only eligible paid campaigns show shopping actions in Inspo and Projects. `saleLinkFor` resolves a genuine catalogue/product destination; `paidPlacementFor` additionally validates campaign data. A product reference alone is not proof of paid placement. `demoLinkFor` keeps Craftmode separate from commerce. Organic Craft, Tutorials and Inspire uploads may be unconnected and do not create campaigns.

The feed's shopping icon and the detail purchase button open the same primary connected item. Other materials are shown in the paid detail's compact connected-materials section. Organic stories have a Save action and any non-shopping Craftmode demo action; catalogue relationships are preserved in their underlying records.

### 2. Sample content

Seventeen eligible sample candidates comprise fourteen organic stories and three illustrative campaigns (Golden hour, A softer palette and In full colour). Permin is explicitly assigned as the advertiser in these fixtures. The same-advertiser cooldown permits only two of these three campaigns in the current unfiltered Inspo sequence. Product pairings with the three catalogue records remain demonstrations, not claims about the garments photographed or actual paid endorsements.

Both Sagene stories are non-shoppable Craftmode examples. “Think bigger” has no verified tool record and remains excluded from discovery through `discoveryHidden`; its Needles catalogue card is unchanged. The Permin pattern destination is `https://www.krafthub.art/en/pattern/cardigan-med-brede-rmer`; the existing yarn URLs are retained.

### 3. Hero

The “Sponsored · demo placement” label on the hero video was a design slip and is removed. The hero is not a sponsored placement. The Sagene feed cards and their details also remain unlabelled because Sagene is not shoppable.

### 4. Open decision — one Upload + button, two meanings

On krafthub.art today, Upload + leads to selling patterns with the structured editor, sharing resources, and importing a yarn or needle catalogue. In this package, Upload + creates Inspo posts only and rejects new products and PDFs. Before V2 replaces the live button, decide how a supplier or designer reaches the existing routes: either add them to this chooser or keep a separate entry. This package does not change the chooser.

### 5. Feed order

Feed selection runs before editorial chapters are planned. The default mixed sequence has sixteen posts with paid positions five and fifteen. Chapter boundaries and full-width images follow the existing media-ratio rules; Load more reveals the already-selected sequence without reranking it.

### 6. Detail view fits the viewport (Inspo and Projects)

Opening a post no longer requires scrolling. The four stacked buttons are replaced by one lime sale button (“Buy this pattern / yarn / tool”, or the first-party link) with an icon-only Save beside it. Further connected items are reached from their compact rows under “Connected materials”; each row links to the item. The “Explore …” buttons and the in-dialog “Details & instructions” disclosure are removed from this view, since the item page holds that information. `ConnectedMaterials` takes a `compact` prop; the upload flow still uses the full version.

- Portrait and square stills: media left, details right, dialog height `min(100dvh − 48px, 760px)`.
- Films and landscape media keep the wide layout: complete media above, text and materials side by side below.
- Mobile: media scales down (never cropped) so title, materials and the sale button stay visible; tags and the illustrative note are hidden, and the description is clamped to two lines.
- The description is clamped to three lines on desktop. The body keeps `overflow:auto` only as a safety net for long uploaded posts (project metadata, shared catalogue specifications), which can still scroll.
- Styles are scoped to `.detail-fit`, applied only to Inspo and Projects. Checked for all sample posts at 1440×900, 1280×720, 900×1000, 375×667 and 360×640: no scrolling and nothing clipped.

This supersedes the older “Opened Inspo media” and “Bounded image previews” sizing notes below (70dvh / 720px), which described the scrolling layout.

## Implementation and deployment scope — 14 November 2026

**Implement only the Inspo and Projects tabs in this delivery.** Patterns, Yarn and Needles/hooks beside Inspo are **out of scope**. Their presence in this preview is navigation context, not approval to implement, redesign or replace those catalogue tabs.

- Preserve the existing production Patterns, Yarn and Needles/hooks routes, screens, data, search/filter behavior and purchase flows. Do not deploy the V2 catalogue demo cards or fixture data into them.
- Scope new feed, card, detail-view and mobile-media styles/interactions to Inspo and Projects. Reuse shared navigation without changing the excluded tabs; verify them for regressions before release.
- Existing pattern, yarn and tool links/material relations within Inspo or Projects remain in scope as connections to the existing catalogue. They do not expand this delivery into catalogue implementation or new material uploads.
- The Upload + publication rules below remain unchanged: an Inspo upload appears in Inspo and the owner's profile Inspo tab, not automatically as a new Project or catalogue record.

This scope note takes precedence over the broader inventory of demonstration features below.

## Run and build

React 18.3.1, strict TypeScript 5.8.3 and esbuild 0.25.5, matching the existing designer-onboarding preview. All UI is rendered through React components; there is no HTML-string rendering or delegated global click handler.

From `landing-page-v2/`:

```sh
npm ci
npm run build
npm test
```

`npm run typecheck` runs TypeScript separately; `npm run format` formats source. The build emits `app.js` and `index.html` with content-based cache keys. Both are included so the preview can also run without installing dependencies. Serve the extracted ZIP root over HTTP, then open `/landing-page-v2/`. For example, run `python3 -m http.server 4173` at the extracted root. Sibling image, video and font files are included. Links to other preview journeys require the full Frontend Previews site.

## Source map

- `src/main.tsx`: React root and StrictMode.
- `src/App.tsx`: discovery state, tab-specific views, search, filtering, saved ideas and dialog selection.
- `src/components.tsx`: header, hero, feed cards, filter panel, detail dialog and footer.
- `src/media.tsx`, `src/hooks.ts`: managed video components, visibility/playback coordination and measured responsive feed layout. DOM refs are limited to focus, native dialog/video lifecycle and geometry; React owns content and interaction.
- `src/data.ts`, `src/types.ts`: typed sample content, category definitions, editorial crop/feature hints and interfaces.
- `src/discovery.ts`: pure search/filter/sort matching and safe local bookmark loading.
- `src/editorial-layout.ts`: deterministic card sizing and staggered placement, independent of React and the DOM.
- `styles.css`, `local-v2.css`, `tokens.css`: component styling and responsive editorial rules. ES Allianz, black/white, lime and purple follow the supplied design manual.
- `verify.mjs`: responsive packing and discovery behavior checks.
- `assets/`, `ASSET-CREDITS.md`, `DESIGN-REFERENCE.md`: local media, provenance and supplied design guidance.

## Page and interactions

The discovery feed leads directly to the footer. The closing star, “Good things…” copy, “Find it. Love it. Make it yours.” heading and yarn-shop CTA have been removed.

- Compact lime `Upload +` button, Menu and centered logo. Hero heading “CRAFT, CONNECTED” retains the introductory H2/H3 copy. Sagene title and underlined Andrea Dahlin credit are white inside the video.
- Designer credit links to `https://www.krafthub.art/en/profile/andrea`; purple Craftmode CTA links to `https://www.krafthub.art/en/craftmode/demo`.
- One inset black divider introduces sticky discovery controls beneath the 80px desktop / 64px mobile header. Inspo, Patterns, Yarn, Needles and Projects pills use black for the active selection.
- Search sits beside pills on desktop and underneath on mobile. Its 1px warm-gray border becomes black on focus without a size change. Typing filters immediately. Enter/search scrolls to discovery. Clear and Escape clear only the query and retain filters/focus.
- Inspo has no sorting control. Gray text-only Filters and Saved sit below the sticky controls. Query persists across categories; each category retains filters, sort, loaded count and scroll offset for the session.
- Filters use OR within a group and AND across groups. Empty results offer a reset.
- Saved ideas persist on this device under `krafthub-landing-v2-saved`. Bookmarks are white with a black outline and no surrounding box; active bookmarks are lime.
- Images/titles open a native dialog with Escape, contained focus and focus return. Details pause feed videos. Product/project stories are illustrative; no purchase occurs.
- Videos are muted and looping, with at most one managed video playing per document. Offscreen and hidden-document videos pause. Reduced-motion users can explicitly start playback.

## Editorial catalogue layout

Inspo combines mixed-height image stacks with occasional full-width landscape films and stills. Each composition starts on a shared top edge; its columns finish on a shared bottom edge before the next full-width feature. Square media edges, restrained captions and the existing page margins are retained.

`planEditorialCards` automatically places a full-width landscape image or video after nine regular cards (the 10th post). If that position is portrait, square, text-only, or lacks verified source dimensions, keep it as a regular card and use the next eligible landscape post without reordering or duplication. Restart the nine-card count after each feature. A run without a landscape item still closes a composition after twelve regular cards, but does not reset the full-width cadence. The sample opening uses nine smaller stories followed by a full-width knitting film. Search, filters and saved-only views restart the count within their matching feed; fewer than ten results have no full-width feature. This replaces manual editor-approved feature flags.

The first spread uses four desktop columns. Five-to-seven-story desktop spreads use a wider centre column across two tracks, flanked by narrower columns. Tablet uses three columns and mobile uses two. A bounded composition search assigns stories to column stacks while preserving order within each stack and minimizing height differences. Measured caption heights remain fixed; media heights adjust proportionally to bring the columns to a shared baseline. Typography tiles retain a measured minimum height. Automatically selected landscape features span the full content width on every viewport.

Gutters remain 24px desktop, 18px tablet and 12px mobile. The reference needle image is cropped to its photo region even when its card proportions change. Full-width features retain bookmarks, details, visible credits and muted video playback/pause behavior.

Pagination reveals complete chapters from the selected mixed feed. The nominal initial budget is twelve items. Earlier chapters keep their geometry when more content is revealed. Search and filters create a new matching sequence; renders never reroll the session rotation or reset delivery counters per chapter.

Regular-card crops live in `editorialHints`, separate from product-card proportions. `FeedItem.mediaRatio` records the original main image/video width divided by height; a finite value greater than one is landscape. Full-width features use that source ratio, not a portrait card crop. Uploads use the main image or video dimensions (a video cover does not change eligibility); catalogue shares inherit the original cover ratio. The static examples use measured asset dimensions. This is local presentation logic, not a recommendation backend. Production must supply verified source dimensions and keep the cadence across API pagination, then reset it for a newly filtered feed. Other categories retain their existing product cards.

## Sponsored placements

See the 15 November automatic feed rules above and FEED-RULES.md. In Inspo and Projects, the lime tag replaces the gold frame and links to the post’s buying destination. The top-right hero remains unlabelled.

## Upload flow

**Latest decision — 14 November 2026:** see [FRONTEND-NOTES.md](FRONTEND-NOTES.md). Uploads appear only in Inspo and, in production, the uploader’s existing profile Inspo tab. Materials → Pattern / Yarn / Needles/hooks shares an existing catalogue item owned by the uploader (or an organisation they are authorised to publish for), with its pictures, metadata and Buy button. No new product or PDF upload is offered. The older Projects publication behavior described in earlier revisions is superseded. Owner-profile integration and real Views/Clicks are frontend/backend follow-up work, not simulated counters.

The new entry reproduces the live krafthub.art button: lime #CEFF1A, black 12px/600 text, 8px 16px padding, 32px height and full pill radius. The existing white V2 header is preserved. On mobile (up to 767px), Upload becomes a 40px filled lime circle (36px on the narrowest screens) with only a black +, immediately before Menu in the left header group. The logo remains centered, and the button retains its accessible Upload label and existing dialog behavior. `/landing-page-v2/?upload=1` opens the chooser directly.

| Group | Routes | Content |
| --- | --- | --- |
| Craft | Knitting / Crochet | Up to five project images and progress |
| Materials | Pattern / Yarn / Needles/hooks | Select owned Krafthub item → optional caption → preview with pictures, metadata and Buy button |
| Tutorials | Image / Video / Text | Images, MP4/WebM, or a written technique |
| Inspire | Image / Text | Image gallery or an editorial text post |

Craft, Tutorials and Inspire proceed through Content → Details → Preview → success. Materials proceeds through Select item → Caption → Preview → success, using the original catalogue pictures and metadata with Buy this pattern / Buy this yarn / Buy this tool linking to Krafthub. Images support main-image selection and removal; videos accept one file. The main image, thumbnail strip and small add-image control fit together on a 375 × 667 viewport. Originals remain uncropped in the uploader, post preview and detail; only the selected main image is cropped for the editorial Inspo tile. No artificial image padding is added to the preview.

Images are limited to 20 MB, video to 100 MB, and text to 5,000 characters. File type, size and image/video readability are checked. Pattern PDFs are rejected. Title and craft are required, and tutorials require explanatory text.

“By” links to the uploader, separately from an optional linked creator credit. `CreatorPicker.tsx` offers keyboard-accessible sample profile suggestions. Real authentication and the complete creator directory remain integration work.

`catalogue.ts` contains three real Krafthub product references from the existing request-order catalogue snapshot: Permin 93995, Kamma 9902050 and Angel 9902026. `connections.tsx` supplies the selector and shared thumbnail/detail rows. Search matches name, supplier or product number. Connected items render Pattern → Yarn → Needles/hooks, independent of selection order. Covers, identifiers, published specifications and canonical item links are retained; full pattern instructions remain on the original pattern behind its normal access flow. No material creation, replacement PDF or material-image upload is offered. No verified tool record is available in this snapshot, so that category shows an empty state. Older editorial placeholder IDs require removal and reselection before saving an edit.

Craft posts retain progress, type, size and yarn/tool notes, and can display Yarn connected when an actual yarn reference is selected. All ten active routes create Inspo posts only. The same record is intended for the owner’s profile Inspo tab; see FRONTEND-NOTES.md for that separate integration and owner-only Views/Clicks requirements. No uploaded post is added to Projects or product catalogues.

Owned posts expose Edit post. Saving retains the same ID, owner and creation time; Cancel discards edits. Legacy material records remain readable, but legacy file-based material drafts cannot resume and product creation is blocked. New catalogue-share drafts resume with a fresh content-ownership check; their optional caption and eligible selected item can be edited. Loss of ownership or organisation permission blocks publication and editing. These compatibility records do not reintroduce upload options.

`upload-storage.ts` stores local drafts and File blobs in IndexedDB (`krafthub-upload-preview-v1`, stores `drafts` and `posts`). New posts atomically remove their corresponding draft and appear first in Inspo. Edits replace the same record. Object URLs are revoked on replacement/unmount. This remains a device-local frontend demonstration: no content is sent to krafthub.art or other users. Live catalogue search, server persistence, authenticated ownership, profile feed integration, engagement tracking, moderation and media processing must be connected in production.

## Integration boundaries

Sagene film, fashion/product stills, logo, fonts and needle reference come from existing Krafthub previews. Hands-knitting film is by Vlada Karpovich and yarn-study film by Pavel Danilyuk, from Pexels; see `ASSET-CREDITS.md`. Stock films do not imply endorsements. Trial fonts are inherited from the supplied design manual; production licensing must be established separately.

Project stories and pairings are examples. “Sponsored · demo placement” is illustrative. Production integration must supply canonical content/product/designer IDs, verified media rights, real pattern/material relationships, authenticated bookmarks, moderation, sponsorship data, catalogue search and commerce destinations.

## Validation

Latest: the automated checks also assert that every sample post shown in Inspo and Projects resolves to a `https://www.krafthub.art/` sale link, that unconnected samples are excluded, that preview links and unknown IDs do not qualify, and that crafter uploads remain exempt pending the open decision. Browser checks on 1440px and 375px confirmed 17 of 17 feed posts carry a visible sale link, the hero has no sponsor label, and there are no console errors.

Strict TypeScript checking and the production build pass. Automated checks cover 200 responsive composition cases: bounds, no overlap, minimum gutters, automatic 10th-post landscape features, delayed eligible posts, media eligibility, aligned chapter endings, deterministic geometry and stable complete-chapter pagination. Discovery checks cover search, filters, curated order, category separation, sorting and saved-only results. Additional checks cover all ten active post routes, missing-content/title validation, upload types and size limits, feed conversion and newest-first local posts.

Browser checks cover desktop and mobile rendering, live search/empty results, black focus outline, query clearing without losing filters, tab-state restoration, saves, detail opening/closing and focus return, one managed video at a time, and unchanged prior positions after loading more.

Upload browser checks cover desktop and 375px mobile chooser/content/details, missing-content/title/craft feedback, saving and resuming a text draft after reload, local post persistence, related-material navigation, two-image selection and cover order, image-blob draft persistence, gallery navigation, MP4 metadata and preview, PDF attachment, and local post removal. Updated checks verify a complete uncropped image and add control within the mobile viewport, keyboard creator selection, separate uploader/creator links, Pattern → Yarn → Needles/hooks ordering, project metadata and Yarn connected badge, editing without duplication, and persistence after reload. Pure checks also cover creator validation, ownership, preserved image ratios and project search metadata.

Latest validation additionally covers catalogue-only IDs, unavailable references, blocked material/PDF routes, real cover images, Pattern/Yarn ordering, original-item links, and no uploaded posts in Projects. Historical PDF/material-upload checks describe earlier versions only and are superseded by the active restrictions.

`src/CatalogueShare.tsx` owns the existing-item selector, product metadata/purchase instructions and post preview. `catalogueItemId` binds the post to the canonical reference. The poster can change their caption or choose another existing item; source product fields remain authoritative. Tests cover missing/wrong-type references, prohibited files, inherited images/metadata/purchase links, optional captions, and stable edit IDs.

## Materials content ownership — 14 November 2026

Materials search only returns catalogue content owned by the authenticated uploader or an organisation they have explicit publishing permission for. Buying, stocking or linking an item does not qualify. Canonical `ownerProfileId` and the trusted publisher context are checked again by validation and post creation/editing; draft uploader and creator-credit fields cannot grant access. Craft/Inspo related-material connections remain available across the catalogue.

The demonstration uploader has no catalogue ownership, so Materials shows an empty state; the three existing catalogue examples belong to the Permin preview profile. The owner and organisation success paths are covered by automated checks. Production must replace these fixtures with authenticated identity, canonical ownership and server-enforced create/update permission checks, including transferred ownership and revoked membership. See FRONTEND-NOTES.md for the integration contract.

### Latest tutorial — landscape experiment

The regular V2 URL now features the newest uploaded tutorial as a full-width 16:9 feed crop after nine cards, so “Cast on” does not require a special tryout URL. It resolves the tutorial from the same browser used for uploading. The compatibility link `?preview=latest-tutorial-landscape` still works; Original layout uses `?preview=original-layout` to compare. Originals, source dimensions, ownership and saved posts remain unchanged. This preview-specific experiment is separate from the production every-tenth eligible landscape rule.

### Opened Inspo videos and landscape images

Open these in a wide single-column dialog: complete media above, left-aligned metadata and all existing creator/material/edit actions below. Square and portrait stills keep the existing detail layout. Media uses natural proportions; the 16:9 tutorial crop applies only to its feed card. No new persistence or backend changes.

### Bounded image previews — desktop and mobile

Center still images within the available preview width and a maximum height of 70dvh, capped at 720px. Scale proportionally, without cropping uploaded images or stretching small images. The existing “Think bigger” needle-photo extraction is retained in a centered square of the same maximum size. Apply only to Inspo/Projects details and the Inspo upload preview; preserve the excluded catalogue tabs. Videos and editorial feed crops retain their existing behavior.

### Product actions must open the actual connected item

Within Inspo and Projects, Explore pattern / yarn / needles and Buy actions resolve from the post's canonical catalogue references. Each action names the item and supplier/designer, and opens that exact item's Krafthub detail/purchase route. Creator-profile links remain separate. Do not route these actions to a category tab, advertisement preview or an unrelated item. Retain the existing production catalogue pages; this does not expand the tab implementation scope.

Under the sale-link rule above, a post with no resolvable item is not shown in Inspo or Projects. Missing, deleted or unresolved item references inside an otherwise connected post show an unavailable state with no active product action. Authors must select the real catalogue record. The current snapshot has verified identities for Permin 93995, Kamma 9902050 and Angel 9902026; editorial samples such as “Think bigger” have no verified Krafthub tool ID and must not be assigned an invented link. Production must supply canonical IDs, current URLs and creator/supplier relations from the catalogue service. The preview does not claim live price, stock or current public accessibility.
