Difficulty and estimated duration for guides (#92) #110

Merged
miko merged 4 commits from feature/92-difficulty-and-duration into development 2026-11-05 12:40:58 +01:00
Owner

Closes #92

Summary

A guide gets an optional Difficulty (easy / medium / hard) and Estimated Duration (minutes, entered as hours + minutes), set in the guide's properties and shown as badges.

 Guide (schema)
+  difficulty       Difficulty?   // easy | medium | hard
+  estimatedMinutes Int?

 <GuidePropertiesForm>            saveGuideProperties → guidePropertiesFrom
+  <DifficultyChoice>             button group, stacked icon + label, "None" for no value
+  <DurationInput> h | m          input groups; whole hours ≤ 999, minutes 0–59
 src/guides/effort.ts
+  guideEffortFrom(formData)      → {difficulty, estimatedMinutes} | {error}
+  effortLabels(guide, i18n)      → ["Medium", "about 1 h 30 min"] (de: "Mittel", "ca. 1 h 30 min")

 shown via effortLabels in
+  read view header (and so print)   <EffortBadges>
+  category grid tiles               <Tile badges>
+  PDF                               <Effort> with gauge/clock icons

Without values nothing is shown. No filtering or sorting (out of scope). GLOSSARY: new entries Difficulty and Estimated Duration.

Evidence

  • Before: effort.test.ts, the new GuideListing badge tests, the extended properties.test.ts fail (no module / no fields)
    After: vitest run → 50 files, 404 tests passed; tsc --noEmit and eslint clean
  • PDF rendered with difficulty: "medium", estimatedMinutes: 90 shows the badges "Mittel" and "ca. 1 h 30 min" under the title; read view and tile checked in the dev server.

Merge Danger

Door: two-way

Additive migration: two nullable columns on Guide, no backfill.

Blast Radius: small

ChoiceGroup gained an optional stacked layout and an optional description; visibility and page status groups render as before. Note for #93: difficulty and duration are saved with the properties (immediately, without version bump) and must move to the versioned content save when the working copy lands.

🤖 Generated with Claude Code

Closes #92 ## Summary A guide gets an optional **Difficulty** (easy / medium / hard) and **Estimated Duration** (minutes, entered as hours + minutes), set in the guide's properties and shown as badges. ```diff Guide (schema) + difficulty Difficulty? // easy | medium | hard + estimatedMinutes Int? <GuidePropertiesForm> saveGuideProperties → guidePropertiesFrom + <DifficultyChoice> button group, stacked icon + label, "None" for no value + <DurationInput> h | m input groups; whole hours ≤ 999, minutes 0–59 src/guides/effort.ts + guideEffortFrom(formData) → {difficulty, estimatedMinutes} | {error} + effortLabels(guide, i18n) → ["Medium", "about 1 h 30 min"] (de: "Mittel", "ca. 1 h 30 min") shown via effortLabels in + read view header (and so print) <EffortBadges> + category grid tiles <Tile badges> + PDF <Effort> with gauge/clock icons ``` Without values nothing is shown. No filtering or sorting (out of scope). GLOSSARY: new entries Difficulty and Estimated Duration. ## Evidence - **Before:** `effort.test.ts`, the new `GuideListing` badge tests, the extended `properties.test.ts` fail (no module / no fields) **After:** `vitest run` → 50 files, 404 tests passed; `tsc --noEmit` and `eslint` clean - PDF rendered with `difficulty: "medium", estimatedMinutes: 90` shows the badges "Mittel" and "ca. 1 h 30 min" under the title; read view and tile checked in the dev server. ## Merge Danger **Door:** two-way Additive migration: two nullable columns on `Guide`, no backfill. **Blast Radius:** small `ChoiceGroup` gained an optional `stacked` layout and an optional `description`; visibility and page status groups render as before. Note for #93: difficulty and duration are saved with the properties (immediately, without version bump) and must move to the versioned content save when the working copy lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A guide can have an optional difficulty (easy, medium, hard) and an
estimated duration in minutes, entered as hours and minutes in its
properties. Both show as badges in the guide's header (and so in print),
on its tile in the category grid and in the PDF, e.g. "Medium" and
"about 1 h 30 min".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The difficulty is a button group like visibility, with "None" for no
difficulty; hours and minutes are input groups with "h" and "m" attached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Footprints, mountain and snowy mountain for easy, medium and hard, a
dashed circle for none; each label on one line under its icon, all four
side by side, so the group fits the narrow properties column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 3c2f81fa0b into development 2026-11-05 12:40:58 +01:00
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
MassiveDynamic/kataba!110
No description provided.