HifiPlanet-Website/hifi-src
Maaxxs a3767b1c0f Extend text styling to brand/model names and package text, add bold bullets
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>
2026-09-10 03:15:53 +02:00
..
public Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
src Extend text styling to brand/model names and package text, add bold bullets 2026-09-10 03:15:53 +02:00
index.html Replace the contact form with the new high-fidelity redesign 2026-07-18 20:00:06 +02:00
package-lock.json Add image cropping to the shared upload field 2026-09-09 23:59:27 +02:00
package.json Add image cropping to the shared upload field 2026-09-09 23:59:27 +02:00
postcss.config.js Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
tailwind.config.js Add global font selection with per-section override 2026-09-10 00:12:01 +02:00
vite.config.js Bundle all Lucide icon chunks into one file instead of ~1600 tiny files 2026-07-05 15:36:07 +02:00