diff --git a/docs/working/plans/2026-07-04-standalone-page-cleanup.md b/docs/working/plans/2026-07-04-standalone-page-cleanup.md new file mode 100644 index 0000000..64dfd81 --- /dev/null +++ b/docs/working/plans/2026-07-04-standalone-page-cleanup.md @@ -0,0 +1,104 @@ +--- +artifact_contract: ce-unified-plan/v1 +artifact_readiness: requirements-only +product_contract_source: ce-brainstorm +--- + +# Standalone Sub-Page Cleanup โ€” retire redundant map/stats/dailies/stories pages + +**Status:** ๐Ÿ“‹ Not started + +> Plan type: `refactor` ยท Depth: Standard ยท Origin: sequel to `2026-06-27-map-init-consolidation.md` โ€” that plan unified the map *engine* (`MapUtils.initEntryMap()`) onto trip + home but deferred `feed-map`/`map.html`; this plan removes those deferred surfaces entirely. + +--- + +## Summary + +Every trip carries four standalone sub-pages โ€” `02.map`, `03.stats`, plus the standalone `dailies` and `stories` list views โ€” that are **fully consolidated onto the trip page** (inline map + filter bar + inline stats via `trip-feed-col`) and are **no longer reachable from navigation**. They are also the last consumers of the *old* map code path: `feed-map.html.twig` hand-rolls an inline MapLibre init that duplicates `MapUtils.initEntryMap()`, and `map.html.twig` is a third variant built on `renderGpxJourney` directly. + +This plan removes the dead pages/logic (**Phase 1**) and then finishes the shared-logic arc by de-duplicating the map markup that trip and home still copy-paste (**Phase 2**). + +**Net effect after both phases:** the entire site renders maps through exactly one code path (`initEntryMap()`), invoked from exactly one shared partial. + +## Goal + +- Remove unused pages and view logic so the codebase has no orphaned templates or dead map variants. +- Preserve all content and all currently-linked behavior โ€” this is a pure internal cleanup, no user-visible feature change on the pages that remain. +- Converge on a single map code path. + +## Product authority / decisions locked + +- **Scope = Option 2** (all four standalone views retired), confirmed by owner. +- **Keepers โ€” must not break:** `home.html.twig`, `trips.html.twig` (trip overview), `trip.html.twig`, `story.html.twig`, and every shared element they use (`trip-feed-col`, `home-predeparture`, `macros/stats`, `macros/cycling`, `macros/date-range`, `map.css`, `map.js`). +- **Containers stay:** `01.dailies/` and `04.stories/` folders remain as data containers (they physically hold entries/stories; trip + home fetch children via `grav.pages.find(route ~ '/dailies').children`). +- **Old URLs are don't-care:** `/map`, `/stats`, `/dailies`, `/stories` direct hits may 404. No redirects required (owner decision). Individual entry/story detail pages underneath remain reachable. + +--- + +## Phase 1 โ€” Cleanup (content + logic + old templates) + +**Delete these page templates (old / unreachable views):** + +- `user/themes/intotheeast/templates/map.html.twig` โ€” old map variant (`renderGpxJourney` inline) +- `user/themes/intotheeast/templates/stats.html.twig` โ€” orphaned (nothing links to it) +- `user/themes/intotheeast/templates/dailies.html.twig` โ€” standalone list view, consolidated onto trip page +- `user/themes/intotheeast/templates/stories.html.twig` โ€” standalone list view, consolidated onto trip page + +**Delete this partial (dies with its only two consumers):** + +- `user/themes/intotheeast/templates/partials/feed-map.html.twig` โ€” old inline-script map duplicate; included **only** by the two deleted list views. + +**Delete these page folders (empty pure-view shells) across every trip:** + +- `user/pages/01.trips//02.map/` +- `user/pages/01.trips//03.stats/` +- (applies to all trips: `central-asia-2023`, `italy-2025`, `italy-2026-demo`, `slovenia-2024`, `us-canada-mex-2024`) + +**Repoint the two container pages so nothing errors** (keep the folders, retire the view): + +- `01.dailies/dailies.md` and `04.stories/stories.md`: change `template:` off the deleted templates (e.g. to `default`), and mark the container non-routable/non-visible so its own URL is inert while children stay reachable. + +**Also update / remove any dangling reference to the deleted pages found during work** (e.g. the `link_href: โ€ฆ ~ '/map'` line lived inside `dailies.html.twig`, which is being deleted โ€” confirm no *other* template links to `/map`, `/stats`, `/dailies`, `/stories` as a destination). + +### Phase 1 acceptance criteria + +- Site renders with no Twig errors on: home (active-trip + between-trips), `/trips`, every trip page, and an individual entry and story detail page. +- Trip page + home still show the inline map, filter bar, and stats correctly (child-fetch via `find(...).children` still resolves). +- `grep` for `feed-map.html.twig`, `map.html.twig`, `stats.html.twig`, `dailies.html.twig`, `stories.html.twig` returns **no remaining `include`/`import`/link references**. +- No content lost: journal entries and stories still present and reachable at their detail URLs. +- Only one non-`initEntryMap` map path removed โ€” confirm `map.css`/`map.js` and `macros/stats` are untouched. + +--- + +## Phase 2 โ€” Optimization (finish the shared-logic arc) + +`trip.html.twig` and `home.html.twig` still hand-write near-identical map markup (`home-map-col` โ†’ `home-map`/`trip-map` div โ†’ fullscreen button) plus a thin inline `