|
| 1 | +--- |
| 2 | +name: prototype-contributor |
| 3 | +description: >- |
| 4 | + Guides designers through contributing to the OpenShift UX design repo (hub |
| 5 | + listings, manifests, hpux-prototypes embeds, MRs). When the user says |
| 6 | + "I need to add to the design repo", start by asking the intake questions |
| 7 | + below before editing files. Also use for "add a prototype", "register my |
| 8 | + prototype", "update the hub", "update the manifest", "set up my branch", |
| 9 | + "how do I contribute", or "open an MR" for this repository. |
| 10 | +--- |
| 11 | + |
| 12 | +# Prototype contributor |
| 13 | + |
| 14 | +Help designers contribute to this design repository. **Prefer a short question-and-answer intake** so you know whether work is **new** or an **update** before you touch the tree. |
| 15 | + |
| 16 | +## Intake: start here when they add to the design repo |
| 17 | + |
| 18 | +When the user says **"I need to add to the design repo"** (or equivalent), **do not jump straight to edits.** Run through this intake, **one or a few questions at a time** so it stays conversational. Summarize answers before implementation. |
| 19 | + |
| 20 | +### Step 0 — Branch sanity |
| 21 | + |
| 22 | +Confirm they are on a branch (not `main`), or offer: `git checkout main && git pull && git checkout -b name/short-description` — see **Branch conventions** below. |
| 23 | + |
| 24 | +### Step 1 — New or update? |
| 25 | + |
| 26 | +Ask: |
| 27 | + |
| 28 | +1. **Is this a brand-new listing/prototype in the hub, or an update to something already listed?** |
| 29 | + |
| 30 | +### If **update existing** |
| 31 | + |
| 32 | +Ask (skip what they already answered): |
| 33 | + |
| 34 | +2. **Which entry?** — hub card title, `jiraKey`, team page, `prototypeUrl`, or path under `hpux-prototypes/`. |
| 35 | +3. **What changes?** — hub manifest only (`prototypes.manifest.json`), prototype code/assets, embed URL, copy/metadata (title, persona, Jira link), or several of these. |
| 36 | +4. **Jira** — does the ticket / fixVersion / workflow status need refreshing on the card? Run **`npm run sync:jira-manifest`** from `hub/` after manifest edits (needs `~/.jira-token`). |
| 37 | + |
| 38 | +Then: locate the manifest entry (and code paths if any), apply edits, bump `updatedAt`, run checks from **Running locally** if relevant, draft commit + MR notes. |
| 39 | + |
| 40 | +### If **brand new** |
| 41 | + |
| 42 | +Ask (skip what they already answered): |
| 43 | + |
| 44 | +2. **Product area** — which UX lane? (`teamId` must match an `id` in `teams` *or* `crossProducts` in the manifest, e.g. `rbac` for RBAC cross-lane listings; if missing, flag that a team or cross-product block may be needed first — coordinate maintainer / Matt per **When to ask for help**.) |
| 45 | +3. **Card title** — should match the linked Jira issue **`summary`** (hub cards mirror the ticket title). |
| 46 | +4. **What they’re shipping** — e.g. PatternFly prototype under `hpux-prototypes/` (embed link), static/site URL, OME/OSAC-style embed route, or **manifest-only** until hosted (`prototypeUrl: null`). |
| 47 | +5. **Jira** — real issue key and `https://redhat.atlassian.net/browse/…` or `https://issues.redhat.com/browse/…` (avoid using registry slugs as `jiraKey` when a real ticket exists). |
| 48 | +6. **Persona** (optional) — one line for the card; use **admin** not **administrator** per team wording norms. |
| 49 | +7. **Author** — full name; **updatedAt** — `YYYY-MM-DD` for today or last meaningful change. |
| 50 | + |
| 51 | +Then: add the `prototypes` entry (and register in hpux or wire URL/embed as needed), follow **Manifest structure** and repo layout, draft commit + MR. |
| 52 | + |
| 53 | +### After intake |
| 54 | + |
| 55 | +- Confirm **manifest path**: `hub/src/data/prototypes.manifest.json`. |
| 56 | +- For **hpux** screens: `hpux-prototypes/` app + registry; embed pattern `/embed/hpux-prototypes?prototype=<id>` when relevant. |
| 57 | +- Point to **Contributor guide** in the hub (`/contributing`) for long-form context. |
| 58 | + |
| 59 | +## Repo orientation |
| 60 | + |
| 61 | +This monorepo powers the **OpenShift UX Prototypes** hub (`hub/`). Listings are driven by: |
| 62 | + |
| 63 | +``` |
| 64 | +hub/src/data/prototypes.manifest.json |
| 65 | +``` |
| 66 | + |
| 67 | +PatternFly/console-style demos often live in **`hpux-prototypes/`** and are embedded from the hub. JTBD/research links for the home page live under `resourceLinks` in the same manifest. |
| 68 | + |
| 69 | +Designers typically: work on a branch → change prototype and/or manifest → commit → open MR. |
| 70 | + |
| 71 | +## Branch conventions |
| 72 | + |
| 73 | +Create branches as: `name/short-description` |
| 74 | + |
| 75 | +Examples: |
| 76 | + |
| 77 | +- `joy/acm-cluster-overview` |
| 78 | +- `ethan/sovereign-cloud-onboarding` |
| 79 | +- `mansur/acs-vulnerability-dashboard` |
| 80 | + |
| 81 | +Branch from default (usually `main`): |
| 82 | + |
| 83 | +```bash |
| 84 | +git checkout main && git pull |
| 85 | +git checkout -b your-name/description |
| 86 | +``` |
| 87 | + |
| 88 | +## Folder structure (high level) |
| 89 | + |
| 90 | +- **`hub/`** — prototype hub site (Vite), manifest under `hub/src/data/`. |
| 91 | +- **`hpux-prototypes/`** — shared PatternFly seed; prototypes under `src/app/prototypes/` with registry entries. |
| 92 | + |
| 93 | +Group by feature or flow, not sprint folders. |
| 94 | + |
| 95 | +## Running locally |
| 96 | + |
| 97 | +From `hub/`: |
| 98 | + |
| 99 | +```bash |
| 100 | +npm ci # first time or after dependency changes |
| 101 | +npm run sync:jira-manifest # pull Jira status + fix versions into the manifest (needs ~/.jira-token) |
| 102 | +npm run dev # local server with hot reload |
| 103 | +npm run build # production build → dist/ |
| 104 | +``` |
| 105 | + |
| 106 | +From `hpux-prototypes/` when editing embeds: use that package’s README/scripts (webpack build is wired via hub `build:hpux` when needed). |
| 107 | + |
| 108 | +## Manifest structure |
| 109 | + |
| 110 | +Append to `prototypes` (and optionally `teams`). Example: |
| 111 | + |
| 112 | +```json |
| 113 | +{ |
| 114 | + "teamId": "acs", |
| 115 | + "title": "[UX Spec] Show vulnerabilities by namespace view", |
| 116 | + "persona": "Security analyst", |
| 117 | + "author": "Mansur Syed", |
| 118 | + "updatedAt": "2026-04-28", |
| 119 | + "jiraKey": "ROX-22407", |
| 120 | + "jiraUrl": "https://redhat.atlassian.net/browse/ROX-22407", |
| 121 | + "prototypeUrl": null |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +**Common fields:** `teamId`, `title` (Jira summary), `author`, `updatedAt`, `jiraKey`, `jiraUrl` (browse URL for the same issue), `prototypeUrl`. Optional: `description`, `persona`. **Do not** add manual `status` / `release`; run **`npm run sync:jira-manifest`** to fill `jiraIssueStatus` and `jiraIssueRelease`. If `jiraKey` / `jiraUrl` are missing or invalid, the hub shows a **Jira ticket needed** warning on the card. |
| 126 | + |
| 127 | +Valid **`teamId`** values come from the manifest `teams` array (`acs`, `acm`, `virtualization`, …) **or** a `crossProducts` `id` when the prototype belongs on a cross-lane listing (e.g. **`rbac`** for ACM RBAC fleet/tenant/empty-state builds). New product areas need a `teams` entry and icon from `hub/src/iconImports.tsx`; cross-lanes are already defined under `crossProducts` and use the hub route `/cross-product/<id>`. |
| 128 | + |
| 129 | +## Fullscreen embed versions (hub top bar) |
| 130 | + |
| 131 | +All hub **fullscreen** prototype tabs (`/embed/…`) show a **version control** on the right of the top bar, next to the back link. If only one build exists, the UI shows the text **Latest version** (read-only). If multiple builds exist, it is a dropdown. |
| 132 | + |
| 133 | +### When you ship a new hpux-prototypes iteration (same feature, new registry folder) |
| 134 | + |
| 135 | +1. Add or copy the prototype under `hpux-prototypes/src/app/prototypes/<id>/` and register it in the app registry (same as today). |
| 136 | +2. In **`hub/src/App.tsx`**, find `HPUX_PROTOTYPE_VERSION_GROUPS`. Either: |
| 137 | + - **Add a row** to an existing group’s `versions` array (put the newest first; label it with `(latest)`), or |
| 138 | + - **Create a new group** with `backTo`, `backLabel`, and `versions` if this is a new multi-build feature. |
| 139 | + - *Existing groups:* Observability alerting (`shiri-alerting-ui-v2` / `shiri-alerting-ui`) and RBAC cross-lane (`fleet-admin-rbac`, `fleet-admin-rbac-v1.1`, `tenant-admin-access`, `acm-empty-states`) — embed “back” goes to `/cross-product/rbac`. Extend those lists when you add siblings; don’t duplicate the in-iframe toolbar (it was removed from `hpux-prototypes`). |
| 140 | +3. Update **`hub/src/data/prototypes.manifest.json`**: one card per feature is preferred when versions are grouped — set `prototypeUrl` to `/embed/hpux-prototypes?prototype=<id>` using the **default (latest)** registry id, refresh title/description, bump `updatedAt`, adjust `jiraKey` / `jiraUrl` if needed, then run **`npm run sync:jira-manifest`**. |
| 141 | +4. Run hub locally and confirm the embed: back link, dropdown labels, and iframe all match. |
| 142 | + |
| 143 | +### Other embed families (not hpux-prototypes) |
| 144 | + |
| 145 | +- **RHACS** (`/embed/rhacs-ux-prototypes`): surfaces are listed in `RHACS_EMBED_VERSION_OPTIONS` in `App.tsx`; add or reorder there if a new surface should appear in the dropdown. |
| 146 | +- **OME** (`/embed/ome/:mode`): modes are in `OME_EMBED_VERSION_OPTIONS`. |
| 147 | +- **Single-build embeds** (OCP5, list-filter, OSAC, …): no code change when there is still only one build — the bar already shows **Latest version**. |
| 148 | + |
| 149 | +## Committing and pushing |
| 150 | + |
| 151 | +```bash |
| 152 | +git add . |
| 153 | +git commit -m "Add vulnerability dashboard prototype for ACS" |
| 154 | +git push -u origin your-name/description |
| 155 | +``` |
| 156 | + |
| 157 | +Commit messages: short, state **what** changed. |
| 158 | + |
| 159 | +## Opening a pull request |
| 160 | + |
| 161 | +Coach them to include: |
| 162 | + |
| 163 | +1. **What** — one sentence on what the design/prototype shows |
| 164 | +2. **Why** — Jira or design question |
| 165 | +3. **Screenshot or preview link** — so others can scan the PR without running everything locally |
| 166 | + |
| 167 | +**Merge policy:** no required approvers — they can merge when ready (after CI passes if the pipeline is configured). Optionally @mention the area maintainer from manifest `teams` for a voluntary design pass. |
| 168 | + |
| 169 | +## Quick reference — decision tree |
| 170 | + |
| 171 | +- **Intake phrase** (“I need to add to the design repo”) → run **Intake** questions first. |
| 172 | +- **Share before merge** → push branch → GitHub Actions publishes hub preview to GitHub Pages (see workflow) + optional draft PR link. |
| 173 | +- **New prototype** → branch → implement/register → manifest entry → PR. |
| 174 | +- **Update existing** → branch → edit listed files + bump `updatedAt` → PR. |
| 175 | +- **New team/area** → add `teams` entry, align `id`/`maintainer`, then prototypes. |
| 176 | +- **Hosted outside repo** → deploy elsewhere, set `prototypeUrl` in manifest. |
| 177 | + |
| 178 | +## Sharing a preview (no merge required) |
| 179 | + |
| 180 | +Designers can share work **from their branch** without waiting for `main`: |
| 181 | + |
| 182 | +1. **Push the branch to GitHub** — `git push -u origin …`. |
| 183 | +2. **Hub preview URL (no local build, no Netlify)** — Repo workflow **Hub branch preview (GitHub Pages)** (`.github/workflows/hub-github-pages-preview.yml`) runs on push, builds `hub/` with the right `BASE_PATH`, and deploys to the `gh-pages` branch under `preview/<branch-slug>/`. Tell them to open **Actions → latest run → job summary** for the exact link. URL pattern: `https://<owner>.github.io/<repo>/preview/<slug>/` (slug = branch name, lowercased, sanitized). **Org setup:** GitHub Pages must be enabled on branch `gh-pages` / root (Settings → Pages) once per repo. |
| 184 | +3. **Pull request** — Draft or normal PR from the branch for review threads and diffs; optional alongside the Pages preview. |
| 185 | +4. **Screenshots / short recording** — For quick async feedback without a live site. |
| 186 | + |
| 187 | +Merge to `main` only when they want the change in the shared default branch / production hub — not as a prerequisite for showing progress. |
| 188 | + |
| 189 | +## When to ask for help |
| 190 | + |
| 191 | +Git/CI/build issues: troubleshoot in Cursor. **Area ownership**, new `teamId`, or stakeholder approval: area lead or Matt Carleton. |
0 commit comments