diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97174c09..6ea284b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to loopkit are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
+## [0.6.3] - 2026-12-01
+
+### Changed
+
+- The loopkit stamp now shows on every qkit order by default. Migration `0071` adds `qkit_earn_resolve_program`: a Pro vendor with no `qkit_earn_config` row offers its oldest active stamp program (free vendors still have to opt in, as before), an explicit `enabled = false` stays off, and `qkit_earn_offer` also returns `reward_label`, `stamps_goal` and `stamps_per_order`. The `/earn` claim uses the same resolution. The dashboard qkit setting shows as on by default for Pro vendors and says a stamp card shows on every qkit order. Saving the setting stays Pro-only.
+
## [0.6.2] - 2026-12-01
### Security
diff --git a/README.md b/README.md
index db425416..0f815d06 100644
--- a/README.md
+++ b/README.md
@@ -390,9 +390,11 @@ flips it from a switch there (`src/app/dashboard/customer-notify-settings.tsx`,
under RLS (`for all` own-row policy, not service-role-only). See
`docs/superpowers/specs/2026-08-16-customer-notify-vendor-toggle-design.md`.
-Separately, a Pro vendor can let customers earn a stamp from a completed
+Separately, every Pro vendor with a stamp program shows it on qkit orders by default and can switch it off
+(migration `0071`; a vendor with no `qkit_earn_config` row offers its oldest active stamp program)
+so customers can earn a stamp from a completed
qkit order (`src/app/dashboard/qkit-earn-settings.tsx`) — this is a pull-model
-claim link, not push automation: qkit shows an "Earn a stamp" link on the
+claim link, not push automation: qkit shows a stamp card on the
customer's order page, which sends them to loopkit's own `/earn?order=...`
page to enter their phone number and claim it (`src/app/earn/`). Existing customers must also supply their saved card token, directly or through the HttpOnly proof cookie; the shop assists with lost-card recovery. This is a claim flow rather than
the stamp being awarded automatically the moment the qkit order completes.
diff --git a/package.json b/package.json
index d45e5efa..c0085f4b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "loopkit",
- "version": "0.6.2",
+ "version": "0.6.3",
"private": true,
"packageManager": "pnpm@11.10.0",
"engines": {
diff --git a/src/app/dashboard/README.md b/src/app/dashboard/README.md
index b694b65b..13da88f1 100644
--- a/src/app/dashboard/README.md
+++ b/src/app/dashboard/README.md
@@ -44,8 +44,8 @@ Shared controls and `cn` used by this folder's modules are imported from `@merqo
- `referrals/`
- `points-offset-form.dom.test.tsx` — jsdom tests for `PointsOffsetForm`: input defaults to the card's full balance and Apply calls through, Apply disables once the entered amount exceeds the card's balance
- `points-offset-form.tsx` — client `PointsOffsetForm`: a small inline apply-points form (not an AlertDialog like `redeem-button.tsx`/`redeem-voucher/`'s confirm screen, since there's a number to pick here) — calls `applyPointsOffsetAction` and reports the updated card plus the dollar figure back to the caller for the vendor to apply manually at their own register
-- `qkit-earn-settings.dom.test.tsx` — jsdom tests for `QkitEarnSettings`: shows upgrade prompt when not Pro (and that its copy never claims the stamp is awarded automatically), lets a Pro vendor pick a program and toggle the switch
-- `qkit-earn-settings.tsx` — client `QkitEarnSettings` form: Pro-gated switch + program picker that calls `saveQkitEarnConfigAction`; the non-Pro upsell copy describes the real claim-link flow (customer taps a link on their qkit order, enters their phone number on `/earn`) rather than overselling it as automatic. Wrapped in `@merqo/ui`'s `ElevatedCard`
+- `qkit-earn-settings.dom.test.tsx` — jsdom tests for `QkitEarnSettings`: the not-Pro note, the on-by-default switch and its every-qkit-order copy (never claiming the stamp is awarded automatically), the no-stamp-program note, and picking a program and toggling the switch
+- `qkit-earn-settings.tsx` — client `QkitEarnSettings` form: switch + program picker that calls `saveQkitEarnConfigAction`, with a not-available note for non-Pro vendors. The stamp card shows on every qkit order by default (migration `0071`), and turning the switch off saves `enabled = false`. With no stamp program it shows a note to create one. Wrapped in `@merqo/ui`'s `ElevatedCard`
- `redeem-button.dom.test.tsx` — jsdom test asserting `RedeemButton`'s confirm dialog shows the exact stamp count and carryover wording
- `redeem-button.tsx` — client `RedeemButton`: ConfirmDialog-confirmed redeem control that calls `redeemAction` and reports the reset card back to the caller
- `redeem-voucher/`
@@ -86,7 +86,7 @@ Each page exports its own `metadata.title`, shown through the root `loopkit | %s
card-link test pins the clipboard-failure copy.
-`qkit-earn-settings.tsx` shows the plain line "Qkit stamp earning is not available yet." with no link to non-Pro vendors.
+`qkit-earn-settings.tsx` stays Pro-gated: the qkit stamp card is on for every Pro vendor with a stamp program until they switch it off.
Dates and times on these pages render through `@merqo/ui`'s `formatDate`/`formatDateTime` (Singapore time).
diff --git a/src/app/dashboard/profile/README.md b/src/app/dashboard/profile/README.md
index 6be2f91c..4f8b38ae 100644
--- a/src/app/dashboard/profile/README.md
+++ b/src/app/dashboard/profile/README.md
@@ -10,7 +10,7 @@ Shared controls and `cn` used by this folder's modules are imported from `@merqo
- `actions.test.ts` — unit tests for `updateSocialLinksAction`: saves valid links while preserving the existing `stall_name`, rejects an invalid URL without calling `patchVendorProfile`, errors when not signed in, and errors (without revalidating) when the field-specific patch fails.
- `actions.ts` — server actions `updateStallNameAction()` (thin wrapper around `saveStallName`, `src/lib/vendor.ts`, revalidates the dashboard layout), `updatePasswordAction()` (Zod-validates an 8-72 char password, updates it via the Supabase auth client), and `updateSocialLinksAction()` (Zod-validates each link as an optional URL, uses a field-specific shared-profile patch for `social_links`, preserving concurrent stall-name changes).
-- `page.tsx` — `ProfilePage` server component (also hosts the former Settings page: an `#integrations` block with `QkitEarnSettings` and `CustomerNotifySettings`, loaded from `qkit_earn_config` / `vendor_notify_settings`); requires a vendor, loads the vendor profile (`getVendorProfile()`, `src/lib/vendor.ts`) and auth `user_metadata` display name, reads the shared `merqo.vendor_profile` row's `social_links` (degrading to `{}` on failure, same pattern as `/setup`'s page), and renders `@merqo/ui`'s `BackButton` ("Back to dashboard") above `ProfileForm`. Its root element is `
` — deliberately narrower than the `../layout.tsx` ``'s shared `max-w-7xl` (this form genuinely reads better constrained), so it nests its own `mx-auto`/`max-w-*` wrapper inside that container rather than stretching full-width; the page no longer sets its own padding, which the layout's `` now owns.
+- `page.tsx` — `ProfilePage` server component (also hosts the former Settings page: an `#integrations` block with `QkitEarnSettings` and `CustomerNotifySettings`, loaded from `qkit_earn_config` / `vendor_notify_settings`; with no `qkit_earn_config` row the oldest active stamp program is passed as already on, mirroring `qkit_earn_resolve_program`); requires a vendor, loads the vendor profile (`getVendorProfile()`, `src/lib/vendor.ts`) and auth `user_metadata` display name, reads the shared `merqo.vendor_profile` row's `social_links` (degrading to `{}` on failure, same pattern as `/setup`'s page), and renders `@merqo/ui`'s `BackButton` ("Back to dashboard") above `ProfileForm`. Its root element is `
` — deliberately narrower than the `../layout.tsx` ``'s shared `max-w-7xl` (this form genuinely reads better constrained), so it nests its own `mx-auto`/`max-w-*` wrapper inside that container rather than stretching full-width; the page no longer sets its own padding, which the layout's `` now owns.
- `profile-form.dom.test.tsx` — jsdom tests for `ProfileForm`: renders all 5 sections, prefills the social-links fields from `socialLinks` and saves them via `updateSocialLinksAction`, saves the stall name via `updateStallNameAction`.
- `profile-form.tsx` — `ProfileForm` client component; `@merqo/ui`'s `TwoColumnSections` (column 1: stall name, profile icon, change password; column 2: display name, social links — the locked cross-kit order) of five independently-saving `Section` cards (stall name via server action, social/website links via `@merqo/ui`'s `SocialLinksFields` + server action, avatar via `@merqo/ui`'s `ImageUploader` + browser auth client, display name via browser auth client, password change with client-side confirm match).
diff --git a/src/app/dashboard/profile/page.tsx b/src/app/dashboard/profile/page.tsx
index dbb93af3..cca522c8 100644
--- a/src/app/dashboard/profile/page.tsx
+++ b/src/app/dashboard/profile/page.tsx
@@ -34,6 +34,21 @@ export default async function ProfilePage() {
.maybeSingle(),
]);
const qkitEarnConfig = qkitEarnConfigResult.data;
+ const qkitPrograms = programs.filter(
+ (prog) => prog.type === "stamp" && prog.active,
+ );
+ // Mirrors qkit_earn_resolve_program: with no saved row a Pro vendor's oldest
+ // active stamp program is already on.
+ const defaultProgram = pro ? qkitPrograms[0] : undefined;
+ let qkitCurrent: { programId: string; enabled: boolean } | null = null;
+ if (qkitEarnConfig) {
+ qkitCurrent = {
+ programId: qkitEarnConfig.program_id,
+ enabled: qkitEarnConfig.enabled,
+ };
+ } else if (defaultProgram) {
+ qkitCurrent = { programId: defaultProgram.id, enabled: true };
+ }
const notifySettings = notifySettingsResult.data;
// Same cross-schema, degrade-to-empty-on-failure pattern as /setup's page
// (src/app/setup/page.tsx) — social links are a nice-to-have, not worth
@@ -79,17 +94,11 @@ export default async function ProfilePage() {
qkit integration
prog.type === "stamp")
- .map((prog) => ({ id: prog.id, name: prog.name }))}
- current={
- qkitEarnConfig
- ? {
- programId: qkitEarnConfig.program_id,
- enabled: qkitEarnConfig.enabled,
- }
- : null
- }
+ programs={qkitPrograms.map((prog) => ({
+ id: prog.id,
+ name: prog.name,
+ }))}
+ current={qkitCurrent}
isPro={pro}
/>