# Home / Trip View Convergence Implementation Plan **Status:** ✅ Complete (2026-06-27) > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Make the home page's active-trip view present the same feed-col chrome (date range, filter bar, stats/cycling panels) as the trip page, by extracting the chrome into one shared Twig partial and the stats computation into one shared JS function. **Architecture:** A new partial `templates/partials/trip-feed-col.html.twig` holds the entire `.home-feed-col` markup (header, filter bar, panel toggles, stats/cycling macro calls, feed loop) and is included by both `trip.html.twig` and `home.html.twig` (active branch). The inline stats/cycling computation currently in `trip.html.twig` becomes a window-exposed `initTripStats(config)` in `js/src/main.js`; the partial emits a small `DOMContentLoaded` inline script that calls it with page-specific data. The two intended differences (home has no sort button and keeps its own feed order) are driven by partial params, not separate markup. **Tech Stack:** Grav 2.0 / Twig templates, esbuild-bundled vanilla JS (`js/src/main.js` → `js/main.js`), MapLibre via `map.js` (`window.MapUtils`). ## Global Constraints - **Only ever write changes inside `travel-blog-intotheeast/` or subfolders.** The `user/` tree is a standalone git repo synced via `make content-push`; commit there as instructed by the execution skill. - **Dev mode stays dev** — `twig.cache: false` is already set. Do NOT toggle any dev/prod config flag to work around caching; theme edits take effect on reload. - **No map convergence.** Both inline map ` {% endif %} ``` Notes baked into this markup: - The non-pre-departure feed keeps the `{% else %}` "No entries yet" fallback so the trip page's empty-case output is unchanged (trip always passes `pre_departure: false`). Home never reaches this fallback because home-empty sets `pre_departure: true`. - The `initTripStats` call is wrapped in `DOMContentLoaded` so `window.initTripStats` and `window.MapUtils` (both in the `bottom` asset group rendered at the end of `
`) are defined when it runs. - The call is **not** nested inside any map-entries condition, so a trip with GPX but zero geocoded journal entries still populates the panels. - The partial is included with `only`, so it imports the `stats`/`cycling` macros itself. - [ ] **Step 2: Verify Twig syntax compiles (no include yet, so render via a temporary check)** The partial isn't referenced anywhere yet, so it can't render on its own. Verify there are no obvious Twig errors by confirming the file is well-formed: Run: `grep -c "endif\|endfor\|endmacro" /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user/themes/intotheeast/templates/partials/trip-feed-col.html.twig` Expected: non-zero (sanity check the file saved). Real verification happens in Task 3 when the trip page includes it. - [ ] **Step 3: Commit** ```bash cd /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user/themes/intotheeast git add templates/partials/trip-feed-col.html.twig git commit -m "feat(theme): add shared trip-feed-col partial" ``` --- ## Task 3: Refactor `trip.html.twig` to use the partial **Files:** - Modify: `user/themes/intotheeast/templates/trip.html.twig` (replace `:70-120`; remove `:213-249`) **Interfaces:** - Consumes: the partial from Task 2, `window.initTripStats` from Task 1. - Produces: visually and functionally identical trip-page output (regression-critical) — exact bytes may differ (re-indented markup, relocated stats `