feat(catalog): park text cleanup — drop duplicated fields, light Markdown (#45, PR 1) #142

Merged
amiryahaya merged 6 commits from feat/admin-catalogue into main 2026-11-02 08:33:13 +01:00
Owner

PR 1 of #45 (admin catalogue). It cleans up park text before the admin park pages and the legacy import.

Design: docs/superpowers/specs/2026-11-02-admin-catalogue-design.md · Plan: docs/superpowers/plans/2026-11-02-park-text-cleanup.md

What changes

API

  • Migration 0035_drop_park_duplicate_text drops parks.park_fees, vehicle_fees, entry_gates and payment_method. The site already shows those from prices, vehicle products, the gates table and checkout. down re-adds them as nullable text, as 0006 created them.
  • Removed from catalog.Park/ParkInput, the store SQL and the three park schemas in OpenAPI. Every other payment_method (transactions, checkout, reports) is unchanged.
  • Strict body decoding means a client that still sends one of the four fields now gets a 400. No client sends them; the admin park pages are not built yet.

Web

  • New Markdown in @kws/ui, a light Markdown subset rendered as React elements, never HTML:
    • paragraphs, with a single newline as a line break;
    • **bold**;
    • - and 1. lists; a numbered list keeps its first number, and an unindented line ends the list;
    • [label](url) links, for http, https and mailto only. Other schemes show the label as plain text.
    • Any HTML tag shows literally.
  • The ticket park page renders its text sections with it. Legacy plain text keeps its line breaks.
  • CLAUDE.md: one line on the rule.

Test fixes found on the way

  • CheckoutPage.test.tsx: the fixture visit date 2026-11-01 expired today (the line rendered as past and hid the price). Moved to 2099.
  • media_schema_test.go: the hard-coded rollback count went from 5 to 6 for the new migration.

Verification

  • make cover: 91.6 % total (minimum 80 %). make lint: 0 issues. make contract: ok. Clients regenerated (TypeScript and Dart).
  • Web unit tests 676/676 and typecheck clean.
  • scripts/web-e2e.sh: ticket 207, admin 113 passed. This ran before the last renderer fix, which changes only Markdown.tsx and its tests.
  • Real local run:
    • the API omits the four fields;
    • a park page rendered bold, a line break, a list and a link;
    • <b>, <script> and a javascript: link showed as plain text.
  • Review, Pass 1 (complexity): no must-fix.
  • Review, Pass 2 (correctness): two Important findings in list parsing, both fixed with a test that failed first:
    • numbered lists split by blank lines restarted at 1;
    • prose after a bullet was glued onto it.

Known and deferred

  • A gates CSS rule removes the gap after a list in park text.
  • Link matching is quadratic on very long lines of [. Staff-only text, no length cap yet.
  • Bold works across lines in a list item but not in a paragraph.
  • Bold can split a link label.

🤖 Generated with Claude Code

PR 1 of #45 (admin catalogue). It cleans up park text before the admin park pages and the legacy import. Design: `docs/superpowers/specs/2026-11-02-admin-catalogue-design.md` · Plan: `docs/superpowers/plans/2026-11-02-park-text-cleanup.md` ## What changes **API** - Migration `0035_drop_park_duplicate_text` drops `parks.park_fees`, `vehicle_fees`, `entry_gates` and `payment_method`. The site already shows those from prices, vehicle products, the gates table and checkout. `down` re-adds them as nullable `text`, as 0006 created them. - Removed from `catalog.Park`/`ParkInput`, the store SQL and the three park schemas in OpenAPI. Every other `payment_method` (transactions, checkout, reports) is unchanged. - Strict body decoding means a client that still sends one of the four fields now gets a 400. No client sends them; the admin park pages are not built yet. **Web** - New `Markdown` in `@kws/ui`, a light Markdown subset rendered as React elements, never HTML: - paragraphs, with a single newline as a line break; - `**bold**`; - `-` and `1.` lists; a numbered list keeps its first number, and an unindented line ends the list; - `[label](url)` links, for `http`, `https` and `mailto` only. Other schemes show the label as plain text. - Any HTML tag shows literally. - The ticket park page renders its text sections with it. Legacy plain text keeps its line breaks. - `CLAUDE.md`: one line on the rule. **Test fixes found on the way** - `CheckoutPage.test.tsx`: the fixture visit date 2026-11-01 expired today (the line rendered as past and hid the price). Moved to 2099. - `media_schema_test.go`: the hard-coded rollback count went from 5 to 6 for the new migration. ## Verification - `make cover`: **91.6 %** total (minimum 80 %). `make lint`: 0 issues. `make contract`: ok. Clients regenerated (TypeScript and Dart). - Web unit tests 676/676 and typecheck clean. - `scripts/web-e2e.sh`: ticket 207, admin 113 passed. This ran before the last renderer fix, which changes only `Markdown.tsx` and its tests. - Real local run: - the API omits the four fields; - a park page rendered bold, a line break, a list and a link; - `<b>`, `<script>` and a `javascript:` link showed as plain text. - Review, Pass 1 (complexity): no must-fix. - Review, Pass 2 (correctness): two Important findings in list parsing, both fixed with a test that failed first: - numbered lists split by blank lines restarted at 1; - prose after a bullet was glued onto it. ## Known and deferred - A gates CSS rule removes the gap after a list in park text. - Link matching is quadratic on very long lines of `[`. Staff-only text, no length cap yet. - Bold works across lines in a list item but not in a paragraph. - Bold can split a link label. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Park fees, vehicle fees, entry gates and payment method are shown from
prices, vehicle products, the gates table and checkout instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also moves an expired checkout test date into the future.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(ui): Markdown lists keep their number and end at unindented prose (#45)
All checks were successful
ci / changes (pull_request) Successful in 17s
ci / clients (pull_request) Successful in 2m1s
ci / web (pull_request) Successful in 6m31s
ci / api (pull_request) Successful in 23m6s
ci / ci-gate (pull_request) Successful in 6s
fd6e0210c5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/kws!142
No description provided.