@marktiderman/genesis-product 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -393,5 +393,5 @@ function createProductWhatsNew(options) {
393
393
  }
394
394
 
395
395
  export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey };
396
- //# sourceMappingURL=chunk-TJ5YBFJJ.js.map
397
- //# sourceMappingURL=chunk-TJ5YBFJJ.js.map
396
+ //# sourceMappingURL=chunk-OVFCCATA.js.map
397
+ //# sourceMappingURL=chunk-OVFCCATA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/model.ts","../src/board.ts","../src/release.ts","../src/app.ts"],"names":["list"],"mappings":";AAsBO,IAAM,YAAA,GAAe,CAAC,MAAA,EAAQ,UAAA,EAAY,KAAK;AAuD/C,SAAS,cAAc,OAAA,EAA0C;AACtE,EAAA,OAAO,EAAE,IAAA,EAAM,YAAY,CAAC,GAAG,OAAO,CAAA,EAAE;AAC1C;;;AC7CO,SAAS,OAAO,OAAA,EAAoC;AACzD,EAAA,OAAO,QAAQ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,KAAA,KAAU,MAAM,CAAA,CAAE,MAAA,CAAO,CAAC,GAAA,EAAK,MAAM,GAAA,IAAO,CAAA,CAAE,cAAc,CAAA,CAAA,GAAK,CAAA,CAAE,OAAO,CAAC,CAAA;AAC5G;AAEA,SAAS,UAAA,CAAW,GAAc,CAAA,EAAsB;AACtD,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,MAAA,KAAW,UAAU,CAAA,GAAI,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,MAAA,KAAW,UAAU,CAAA;AACjG,EAAA,OAAO,Q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AQ,QAAA,EAAU,KAAA,EAAO,EAAC,EAAG,CAAA;AAChE,QAAA,IAAI,GAAA;AACJ,QAAA,IAAI;AACF,UAAA,GAAA,GAAM,MAAM,OAAA,CAAQ,OAAA,CAAQ,UAAU,CAAA;AAAA,QACxC,SAAS,KAAA,EAAO;AACd,UAAA,MAAA,CAAO,KAAK,CAAA;AACZ,UAAA,OAAO,IAAI,EAAE,MAAA,EAAQ,UAAU,KAAA,EAAO,IAAI,CAAA;AAAA,QAC5C;AACA,QAAA,IAAA,GAAO,UAAU,GAAG,CAAA;AAEpB,QAAA,IAAI,SAAA,EAAW;AACf,QAAA,IAAI,QAAQ,IAAA,EAAM;AAChB,UAAA,QAAA,EAAS;AACT,UAAA,OAAO,IAAI,EAAE,MAAA,EAAQ,UAAU,KAAA,EAAO,IAAI,CAAA;AAAA,QAC5C;AACA,QAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,EAAG,OAAO,GAAA,CAAI,EAAE,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,EAAC,EAAG,CAAA;AAClE,QAAA,MAAM,WAAW,IAAI,CAAA;AAAA,MACvB,CAAA,GAAG;AACH,MAAA,OAAO,OAAA;AAAA,IACT,CAAA;AAAA,IACA,IAAA,EAAM,MAAM,UAAA,CAAW,KAAK,CAAA;AAAA,IAC5B,OAAA,GAAU;AACR,MAAA,OAAA,EAAA;AACA,MAAA,SAAA,GAAY,IAAA;AACZ,MAAA,QAAA,EAAS;AACT,MAAA,GAAA,CAAI,EAAE,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,IAAI,CAAA;AAAA,IACrC;AAAA,GACF;AACF","file":"chunk-OVFCCATA.js","sourcesContent":["import type { FeatureHorizon, FeatureStatus } from \"@marktiderman/genesis-config\";\n\n/**\n * A feature as the product system reads it: one entry of `features.json` (the\n * registry's generated output), so the catalog is always the code's own list.\n *\n * @stability Experimental\n */\nexport interface CatalogFeature {\n id: string;\n name: string;\n summary: string;\n status: FeatureStatus;\n owner: string;\n horizon?: FeatureHorizon;\n claimedBy?: string;\n tagline?: string;\n visibility?: string;\n aliases?: readonly string[];\n}\n\n/** What someone sent: an idea, a piece of feedback or a bug. @stability Experimental */\nexport const SIGNAL_KINDS = [\"idea\", \"feedback\", \"bug\"] as const;\n\n/** @stability Experimental */\nexport type SignalKind = (typeof SIGNAL_KINDS)[number];\n\n/**\n * How much a signal matters to the feature it is linked to, set by whoever\n * triages it: 1 nice to have, 2 important, 3 critical. Unset counts as 1.\n *\n * @stability Experimental\n */\nexport type Importance = 1 | 2 | 3;\n\n/**\n * One piece of evidence from a person: the intake record every source maps to.\n * Linked to a feature by `featureId` once triaged; until then it waits in the\n * triage inbox.\n *\n * @stability Experimental\n */\nexport interface Signal {\n /** Unique within its source, e.g. `github#12`. */\n id: string;\n kind: SignalKind;\n title: string;\n url?: string;\n /**\n * The FeatureId it is evidence for, set by whoever triages it (on GitHub, a\n * `feature:<id>` label, which only triagers can add). Unset means not triaged\n * yet. Only a linked signal counts toward demand or is closed by a release.\n */\n featureId?: string;\n /** The FeatureId the sender named themselves: untrusted, shown in triage only. */\n suggestedFeatureId?: string;\n author?: string;\n /** People who added their support (a 👍 on GitHub), not counting the author or bots. */\n votes: number;\n importance?: Importance;\n state: \"open\" | \"closed\";\n /** ISO 8601. */\n createdAt: string;\n}\n\n/**\n * Where signals come from. GitHub issues today (`githubSignals` in `/node`); a\n * database source implements the same contract later, and nothing above it\n * changes.\n *\n * @stability Experimental\n */\nexport interface SignalSource {\n list(): Promise<Signal[]>;\n}\n\n/** Signals held in memory, for tests and demos. @stability Experimental */\nexport function memorySignals(signals: readonly Signal[]): SignalSource {\n return { list: async () => [...signals] };\n}\n","import type { CatalogFeature, Signal } from \"./model\";\n\n/** A feature on the board with the evidence behind it. @stability Experimental */\nexport interface BoardItem {\n feature: CatalogFeature;\n /** Open signals linked to it. */\n signals: Signal[];\n demand: number;\n}\n\n/**\n * The roadmap without dates: what is being built now, next and later, the\n * ideas not yet agreed (ranked by demand), and the signals still to triage.\n *\n * @stability Experimental\n */\nexport interface Board {\n now: BoardItem[];\n next: BoardItem[];\n later: BoardItem[];\n ideas: BoardItem[];\n /** Open signals with no feature yet, newest first. */\n untriaged: Signal[];\n /** Open signals naming a feature id the catalog doesn't have. */\n unknown: Signal[];\n}\n\n/**\n * Demand for a feature: each open signal counts its importance (1 when unset)\n * plus its votes. Closed signals don't count, so demand falls as asks are\n * answered.\n *\n * @stability Experimental\n */\nexport function demand(signals: readonly Signal[]): number {\n return signals.filter((s) => s.state === \"open\").reduce((sum, s) => sum + (s.importance ?? 1) + s.votes, 0);\n}\n\nfunction byPriority(a: BoardItem, b: BoardItem): number {\n const building = Number(b.feature.status === \"building\") - Number(a.feature.status === \"building\");\n return building || b.demand - a.demand || a.feature.name.localeCompare(b.feature.name);\n}\n\n/**\n * Lays the catalog and its signals out as a board. A building feature with no\n * horizon counts as now. Signals are matched to features by id or alias.\n *\n * @stability Experimental\n */\nexport function buildBoard(features: readonly CatalogFeature[], signals: readonly Signal[]): Board {\n const owner = new Map<string, CatalogFeature>();\n for (const f of features) for (const name of [f.id, ...(f.aliases ?? [])]) owner.set(name, f);\n\n const linked = new Map<string, Signal[]>();\n const untriaged: Signal[] = [];\n const unknown: Signal[] = [];\n for (const s of signals) {\n if (s.state !== \"open\") continue;\n if (!s.featureId) untriaged.push(s);\n else {\n const f = owner.get(s.featureId);\n if (!f) unknown.push(s);\n else linked.set(f.id, [...(linked.get(f.id) ?? []), s]);\n }\n }\n\n const board: Board = { now: [], next: [], later: [], ideas: [], untriaged, unknown };\n for (const f of features) {\n const own = linked.get(f.id) ?? [];\n const item: BoardItem = { feature: f, signals: own, demand: demand(own) };\n if (f.status === \"idea\") board.ideas.push(item);\n else if (f.status === \"planned\" || f.status === \"building\") board[f.horizon ?? \"now\"].push(item);\n }\n for (const column of [board.now, board.next, board.later, board.ideas]) column.sort(byPriority);\n const newest = (a: Signal, b: Signal) => b.createdAt.localeCompare(a.createdAt);\n untriaged.sort(newest);\n unknown.sort(newest);\n return board;\n}\n\nconst cell = (text: string) => text.replace(/\\|/g, \"\\\\|\").replace(/\\s+/g, \" \").trim();\n/**\n * Text people wrote (an issue title) as an inline code span, so the board\n * can't be made to @mention anyone, link anywhere or show an image.\n */\nconst quoted = (text: string) => `\\`${text.replace(/\\s+/g, \" \").trim().replace(/`/g, \"'\") || \" \"}\\``;\nconst ref = (s: Signal) => (s.url ? `[${s.id.replace(/^github/, \"\")}](${s.url})` : s.id);\n\nfunction table(items: readonly BoardItem[]): string {\n if (!items.length) return \"_Nothing here._\\n\";\n const rows = items.map(\n (i) =>\n `| ${cell(i.feature.name)} (\\`${i.feature.id}\\`) | ${i.feature.status} | ${cell(i.feature.claimedBy ?? i.feature.owner)} | ${i.demand} | ${i.signals.map(ref).join(\" \")} |`,\n );\n return [\"| Feature | Status | Who | Demand | Asks |\", \"| --- | --- | --- | ---: | --- |\", ...rows].join(\"\\n\") + \"\\n\";\n}\n\nfunction list(signals: readonly Signal[]): string {\n if (!signals.length) return \"_Nothing to triage._\\n\";\n return (\n signals\n .map((s) => {\n const named = s.featureId ?? s.suggestedFeatureId;\n return `- ${ref(s)} ${s.kind}: ${quoted(s.title)}${named ? ` (${s.featureId ? \"linked to\" : \"suggests\"} \\`${named}\\`)` : \"\"}`;\n })\n .join(\"\\n\") + \"\\n\"\n );\n}\n\n/** Options for {@link renderBoard}. @stability Experimental */\nexport interface RenderBoardOptions {\n /** Shown in the header, e.g. `2026-10-25`. */\n date: string;\n /** How many ideas to list. Default 15. */\n ideas?: number;\n}\n\n/**\n * The board as GitHub-flavoured markdown: one table per horizon, the top ideas\n * by demand, and the triage inbox.\n *\n * @stability Experimental\n */\nexport function renderBoard(board: Board, options: RenderBoardOptions): string {\n const ideas = board.ideas.slice(0, options.ideas ?? 15);\n return [\n \"# Product board\",\n \"\",\n `Generated ${options.date} by \\`genesis-product board\\` from \\`features.ts\\` and the idea and feedback issues. Don't edit it: change \\`features.ts\\`, or open an issue. A 👍 on an issue is a vote.`,\n \"\",\n \"Demand counts each open ask linked to a feature (its importance, 1 to 3) plus its 👍.\",\n \"\",\n `## Now (${board.now.length})`,\n \"\",\n table(board.now),\n `## Next (${board.next.length})`,\n \"\",\n table(board.next),\n `## Later (${board.later.length})`,\n \"\",\n table(board.later),\n `## Ideas (top ${ideas.length} of ${board.ideas.length} by demand)`,\n \"\",\n table(ideas),\n `## To triage (${board.untriaged.length})`,\n \"\",\n \"Link each to a feature by adding the `feature:<id>` label. The id a sender suggests counts only once a triager adds the label.\",\n \"\",\n list(board.untriaged),\n ...(board.unknown.length ? [`## Unknown feature ids (${board.unknown.length})`, \"\", list(board.unknown)] : []),\n ].join(\"\\n\");\n}\n","import type { CatalogFeature, Signal } from \"./model\";\n\n/** What a release did to one feature. @stability Experimental */\nexport interface ReleaseChange {\n feature: CatalogFeature;\n /** `live`: shipped to everyone. `beta`: shipped to try. */\n change: \"live\" | \"beta\";\n /** Its status before, or `undefined` when it is new in the catalog. */\n from?: CatalogFeature[\"status\"];\n}\n\n/**\n * The features a release shipped: those that reached `live` or `beta` between\n * the catalog before and after it. Features with `visibility: internal` are\n * left out of release notes.\n *\n * @stability Experimental\n */\nexport function diffRelease(before: readonly CatalogFeature[], after: readonly CatalogFeature[]): ReleaseChange[] {\n const was = new Map(before.map((f) => [f.id, f.status]));\n const changes: ReleaseChange[] = [];\n for (const f of after) {\n if (f.visibility === \"internal\") continue;\n const from = was.get(f.id);\n if (from === f.status) continue;\n if (f.status === \"live\") changes.push({ feature: f, change: \"live\", from });\n else if (f.status === \"beta\" && from !== \"live\") changes.push({ feature: f, change: \"beta\", from });\n }\n return changes.sort((a, b) => a.change.localeCompare(b.change) || a.feature.name.localeCompare(b.feature.name));\n}\n\n/**\n * The open ideas a release answers: the people to tell, and the asks to close.\n * This is how the loop closes. Feedback and bugs are left alone: a feature\n * going live doesn't mean a reported problem with it is fixed.\n *\n * @stability Experimental\n */\nexport function answeredBy(changes: readonly ReleaseChange[], signals: readonly Signal[]): Signal[] {\n const shipped = new Set(changes.flatMap((c) => [c.feature.id, ...(c.feature.aliases ?? [])]));\n return signals.filter((s) => s.kind === \"idea\" && s.state === \"open\" && s.featureId !== undefined && shipped.has(s.featureId));\n}\n\n/** Options for {@link renderRelease}. @stability Experimental */\nexport interface RenderReleaseOptions {\n /** The release's name, e.g. `2026-10-25` or a version. */\n name: string;\n}\n\n/**\n * Draft release notes for people, not developers: each feature's tagline (or\n * its summary), grouped into shipped and in beta, with the asks it answers. A\n * person edits and publishes them.\n *\n * @stability Experimental\n */\nexport function renderRelease(changes: readonly ReleaseChange[], signals: readonly Signal[], options: RenderReleaseOptions): string {\n const answered = answeredBy(changes, signals);\n const section = (title: string, kind: ReleaseChange[\"change\"]) => {\n const own = changes.filter((c) => c.change === kind);\n if (!own.length) return [];\n return [\n `## ${title}`,\n \"\",\n ...own.map((c) => {\n const asks = answered.filter((s) => s.featureId === c.feature.id || c.feature.aliases?.includes(s.featureId!));\n const thanks = asks.length ? ` Asked for in ${asks.map((s) => (s.url ? `[${s.id.replace(/^github/, \"\")}](${s.url})` : s.id)).join(\", \")}.` : \"\";\n return `- **${c.feature.name}**: ${c.feature.tagline ?? c.feature.summary}${thanks}`;\n }),\n \"\",\n ];\n };\n const body = [...section(\"Shipped\", \"live\"), ...section(\"In beta\", \"beta\")];\n return [`# Release ${options.name}`, \"\", ...(body.length ? body : [\"_No feature reached beta or live in this range._\", \"\"])].join(\"\\n\");\n}\n","// @feat:product-roadmap @feat:product-insights\n/**\n * What an app shows people about the product: the idea board (with votes), the\n * Now / Next / Later roadmap and \"what's new\". Data comes through a\n * `ProductSource` the app passes in (a Supabase source comes later; the\n * memory source here is for tests and demos), and votes go through a queue\n * that survives being offline. No React and no I/O: `/native` draws it.\n */\nimport type { FeatureHorizon, FeatureStatus } from \"@marktiderman/genesis-config\";\nimport type { Board } from \"./board\";\n\n/** Where an idea stands. @stability Experimental */\nexport type ProductIdeaStatus = \"open\" | \"planned\" | \"building\" | \"shipped\" | \"declined\";\n\n/** An idea on the board, as the signed-in person sees it. @stability Experimental */\nexport interface ProductIdea {\n id: string;\n title: string;\n body?: string;\n /** The FeatureId it was linked to, once triaged. */\n featureId?: string;\n /** People who voted for it, the signed-in person included. */\n votes: number;\n /** The signed-in person voted for it. */\n voted: boolean;\n status: ProductIdeaStatus;\n}\n\n/** One row of the roadmap. @stability Experimental */\nexport interface RoadmapItem {\n /** The FeatureId. */\n id: string;\n title: string;\n summary?: string;\n horizon: FeatureHorizon;\n status?: FeatureStatus;\n /** Demand, when the source knows it. */\n votes?: number;\n}\n\n/** One entry of \"what's new\". @stability Experimental */\nexport interface WhatsNewNote {\n id: string;\n title: string;\n body?: string;\n /** An app path to open for more. */\n url?: string;\n}\n\n/**\n * Where the screens read from and vote through. Injected, so the screens\n * don't care whether it is memory, Supabase or something else.\n *\n * `vote` and `unvote` are idempotent (voting twice is one vote). A refusal\n * that retrying won't fix (not allowed, the idea is gone) throws an error with\n * `permanent: true` (see {@link VoteRefusedError}) or an HTTP 4xx `status`;\n * anything else is retried.\n *\n * @stability Experimental\n */\nexport interface ProductSource {\n ideas(): Promise<ProductIdea[]>;\n vote(ideaId: string): Promise<void>;\n unvote(ideaId: string): Promise<void>;\n roadmap(): Promise<RoadmapItem[]>;\n /** The notes for one app version plus over-the-air update (see `whatsNewKey`), newest first. */\n whatsNew(key: string): Promise<WhatsNewNote[]>;\n}\n\n/** A vote the source refused for good: the queue drops it and the board shows the source's state again. @stability Experimental */\nexport class VoteRefusedError extends Error {\n readonly permanent = true;\n constructor(message = \"This vote was refused.\") {\n super(message);\n this.name = \"VoteRefusedError\";\n }\n}\n\n/** True for an error retrying won't fix: `permanent: true`, or an HTTP 4xx other than 408 and 429. @stability Experimental */\nexport function isPermanentVoteError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const e = error as { permanent?: unknown; status?: unknown };\n if (e.permanent === true) return true;\n return typeof e.status === \"number\" && e.status >= 400 && e.status < 500 && e.status !== 408 && e.status !== 429;\n}\n\n/** Options for {@link roadmapFromBoard}. @stability Experimental */\nexport interface RoadmapFromBoardOptions {\n /** The client whose own features (`visibility: \"client:<name>\"`) this roadmap may show. Default: none. */\n client?: string;\n}\n\n/**\n * The board's Now / Next / Later columns as roadmap rows. Only features\n * everyone may see are kept (`public`, `customer`, or no visibility):\n * `internal` and every `client:<name>` feature are left out, except that\n * `client`'s own when it is given.\n *\n * @stability Experimental\n */\nexport function roadmapFromBoard(board: Pick<Board, \"now\" | \"next\" | \"later\">, options: RoadmapFromBoardOptions = {}): RoadmapItem[] {\n const visible = (v: string | undefined) => v === undefined || v === \"public\" || v === \"customer\" || (options.client !== undefined && v === `client:${options.client}`);\n return ([\"now\", \"next\", \"later\"] as const).flatMap((horizon) =>\n board[horizon]\n .filter((item) => visible(item.feature.visibility))\n .map((item) => ({\n id: item.feature.id,\n title: item.feature.name,\n summary: item.feature.tagline ?? item.feature.summary,\n horizon,\n status: item.feature.status,\n votes: item.demand,\n })),\n );\n}\n\n/** What {@link memoryProductSource} starts with. @stability Experimental */\nexport interface MemoryProductSeed {\n ideas?: readonly ProductIdea[];\n roadmap?: readonly RoadmapItem[];\n /** Notes by `whatsNewKey`; `\"*\"` answers every key. */\n whatsNew?: Readonly<Record<string, readonly WhatsNewNote[]>>;\n}\n\n/** A source in memory, for tests and demos: votes change its own copy. @stability Experimental */\nexport function memoryProductSource(seed: MemoryProductSeed = {}): ProductSource {\n let ideas = (seed.ideas ?? []).map((i) => ({ ...i }));\n const set = (ideaId: string, voted: boolean) => {\n const idea = ideas.find((i) => i.id === ideaId);\n if (!idea) throw new VoteRefusedError(`No idea ${ideaId}.`);\n if (idea.voted === voted) return;\n ideas = ideas.map((i) => (i.id === ideaId ? { ...i, voted, votes: Math.max(0, i.votes + (voted ? 1 : -1)) } : i));\n };\n return {\n ideas: async () => ideas.map((i) => ({ ...i })).sort((a, b) => b.votes - a.votes || a.title.localeCompare(b.title)),\n vote: async (id) => set(id, true),\n unvote: async (id) => set(id, false),\n roadmap: async () => (seed.roadmap ?? []).map((r) => ({ ...r })),\n whatsNew: async (key) => [...(seed.whatsNew?.[key] ?? seed.whatsNew?.[\"*\"] ?? [])],\n };\n}\n\n/** A vote waiting to reach the source: the person wants `voted`; `base` is what the source has. @stability Experimental */\nexport interface QueuedVote {\n ideaId: string;\n voted: boolean;\n base: boolean;\n}\n\n/** Where the queue is kept between launches (AsyncStorage, MMKV). @stability Experimental */\nexport interface VoteQueueStore {\n load(): Promise<QueuedVote[]>;\n save(queue: QueuedVote[]): Promise<void>;\n}\n\n/** A queue store in memory (the default: queued votes last as long as the app runs). @stability Experimental */\nexport function memoryVoteQueueStore(initial: readonly QueuedVote[] = []): VoteQueueStore {\n let saved = initial.map((v) => ({ ...v }));\n return {\n load: async () => saved.map((v) => ({ ...v })),\n save: async (queue) => void (saved = queue.map((v) => ({ ...v }))),\n };\n}\n\n/** AsyncStorage's shape (also MMKV's async adapter). @stability Experimental */\nexport interface ProductStorageLike {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n}\n\n/** A queue store in AsyncStorage, under one key. A value that can't be read counts as empty. @stability Experimental */\nexport function storageVoteQueueStore(storage: ProductStorageLike, key = \"genesis:product:votes\"): VoteQueueStore {\n return {\n async load() {\n const raw = JSON.parse((await storage.getItem(key)) ?? \"[]\") as unknown;\n if (!Array.isArray(raw)) return [];\n return raw.filter(\n (v): v is QueuedVote => !!v && typeof v === \"object\" && typeof v.ideaId === \"string\" && typeof v.voted === \"boolean\" && typeof v.base === \"boolean\",\n );\n },\n save: (queue) => storage.setItem(key, JSON.stringify(queue)),\n };\n}\n\n/** What one {@link VoteQueue.flush} did. @stability Experimental */\nexport interface VoteFlushResult {\n /** Reached the source, with the vote it now has. */\n sent: { ideaId: string; voted: boolean }[];\n /** Refused for good and dropped: the board shows the source's state again. */\n refused: string[];\n /** Couldn't be sent (offline): kept for the next flush. */\n failed: string[];\n}\n\n/** @stability Experimental */\nexport interface VoteQueue {\n /** Reads the saved queue (votes from before a relaunch). Never rejects; runs once. */\n load(): Promise<void>;\n /** The votes not yet sent. */\n pending(): QueuedVote[];\n /** `ideas` with the person's unsent votes laid over them. */\n apply(ideas: readonly ProductIdea[]): ProductIdea[];\n /**\n * Flips the person's vote on an idea as the source last reported it: queued\n * and saved at once. Toggling back to what the source has cancels the queued\n * vote, so nothing is sent. Resolves once saved, not sent: then `flush()`.\n */\n toggle(idea: ProductIdea): Promise<void>;\n /** Sends what is queued, one at a time. A call while one runs waits for it, then sends what is left. */\n flush(): Promise<VoteFlushResult>;\n /** Called on every change to the queue. Returns the unsubscribe. */\n subscribe(listener: () => void): () => void;\n}\n\n/** Options for {@link createVoteQueue}. @stability Experimental */\nexport interface VoteQueueOptions {\n source: Pick<ProductSource, \"vote\" | \"unvote\">;\n /** Default {@link memoryVoteQueueStore}. */\n store?: VoteQueueStore;\n /** Every error, from a send (a refusal included) or the store. */\n onError?: (error: unknown, ideaId?: string) => void;\n}\n\n/**\n * The offline vote queue, modelled on chat's outbox: a vote shows at once, is\n * saved, and is sent when there is a connection (`flush()`: on start, after\n * each vote and on reconnect). Votes on one idea collapse into the last one,\n * and a toggle back before it is sent sends nothing.\n *\n * @stability Experimental\n */\nexport function createVoteQueue(options: VoteQueueOptions): VoteQueue {\n const store = options.store ?? memoryVoteQueueStore();\n const queue = new Map<string, QueuedVote>();\n const inFlight = new Set<string>();\n const listeners = new Set<() => void>();\n let loading: Promise<void> | null = null;\n let running: Promise<VoteFlushResult> | null = null;\n let again = false;\n\n const report = (error: unknown, ideaId?: string) => {\n try {\n options.onError?.(error, ideaId);\n } catch {\n // a failing reporter never breaks a vote\n }\n };\n const changed = () => {\n for (const l of [...listeners]) l();\n };\n const save = async () => {\n try {\n await store.save([...queue.values()].map((v) => ({ ...v })));\n } catch (error) {\n report(error);\n }\n };\n\n const sendAll = async (): Promise<VoteFlushResult> => {\n const result: VoteFlushResult = { sent: [], refused: [], failed: [] };\n for (const ideaId of [...queue.keys()]) {\n // Read it again: a vote toggled back while an earlier one was being sent is gone, or changed.\n const entry = queue.get(ideaId);\n if (!entry) continue;\n const sent = { ...entry };\n inFlight.add(ideaId);\n try {\n await (sent.voted ? options.source.vote(sent.ideaId) : options.source.unvote(sent.ideaId));\n const now = queue.get(sent.ideaId);\n // The source now has `sent.voted`; a toggle made meanwhile stays queued only if it differs.\n if (now) {\n if (now.voted === sent.voted) queue.delete(sent.ideaId);\n else now.base = sent.voted;\n }\n result.sent.push({ ideaId: sent.ideaId, voted: sent.voted });\n } catch (error) {\n report(error, sent.ideaId);\n if (isPermanentVoteError(error)) {\n const now = queue.get(sent.ideaId);\n if (now && now.voted === sent.voted) queue.delete(sent.ideaId);\n result.refused.push(sent.ideaId);\n } else result.failed.push(sent.ideaId);\n } finally {\n inFlight.delete(sent.ideaId);\n }\n }\n if (result.sent.length || result.refused.length) {\n await save();\n changed();\n }\n return result;\n };\n\n const self: VoteQueue = {\n load() {\n loading ??= (async () => {\n try {\n const stored = await store.load();\n for (const v of stored) if (!queue.has(v.ideaId)) queue.set(v.ideaId, { ...v });\n // Votes cast before this read are saved with the stored ones, so neither is lost.\n if (queue.size !== stored.length) await save();\n } catch (error) {\n report(error);\n }\n changed();\n })();\n return loading;\n },\n pending: () => [...queue.values()].map((v) => ({ ...v })),\n apply(ideas) {\n return ideas.map((idea) => {\n const q = queue.get(idea.id);\n if (!q || q.voted === idea.voted) return idea;\n return { ...idea, voted: q.voted, votes: Math.max(0, idea.votes + (q.voted ? 1 : -1)) };\n });\n },\n async toggle(idea) {\n // The saved queue first: a save before it is read would overwrite it.\n await self.load();\n const q = queue.get(idea.id);\n const base = q?.base ?? idea.voted;\n const voted = !(q?.voted ?? idea.voted);\n // Back to what the source has: nothing to send, unless a send for it is on its way.\n if (voted === base && !inFlight.has(idea.id)) queue.delete(idea.id);\n else queue.set(idea.id, { ideaId: idea.id, voted, base });\n changed();\n await save();\n },\n flush() {\n if (running) {\n again = true;\n return running;\n }\n running = (async () => {\n await self.load();\n let result = await sendAll();\n while (again) {\n again = false;\n const next = await sendAll();\n result = { sent: [...result.sent, ...next.sent], refused: [...result.refused, ...next.refused], failed: next.failed };\n }\n return result;\n })().finally(() => {\n running = null;\n });\n return running;\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n };\n return self;\n}\n\n/** The shape `whatsNewKey` reads from expo-application (genesis-native's `ApplicationLike`). @stability Experimental */\nexport interface WhatsNewApplicationLike {\n readonly nativeApplicationVersion: string | null;\n}\n\n/** The shape `whatsNewKey` reads from expo-updates (genesis-native's `UpdatesModuleLike`). @stability Experimental */\nexport interface WhatsNewUpdatesLike {\n readonly isEnabled: boolean;\n readonly updateId: string | null;\n readonly isEmbeddedLaunch: boolean;\n}\n\n/**\n * What \"what's new\" is shown once for: the store version plus the\n * over-the-air update running (`\"1.4.0+3f2a…\"`), or `\"1.4.0+embedded\"` for\n * the code that shipped in the binary. `null` without a version: it never shows.\n *\n * @stability Experimental\n */\nexport function whatsNewKey(input: { application?: WhatsNewApplicationLike | null; updates?: WhatsNewUpdatesLike | null }): string | null {\n const version = input.application?.nativeApplicationVersion;\n if (!version) return null;\n const u = input.updates;\n const update = u && u.isEnabled && !u.isEmbeddedLaunch && u.updateId ? u.updateId : \"embedded\";\n return `${version}+${update}`;\n}\n\n/** How many \"what's new\" keys are remembered. */\nconst MAX_SEEN_KEYS = 20;\n\nfunction parseSeen(raw: string | null): string[] {\n if (raw === null) return [];\n try {\n const list = JSON.parse(raw) as unknown;\n if (Array.isArray(list)) return list.filter((k): k is string => typeof k === \"string\").slice(-MAX_SEEN_KEYS);\n } catch {\n // a plain key, written before the list\n }\n return [raw];\n}\n\n/** @stability Experimental */\nexport interface ProductWhatsNewState {\n /** `loading`: reading what was seen; `fetching`: the notes are on their way; `showing`: open. */\n status: \"loading\" | \"hidden\" | \"fetching\" | \"showing\";\n notes: readonly WhatsNewNote[];\n}\n\n/** Options for {@link createProductWhatsNew}. @stability Experimental */\nexport interface ProductWhatsNewOptions {\n source: Pick<ProductSource, \"whatsNew\">;\n /** `whatsNewKey(...)`. `null`: never shows by itself. */\n key: string | null;\n /** AsyncStorage. Without it nothing shows by itself (rather than on every launch). */\n storage?: ProductStorageLike;\n /** Default `\"genesis:product:whats-new\"`. */\n storageKey?: string;\n onError?: (error: unknown) => void;\n}\n\n/** @stability Experimental */\nexport interface ProductWhatsNew {\n getState(): ProductWhatsNewState;\n subscribe(listener: () => void): () => void;\n /** Reads the key seen last and, when this one is new, fetches its notes. Never rejects; runs once. */\n load(): Promise<void>;\n /** Opens it by hand (a \"What's new\" row): fetches the notes for this key. */\n open(): Promise<void>;\n /** Closes it and remembers this key. */\n dismiss(): void;\n}\n\n/**\n * \"What's new\", once per app version plus over-the-air update. A first\n * install remembers the key and shows nothing; a new key fetches its notes\n * then (never bundled) and opens when there are any. No notes for it:\n * remembered, nothing shown. A failed fetch shows nothing and tries again\n * next launch. Storage that can't be read shows nothing.\n *\n * @stability Experimental\n */\nexport function createProductWhatsNew(options: ProductWhatsNewOptions): ProductWhatsNew {\n const { source, key, storage, storageKey = \"genesis:product:whats-new\" } = options;\n let state: ProductWhatsNewState = { status: \"loading\", notes: [] };\n const listeners = new Set<() => void>();\n const set = (next: ProductWhatsNewState) => {\n state = next;\n for (const l of [...listeners]) l();\n };\n const report = (error: unknown) => {\n try {\n options.onError?.(error);\n } catch {\n // ignore a failing reporter\n }\n };\n // The keys seen, oldest first (a plain string from before is one key). Kept as a list, so going\n // back to a key seen before (expo-updates falling back to the embedded code) shows nothing.\n let seen: string[] = [];\n const remember = () => {\n if (!storage || !key) return;\n seen = [...seen.filter((k) => k !== key), key].slice(-MAX_SEEN_KEYS);\n const value = JSON.stringify(seen);\n Promise.resolve()\n .then(() => storage.setItem(storageKey, value))\n .catch(report);\n };\n let dismissed = false;\n let fetches = 0;\n const fetchNotes = async (rememberWhenEmpty: boolean) => {\n if (!key) return set({ status: \"hidden\", notes: [] });\n const mine = ++fetches;\n set({ status: \"fetching\", notes: [] });\n let notes: WhatsNewNote[] = [];\n try {\n notes = await source.whatsNew(key);\n if (!notes.length && rememberWhenEmpty) remember();\n } catch (error) {\n report(error);\n }\n // Closed (or opened again) meanwhile: this answer is stale.\n if (mine !== fetches || state.status !== \"fetching\") return;\n set(notes.length ? { status: \"showing\", notes } : { status: \"hidden\", notes: [] });\n };\n let loading: Promise<void> | null = null;\n return {\n getState: () => state,\n subscribe(listener) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n load() {\n loading ??= (async () => {\n if (!storage || !key) return set({ status: \"hidden\", notes: [] });\n let raw: string | null;\n try {\n raw = await storage.getItem(storageKey);\n } catch (error) {\n report(error);\n return set({ status: \"hidden\", notes: [] });\n }\n seen = parseSeen(raw);\n // Closed by hand while storage was being read: this key is seen.\n if (dismissed) return;\n if (raw === null) {\n remember();\n return set({ status: \"hidden\", notes: [] });\n }\n if (seen.includes(key)) return set({ status: \"hidden\", notes: [] });\n await fetchNotes(true);\n })();\n return loading;\n },\n open: () => fetchNotes(false),\n dismiss() {\n fetches++;\n dismissed = true;\n remember();\n set({ status: \"hidden\", notes: [] });\n },\n };\n}\n"]}
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { repoFromGit, githubSignals, readCatalog, publishBoardIssue, catalogAt, closeAnswered } from './chunk-ZL7SMZKX.js';
3
- import { renderBoard, buildBoard, diffRelease, renderRelease, answeredBy } from './chunk-TJ5YBFJJ.js';
3
+ import { renderBoard, buildBoard, diffRelease, renderRelease, answeredBy } from './chunk-OVFCCATA.js';
4
4
  import './chunk-WICY5UX4.js';
5
5
  import { writeFileSync } from 'fs';
6
6
  import { parseArgs } from 'util';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FeatureStatus, FeatureHorizon } from '@marktiderman/genesis-features';
1
+ import { FeatureStatus, FeatureHorizon } from '@marktiderman/genesis-config';
2
2
  export { NOTIFY_BATCH, NotifyShippedOptions, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, ProductCancelInput, ProductNotifyInput, ProductRecipient, ShippedData, ShippedFeature, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './server.js';
3
3
 
4
4
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-TJ5YBFJJ.js';
1
+ export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-OVFCCATA.js';
2
2
  export { NOTIFY_BATCH, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './chunk-WICY5UX4.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/native.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { InboxPageProps } from '@marktiderman/genesis-ui-native/layouts';
4
4
  import { VoteFlushResult, ProductSource, VoteQueue, ProductIdea, RoadmapItem, WhatsNewNote, ProductWhatsNew as ProductWhatsNew$1, ProductWhatsNewState } from './index.js';
5
5
  export { Board, BoardItem, CatalogFeature, Importance, MemoryProductSeed, ProductIdeaStatus, ProductStorageLike, ProductWhatsNewOptions, QueuedVote, ReleaseChange, RenderBoardOptions, RenderReleaseOptions, RoadmapFromBoardOptions, SIGNAL_KINDS, Signal, SignalKind, SignalSource, VoteQueueOptions, VoteQueueStore, VoteRefusedError, WhatsNewApplicationLike, WhatsNewUpdatesLike, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './index.js';
6
- import { FeatureHorizon } from '@marktiderman/genesis-features';
6
+ import { FeatureHorizon } from '@marktiderman/genesis-config';
7
7
  export { NOTIFY_BATCH, NotifyShippedOptions, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, ProductCancelInput, ProductNotifyInput, ProductRecipient, ShippedData, ShippedFeature, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './server.js';
8
8
 
9
9
  /** `import * as Haptics from "expo-haptics"`: genesis-ui-native's `GenesisHapticsModule`. */
package/dist/native.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createVoteQueue } from './chunk-TJ5YBFJJ.js';
2
- export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-TJ5YBFJJ.js';
1
+ import { createVoteQueue } from './chunk-OVFCCATA.js';
2
+ export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-OVFCCATA.js';
3
3
  export { NOTIFY_BATCH, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './chunk-WICY5UX4.js';
4
4
  import { playHaptic } from '@marktiderman/genesis-ui-native/hooks';
5
5
  import { useMemo, useRef, useState, useReducer, useCallback, useEffect, useSyncExternalStore } from 'react';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/native/haptics.ts","../src/native/copy.ts","../src/native/idea-board.tsx","../src/native/roadmap.tsx","../src/native/whats-new.tsx"],"names":["useMemo","useState","useRef","useCallback","items","useEffect","jsx","NativeButton","InboxPage"],"mappings":";;;;;;;;;;AAQA,IAAM,OAAO,EAAE,IAAA,EAAM,SAAS,MAAA,EAAQ,QAAA,EAAU,SAAS,OAAA,EAAQ;AAG1D,SAAS,MAAA,CAAO,SAAkC,KAAA,EAAiC;AACxF,EAAA,UAAA,CAAW,OAAA,EAAS,IAAA,CAAK,KAAK,CAAC,CAAA;AACjC;;;ACVO,IAAM,YAAA,GAAe;AAAA,EAC1B,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,OAAA;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAAO,OAAA;AAAA,IACP,UAAA,EAAY,aAAA;AAAA,IACZ,QAAA,EAAU,WAAA;AAAA,IACV,OAAA,EAAS,CAAC,KAAA,KAAkB,CAAA,SAAA,EAAY,KAAK,CAAA,CAAA;AAAA,IAC7C,aAAA,EAAe,CAAC,KAAA,KAAkB,CAAA,qBAAA,EAAwB,KAAK,CAAA,CAAA;AAAA,IAC/D,OAAO,CAAC,CAAA,KAAe,MAAM,CAAA,GAAI,QAAA,GAAW,GAAG,CAAC,CAAA,MAAA,CAAA;AAAA,IAChD,QAAA,EAAU,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAA,EAAS,SAAA,EAAW,QAAA,EAAU,aAAA,EAAe,OAAA,EAAS,SAAA,EAAW,QAAA,EAAU,aAAA,EAAc;AAAA,IACnH,UAAA,EAAY,cAAA;AAAA,IACZ,SAAA,EAAW,sDAAA;AAAA,IACX,UAAA,EAAY,yBAAA;AAAA,IACZ,SAAA,EAAW,8CAAA;AAAA,IACX,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,KAAA,EAAO,SAAA;AAAA,IACP,GAAA,EAAK,KAAA;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAA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A,EAAM,IAAA,CAAK,IAAA,EAAK,GAAI,EAAC,EAAI,GAAI,IAAA,CAAK,GAAA,GAAM,EAAE,GAAA,EAAK,IAAA,CAAK,GAAA,EAAI,GAAI,IAAI,CAAE,CAAA;AAAA,MACnJ,OAAA;AAAA,MACC,GAAI,UAAA,GAAa,EAAE,UAAA,EAAY,CAAC,IAAA,KAA0B,UAAA,CAAW,KAAA,CAAM,GAAA,CAAI,IAAA,CAAK,GAAG,CAAE,CAAA,KAAM,EAAC;AAAA,MACjG,KAAA,EAAO,KAAK,QAAA,CAAS,KAAA;AAAA,MACrB,SAAA,EAAW,KAAK,QAAA,CAAS,IAAA;AAAA,MACzB,cAAA,EAAgB,KAAK,QAAA,CAAS,SAAA;AAAA,MAC9B,MAAA;AAAA,MACA,YAAY,CAAC,GAAA,KAAQ,CAAA,EAAG,MAAM,SAAS,GAAG,CAAA;AAAA;AAAA,GAC5C;AAEJ;AAOO,SAAS,eAAA,CAAgB,EAAE,KAAA,EAAO,GAAG,OAAM,EAAyB;AACzE,EAAA,MAAM,KAAA,GAAQ,mBAAmB,KAAK,CAAA;AACtC,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,SAAA,EAAW,OAAO,IAAA;AACvC,EAAA,uBAAOA,GAAAA,CAAC,uBAAA,EAAA,EAAyB,GAAG,KAAA,EAAO,OAAO,KAAA,CAAM,KAAA,EAAO,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,CAAA;AACzF","file":"native.js","sourcesContent":["import { playHaptic, type GenesisHapticsModule } from \"@marktiderman/genesis-ui-native/hooks\";\n\n/** `import * as Haptics from \"expo-haptics\"`: genesis-ui-native's `GenesisHapticsModule`. */\nexport type HapticsLike = GenesisHapticsModule;\n\n/** `vote`: a vote cast or taken back; `select`: a tab changed; `refused`: a vote the source turned down. */\nexport type ProductHapticEvent = \"vote\" | \"select\" | \"refused\";\n\nconst KIND = { vote: \"light\", select: \"select\", refused: \"error\" } as const;\n\n/** Plays a haptic when the app gave expo-haptics; never throws, never rejects (genesis-ui-native's `playHaptic`). */\nexport function haptic(haptics: HapticsLike | undefined, event: ProductHapticEvent): void {\n playHaptic(haptics, KIND[event]);\n}\n","import type { ProductIdeaStatus } from \"../app\";\n\n/** Every word the product screens show. Pass a part of it as `copy` to change or translate it. */\nexport const PRODUCT_COPY = {\n ideas: {\n title: \"Ideas\",\n vote: \"Vote\",\n voted: \"Voted\",\n removeVote: \"Remove vote\",\n youVoted: \"You voted\",\n voteFor: (title: string) => `Vote for ${title}`,\n removeVoteFor: (title: string) => `Remove your vote for ${title}`,\n votes: (n: number) => (n === 1 ? \"1 vote\" : `${n} votes`),\n statuses: { open: \"Open\", planned: \"Planned\", building: \"Being built\", shipped: \"Shipped\", declined: \"Not planned\" } satisfies Record<ProductIdeaStatus, string>,\n emptyTitle: \"No ideas yet\",\n emptyBody: \"Ideas people suggest show up here, with their votes.\",\n errorTitle: \"Couldn't load the ideas\",\n errorBody: \"Check your connection, then pull to refresh.\",\n refused: \"That vote didn't go through.\",\n },\n roadmap: {\n title: \"Roadmap\",\n now: \"Now\",\n next: \"Next\",\n later: \"Later\",\n emptyTitle: \"Nothing here yet\",\n emptyBody: \"What's planned for this stage shows up here.\",\n errorTitle: \"Couldn't load the roadmap\",\n errorBody: \"Check your connection, then pull to refresh.\",\n close: \"Close\",\n },\n whatsNew: { title: \"What's new\", done: \"Got it\", learnMore: \"Learn more\" },\n};\n\nexport type ProductCopy = typeof PRODUCT_COPY;\n\n/** The copy with the app's changes laid over, one level deep per section. */\nexport function mergeCopy(copy: { [K in keyof ProductCopy]?: Partial<ProductCopy[K]> } | undefined): ProductCopy {\n if (!copy) return PRODUCT_COPY;\n return {\n ideas: { ...PRODUCT_COPY.ideas, ...copy.ideas },\n roadmap: { ...PRODUCT_COPY.roadmap, ...copy.roadmap },\n whatsNew: { ...PRODUCT_COPY.whatsNew, ...copy.whatsNew },\n };\n}\n\n/** The `copy` option the screens take. */\nexport type ProductCopyInput = { [K in keyof ProductCopy]?: Partial<ProductCopy[K]> };\n","/**\n * The idea board: InboxPage rows, each with \"N votes\" and a vote button at\n * the end. A vote shows at once and goes through the offline queue\n * (`createVoteQueue`), so it is never lost to a dropped connection; a vote the\n * source refuses for good is rolled back with an error haptic.\n */\nimport { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\nimport { NativeButton } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { createVoteQueue, type ProductIdea, type ProductSource, type VoteFlushResult, type VoteQueue } from \"../app\";\nimport { mergeCopy, type ProductCopyInput } from \"./copy\";\nimport { haptic, type HapticsLike } from \"./haptics\";\n\n/** Options for {@link useIdeaBoard}. */\nexport interface IdeaBoardOptions {\n source: ProductSource;\n /**\n * The vote queue. Default: one in memory over `source`. Pass\n * `createVoteQueue({ source, store: storageVoteQueueStore(AsyncStorage) })`\n * (made once, outside render) to keep votes across a relaunch.\n */\n queue?: VoteQueue;\n /** `import * as Haptics from \"expo-haptics\"`. */\n haptics?: HapticsLike;\n /**\n * Called with a listener to run when the connection comes back; returns the\n * unsubscribe. With NetInfo: `(run) => NetInfo.addEventListener((s) => s.isConnected && run())`.\n */\n onReconnect?: (listener: () => void) => () => void;\n /** A tap on a row (its detail). Without it rows aren't tappable; the vote button always is. */\n onOpenIdea?: (idea: ProductIdea) => void;\n /**\n * Votes the source refused for good, by idea id, after the board rolled them back. The board\n * plays an error haptic and has screen readers say `copy.ideas.refused`; show your own toast here.\n */\n onRefused?: (ideaIds: string[]) => void;\n copy?: ProductCopyInput;\n /** Default `\"product-ideas\"`. */\n testID?: string;\n}\n\n/** What {@link useIdeaBoard} returns: InboxPage's props, plus the screen's title and a flush. */\nexport type IdeaBoard = Pick<\n InboxPageProps,\n \"items\" | \"loading\" | \"error\" | \"refreshing\" | \"onRefresh\" | \"emptyTitle\" | \"emptyBody\" | \"errorTitle\" | \"errorBody\" | \"testID\"\n> & {\n headerTitle: string;\n /** Send queued votes now (also runs on start, after each vote and on reconnect). */\n flush: () => Promise<VoteFlushResult>;\n};\n\n/** The vote button at the end of a row. */\nexport interface VoteButtonProps {\n voted: boolean;\n onPress: () => void;\n /** What it shows: \"Vote\" or \"Voted\". */\n label: string;\n /** What a screen reader says, with the idea's title: \"Vote for Dark mode\". */\n accessibilityLabel?: string;\n testID: string;\n}\n\nexport function VoteButton({ voted, onPress, label, accessibilityLabel, testID }: VoteButtonProps) {\n return (\n <NativeButton\n size=\"sm\"\n variant={voted ? \"default\" : \"outline\"}\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected: voted }}\n testID={testID}\n >\n {label}\n </NativeButton>\n );\n}\n\n/** The idea board as InboxPage props: `<InboxPage {...useIdeaBoard({ source })} />`. */\nexport function useIdeaBoard(options: IdeaBoardOptions): IdeaBoard {\n const { source, haptics, onReconnect, onOpenIdea, testID = \"product-ideas\" } = options;\n const copy = useMemo(() => mergeCopy(options.copy), [options.copy]);\n // The latest props, read at call time: an inline `source` or `haptics` never restarts the board.\n const latest = useRef({ source, haptics, onRefused: options.onRefused, copy });\n latest.current = { source, haptics, onRefused: options.onRefused, copy };\n const [ownQueue] = useState(() =>\n createVoteQueue({ source: { vote: (id) => latest.current.source.vote(id), unvote: (id) => latest.current.source.unvote(id) } }),\n );\n const queue = options.queue ?? ownQueue;\n const [ideas, setIdeas] = useState<ProductIdea[] | null>(null);\n const [error, setError] = useState(false);\n const [refreshing, setRefreshing] = useState(false);\n const [, rerender] = useReducer((n: number) => n + 1, 0);\n const alive = useRef(true);\n const read = useRef(0);\n\n const load = useCallback(async () => {\n const mine = ++read.current;\n try {\n const next = await latest.current.source.ideas();\n if (alive.current && mine === read.current) {\n setIdeas(next);\n setError(false);\n }\n } catch {\n if (alive.current && mine === read.current) setError(true);\n }\n }, []);\n\n const flush = useCallback(async () => {\n const result = await queue.flush();\n if (!alive.current) return result;\n if (result.sent.length) {\n // The source has these now: keep its copy in step until the next read.\n const sent = new Map(result.sent.map((s) => [s.ideaId, s.voted]));\n setIdeas((list) =>\n list?.map((i) => {\n const voted = sent.get(i.id);\n return voted === undefined || voted === i.voted ? i : { ...i, voted, votes: Math.max(0, i.votes + (voted ? 1 : -1)) };\n }) ?? list,\n );\n }\n if (result.refused.length) {\n haptic(latest.current.haptics, \"refused\");\n try {\n AccessibilityInfo.announceForAccessibility?.(latest.current.copy.ideas.refused);\n } catch {\n // an announcement is never worth an error\n }\n latest.current.onRefused?.(result.refused);\n }\n // A read that started before these reached the source would bring back the old counts:\n // drop it, and read again.\n if (result.sent.length || result.refused.length) void load();\n return result;\n }, [queue, load]);\n\n useEffect(() => {\n alive.current = true;\n const stop = queue.subscribe(rerender);\n void load();\n void queue.load().then(() => flush());\n const offline = onReconnect?.(() => void flush());\n return () => {\n alive.current = false;\n stop();\n offline?.();\n };\n // `onReconnect` is read once, at mount.\n }, [queue, load, flush]);\n\n const toggle = (idea: ProductIdea) => {\n haptic(latest.current.haptics, \"vote\");\n void queue.toggle(idea).then(() => flush());\n };\n\n const shown = queue.apply(ideas ?? []);\n const items: InboxItem[] = shown.map((idea) => {\n const server = ideas!.find((i) => i.id === idea.id)!;\n return {\n id: idea.id,\n title: idea.title,\n preview: idea.body,\n meta: [copy.ideas.votes(idea.votes), copy.ideas.statuses[idea.status], idea.voted ? copy.ideas.youVoted : null].filter(Boolean).join(\" · \"),\n onPress: onOpenIdea ? () => onOpenIdea(idea) : undefined,\n // Swipe, long press or a screen reader action: the same vote, for people who don't see the button.\n swipeActions: [{ id: \"vote\", label: idea.voted ? copy.ideas.removeVote : copy.ideas.vote, onPress: () => toggle(server) }],\n trailing: (\n <VoteButton\n voted={idea.voted}\n label={idea.voted ? copy.ideas.voted : copy.ideas.vote}\n accessibilityLabel={(idea.voted ? copy.ideas.removeVoteFor : copy.ideas.voteFor)(idea.title)}\n onPress={() => toggle(server)}\n testID={`${testID}-vote-${idea.id}`}\n />\n ),\n testID: `${testID}-idea-${idea.id}`,\n };\n });\n\n return {\n testID,\n headerTitle: copy.ideas.title,\n items,\n loading: ideas === null && !error,\n error,\n refreshing,\n onRefresh: async () => {\n setRefreshing(true);\n try {\n await Promise.all([load(), flush()]);\n } finally {\n if (alive.current) setRefreshing(false);\n }\n },\n emptyTitle: copy.ideas.emptyTitle,\n emptyBody: copy.ideas.emptyBody,\n errorTitle: copy.ideas.errorTitle,\n errorBody: copy.ideas.errorBody,\n flush,\n };\n}\n\n/** The idea board screen. Put `getInboxPageStackOptions({ headerTitle })` on its `<Stack.Screen>`. */\nexport function IdeaBoardScreen(props: IdeaBoardOptions) {\n const { headerTitle: _title, flush: _flush, ...board } = useIdeaBoard(props);\n return <InboxPage {...board} />;\n}\n","/**\n * The roadmap without dates: Now / Next / Later in a segmented control over\n * InboxPage rows. A tap opens the item in a sheet.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { View } from \"react-native\";\nimport { NativeButton, NativeSegmentedControl, NativeSheet, NativeSheetScrollView, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport type { FeatureHorizon } from \"@marktiderman/genesis-features\";\nimport type { ProductSource, RoadmapItem } from \"../app\";\nimport { mergeCopy, type ProductCopy, type ProductCopyInput } from \"./copy\";\nimport { haptic, type HapticsLike } from \"./haptics\";\n\n/** Options for {@link useRoadmap}. */\nexport interface RoadmapOptions {\n source: Pick<ProductSource, \"roadmap\">;\n /** The tab it opens on. Default `\"now\"`. */\n initial?: FeatureHorizon;\n haptics?: HapticsLike;\n copy?: ProductCopyInput;\n /** Default `\"product-roadmap\"`. */\n testID?: string;\n}\n\n/** What {@link useRoadmap} returns. */\nexport interface Roadmap {\n headerTitle: string;\n horizon: FeatureHorizon;\n setHorizon: (horizon: FeatureHorizon) => void;\n /** The open item, or `null`. */\n selected: RoadmapItem | null;\n close: () => void;\n page: Pick<\n InboxPageProps,\n \"items\" | \"loading\" | \"error\" | \"refreshing\" | \"onRefresh\" | \"emptyTitle\" | \"emptyBody\" | \"errorTitle\" | \"errorBody\" | \"testID\"\n >;\n copy: ProductCopy;\n}\n\nexport function useRoadmap(options: RoadmapOptions): Roadmap {\n const { source, haptics, testID = \"product-roadmap\" } = options;\n const copy = useMemo(() => mergeCopy(options.copy), [options.copy]);\n const [horizon, setHorizonState] = useState<FeatureHorizon>(options.initial ?? \"now\");\n const [all, setAll] = useState<RoadmapItem[] | null>(null);\n const [error, setError] = useState(false);\n const [refreshing, setRefreshing] = useState(false);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const alive = useRef(true);\n const latest = useRef(source);\n latest.current = source;\n\n const load = useCallback(async () => {\n try {\n const items = await latest.current.roadmap();\n if (alive.current) {\n setAll(items);\n setError(false);\n }\n } catch {\n if (alive.current) setError(true);\n }\n }, []);\n\n useEffect(() => {\n alive.current = true;\n void load();\n return () => {\n alive.current = false;\n };\n }, [load]);\n\n const items: InboxItem[] = (all ?? [])\n .filter((item) => item.horizon === horizon)\n .map((item) => ({\n id: item.id,\n title: item.title,\n preview: item.summary,\n meta: item.votes ? copy.ideas.votes(item.votes) : undefined,\n onPress: () => setSelectedId(item.id),\n testID: `${testID}-item-${item.id}`,\n }));\n\n return {\n headerTitle: copy.roadmap.title,\n horizon,\n setHorizon: (next) => {\n if (next === horizon) return;\n haptic(haptics, \"select\");\n setHorizonState(next);\n },\n // Read from the current rows, so a refresh shows in an open sheet; gone from them, it closes.\n selected: (selectedId && all?.find((item) => item.id === selectedId)) || null,\n close: () => setSelectedId(null),\n copy,\n page: {\n testID,\n items,\n loading: all === null && !error,\n error,\n refreshing,\n onRefresh: async () => {\n setRefreshing(true);\n try {\n await load();\n } finally {\n if (alive.current) setRefreshing(false);\n }\n },\n emptyTitle: copy.roadmap.emptyTitle,\n emptyBody: copy.roadmap.emptyBody,\n errorTitle: copy.roadmap.errorTitle,\n errorBody: copy.roadmap.errorBody,\n },\n };\n}\n\n/** One roadmap item in a sheet. */\nexport interface RoadmapDetailSheetProps {\n item: RoadmapItem;\n onClose: () => void;\n copy: ProductCopy;\n testID?: string;\n}\n\nexport function RoadmapDetailSheet({ item, onClose, copy, testID = \"product-roadmap-detail\" }: RoadmapDetailSheetProps) {\n return (\n <NativeSheet open onOpenChange={(open) => (open ? undefined : onClose())} fitContent testID={testID}>\n <NativeSheetScrollView contentContainerStyle={{ gap: 12, padding: 24 }}>\n <NativeText preset=\"h3\" accessibilityRole=\"header\">\n {item.title}\n </NativeText>\n <NativeText preset=\"label\" className=\"text-muted-foreground\">\n {[copy.roadmap[item.horizon], item.votes ? copy.ideas.votes(item.votes) : null].filter(Boolean).join(\" · \")}\n </NativeText>\n {item.summary ? <NativeText preset=\"body-sm\">{item.summary}</NativeText> : null}\n <NativeButton variant=\"outline\" onPress={onClose} testID={`${testID}-close`}>\n {copy.roadmap.close}\n </NativeButton>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n/** The roadmap screen: the segmented control above the rows, and the open item's sheet. */\nexport function RoadmapScreen(props: RoadmapOptions) {\n const roadmap = useRoadmap(props);\n const testID = roadmap.page.testID ?? \"product-roadmap\";\n const header = (\n <View style={{ paddingHorizontal: 16, paddingBottom: 12 }}>\n <NativeSegmentedControl<FeatureHorizon>\n testID={`${testID}-horizon`}\n value={roadmap.horizon}\n onChange={roadmap.setHorizon}\n options={([\"now\", \"next\", \"later\"] as const).map((h) => ({ value: h, label: roadmap.copy.roadmap[h] }))}\n />\n </View>\n );\n return (\n <>\n <InboxPage {...roadmap.page} header={header} />\n {roadmap.selected ? <RoadmapDetailSheet item={roadmap.selected} onClose={roadmap.close} copy={roadmap.copy} testID={`${testID}-detail`} /> : null}\n </>\n );\n}\n","/**\n * \"What's new\" in a sheet, once per app version plus over-the-air update\n * (`createProductWhatsNew` and `whatsNewKey` in the core), with notes fetched\n * from the source when it is due, never bundled.\n *\n * Hung off genesis-native's updates block: turn the block's own sheet off\n * (`createUpdates({ whatsNew: false, … })`) and render this inside\n * `GenesisNativeApp`, keyed by the same modules the block reads:\n *\n * const whatsNew = createProductWhatsNew({\n * source, storage: AsyncStorage,\n * key: whatsNewKey({ application: Application, updates: Updates }),\n * });\n * <ProductWhatsNew store={whatsNew} />\n */\nimport { useEffect, useMemo, useSyncExternalStore } from \"react\";\nimport { NativeWhatsNewSheet } from \"@marktiderman/genesis-ui-native/components\";\nimport type { ProductWhatsNew as ProductWhatsNewStore, ProductWhatsNewState, WhatsNewNote } from \"../app\";\nimport { mergeCopy, type ProductCopyInput } from \"./copy\";\n\n/** The store's state; loads it once on mount. */\nexport function useProductWhatsNew(store: ProductWhatsNewStore): ProductWhatsNewState {\n const state = useSyncExternalStore(store.subscribe, store.getState, store.getState);\n useEffect(() => {\n void store.load();\n }, [store]);\n return state;\n}\n\n/** The sheet itself. */\nexport interface ProductWhatsNewSheetProps {\n notes: readonly WhatsNewNote[];\n dismiss: () => void;\n /** \"Learn more\" on a note with a `url`: the sheet closes (and is remembered), then this opens it. */\n onOpenNote?: (note: WhatsNewNote) => void;\n copy?: ProductCopyInput;\n testID?: string;\n}\n\n/**\n * The sheet, in the product's copy: genesis-ui-native's `NativeWhatsNewSheet` with the notes'\n * ids as keys.\n *\n * @deprecated Render `NativeWhatsNewSheet` from `@marktiderman/genesis-ui-native` (the one\n * \"what's new\" sheet, also behind genesis-native's updates block), mapping each note to\n * `{ key: note.id, title, body, url }`; `ProductWhatsNew` keeps working and renders it.\n */\nexport function ProductWhatsNewSheet(props: ProductWhatsNewSheetProps) {\n return <WhatsNewSheetForProduct {...props} />;\n}\n\nfunction WhatsNewSheetForProduct({ notes, dismiss, onOpenNote, copy: input, testID = \"product-whats-new\" }: ProductWhatsNewSheetProps) {\n const copy = useMemo(() => mergeCopy(input), [input]);\n const byKey = useMemo(() => new Map(notes.map((note) => [note.id, note])), [notes]);\n return (\n <NativeWhatsNewSheet\n notes={notes.map((note) => ({ key: note.id, title: note.title, ...(note.body ? { body: note.body } : {}), ...(note.url ? { url: note.url } : {}) }))}\n dismiss={dismiss}\n {...(onOpenNote ? { onOpenNote: (note: { key: string }) => onOpenNote(byKey.get(note.key)!) } : {})}\n title={copy.whatsNew.title}\n doneLabel={copy.whatsNew.done}\n learnMoreLabel={copy.whatsNew.learnMore}\n testID={testID}\n noteTestID={(key) => `${testID}-note-${key}`}\n />\n );\n}\n\nexport interface ProductWhatsNewProps extends Omit<ProductWhatsNewSheetProps, \"notes\" | \"dismiss\"> {\n store: ProductWhatsNewStore;\n}\n\n/** Renders the sheet while the store shows notes, and nothing otherwise. */\nexport function ProductWhatsNew({ store, ...sheet }: ProductWhatsNewProps) {\n const state = useProductWhatsNew(store);\n if (state.status !== \"showing\") return null;\n return <WhatsNewSheetForProduct {...sheet} notes={state.notes} dismiss={store.dismiss} />;\n}\n"]}
1
+ {"version":3,"sources":["../src/native/haptics.ts","../src/native/copy.ts","../src/native/idea-board.tsx","../src/native/roadmap.tsx","../src/native/whats-new.tsx"],"names":["useMemo","useState","useRef","useCallback","items","useEffect","jsx","NativeButton","InboxPage"],"mappings":";;;;;;;;;;AAQA,IAAM,OAAO,EAAE,IAAA,EAAM,SAAS,MAAA,EAAQ,QAAA,EAAU,SAAS,OAAA,EAAQ;AAG1D,SAAS,MAAA,CAAO,SAAkC,KAAA,EAAiC;AACxF,EAAA,UAAA,CAAW,OAAA,EAAS,IAAA,CAAK,KAAK,CAAC,CAAA;AACjC;;;ACVO,IAAM,YAAA,GAAe;AAAA,EAC1B,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,OAAA;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,KAAA,EAAO,OAAA;AAAA,IACP,UAAA,EAAY,aAAA;AAAA,IACZ,QAAA,EAAU,WAAA;AAAA,IACV,OAAA,EAAS,CAAC,KAAA,KAAkB,CAAA,SAAA,EAAY,KAAK,CAAA,CAAA;AAAA,IAC7C,aAAA,EAAe,CAAC,KAAA,KAAkB,CAAA,qBAAA,EAAwB,K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K,CAAA;AACtC,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,SAAA,EAAW,OAAO,IAAA;AACvC,EAAA,uBAAOA,GAAAA,CAAC,uBAAA,EAAA,EAAyB,GAAG,KAAA,EAAO,OAAO,KAAA,CAAM,KAAA,EAAO,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,CAAA;AACzF","file":"native.js","sourcesContent":["import { playHaptic, type GenesisHapticsModule } from \"@marktiderman/genesis-ui-native/hooks\";\n\n/** `import * as Haptics from \"expo-haptics\"`: genesis-ui-native's `GenesisHapticsModule`. */\nexport type HapticsLike = GenesisHapticsModule;\n\n/** `vote`: a vote cast or taken back; `select`: a tab changed; `refused`: a vote the source turned down. */\nexport type ProductHapticEvent = \"vote\" | \"select\" | \"refused\";\n\nconst KIND = { vote: \"light\", select: \"select\", refused: \"error\" } as const;\n\n/** Plays a haptic when the app gave expo-haptics; never throws, never rejects (genesis-ui-native's `playHaptic`). */\nexport function haptic(haptics: HapticsLike | undefined, event: ProductHapticEvent): void {\n playHaptic(haptics, KIND[event]);\n}\n","import type { ProductIdeaStatus } from \"../app\";\n\n/** Every word the product screens show. Pass a part of it as `copy` to change or translate it. */\nexport const PRODUCT_COPY = {\n ideas: {\n title: \"Ideas\",\n vote: \"Vote\",\n voted: \"Voted\",\n removeVote: \"Remove vote\",\n youVoted: \"You voted\",\n voteFor: (title: string) => `Vote for ${title}`,\n removeVoteFor: (title: string) => `Remove your vote for ${title}`,\n votes: (n: number) => (n === 1 ? \"1 vote\" : `${n} votes`),\n statuses: { open: \"Open\", planned: \"Planned\", building: \"Being built\", shipped: \"Shipped\", declined: \"Not planned\" } satisfies Record<ProductIdeaStatus, string>,\n emptyTitle: \"No ideas yet\",\n emptyBody: \"Ideas people suggest show up here, with their votes.\",\n errorTitle: \"Couldn't load the ideas\",\n errorBody: \"Check your connection, then pull to refresh.\",\n refused: \"That vote didn't go through.\",\n },\n roadmap: {\n title: \"Roadmap\",\n now: \"Now\",\n next: \"Next\",\n later: \"Later\",\n emptyTitle: \"Nothing here yet\",\n emptyBody: \"What's planned for this stage shows up here.\",\n errorTitle: \"Couldn't load the roadmap\",\n errorBody: \"Check your connection, then pull to refresh.\",\n close: \"Close\",\n },\n whatsNew: { title: \"What's new\", done: \"Got it\", learnMore: \"Learn more\" },\n};\n\nexport type ProductCopy = typeof PRODUCT_COPY;\n\n/** The copy with the app's changes laid over, one level deep per section. */\nexport function mergeCopy(copy: { [K in keyof ProductCopy]?: Partial<ProductCopy[K]> } | undefined): ProductCopy {\n if (!copy) return PRODUCT_COPY;\n return {\n ideas: { ...PRODUCT_COPY.ideas, ...copy.ideas },\n roadmap: { ...PRODUCT_COPY.roadmap, ...copy.roadmap },\n whatsNew: { ...PRODUCT_COPY.whatsNew, ...copy.whatsNew },\n };\n}\n\n/** The `copy` option the screens take. */\nexport type ProductCopyInput = { [K in keyof ProductCopy]?: Partial<ProductCopy[K]> };\n","/**\n * The idea board: InboxPage rows, each with \"N votes\" and a vote button at\n * the end. A vote shows at once and goes through the offline queue\n * (`createVoteQueue`), so it is never lost to a dropped connection; a vote the\n * source refuses for good is rolled back with an error haptic.\n */\nimport { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\nimport { NativeButton } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport { createVoteQueue, type ProductIdea, type ProductSource, type VoteFlushResult, type VoteQueue } from \"../app\";\nimport { mergeCopy, type ProductCopyInput } from \"./copy\";\nimport { haptic, type HapticsLike } from \"./haptics\";\n\n/** Options for {@link useIdeaBoard}. */\nexport interface IdeaBoardOptions {\n source: ProductSource;\n /**\n * The vote queue. Default: one in memory over `source`. Pass\n * `createVoteQueue({ source, store: storageVoteQueueStore(AsyncStorage) })`\n * (made once, outside render) to keep votes across a relaunch.\n */\n queue?: VoteQueue;\n /** `import * as Haptics from \"expo-haptics\"`. */\n haptics?: HapticsLike;\n /**\n * Called with a listener to run when the connection comes back; returns the\n * unsubscribe. With NetInfo: `(run) => NetInfo.addEventListener((s) => s.isConnected && run())`.\n */\n onReconnect?: (listener: () => void) => () => void;\n /** A tap on a row (its detail). Without it rows aren't tappable; the vote button always is. */\n onOpenIdea?: (idea: ProductIdea) => void;\n /**\n * Votes the source refused for good, by idea id, after the board rolled them back. The board\n * plays an error haptic and has screen readers say `copy.ideas.refused`; show your own toast here.\n */\n onRefused?: (ideaIds: string[]) => void;\n copy?: ProductCopyInput;\n /** Default `\"product-ideas\"`. */\n testID?: string;\n}\n\n/** What {@link useIdeaBoard} returns: InboxPage's props, plus the screen's title and a flush. */\nexport type IdeaBoard = Pick<\n InboxPageProps,\n \"items\" | \"loading\" | \"error\" | \"refreshing\" | \"onRefresh\" | \"emptyTitle\" | \"emptyBody\" | \"errorTitle\" | \"errorBody\" | \"testID\"\n> & {\n headerTitle: string;\n /** Send queued votes now (also runs on start, after each vote and on reconnect). */\n flush: () => Promise<VoteFlushResult>;\n};\n\n/** The vote button at the end of a row. */\nexport interface VoteButtonProps {\n voted: boolean;\n onPress: () => void;\n /** What it shows: \"Vote\" or \"Voted\". */\n label: string;\n /** What a screen reader says, with the idea's title: \"Vote for Dark mode\". */\n accessibilityLabel?: string;\n testID: string;\n}\n\nexport function VoteButton({ voted, onPress, label, accessibilityLabel, testID }: VoteButtonProps) {\n return (\n <NativeButton\n size=\"sm\"\n variant={voted ? \"default\" : \"outline\"}\n onPress={onPress}\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected: voted }}\n testID={testID}\n >\n {label}\n </NativeButton>\n );\n}\n\n/** The idea board as InboxPage props: `<InboxPage {...useIdeaBoard({ source })} />`. */\nexport function useIdeaBoard(options: IdeaBoardOptions): IdeaBoard {\n const { source, haptics, onReconnect, onOpenIdea, testID = \"product-ideas\" } = options;\n const copy = useMemo(() => mergeCopy(options.copy), [options.copy]);\n // The latest props, read at call time: an inline `source` or `haptics` never restarts the board.\n const latest = useRef({ source, haptics, onRefused: options.onRefused, copy });\n latest.current = { source, haptics, onRefused: options.onRefused, copy };\n const [ownQueue] = useState(() =>\n createVoteQueue({ source: { vote: (id) => latest.current.source.vote(id), unvote: (id) => latest.current.source.unvote(id) } }),\n );\n const queue = options.queue ?? ownQueue;\n const [ideas, setIdeas] = useState<ProductIdea[] | null>(null);\n const [error, setError] = useState(false);\n const [refreshing, setRefreshing] = useState(false);\n const [, rerender] = useReducer((n: number) => n + 1, 0);\n const alive = useRef(true);\n const read = useRef(0);\n\n const load = useCallback(async () => {\n const mine = ++read.current;\n try {\n const next = await latest.current.source.ideas();\n if (alive.current && mine === read.current) {\n setIdeas(next);\n setError(false);\n }\n } catch {\n if (alive.current && mine === read.current) setError(true);\n }\n }, []);\n\n const flush = useCallback(async () => {\n const result = await queue.flush();\n if (!alive.current) return result;\n if (result.sent.length) {\n // The source has these now: keep its copy in step until the next read.\n const sent = new Map(result.sent.map((s) => [s.ideaId, s.voted]));\n setIdeas((list) =>\n list?.map((i) => {\n const voted = sent.get(i.id);\n return voted === undefined || voted === i.voted ? i : { ...i, voted, votes: Math.max(0, i.votes + (voted ? 1 : -1)) };\n }) ?? list,\n );\n }\n if (result.refused.length) {\n haptic(latest.current.haptics, \"refused\");\n try {\n AccessibilityInfo.announceForAccessibility?.(latest.current.copy.ideas.refused);\n } catch {\n // an announcement is never worth an error\n }\n latest.current.onRefused?.(result.refused);\n }\n // A read that started before these reached the source would bring back the old counts:\n // drop it, and read again.\n if (result.sent.length || result.refused.length) void load();\n return result;\n }, [queue, load]);\n\n useEffect(() => {\n alive.current = true;\n const stop = queue.subscribe(rerender);\n void load();\n void queue.load().then(() => flush());\n const offline = onReconnect?.(() => void flush());\n return () => {\n alive.current = false;\n stop();\n offline?.();\n };\n // `onReconnect` is read once, at mount.\n }, [queue, load, flush]);\n\n const toggle = (idea: ProductIdea) => {\n haptic(latest.current.haptics, \"vote\");\n void queue.toggle(idea).then(() => flush());\n };\n\n const shown = queue.apply(ideas ?? []);\n const items: InboxItem[] = shown.map((idea) => {\n const server = ideas!.find((i) => i.id === idea.id)!;\n return {\n id: idea.id,\n title: idea.title,\n preview: idea.body,\n meta: [copy.ideas.votes(idea.votes), copy.ideas.statuses[idea.status], idea.voted ? copy.ideas.youVoted : null].filter(Boolean).join(\" · \"),\n onPress: onOpenIdea ? () => onOpenIdea(idea) : undefined,\n // Swipe, long press or a screen reader action: the same vote, for people who don't see the button.\n swipeActions: [{ id: \"vote\", label: idea.voted ? copy.ideas.removeVote : copy.ideas.vote, onPress: () => toggle(server) }],\n trailing: (\n <VoteButton\n voted={idea.voted}\n label={idea.voted ? copy.ideas.voted : copy.ideas.vote}\n accessibilityLabel={(idea.voted ? copy.ideas.removeVoteFor : copy.ideas.voteFor)(idea.title)}\n onPress={() => toggle(server)}\n testID={`${testID}-vote-${idea.id}`}\n />\n ),\n testID: `${testID}-idea-${idea.id}`,\n };\n });\n\n return {\n testID,\n headerTitle: copy.ideas.title,\n items,\n loading: ideas === null && !error,\n error,\n refreshing,\n onRefresh: async () => {\n setRefreshing(true);\n try {\n await Promise.all([load(), flush()]);\n } finally {\n if (alive.current) setRefreshing(false);\n }\n },\n emptyTitle: copy.ideas.emptyTitle,\n emptyBody: copy.ideas.emptyBody,\n errorTitle: copy.ideas.errorTitle,\n errorBody: copy.ideas.errorBody,\n flush,\n };\n}\n\n/** The idea board screen. Put `getInboxPageStackOptions({ headerTitle })` on its `<Stack.Screen>`. */\nexport function IdeaBoardScreen(props: IdeaBoardOptions) {\n const { headerTitle: _title, flush: _flush, ...board } = useIdeaBoard(props);\n return <InboxPage {...board} />;\n}\n","/**\n * The roadmap without dates: Now / Next / Later in a segmented control over\n * InboxPage rows. A tap opens the item in a sheet.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { View } from \"react-native\";\nimport { NativeButton, NativeSegmentedControl, NativeSheet, NativeSheetScrollView, NativeText } from \"@marktiderman/genesis-ui-native/components\";\nimport { InboxPage, type InboxItem, type InboxPageProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport type { FeatureHorizon } from \"@marktiderman/genesis-config\";\nimport type { ProductSource, RoadmapItem } from \"../app\";\nimport { mergeCopy, type ProductCopy, type ProductCopyInput } from \"./copy\";\nimport { haptic, type HapticsLike } from \"./haptics\";\n\n/** Options for {@link useRoadmap}. */\nexport interface RoadmapOptions {\n source: Pick<ProductSource, \"roadmap\">;\n /** The tab it opens on. Default `\"now\"`. */\n initial?: FeatureHorizon;\n haptics?: HapticsLike;\n copy?: ProductCopyInput;\n /** Default `\"product-roadmap\"`. */\n testID?: string;\n}\n\n/** What {@link useRoadmap} returns. */\nexport interface Roadmap {\n headerTitle: string;\n horizon: FeatureHorizon;\n setHorizon: (horizon: FeatureHorizon) => void;\n /** The open item, or `null`. */\n selected: RoadmapItem | null;\n close: () => void;\n page: Pick<\n InboxPageProps,\n \"items\" | \"loading\" | \"error\" | \"refreshing\" | \"onRefresh\" | \"emptyTitle\" | \"emptyBody\" | \"errorTitle\" | \"errorBody\" | \"testID\"\n >;\n copy: ProductCopy;\n}\n\nexport function useRoadmap(options: RoadmapOptions): Roadmap {\n const { source, haptics, testID = \"product-roadmap\" } = options;\n const copy = useMemo(() => mergeCopy(options.copy), [options.copy]);\n const [horizon, setHorizonState] = useState<FeatureHorizon>(options.initial ?? \"now\");\n const [all, setAll] = useState<RoadmapItem[] | null>(null);\n const [error, setError] = useState(false);\n const [refreshing, setRefreshing] = useState(false);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const alive = useRef(true);\n const latest = useRef(source);\n latest.current = source;\n\n const load = useCallback(async () => {\n try {\n const items = await latest.current.roadmap();\n if (alive.current) {\n setAll(items);\n setError(false);\n }\n } catch {\n if (alive.current) setError(true);\n }\n }, []);\n\n useEffect(() => {\n alive.current = true;\n void load();\n return () => {\n alive.current = false;\n };\n }, [load]);\n\n const items: InboxItem[] = (all ?? [])\n .filter((item) => item.horizon === horizon)\n .map((item) => ({\n id: item.id,\n title: item.title,\n preview: item.summary,\n meta: item.votes ? copy.ideas.votes(item.votes) : undefined,\n onPress: () => setSelectedId(item.id),\n testID: `${testID}-item-${item.id}`,\n }));\n\n return {\n headerTitle: copy.roadmap.title,\n horizon,\n setHorizon: (next) => {\n if (next === horizon) return;\n haptic(haptics, \"select\");\n setHorizonState(next);\n },\n // Read from the current rows, so a refresh shows in an open sheet; gone from them, it closes.\n selected: (selectedId && all?.find((item) => item.id === selectedId)) || null,\n close: () => setSelectedId(null),\n copy,\n page: {\n testID,\n items,\n loading: all === null && !error,\n error,\n refreshing,\n onRefresh: async () => {\n setRefreshing(true);\n try {\n await load();\n } finally {\n if (alive.current) setRefreshing(false);\n }\n },\n emptyTitle: copy.roadmap.emptyTitle,\n emptyBody: copy.roadmap.emptyBody,\n errorTitle: copy.roadmap.errorTitle,\n errorBody: copy.roadmap.errorBody,\n },\n };\n}\n\n/** One roadmap item in a sheet. */\nexport interface RoadmapDetailSheetProps {\n item: RoadmapItem;\n onClose: () => void;\n copy: ProductCopy;\n testID?: string;\n}\n\nexport function RoadmapDetailSheet({ item, onClose, copy, testID = \"product-roadmap-detail\" }: RoadmapDetailSheetProps) {\n return (\n <NativeSheet open onOpenChange={(open) => (open ? undefined : onClose())} fitContent testID={testID}>\n <NativeSheetScrollView contentContainerStyle={{ gap: 12, padding: 24 }}>\n <NativeText preset=\"h3\" accessibilityRole=\"header\">\n {item.title}\n </NativeText>\n <NativeText preset=\"label\" className=\"text-muted-foreground\">\n {[copy.roadmap[item.horizon], item.votes ? copy.ideas.votes(item.votes) : null].filter(Boolean).join(\" · \")}\n </NativeText>\n {item.summary ? <NativeText preset=\"body-sm\">{item.summary}</NativeText> : null}\n <NativeButton variant=\"outline\" onPress={onClose} testID={`${testID}-close`}>\n {copy.roadmap.close}\n </NativeButton>\n </NativeSheetScrollView>\n </NativeSheet>\n );\n}\n\n/** The roadmap screen: the segmented control above the rows, and the open item's sheet. */\nexport function RoadmapScreen(props: RoadmapOptions) {\n const roadmap = useRoadmap(props);\n const testID = roadmap.page.testID ?? \"product-roadmap\";\n const header = (\n <View style={{ paddingHorizontal: 16, paddingBottom: 12 }}>\n <NativeSegmentedControl<FeatureHorizon>\n testID={`${testID}-horizon`}\n value={roadmap.horizon}\n onChange={roadmap.setHorizon}\n options={([\"now\", \"next\", \"later\"] as const).map((h) => ({ value: h, label: roadmap.copy.roadmap[h] }))}\n />\n </View>\n );\n return (\n <>\n <InboxPage {...roadmap.page} header={header} />\n {roadmap.selected ? <RoadmapDetailSheet item={roadmap.selected} onClose={roadmap.close} copy={roadmap.copy} testID={`${testID}-detail`} /> : null}\n </>\n );\n}\n","/**\n * \"What's new\" in a sheet, once per app version plus over-the-air update\n * (`createProductWhatsNew` and `whatsNewKey` in the core), with notes fetched\n * from the source when it is due, never bundled.\n *\n * Hung off genesis-native's updates block: turn the block's own sheet off\n * (`createUpdates({ whatsNew: false, … })`) and render this inside\n * `GenesisNativeApp`, keyed by the same modules the block reads:\n *\n * const whatsNew = createProductWhatsNew({\n * source, storage: AsyncStorage,\n * key: whatsNewKey({ application: Application, updates: Updates }),\n * });\n * <ProductWhatsNew store={whatsNew} />\n */\nimport { useEffect, useMemo, useSyncExternalStore } from \"react\";\nimport { NativeWhatsNewSheet } from \"@marktiderman/genesis-ui-native/components\";\nimport type { ProductWhatsNew as ProductWhatsNewStore, ProductWhatsNewState, WhatsNewNote } from \"../app\";\nimport { mergeCopy, type ProductCopyInput } from \"./copy\";\n\n/** The store's state; loads it once on mount. */\nexport function useProductWhatsNew(store: ProductWhatsNewStore): ProductWhatsNewState {\n const state = useSyncExternalStore(store.subscribe, store.getState, store.getState);\n useEffect(() => {\n void store.load();\n }, [store]);\n return state;\n}\n\n/** The sheet itself. */\nexport interface ProductWhatsNewSheetProps {\n notes: readonly WhatsNewNote[];\n dismiss: () => void;\n /** \"Learn more\" on a note with a `url`: the sheet closes (and is remembered), then this opens it. */\n onOpenNote?: (note: WhatsNewNote) => void;\n copy?: ProductCopyInput;\n testID?: string;\n}\n\n/**\n * The sheet, in the product's copy: genesis-ui-native's `NativeWhatsNewSheet` with the notes'\n * ids as keys.\n *\n * @deprecated Render `NativeWhatsNewSheet` from `@marktiderman/genesis-ui-native` (the one\n * \"what's new\" sheet, also behind genesis-native's updates block), mapping each note to\n * `{ key: note.id, title, body, url }`; `ProductWhatsNew` keeps working and renders it.\n */\nexport function ProductWhatsNewSheet(props: ProductWhatsNewSheetProps) {\n return <WhatsNewSheetForProduct {...props} />;\n}\n\nfunction WhatsNewSheetForProduct({ notes, dismiss, onOpenNote, copy: input, testID = \"product-whats-new\" }: ProductWhatsNewSheetProps) {\n const copy = useMemo(() => mergeCopy(input), [input]);\n const byKey = useMemo(() => new Map(notes.map((note) => [note.id, note])), [notes]);\n return (\n <NativeWhatsNewSheet\n notes={notes.map((note) => ({ key: note.id, title: note.title, ...(note.body ? { body: note.body } : {}), ...(note.url ? { url: note.url } : {}) }))}\n dismiss={dismiss}\n {...(onOpenNote ? { onOpenNote: (note: { key: string }) => onOpenNote(byKey.get(note.key)!) } : {})}\n title={copy.whatsNew.title}\n doneLabel={copy.whatsNew.done}\n learnMoreLabel={copy.whatsNew.learnMore}\n testID={testID}\n noteTestID={(key) => `${testID}-note-${key}`}\n />\n );\n}\n\nexport interface ProductWhatsNewProps extends Omit<ProductWhatsNewSheetProps, \"notes\" | \"dismiss\"> {\n store: ProductWhatsNewStore;\n}\n\n/** Renders the sheet while the store shows notes, and nothing otherwise. */\nexport function ProductWhatsNew({ store, ...sheet }: ProductWhatsNewProps) {\n const state = useProductWhatsNew(store);\n if (state.status !== \"showing\") return null;\n return <WhatsNewSheetForProduct {...sheet} notes={state.notes} dismiss={store.dismiss} />;\n}\n"]}
package/dist/node.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CatalogFeature, Signal, SignalSource } from './index.js';
2
2
  export { Board, BoardItem, Importance, MemoryProductSeed, ProductIdea, ProductIdeaStatus, ProductSource, ProductStorageLike, ProductWhatsNew, ProductWhatsNewOptions, ProductWhatsNewState, QueuedVote, ReleaseChange, RenderBoardOptions, RenderReleaseOptions, RoadmapFromBoardOptions, RoadmapItem, SIGNAL_KINDS, SignalKind, VoteFlushResult, VoteQueue, VoteQueueOptions, VoteQueueStore, VoteRefusedError, WhatsNewApplicationLike, WhatsNewNote, WhatsNewUpdatesLike, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './index.js';
3
3
  export { NOTIFY_BATCH, NotifyShippedOptions, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, ProductCancelInput, ProductNotifyInput, ProductRecipient, ShippedData, ShippedFeature, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './server.js';
4
- import '@marktiderman/genesis-features';
4
+ import '@marktiderman/genesis-config';
5
5
 
6
6
  /**
7
7
  * The catalog from a `features.json` (what `genesis features build` writes),
package/dist/node.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { BOARD_LABEL, catalogAt, closeAnswered, githubSignals, issueToSignal, parseCatalog, publishBoardIssue, readCatalog, repoFromGit } from './chunk-ZL7SMZKX.js';
2
- export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-TJ5YBFJJ.js';
2
+ export { SIGNAL_KINDS, VoteRefusedError, answeredBy, buildBoard, createProductWhatsNew, createVoteQueue, demand, diffRelease, isPermanentVoteError, memoryProductSource, memorySignals, memoryVoteQueueStore, renderBoard, renderRelease, roadmapFromBoard, storageVoteQueueStore, whatsNewKey } from './chunk-OVFCCATA.js';
3
3
  export { NOTIFY_BATCH, PRODUCT_SHIPPED_TYPE, PRODUCT_UPDATES_CATEGORY, cancelShipped, isAppPath, notifyShipped, productNotifications, shippedKey } from './chunk-WICY5UX4.js';
4
4
  //# sourceMappingURL=node.js.map
5
5
  //# sourceMappingURL=node.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-product",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "The product system for a Genesis repo: a Now / Next / Later board from features.ts with demand from ideas and feedback, a triage inbox, and release notes that close the loop with the people who asked. Ideas and feedback come from GitHub issues today, behind a SignalSource contract. Part of the Genesis framework.",
@@ -59,7 +59,7 @@
59
59
  "SKILL.md"
60
60
  ],
61
61
  "dependencies": {
62
- "@marktiderman/genesis-features": "^0.8.2"
62
+ "@marktiderman/genesis-config": "^0.11.0"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@marktiderman/genesis-ui-native": ">=3.8.0 <4.0.0",
@@ -82,8 +82,8 @@
82
82
  }
83
83
  },
84
84
  "devDependencies": {
85
- "@marktiderman/genesis-notifications": "^0.4.2",
86
- "@marktiderman/genesis-ui-native": "^3.9.0",
85
+ "@marktiderman/genesis-notifications": "^0.4.5",
86
+ "@marktiderman/genesis-ui-native": "^3.14.0",
87
87
  "@testing-library/react": "^16.3.2",
88
88
  "@types/node": "^22.9.0",
89
89
  "@types/react": "^19.2.14",
package/src/app.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * memory source here is for tests and demos), and votes go through a queue
7
7
  * that survives being offline. No React and no I/O: `/native` draws it.
8
8
  */
9
- import type { FeatureHorizon, FeatureStatus } from "@marktiderman/genesis-features";
9
+ import type { FeatureHorizon, FeatureStatus } from "@marktiderman/genesis-config";
10
10
  import type { Board } from "./board";
11
11
 
12
12
  /** Where an idea stands. @stability Experimental */
package/src/model.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FeatureHorizon, FeatureStatus } from "@marktiderman/genesis-features";
1
+ import type { FeatureHorizon, FeatureStatus } from "@marktiderman/genesis-config";
2
2
 
3
3
  /**
4
4
  * A feature as the product system reads it: one entry of `features.json` (the
@@ -6,7 +6,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { View } from "react-native";
7
7
  import { NativeButton, NativeSegmentedControl, NativeSheet, NativeSheetScrollView, NativeText } from "@marktiderman/genesis-ui-native/components";
8
8
  import { InboxPage, type InboxItem, type InboxPageProps } from "@marktiderman/genesis-ui-native/layouts";
9
- import type { FeatureHorizon } from "@marktiderman/genesis-features";
9
+ import type { FeatureHorizon } from "@marktiderman/genesis-config";
10
10
  import type { ProductSource, RoadmapItem } from "../app";
11
11
  import { mergeCopy, type ProductCopy, type ProductCopyInput } from "./copy";
12
12
  import { haptic, type HapticsLike } from "./haptics";
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/model.ts","../src/board.ts","../src/release.ts","../src/app.ts"],"names":["list"],"mappings":";AAsBO,IAAM,YAAA,GAAe,CAAC,MAAA,EAAQ,UAAA,EAAY,KAAK;AAuD/C,SAAS,cAAc,OAAA,EAA0C;AACtE,EAAA,OAAO,EAAE,IAAA,EAAM,YAAY,CAAC,GAAG,OAAO,CAAA,EAAE;AAC1C;;;AC7CO,SAAS,OAAO,OAAA,EAAoC;AACzD,EAAA,OAAO,QAAQ,MAAA,CAAO,CAAC,MAAM,CAAA,CAAE,KAAA,KAAU,MAAM,CAAA,CAAE,MAAA,CAAO,CAAC,GAAA,EAAK,MAAM,GAAA,IAAO,CAAA,CAAE,cAAc,CAAA,CAAA,GAAK,CAAA,CAAE,OAAO,CAAC,CAAA;AAC5G;AAEA,SAAS,UAAA,CAAW,GAAc,CAAA,EAAsB;AACtD,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,MAAA,KAAW,UAAU,CAAA,GAAI,MAAA,CAAO,CAAA,CAAE,OAAA,CAAQ,MAAA,KAAW,UAAU,CAAA;AACjG,EAAA,OAAO,QAAA,IAA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A,EAAU,KAAA,EAAO,EAAC,EAAG,CAAA;AAChE,QAAA,IAAI,GAAA;AACJ,QAAA,IAAI;AACF,UAAA,GAAA,GAAM,MAAM,OAAA,CAAQ,OAAA,CAAQ,UAAU,CAAA;AAAA,QACxC,SAAS,KAAA,EAAO;AACd,UAAA,MAAA,CAAO,KAAK,CAAA;AACZ,UAAA,OAAO,IAAI,EAAE,MAAA,EAAQ,UAAU,KAAA,EAAO,IAAI,CAAA;AAAA,QAC5C;AACA,QAAA,IAAA,GAAO,UAAU,GAAG,CAAA;AAEpB,QAAA,IAAI,SAAA,EAAW;AACf,QAAA,IAAI,QAAQ,IAAA,EAAM;AAChB,UAAA,QAAA,EAAS;AACT,UAAA,OAAO,IAAI,EAAE,MAAA,EAAQ,UAAU,KAAA,EAAO,IAAI,CAAA;AAAA,QAC5C;AACA,QAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,EAAG,OAAO,GAAA,CAAI,EAAE,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,EAAC,EAAG,CAAA;AAClE,QAAA,MAAM,WAAW,IAAI,CAAA;AAAA,MACvB,CAAA,GAAG;AACH,MAAA,OAAO,OAAA;AAAA,IACT,CAAA;AAAA,IACA,IAAA,EAAM,MAAM,UAAA,CAAW,KAAK,CAAA;AAAA,IAC5B,OAAA,GAAU;AACR,MAAA,OAAA,EAAA;AACA,MAAA,SAAA,GAAY,IAAA;AACZ,MAAA,QAAA,EAAS;AACT,MAAA,GAAA,CAAI,EAAE,MAAA,EAAQ,QAAA,EAAU,KAAA,EAAO,IAAI,CAAA;AAAA,IACrC;AAAA,GACF;AACF","file":"chunk-TJ5YBFJJ.js","sourcesContent":["import type { FeatureHorizon, FeatureStatus } from \"@marktiderman/genesis-features\";\n\n/**\n * A feature as the product system reads it: one entry of `features.json` (the\n * registry's generated output), so the catalog is always the code's own list.\n *\n * @stability Experimental\n */\nexport interface CatalogFeature {\n id: string;\n name: string;\n summary: string;\n status: FeatureStatus;\n owner: string;\n horizon?: FeatureHorizon;\n claimedBy?: string;\n tagline?: string;\n visibility?: string;\n aliases?: readonly string[];\n}\n\n/** What someone sent: an idea, a piece of feedback or a bug. @stability Experimental */\nexport const SIGNAL_KINDS = [\"idea\", \"feedback\", \"bug\"] as const;\n\n/** @stability Experimental */\nexport type SignalKind = (typeof SIGNAL_KINDS)[number];\n\n/**\n * How much a signal matters to the feature it is linked to, set by whoever\n * triages it: 1 nice to have, 2 important, 3 critical. Unset counts as 1.\n *\n * @stability Experimental\n */\nexport type Importance = 1 | 2 | 3;\n\n/**\n * One piece of evidence from a person: the intake record every source maps to.\n * Linked to a feature by `featureId` once triaged; until then it waits in the\n * triage inbox.\n *\n * @stability Experimental\n */\nexport interface Signal {\n /** Unique within its source, e.g. `github#12`. */\n id: string;\n kind: SignalKind;\n title: string;\n url?: string;\n /**\n * The FeatureId it is evidence for, set by whoever triages it (on GitHub, a\n * `feature:<id>` label, which only triagers can add). Unset means not triaged\n * yet. Only a linked signal counts toward demand or is closed by a release.\n */\n featureId?: string;\n /** The FeatureId the sender named themselves: untrusted, shown in triage only. */\n suggestedFeatureId?: string;\n author?: string;\n /** People who added their support (a 👍 on GitHub), not counting the author or bots. */\n votes: number;\n importance?: Importance;\n state: \"open\" | \"closed\";\n /** ISO 8601. */\n createdAt: string;\n}\n\n/**\n * Where signals come from. GitHub issues today (`githubSignals` in `/node`); a\n * database source implements the same contract later, and nothing above it\n * changes.\n *\n * @stability Experimental\n */\nexport interface SignalSource {\n list(): Promise<Signal[]>;\n}\n\n/** Signals held in memory, for tests and demos. @stability Experimental */\nexport function memorySignals(signals: readonly Signal[]): SignalSource {\n return { list: async () => [...signals] };\n}\n","import type { CatalogFeature, Signal } from \"./model\";\n\n/** A feature on the board with the evidence behind it. @stability Experimental */\nexport interface BoardItem {\n feature: CatalogFeature;\n /** Open signals linked to it. */\n signals: Signal[];\n demand: number;\n}\n\n/**\n * The roadmap without dates: what is being built now, next and later, the\n * ideas not yet agreed (ranked by demand), and the signals still to triage.\n *\n * @stability Experimental\n */\nexport interface Board {\n now: BoardItem[];\n next: BoardItem[];\n later: BoardItem[];\n ideas: BoardItem[];\n /** Open signals with no feature yet, newest first. */\n untriaged: Signal[];\n /** Open signals naming a feature id the catalog doesn't have. */\n unknown: Signal[];\n}\n\n/**\n * Demand for a feature: each open signal counts its importance (1 when unset)\n * plus its votes. Closed signals don't count, so demand falls as asks are\n * answered.\n *\n * @stability Experimental\n */\nexport function demand(signals: readonly Signal[]): number {\n return signals.filter((s) => s.state === \"open\").reduce((sum, s) => sum + (s.importance ?? 1) + s.votes, 0);\n}\n\nfunction byPriority(a: BoardItem, b: BoardItem): number {\n const building = Number(b.feature.status === \"building\") - Number(a.feature.status === \"building\");\n return building || b.demand - a.demand || a.feature.name.localeCompare(b.feature.name);\n}\n\n/**\n * Lays the catalog and its signals out as a board. A building feature with no\n * horizon counts as now. Signals are matched to features by id or alias.\n *\n * @stability Experimental\n */\nexport function buildBoard(features: readonly CatalogFeature[], signals: readonly Signal[]): Board {\n const owner = new Map<string, CatalogFeature>();\n for (const f of features) for (const name of [f.id, ...(f.aliases ?? [])]) owner.set(name, f);\n\n const linked = new Map<string, Signal[]>();\n const untriaged: Signal[] = [];\n const unknown: Signal[] = [];\n for (const s of signals) {\n if (s.state !== \"open\") continue;\n if (!s.featureId) untriaged.push(s);\n else {\n const f = owner.get(s.featureId);\n if (!f) unknown.push(s);\n else linked.set(f.id, [...(linked.get(f.id) ?? []), s]);\n }\n }\n\n const board: Board = { now: [], next: [], later: [], ideas: [], untriaged, unknown };\n for (const f of features) {\n const own = linked.get(f.id) ?? [];\n const item: BoardItem = { feature: f, signals: own, demand: demand(own) };\n if (f.status === \"idea\") board.ideas.push(item);\n else if (f.status === \"planned\" || f.status === \"building\") board[f.horizon ?? \"now\"].push(item);\n }\n for (const column of [board.now, board.next, board.later, board.ideas]) column.sort(byPriority);\n const newest = (a: Signal, b: Signal) => b.createdAt.localeCompare(a.createdAt);\n untriaged.sort(newest);\n unknown.sort(newest);\n return board;\n}\n\nconst cell = (text: string) => text.replace(/\\|/g, \"\\\\|\").replace(/\\s+/g, \" \").trim();\n/**\n * Text people wrote (an issue title) as an inline code span, so the board\n * can't be made to @mention anyone, link anywhere or show an image.\n */\nconst quoted = (text: string) => `\\`${text.replace(/\\s+/g, \" \").trim().replace(/`/g, \"'\") || \" \"}\\``;\nconst ref = (s: Signal) => (s.url ? `[${s.id.replace(/^github/, \"\")}](${s.url})` : s.id);\n\nfunction table(items: readonly BoardItem[]): string {\n if (!items.length) return \"_Nothing here._\\n\";\n const rows = items.map(\n (i) =>\n `| ${cell(i.feature.name)} (\\`${i.feature.id}\\`) | ${i.feature.status} | ${cell(i.feature.claimedBy ?? i.feature.owner)} | ${i.demand} | ${i.signals.map(ref).join(\" \")} |`,\n );\n return [\"| Feature | Status | Who | Demand | Asks |\", \"| --- | --- | --- | ---: | --- |\", ...rows].join(\"\\n\") + \"\\n\";\n}\n\nfunction list(signals: readonly Signal[]): string {\n if (!signals.length) return \"_Nothing to triage._\\n\";\n return (\n signals\n .map((s) => {\n const named = s.featureId ?? s.suggestedFeatureId;\n return `- ${ref(s)} ${s.kind}: ${quoted(s.title)}${named ? ` (${s.featureId ? \"linked to\" : \"suggests\"} \\`${named}\\`)` : \"\"}`;\n })\n .join(\"\\n\") + \"\\n\"\n );\n}\n\n/** Options for {@link renderBoard}. @stability Experimental */\nexport interface RenderBoardOptions {\n /** Shown in the header, e.g. `2026-10-25`. */\n date: string;\n /** How many ideas to list. Default 15. */\n ideas?: number;\n}\n\n/**\n * The board as GitHub-flavoured markdown: one table per horizon, the top ideas\n * by demand, and the triage inbox.\n *\n * @stability Experimental\n */\nexport function renderBoard(board: Board, options: RenderBoardOptions): string {\n const ideas = board.ideas.slice(0, options.ideas ?? 15);\n return [\n \"# Product board\",\n \"\",\n `Generated ${options.date} by \\`genesis-product board\\` from \\`features.ts\\` and the idea and feedback issues. Don't edit it: change \\`features.ts\\`, or open an issue. A 👍 on an issue is a vote.`,\n \"\",\n \"Demand counts each open ask linked to a feature (its importance, 1 to 3) plus its 👍.\",\n \"\",\n `## Now (${board.now.length})`,\n \"\",\n table(board.now),\n `## Next (${board.next.length})`,\n \"\",\n table(board.next),\n `## Later (${board.later.length})`,\n \"\",\n table(board.later),\n `## Ideas (top ${ideas.length} of ${board.ideas.length} by demand)`,\n \"\",\n table(ideas),\n `## To triage (${board.untriaged.length})`,\n \"\",\n \"Link each to a feature by adding the `feature:<id>` label. The id a sender suggests counts only once a triager adds the label.\",\n \"\",\n list(board.untriaged),\n ...(board.unknown.length ? [`## Unknown feature ids (${board.unknown.length})`, \"\", list(board.unknown)] : []),\n ].join(\"\\n\");\n}\n","import type { CatalogFeature, Signal } from \"./model\";\n\n/** What a release did to one feature. @stability Experimental */\nexport interface ReleaseChange {\n feature: CatalogFeature;\n /** `live`: shipped to everyone. `beta`: shipped to try. */\n change: \"live\" | \"beta\";\n /** Its status before, or `undefined` when it is new in the catalog. */\n from?: CatalogFeature[\"status\"];\n}\n\n/**\n * The features a release shipped: those that reached `live` or `beta` between\n * the catalog before and after it. Features with `visibility: internal` are\n * left out of release notes.\n *\n * @stability Experimental\n */\nexport function diffRelease(before: readonly CatalogFeature[], after: readonly CatalogFeature[]): ReleaseChange[] {\n const was = new Map(before.map((f) => [f.id, f.status]));\n const changes: ReleaseChange[] = [];\n for (const f of after) {\n if (f.visibility === \"internal\") continue;\n const from = was.get(f.id);\n if (from === f.status) continue;\n if (f.status === \"live\") changes.push({ feature: f, change: \"live\", from });\n else if (f.status === \"beta\" && from !== \"live\") changes.push({ feature: f, change: \"beta\", from });\n }\n return changes.sort((a, b) => a.change.localeCompare(b.change) || a.feature.name.localeCompare(b.feature.name));\n}\n\n/**\n * The open ideas a release answers: the people to tell, and the asks to close.\n * This is how the loop closes. Feedback and bugs are left alone: a feature\n * going live doesn't mean a reported problem with it is fixed.\n *\n * @stability Experimental\n */\nexport function answeredBy(changes: readonly ReleaseChange[], signals: readonly Signal[]): Signal[] {\n const shipped = new Set(changes.flatMap((c) => [c.feature.id, ...(c.feature.aliases ?? [])]));\n return signals.filter((s) => s.kind === \"idea\" && s.state === \"open\" && s.featureId !== undefined && shipped.has(s.featureId));\n}\n\n/** Options for {@link renderRelease}. @stability Experimental */\nexport interface RenderReleaseOptions {\n /** The release's name, e.g. `2026-10-25` or a version. */\n name: string;\n}\n\n/**\n * Draft release notes for people, not developers: each feature's tagline (or\n * its summary), grouped into shipped and in beta, with the asks it answers. A\n * person edits and publishes them.\n *\n * @stability Experimental\n */\nexport function renderRelease(changes: readonly ReleaseChange[], signals: readonly Signal[], options: RenderReleaseOptions): string {\n const answered = answeredBy(changes, signals);\n const section = (title: string, kind: ReleaseChange[\"change\"]) => {\n const own = changes.filter((c) => c.change === kind);\n if (!own.length) return [];\n return [\n `## ${title}`,\n \"\",\n ...own.map((c) => {\n const asks = answered.filter((s) => s.featureId === c.feature.id || c.feature.aliases?.includes(s.featureId!));\n const thanks = asks.length ? ` Asked for in ${asks.map((s) => (s.url ? `[${s.id.replace(/^github/, \"\")}](${s.url})` : s.id)).join(\", \")}.` : \"\";\n return `- **${c.feature.name}**: ${c.feature.tagline ?? c.feature.summary}${thanks}`;\n }),\n \"\",\n ];\n };\n const body = [...section(\"Shipped\", \"live\"), ...section(\"In beta\", \"beta\")];\n return [`# Release ${options.name}`, \"\", ...(body.length ? body : [\"_No feature reached beta or live in this range._\", \"\"])].join(\"\\n\");\n}\n","// @feat:product-roadmap @feat:product-insights\n/**\n * What an app shows people about the product: the idea board (with votes), the\n * Now / Next / Later roadmap and \"what's new\". Data comes through a\n * `ProductSource` the app passes in (a Supabase source comes later; the\n * memory source here is for tests and demos), and votes go through a queue\n * that survives being offline. No React and no I/O: `/native` draws it.\n */\nimport type { FeatureHorizon, FeatureStatus } from \"@marktiderman/genesis-features\";\nimport type { Board } from \"./board\";\n\n/** Where an idea stands. @stability Experimental */\nexport type ProductIdeaStatus = \"open\" | \"planned\" | \"building\" | \"shipped\" | \"declined\";\n\n/** An idea on the board, as the signed-in person sees it. @stability Experimental */\nexport interface ProductIdea {\n id: string;\n title: string;\n body?: string;\n /** The FeatureId it was linked to, once triaged. */\n featureId?: string;\n /** People who voted for it, the signed-in person included. */\n votes: number;\n /** The signed-in person voted for it. */\n voted: boolean;\n status: ProductIdeaStatus;\n}\n\n/** One row of the roadmap. @stability Experimental */\nexport interface RoadmapItem {\n /** The FeatureId. */\n id: string;\n title: string;\n summary?: string;\n horizon: FeatureHorizon;\n status?: FeatureStatus;\n /** Demand, when the source knows it. */\n votes?: number;\n}\n\n/** One entry of \"what's new\". @stability Experimental */\nexport interface WhatsNewNote {\n id: string;\n title: string;\n body?: string;\n /** An app path to open for more. */\n url?: string;\n}\n\n/**\n * Where the screens read from and vote through. Injected, so the screens\n * don't care whether it is memory, Supabase or something else.\n *\n * `vote` and `unvote` are idempotent (voting twice is one vote). A refusal\n * that retrying won't fix (not allowed, the idea is gone) throws an error with\n * `permanent: true` (see {@link VoteRefusedError}) or an HTTP 4xx `status`;\n * anything else is retried.\n *\n * @stability Experimental\n */\nexport interface ProductSource {\n ideas(): Promise<ProductIdea[]>;\n vote(ideaId: string): Promise<void>;\n unvote(ideaId: string): Promise<void>;\n roadmap(): Promise<RoadmapItem[]>;\n /** The notes for one app version plus over-the-air update (see `whatsNewKey`), newest first. */\n whatsNew(key: string): Promise<WhatsNewNote[]>;\n}\n\n/** A vote the source refused for good: the queue drops it and the board shows the source's state again. @stability Experimental */\nexport class VoteRefusedError extends Error {\n readonly permanent = true;\n constructor(message = \"This vote was refused.\") {\n super(message);\n this.name = \"VoteRefusedError\";\n }\n}\n\n/** True for an error retrying won't fix: `permanent: true`, or an HTTP 4xx other than 408 and 429. @stability Experimental */\nexport function isPermanentVoteError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const e = error as { permanent?: unknown; status?: unknown };\n if (e.permanent === true) return true;\n return typeof e.status === \"number\" && e.status >= 400 && e.status < 500 && e.status !== 408 && e.status !== 429;\n}\n\n/** Options for {@link roadmapFromBoard}. @stability Experimental */\nexport interface RoadmapFromBoardOptions {\n /** The client whose own features (`visibility: \"client:<name>\"`) this roadmap may show. Default: none. */\n client?: string;\n}\n\n/**\n * The board's Now / Next / Later columns as roadmap rows. Only features\n * everyone may see are kept (`public`, `customer`, or no visibility):\n * `internal` and every `client:<name>` feature are left out, except that\n * `client`'s own when it is given.\n *\n * @stability Experimental\n */\nexport function roadmapFromBoard(board: Pick<Board, \"now\" | \"next\" | \"later\">, options: RoadmapFromBoardOptions = {}): RoadmapItem[] {\n const visible = (v: string | undefined) => v === undefined || v === \"public\" || v === \"customer\" || (options.client !== undefined && v === `client:${options.client}`);\n return ([\"now\", \"next\", \"later\"] as const).flatMap((horizon) =>\n board[horizon]\n .filter((item) => visible(item.feature.visibility))\n .map((item) => ({\n id: item.feature.id,\n title: item.feature.name,\n summary: item.feature.tagline ?? item.feature.summary,\n horizon,\n status: item.feature.status,\n votes: item.demand,\n })),\n );\n}\n\n/** What {@link memoryProductSource} starts with. @stability Experimental */\nexport interface MemoryProductSeed {\n ideas?: readonly ProductIdea[];\n roadmap?: readonly RoadmapItem[];\n /** Notes by `whatsNewKey`; `\"*\"` answers every key. */\n whatsNew?: Readonly<Record<string, readonly WhatsNewNote[]>>;\n}\n\n/** A source in memory, for tests and demos: votes change its own copy. @stability Experimental */\nexport function memoryProductSource(seed: MemoryProductSeed = {}): ProductSource {\n let ideas = (seed.ideas ?? []).map((i) => ({ ...i }));\n const set = (ideaId: string, voted: boolean) => {\n const idea = ideas.find((i) => i.id === ideaId);\n if (!idea) throw new VoteRefusedError(`No idea ${ideaId}.`);\n if (idea.voted === voted) return;\n ideas = ideas.map((i) => (i.id === ideaId ? { ...i, voted, votes: Math.max(0, i.votes + (voted ? 1 : -1)) } : i));\n };\n return {\n ideas: async () => ideas.map((i) => ({ ...i })).sort((a, b) => b.votes - a.votes || a.title.localeCompare(b.title)),\n vote: async (id) => set(id, true),\n unvote: async (id) => set(id, false),\n roadmap: async () => (seed.roadmap ?? []).map((r) => ({ ...r })),\n whatsNew: async (key) => [...(seed.whatsNew?.[key] ?? seed.whatsNew?.[\"*\"] ?? [])],\n };\n}\n\n/** A vote waiting to reach the source: the person wants `voted`; `base` is what the source has. @stability Experimental */\nexport interface QueuedVote {\n ideaId: string;\n voted: boolean;\n base: boolean;\n}\n\n/** Where the queue is kept between launches (AsyncStorage, MMKV). @stability Experimental */\nexport interface VoteQueueStore {\n load(): Promise<QueuedVote[]>;\n save(queue: QueuedVote[]): Promise<void>;\n}\n\n/** A queue store in memory (the default: queued votes last as long as the app runs). @stability Experimental */\nexport function memoryVoteQueueStore(initial: readonly QueuedVote[] = []): VoteQueueStore {\n let saved = initial.map((v) => ({ ...v }));\n return {\n load: async () => saved.map((v) => ({ ...v })),\n save: async (queue) => void (saved = queue.map((v) => ({ ...v }))),\n };\n}\n\n/** AsyncStorage's shape (also MMKV's async adapter). @stability Experimental */\nexport interface ProductStorageLike {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n}\n\n/** A queue store in AsyncStorage, under one key. A value that can't be read counts as empty. @stability Experimental */\nexport function storageVoteQueueStore(storage: ProductStorageLike, key = \"genesis:product:votes\"): VoteQueueStore {\n return {\n async load() {\n const raw = JSON.parse((await storage.getItem(key)) ?? \"[]\") as unknown;\n if (!Array.isArray(raw)) return [];\n return raw.filter(\n (v): v is QueuedVote => !!v && typeof v === \"object\" && typeof v.ideaId === \"string\" && typeof v.voted === \"boolean\" && typeof v.base === \"boolean\",\n );\n },\n save: (queue) => storage.setItem(key, JSON.stringify(queue)),\n };\n}\n\n/** What one {@link VoteQueue.flush} did. @stability Experimental */\nexport interface VoteFlushResult {\n /** Reached the source, with the vote it now has. */\n sent: { ideaId: string; voted: boolean }[];\n /** Refused for good and dropped: the board shows the source's state again. */\n refused: string[];\n /** Couldn't be sent (offline): kept for the next flush. */\n failed: string[];\n}\n\n/** @stability Experimental */\nexport interface VoteQueue {\n /** Reads the saved queue (votes from before a relaunch). Never rejects; runs once. */\n load(): Promise<void>;\n /** The votes not yet sent. */\n pending(): QueuedVote[];\n /** `ideas` with the person's unsent votes laid over them. */\n apply(ideas: readonly ProductIdea[]): ProductIdea[];\n /**\n * Flips the person's vote on an idea as the source last reported it: queued\n * and saved at once. Toggling back to what the source has cancels the queued\n * vote, so nothing is sent. Resolves once saved, not sent: then `flush()`.\n */\n toggle(idea: ProductIdea): Promise<void>;\n /** Sends what is queued, one at a time. A call while one runs waits for it, then sends what is left. */\n flush(): Promise<VoteFlushResult>;\n /** Called on every change to the queue. Returns the unsubscribe. */\n subscribe(listener: () => void): () => void;\n}\n\n/** Options for {@link createVoteQueue}. @stability Experimental */\nexport interface VoteQueueOptions {\n source: Pick<ProductSource, \"vote\" | \"unvote\">;\n /** Default {@link memoryVoteQueueStore}. */\n store?: VoteQueueStore;\n /** Every error, from a send (a refusal included) or the store. */\n onError?: (error: unknown, ideaId?: string) => void;\n}\n\n/**\n * The offline vote queue, modelled on chat's outbox: a vote shows at once, is\n * saved, and is sent when there is a connection (`flush()`: on start, after\n * each vote and on reconnect). Votes on one idea collapse into the last one,\n * and a toggle back before it is sent sends nothing.\n *\n * @stability Experimental\n */\nexport function createVoteQueue(options: VoteQueueOptions): VoteQueue {\n const store = options.store ?? memoryVoteQueueStore();\n const queue = new Map<string, QueuedVote>();\n const inFlight = new Set<string>();\n const listeners = new Set<() => void>();\n let loading: Promise<void> | null = null;\n let running: Promise<VoteFlushResult> | null = null;\n let again = false;\n\n const report = (error: unknown, ideaId?: string) => {\n try {\n options.onError?.(error, ideaId);\n } catch {\n // a failing reporter never breaks a vote\n }\n };\n const changed = () => {\n for (const l of [...listeners]) l();\n };\n const save = async () => {\n try {\n await store.save([...queue.values()].map((v) => ({ ...v })));\n } catch (error) {\n report(error);\n }\n };\n\n const sendAll = async (): Promise<VoteFlushResult> => {\n const result: VoteFlushResult = { sent: [], refused: [], failed: [] };\n for (const ideaId of [...queue.keys()]) {\n // Read it again: a vote toggled back while an earlier one was being sent is gone, or changed.\n const entry = queue.get(ideaId);\n if (!entry) continue;\n const sent = { ...entry };\n inFlight.add(ideaId);\n try {\n await (sent.voted ? options.source.vote(sent.ideaId) : options.source.unvote(sent.ideaId));\n const now = queue.get(sent.ideaId);\n // The source now has `sent.voted`; a toggle made meanwhile stays queued only if it differs.\n if (now) {\n if (now.voted === sent.voted) queue.delete(sent.ideaId);\n else now.base = sent.voted;\n }\n result.sent.push({ ideaId: sent.ideaId, voted: sent.voted });\n } catch (error) {\n report(error, sent.ideaId);\n if (isPermanentVoteError(error)) {\n const now = queue.get(sent.ideaId);\n if (now && now.voted === sent.voted) queue.delete(sent.ideaId);\n result.refused.push(sent.ideaId);\n } else result.failed.push(sent.ideaId);\n } finally {\n inFlight.delete(sent.ideaId);\n }\n }\n if (result.sent.length || result.refused.length) {\n await save();\n changed();\n }\n return result;\n };\n\n const self: VoteQueue = {\n load() {\n loading ??= (async () => {\n try {\n const stored = await store.load();\n for (const v of stored) if (!queue.has(v.ideaId)) queue.set(v.ideaId, { ...v });\n // Votes cast before this read are saved with the stored ones, so neither is lost.\n if (queue.size !== stored.length) await save();\n } catch (error) {\n report(error);\n }\n changed();\n })();\n return loading;\n },\n pending: () => [...queue.values()].map((v) => ({ ...v })),\n apply(ideas) {\n return ideas.map((idea) => {\n const q = queue.get(idea.id);\n if (!q || q.voted === idea.voted) return idea;\n return { ...idea, voted: q.voted, votes: Math.max(0, idea.votes + (q.voted ? 1 : -1)) };\n });\n },\n async toggle(idea) {\n // The saved queue first: a save before it is read would overwrite it.\n await self.load();\n const q = queue.get(idea.id);\n const base = q?.base ?? idea.voted;\n const voted = !(q?.voted ?? idea.voted);\n // Back to what the source has: nothing to send, unless a send for it is on its way.\n if (voted === base && !inFlight.has(idea.id)) queue.delete(idea.id);\n else queue.set(idea.id, { ideaId: idea.id, voted, base });\n changed();\n await save();\n },\n flush() {\n if (running) {\n again = true;\n return running;\n }\n running = (async () => {\n await self.load();\n let result = await sendAll();\n while (again) {\n again = false;\n const next = await sendAll();\n result = { sent: [...result.sent, ...next.sent], refused: [...result.refused, ...next.refused], failed: next.failed };\n }\n return result;\n })().finally(() => {\n running = null;\n });\n return running;\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n };\n return self;\n}\n\n/** The shape `whatsNewKey` reads from expo-application (genesis-native's `ApplicationLike`). @stability Experimental */\nexport interface WhatsNewApplicationLike {\n readonly nativeApplicationVersion: string | null;\n}\n\n/** The shape `whatsNewKey` reads from expo-updates (genesis-native's `UpdatesModuleLike`). @stability Experimental */\nexport interface WhatsNewUpdatesLike {\n readonly isEnabled: boolean;\n readonly updateId: string | null;\n readonly isEmbeddedLaunch: boolean;\n}\n\n/**\n * What \"what's new\" is shown once for: the store version plus the\n * over-the-air update running (`\"1.4.0+3f2a…\"`), or `\"1.4.0+embedded\"` for\n * the code that shipped in the binary. `null` without a version: it never shows.\n *\n * @stability Experimental\n */\nexport function whatsNewKey(input: { application?: WhatsNewApplicationLike | null; updates?: WhatsNewUpdatesLike | null }): string | null {\n const version = input.application?.nativeApplicationVersion;\n if (!version) return null;\n const u = input.updates;\n const update = u && u.isEnabled && !u.isEmbeddedLaunch && u.updateId ? u.updateId : \"embedded\";\n return `${version}+${update}`;\n}\n\n/** How many \"what's new\" keys are remembered. */\nconst MAX_SEEN_KEYS = 20;\n\nfunction parseSeen(raw: string | null): string[] {\n if (raw === null) return [];\n try {\n const list = JSON.parse(raw) as unknown;\n if (Array.isArray(list)) return list.filter((k): k is string => typeof k === \"string\").slice(-MAX_SEEN_KEYS);\n } catch {\n // a plain key, written before the list\n }\n return [raw];\n}\n\n/** @stability Experimental */\nexport interface ProductWhatsNewState {\n /** `loading`: reading what was seen; `fetching`: the notes are on their way; `showing`: open. */\n status: \"loading\" | \"hidden\" | \"fetching\" | \"showing\";\n notes: readonly WhatsNewNote[];\n}\n\n/** Options for {@link createProductWhatsNew}. @stability Experimental */\nexport interface ProductWhatsNewOptions {\n source: Pick<ProductSource, \"whatsNew\">;\n /** `whatsNewKey(...)`. `null`: never shows by itself. */\n key: string | null;\n /** AsyncStorage. Without it nothing shows by itself (rather than on every launch). */\n storage?: ProductStorageLike;\n /** Default `\"genesis:product:whats-new\"`. */\n storageKey?: string;\n onError?: (error: unknown) => void;\n}\n\n/** @stability Experimental */\nexport interface ProductWhatsNew {\n getState(): ProductWhatsNewState;\n subscribe(listener: () => void): () => void;\n /** Reads the key seen last and, when this one is new, fetches its notes. Never rejects; runs once. */\n load(): Promise<void>;\n /** Opens it by hand (a \"What's new\" row): fetches the notes for this key. */\n open(): Promise<void>;\n /** Closes it and remembers this key. */\n dismiss(): void;\n}\n\n/**\n * \"What's new\", once per app version plus over-the-air update. A first\n * install remembers the key and shows nothing; a new key fetches its notes\n * then (never bundled) and opens when there are any. No notes for it:\n * remembered, nothing shown. A failed fetch shows nothing and tries again\n * next launch. Storage that can't be read shows nothing.\n *\n * @stability Experimental\n */\nexport function createProductWhatsNew(options: ProductWhatsNewOptions): ProductWhatsNew {\n const { source, key, storage, storageKey = \"genesis:product:whats-new\" } = options;\n let state: ProductWhatsNewState = { status: \"loading\", notes: [] };\n const listeners = new Set<() => void>();\n const set = (next: ProductWhatsNewState) => {\n state = next;\n for (const l of [...listeners]) l();\n };\n const report = (error: unknown) => {\n try {\n options.onError?.(error);\n } catch {\n // ignore a failing reporter\n }\n };\n // The keys seen, oldest first (a plain string from before is one key). Kept as a list, so going\n // back to a key seen before (expo-updates falling back to the embedded code) shows nothing.\n let seen: string[] = [];\n const remember = () => {\n if (!storage || !key) return;\n seen = [...seen.filter((k) => k !== key), key].slice(-MAX_SEEN_KEYS);\n const value = JSON.stringify(seen);\n Promise.resolve()\n .then(() => storage.setItem(storageKey, value))\n .catch(report);\n };\n let dismissed = false;\n let fetches = 0;\n const fetchNotes = async (rememberWhenEmpty: boolean) => {\n if (!key) return set({ status: \"hidden\", notes: [] });\n const mine = ++fetches;\n set({ status: \"fetching\", notes: [] });\n let notes: WhatsNewNote[] = [];\n try {\n notes = await source.whatsNew(key);\n if (!notes.length && rememberWhenEmpty) remember();\n } catch (error) {\n report(error);\n }\n // Closed (or opened again) meanwhile: this answer is stale.\n if (mine !== fetches || state.status !== \"fetching\") return;\n set(notes.length ? { status: \"showing\", notes } : { status: \"hidden\", notes: [] });\n };\n let loading: Promise<void> | null = null;\n return {\n getState: () => state,\n subscribe(listener) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n load() {\n loading ??= (async () => {\n if (!storage || !key) return set({ status: \"hidden\", notes: [] });\n let raw: string | null;\n try {\n raw = await storage.getItem(storageKey);\n } catch (error) {\n report(error);\n return set({ status: \"hidden\", notes: [] });\n }\n seen = parseSeen(raw);\n // Closed by hand while storage was being read: this key is seen.\n if (dismissed) return;\n if (raw === null) {\n remember();\n return set({ status: \"hidden\", notes: [] });\n }\n if (seen.includes(key)) return set({ status: \"hidden\", notes: [] });\n await fetchNotes(true);\n })();\n return loading;\n },\n open: () => fetchNotes(false),\n dismiss() {\n fetches++;\n dismissed = true;\n remember();\n set({ status: \"hidden\", notes: [] });\n },\n };\n}\n"]}