No description
Rolls the generic text_styles mechanism out to three more areas (Phase 3/4 of the earlier text-styling plan): brands.name, car_models.name, packages.description and packages.price_text. Registry entries reuse each table's existing manage permission (brands.manage/models.manage/ packages.manage). Widgets are gated on an existing row (editingId in Brands.jsx/Models.jsx, row.existing in Packages.jsx's batch editor), since a newly-created row has no id yet to key a style on. Added fieldStyle()/useTextStylesMap() to TextStylesContext.jsx alongside the existing useTextStyle() - brand/model lists are open-ended, so styling each one from inside a .map() can't call a hook per item (rules of hooks); fieldStyle() does a plain lookup against the already-loaded styles map instead. pkg.name stays unstyled (it's chosen from a fixed tier list, not free text). Deleting a brand cascades to its models and their packages in the database, so BrandController/ModelController::destroy() now collect the cascaded ids first and clean up their text_styles rows too (mirroring how they already do this for orphaned uploaded images); SettingsController's catalog reset endpoints get the same cleanup in bulk. Separately: package descriptions can now mark individual bullet points bold. Packages.jsx gained a "Fett" button that wraps the current textarea selection in **markers** (one line per bullet is unchanged); the public ModelPage.jsx renders those through a new BoldText.jsx component that turns **text** into <strong> via a plain regex - no dangerouslySetInnerHTML, since the only possible output is a <strong> tag. Product-name bullets (scraped from the linked shop, not admin-authored) are unaffected. Verified locally: registry rejects packages.name (not free text) and a non-numeric id, and deleting a test brand correctly cascades text_styles cleanup through its model and package. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| hifi | ||
| hifi-src | ||
| .gitignore | ||
| DEPLOY.md | ||