← back to Designerwallcoverings
maya-romanoff logo-hero: a failed reorder is a PARTIAL, not done (code review)
dd1ed815e91b6ba10f6b0a9a25de002764288aab · 2026-09-17 10:23:11 -0700 · Steve Abrams
productReorderMedia userErrors left the logo placeholder still the featured hero — the exact
defect TK-11750 fixes — yet the row was recorded to the restore map and counted in done++.
Now: featured flag gates the count (attachedNotFeatured bucket, not done), the map row records
featured:false, and the LIMIT break counts it so the cap isn't under-counted. Second-model
review (grok-4.5, OpenAI spend-limited): no regressions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqefKZFeg2E4pEzpR4xpkv
Files touched
M scripts/maya-romanoff-logohero-fix/apply.mjs
Diff
commit dd1ed815e91b6ba10f6b0a9a25de002764288aab
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Sep 17 10:23:11 2026 -0700
maya-romanoff logo-hero: a failed reorder is a PARTIAL, not done (code review)
productReorderMedia userErrors left the logo placeholder still the featured hero — the exact
defect TK-11750 fixes — yet the row was recorded to the restore map and counted in done++.
Now: featured flag gates the count (attachedNotFeatured bucket, not done), the map row records
featured:false, and the LIMIT break counts it so the cap isn't under-counted. Second-model
review (grok-4.5, OpenAI spend-limited): no regressions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqefKZFeg2E4pEzpR4xpkv
---
scripts/maya-romanoff-logohero-fix/apply.mjs | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/scripts/maya-romanoff-logohero-fix/apply.mjs b/scripts/maya-romanoff-logohero-fix/apply.mjs
index 9c392d3..0cec8cd 100644
--- a/scripts/maya-romanoff-logohero-fix/apply.mjs
+++ b/scripts/maya-romanoff-logohero-fix/apply.mjs
@@ -71,9 +71,9 @@ const rows = readFileSync(join(HERE, 'resolved.tsv'), 'utf8').trim().split('\n')
console.log(`\n=== TK-11750 Maya Romanoff logo-hero fix — ${EXECUTE ? 'EXECUTE (LIVE)' : 'DRY-RUN'}${DELETE_LOGO ? ' +DELETE_LOGO' : ''} — ${Math.min(LIMIT, rows.length)}/${rows.length} products ===\n`);
-let done = 0, skipped = 0, failed = 0;
+let done = 0, skipped = 0, failed = 0, attachedNotFeatured = 0;
for (const row of rows) {
- if (done + skipped + failed >= LIMIT) break;
+ if (done + skipped + failed + attachedNotFeatured >= LIMIT) break;
// Read current live state (guard: only act if the logo is still the media)
const pr = await gql(Q_PROD, { id: row.product_id });
@@ -132,7 +132,11 @@ for (const row of rows) {
// 4. reorder real image to position 1 (featured)
const rr = await gql(M_REORDER, { id: p.id, moves: [{ id: newId, newPosition: '0' }] });
const rue = rr?.productReorderMedia?.userErrors || [];
- if (rue.length) { console.log(` ⚠ reorder userErrors: ${JSON.stringify(rue)} (real image attached but not featured — review)`); }
+ // The reorder is the whole point of the fix — it makes the REAL image the featured hero. If it
+ // returns userErrors the logo PLACEHOLDER is STILL the hero (the exact defect this ticket fixes),
+ // so the row is a PARTIAL, not a success: it must NOT be counted in `done` (TK-11750 code review).
+ const featured = rue.length === 0;
+ if (!featured) { console.log(` ⚠ reorder userErrors: ${JSON.stringify(rue)} (real image attached but NOT featured — PARTIAL, not counted as fixed)`); }
else { console.log(` ✓ real image -> position 1 (featured)`); }
// 5. optional: delete logo (backup already saved)
@@ -148,10 +152,10 @@ for (const row of rows) {
ts: new Date().toISOString(), ticket: 'TK-11750', product_id: p.id, handle: row.handle,
dw_sku: row.dw_sku, pattern: row.pattern, new_media_id: newId, real_url: row.real_url,
logo_media_id: row.logo_media_id, logo_url: row.logo_url, logo_alt: logoNode?.alt || null,
- logo_backup: bakPath, logo_deleted: logoDeleted,
+ logo_backup: bakPath, logo_deleted: logoDeleted, featured,
}) + '\n');
console.log('');
- done++;
+ if (featured) done++; else attachedNotFeatured++;
}
-console.log(`\n=== ${EXECUTE ? 'EXECUTED' : 'DRY-RUN'}: ${done} fixed/planned, ${skipped} skipped, ${failed} failed ===`);
+console.log(`\n=== ${EXECUTE ? 'EXECUTED' : 'DRY-RUN'}: ${done} fixed/planned, ${skipped} skipped, ${failed} failed, ${attachedNotFeatured} attached-not-featured (PARTIAL — real image on product but logo still hero; re-run or reorder manually) ===`);
if (EXECUTE && done) console.log(`Restore map: ${MAP}`);
← 479d315 auto-data-snapshot: 2026-09-17T09:53:49 (1 data files) — dat
·
back to Designerwallcoverings
·
tk11732 PJ showroom rollback: mirror tk11307's two load-bear 09ce7d6 →