Skip to content

Catalog rename/move (#35 #36 #37), Building... status (#11 #12), security fixes - #40

Open
gi-os wants to merge 2 commits into
mainfrom
claude/catalog-mgmt-building-status-fable5
Open

Catalog rename/move (#35 #36 #37), Building... status (#11 #12), security fixes#40
gi-os wants to merge 2 commits into
mainfrom
claude/catalog-mgmt-building-status-fable5

Conversation

@gi-os

@gi-os gi-os commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Closes #35, closes #36, closes #37, closes #11, closes #12.

All changes are in the active nested Launchpad/ tree.

Catalog management (#35 / #36 / #37)

New backend endpoint POST /api/shops/:slug/files/rename ({ path, newPath }) — path-traversal safe via safeShopPath, requires can_edit_ui, refuses overwriting an existing destination and moving a directory into itself, audit-logged as file_renamed. One endpoint powers all three features in CollectionsEditor:

Building... status (#11 / #12)

getContainerStatus() now returns building when the container is running but node_modules or .next/BUILD_ID don't exist yet — i.e. exactly while the container startup chain (npm install → npm run build → npm start) is still working. Pure fs check, no extra docker/network calls.

Security & robustness fixes found during review

  • Checkout schema endpoints (checkout.js): PUT /checkout/schema had no permission check — any authenticated user could rewrite any shop's checkout form. Now requires can_edit_ui. Both routes also validate the slug (^[a-zA-Z0-9_-]+$) since the schema path was built from the raw param.
  • Orders wipe (orders.js): if the CSV began with blank lines, wipe wrote an empty header and corrupted the file. Now finds the first non-blank line and 400s if there is no header.
  • Removed committed orders-webhook.js.bak.

Noted but NOT changed (flagging for later)

  • The repo contains a stale duplicate of backend/frontend at the repo root alongside the active nested Launchpad/ tree — worth consolidating someday, too risky to touch blind.
  • Shop rename in shops.js has a theoretical slug-uniqueness race (check → update without a transaction).

Verification

  • node --check on all touched backend files
  • Frontend vite build passes (2314 modules)
  • Versions bumped: frontend + backend → 4.1.0

🤖 Generated with Claude (Fable 5 test drive)

Giovanni Lupo added 2 commits June 9, 2026 18:30
… & robustness fixes

- #37: rename collections inline from the catalog sidebar
- #36: 'Move to...' selector relocates an item folder to another collection
- #35: rename item photos from the photo card (extension preserved)
- New backend endpoint POST /api/shops/:slug/files/rename (path-safe,
  can_edit_ui, refuses overwrite and self-nesting)
- #11/#12: container status now reports 'building' while npm install /
  next build are still running (node_modules + .next/BUILD_ID check);
  amber pulsing Building... shown on dashboard cards, settings, mission
  control, status badge, and the new-shop launch page now polls until the
  shop is actually ready
- security: checkout schema PUT now requires can_edit_ui + slug validation
  on checkout routes (was writable by any authenticated user, traversable slug)
- fix: orders wipe no longer destroys the CSV header when the file starts
  with blank lines
- chore: remove committed orders-webhook.js.bak; bump frontend+backend to 4.1.0
- Race protection: item-list loads carry a request id; stale responses from
  a previous collection are discarded instead of clobbering current state
- Collection switch now fully resets editor state (details, photos, rename
  inputs, add-item dialog) — no stale editingItem can survive
- Editor renders from a resolved item object; if the edited item vanished
  (switch/move/delete), the editor closes instead of crashing on undefined
- Fix Rules-of-Hooks violation in Catalog.jsx: permission early-return sat
  above other hooks, changing hook count across renders (React crash)
- Error boundary around CollectionsEditor: failures degrade to an inline
  'Reload editor' card instead of white-screening the SPA
gi-os pushed a commit that referenced this pull request Jun 9, 2026
…d, Catalog hooks order, NewShop Building... indicator, CollectionsEditor error boundary, drop .bak

Integrated from claude/catalog-mgmt-building-status-fable5 (PR #40) — only the
parts not already superseded by the 4.1.0 catalog overhaul on this server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant