From a806522ee18b80bb6be2490b819c998d23683331 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 13:48:07 -0700 Subject: [PATCH 1/7] Give every page that lists trails the search box and the filters that have something to offer, however few trails it holds The cutoff of ten trails is gone, so 48 of the 60 state and province pages, the small lists and each route author's page now have the bar. A set that nothing can narrow gets the search box alone, and an option no trail has is not written. In the state-pages golden file only the hashes of the ten pages that differ changed, each by the added bar and nothing else. --- web/olt/authors.py | 2 +- web/olt/home.py | 22 ++++++--------- web/olt/placepages.py | 2 +- web/olt/regions.py | 3 +-- web/tests/golden/state-pages.json | 20 +++++++------- web/tests/test_filter_bar.py | 45 ++++++++++++++++++++++--------- 6 files changed, 53 insertions(+), 41 deletions(-) diff --git a/web/olt/authors.py b/web/olt/authors.py index 0cd2807..b4ec238 100644 --- a/web/olt/authors.py +++ b/web/olt/authors.py @@ -312,7 +312,7 @@ def author_page(g, records, site, all_pages): + " ยท ".join(f'{esc(x["name"])} ({len(x["routes"])})' for x in nav_items) + "") if nav_items else "" more = str(summary.facts(routes, records, by_authors=False)) if n >= 3 else "" briefs = "".join(f'

{esc(common.plain_name(r))}

\n{trail.brief(r)}\n' for r in routes) - listing = home.results(groups=[(None, routes, regions.route_guides)], routes_list=True, top=2, + listing = home.listing(groups=[(None, routes, regions.route_guides)], routes_list=True, top=2, by=lambda r: with_html(g, r, by_name)) route_title = "About the route" if n == 1 else "About each route" bio = about_html(g) diff --git a/web/olt/home.py b/web/olt/home.py index 6994820..37235f4 100644 --- a/web/olt/home.py +++ b/web/olt/home.py @@ -239,17 +239,13 @@ def entry(rec, *, level=3, extra="", routes_list=False, hidden=False, eager=Fals # The filters ------------------------------------------------------------------ -# One bar and one set of panels, on the home page and on every other page that shows a set of at -# least FILTER_MIN trails (listing()), and on every park, range and wilderness page whatever its -# size (the owner's rule: every set of trails gets the bar). Everything is built from the page's own trails: a facet that +# One bar and one set of panels, on the home page and on every other page that shows a set of +# trails (listing()), whatever its size (the owner's rule: every set of trails gets the bar). Everything is built from the page's own trails: a facet that # cannot narrow them is left out, and an option none of them has is not written. The numbers written # here are for the whole set; app.js counts again from the rows on the page every time anything # changes, and hides an option that would show nothing (its counting is facetCounts(), which # web/tests/test_filter_counts.py runs under node against counts made here from the records). -FILTER_MIN = 10 - - def _length_options(steps, selected_any_last, unit="mi"): opts = [f'' for n in steps] if selected_any_last: @@ -443,15 +439,13 @@ def finder_form(records, c=None, steps=None, where="all", bare_if_empty=False): """ -def listing(recs=None, *, where="all", groups=None, always=False, **kw): - """The rows of a page that shows a set of trails, with the filter bar over them when the set - has at least FILTER_MIN trails (else results() alone); with always, whatever its size (the - bar then holds only the filters that have something to offer). where: the Where filter's - scope (finder_form). The other arguments are results()'s.""" +def listing(recs=None, *, where="all", groups=None, **kw): + """The rows of a page that shows a set of trails, with the filter bar over them whatever the size + of the set (the bar holds only the filters that have something to offer, and the search box + alone where nothing can narrow the set). where: the Where filter's scope (finder_form). The + other arguments are results()'s.""" trails = [r for g in groups for r in g[1]] if groups is not None else list(recs) - if len(trails) < FILTER_MIN and not always: - return results(recs, groups=groups, **kw) - return Markup(f"""
{finder_form(trails, where=where, bare_if_empty=always)}
+ return Markup(f"""
{finder_form(trails, where=where, bare_if_empty=True)}
{results(recs, groups=groups, finder=True, **kw)}""") diff --git a/web/olt/placepages.py b/web/olt/placepages.py index 3190ef0..0be36e2 100644 --- a/web/olt/placepages.py +++ b/web/olt/placepages.py @@ -75,7 +75,7 @@ def _kind(): kicker=_kicker, crumbs=_crumbs, lede=_lede, where="all", wholly=False, facts_place=lambda info: (_in_name(info), ()), title_options=_title_options, description=_description, box=lambda info: info.get("box"), nav=_nav, - in_name=_in_name, phrase=_phrase, always_filters=True) + in_name=_in_name, phrase=_phrase) PARK = _kind() diff --git a/web/olt/regions.py b/web/olt/regions.py index ac67435..48bd3c5 100644 --- a/web/olt/regions.py +++ b/web/olt/regions.py @@ -309,7 +309,6 @@ class PageKind: nav: object in_name: object = None phrase: object = None - always_filters: bool = False # the filter bar whatever the number of trails def _state_kicker(info): @@ -433,7 +432,7 @@ def place_page(info, records, site, kind, *, facet_pages=(), place_links=""):
- {home.browse_view(home.listing(recs, top=2, where=kind.where, wholly=wholly, always=kind.always_filters), home.overview_map(recs, f"Map of the trails {phrase}", place=kind.box(info)), + {home.browse_view(home.listing(recs, top=2, where=kind.where, wholly=wholly), home.overview_map(recs, f"Map of the trails {phrase}", place=kind.box(info)), about=f"{summary.facts(recs, records, place=place)}{summary.details(recs)}", about_title=f"About the trails {phrase}")} {nav}{place_links} diff --git a/web/tests/golden/state-pages.json b/web/tests/golden/state-pages.json index 1863e2c..6d57e57 100644 --- a/web/tests/golden/state-pages.json +++ b/web/tests/golden/state-pages.json @@ -1,14 +1,14 @@ { "/regions/": "e70a9608ef0ee6a97d0591ad582abff1b165371dee5111e3277df06a53a554e1", - "/regions/atlantic-canada/": "6af5c4a79cac82eb0a4342297fd4f6755890e98597a98f219087c56432f06243", - "/regions/ca-on/": "12b5726d800090233f082a572cf1472f152552cef8fa5019f49b83e32e337eef", - "/regions/central-canada/": "fa6f8bbe466b5978f1edda22371b6aab8546efa567eee0d0405c717e278b8a3e", - "/regions/mountain-west/": "c079eb93a55c2279f24083983230057940eb032cb034057c822c52230ce22e05", - "/regions/north/": "fdfd201ae1e42b8fd17dd055815d4b06392a8ddb6ac3e72a06f15ec2b333fb56", - "/regions/us-co/": "45cb1b92fd22ffc35f82a26fe2c71b66836b0624bf0e195f9c4926dfab6a8900", - "/regions/us-co/loops/": "8883c9aac63f100196f9e853d6738a42b8199f1250c10ec34d1d0cfe8c998e7d", - "/regions/us-co/with-gpx/": "abc3f7e44cbcbf8d6cce3b5d5065e6e7c085ec5a4033842af8909077f87e1e18", + "/regions/atlantic-canada/": "5146b4b9d1940a268cfd2345f1eee2263fd6c7e2dfd28adfdffc3fff0e698c93", + "/regions/ca-on/": "d4e543c6f163ba188a34444b42c494a3dbbd26c02f2b141339bbc230cd91f84e", + "/regions/central-canada/": "d7478ad682d715705770d35cc902c80c40d27719e7f9f5a1d99ec702d3f7a43e", + "/regions/mountain-west/": "6151f5a28d366fb48aab7027f08cea6da425201d0e7327780a01dd77cedc7bc7", + "/regions/north/": "85ba3ea850c2df690e311cf09257f2548ed888c07c319a01fd30d5e19cdf1fd4", + "/regions/us-co/": "97daaf3511578896b222570cba630da2d8ca0571504ce43b3685dbe532e40f56", + "/regions/us-co/loops/": "03896834b5369655f7b5f26634b6d23c834b17f1a25b0ec328d44934e20e2dfa", + "/regions/us-co/with-gpx/": "d82eace3d70eb9b1ef1346f5a3470199bd6a00e6e104fe661bfeb80199af96b8", "/regions/us-hi/": "1e5681ffbd50e382db7d69528fde602069006bf0cddad494d817369224bd96ad", - "/regions/us-ut/": "065bcc01e14eb588dc1b118c466f44474fca0172c30037fb193d83a044624100", - "/regions/western-canada/": "91b40d35dd3d1a093d38d01bbfcf1ef536221a69631fc58e46732da81d0582c3" + "/regions/us-ut/": "906db4153def35fa5418d0b86dba908fd27396bbc2098978ee169516e1b39785", + "/regions/western-canada/": "1b102ed9d47283869fdf8c8d54229d245f2113fd53c7e8ec2ecc118fd4da3b64" } diff --git a/web/tests/test_filter_bar.py b/web/tests/test_filter_bar.py index 84e9fb1..1911f9a 100644 --- a/web/tests/test_filter_bar.py +++ b/web/tests/test_filter_bar.py @@ -1,7 +1,7 @@ """The filter bar on every page that shows a set of trails, and the numbers beside its choices. The bar (olt/home.py listing(), finder_form()) is the home page's, on each list, place and the Routes -page whose set has at least home.FILTER_MIN trails, built from that page's own trails. app.js counts +page, whatever the number of trails, built from that page's own trails. app.js counts the choices again from the rows on the page every time anything changes (FacetCount, between the facet-counts markers); this file runs that counting under node, on the rows the home page writes, and checks it against counts made here straight from the records. Pages are rendered one at a time; @@ -68,22 +68,36 @@ class WhichPagesHaveTheBarTest(unittest.TestCase): lst = browse.by_key(key) return regions.list_page(lst, self.shown[key], len(self.records), SITE, records=self.records)[2] - def test_a_list_page_a_place_page_a_part_of_the_country_and_routes_have_it(self): - self.assertGreaterEqual(len(self.shown["loops"]), home.FILTER_MIN) - self.assertTrue(form_of(self.list_body("loops"))) + def test_a_list_page_a_place_page_a_part_of_the_country_and_routes_have_it(self): + self.assertTrue(form_of(self.list_body("loops"))) by_slug, _ = regions.collect_regions(self.records) - self.assertGreaterEqual(len(by_slug["ca-on"]["records"]), home.FILTER_MIN) self.assertTrue(form_of(regions.region_page("ca-on", self.records, SITE)[2])) self.assertTrue(form_of(regions.group_page("central-canada", self.records, SITE)[2])) self.assertTrue(form_of(regions.routes_page(self.records, SITE)[2])) - def test_a_set_under_the_threshold_has_the_plain_rows(self): - small = [k for k, recs in self.shown.items() if len(recs) < home.FILTER_MIN and k != "routes"] - self.assertTrue(small) + def test_every_state_province_and_list_page_has_the_bar_however_few_trails(self): + by_slug, _ = regions.collect_regions(self.records) + small = [k for k, v in by_slug.items() if len(v["records"]) < 10] + self.assertGreater(len(small), 40) for key in small: - body = self.list_body(key) - self.assertFalse(form_of(body), key) - self.assertNotIn("data-finder", str(body), key) + body = regions.region_page(key, self.records, SITE)[2] + self.assertIn('id="finder-form"', str(body), key) + self.assertIn("data-finder", str(body), key) + small_lists = [k for k, recs in self.shown.items() if len(recs) < 10 and k != "routes"] + self.assertTrue(small_lists) + for key in small_lists: + self.assertTrue(form_of(self.list_body(key)), key) + + def test_a_two_trail_page_offers_only_filters_that_narrow_it(self): + by_slug, _ = regions.collect_regions(self.records) + two = [k for k, v in by_slug.items() if len(v["records"]) == 2] + self.assertTrue(two) + for key in two: + form = form_of(regions.region_page(key, self.records, SITE)[2]) + self.assertIn('name="q"', form, key) + for sel in re.findall(r"]*>(.*?)", form, re.S): + self.assertNotIn("", sel) + self.assertGreater(len(re.findall(r" Date: Fri, 20 Nov 2026 13:49:40 -0700 Subject: [PATCH 2/7] Put a row of jump links at the very top of the Places page: States and provinces, Parks, Mountain ranges and Wilderness areas, each with its number of pages The row shows at every screen size on one compact line that wraps on a phone, and a kind with no pages is left out. The strip of regional groups below the heading no longer repeats the three kinds. --- web/assets/style.css | 6 ++++++ web/olt/regions.py | 14 ++++++++++---- web/tests/test_place_links.py | 28 +++++++++++++++++----------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/web/assets/style.css b/web/assets/style.css index c4222d2..de55663 100644 --- a/web/assets/style.css +++ b/web/assets/style.css @@ -2298,6 +2298,12 @@ td .linklist a { font-weight: 400; } .lists-row li { flex: none; } .lists-row a { min-block-size: 2.75rem; } } +/* The Places hub's jump row: one compact line at the very top, States and provinces and each kind of + place with its number of pages; it wraps on a phone rather than scrolling. */ +.places-jump { margin-block-end: var(--space-1); } +.places-jump ul { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); padding: 0; list-style: none; font: 600 0.85rem/1.3 var(--font-sans); } +.places-jump a { display: inline-flex; align-items: center; min-block-size: 2.25rem; color: var(--link); } +.places-jump__n { margin-inline-start: 0.35em; color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; } .section--finder { padding-block-start: var(--space-4); } .pills { display: flex; flex-wrap: wrap; gap: var(--space-2); } .pills .check { grid-template-columns: auto auto; padding: 0.15rem var(--space-2); border: 1px solid var(--rule-strong); border-radius: 999px; } diff --git a/web/olt/regions.py b/web/olt/regions.py index 48bd3c5..f164d8b 100644 --- a/web/olt/regions.py +++ b/web/olt/regions.py @@ -166,8 +166,9 @@ def regions_index_page(records, site, infos=()): a page (olt/places.py collect); each kind that has any gets a section of its own.""" by_slug, across = collect_regions(records) place_infos = list(infos.values()) if isinstance(infos, dict) else list(infos or ()) - blocks = "" + blocks = '' jump = [] + kinds = [] for g, name, keys in facets.PLACE_GROUPS: infos = sorted((by_slug[k.lower()] for k in keys if k.lower() in by_slug), key=lambda i: i["name"]) if not infos: @@ -200,7 +201,7 @@ def regions_index_page(records, site, infos=()): f'
  • {esc(i["name"])}' f'{_plural(len(i["records"]))}
  • ' for i in mine) - jump.append(f'
  • {esc(kind.hub_title)}{len(mine)}
  • ') + kinds.append(f'
  • {esc(kind.hub_title)} {len(mine)}
  • ') blocks += f"""

    {esc(kind.hub_title)}

      {rows}
    @@ -214,12 +215,17 @@ def regions_index_page(records, site, infos=()): foot = f'\n

    Places with no listed trail: {links}.

    ' n_us = sum(1 for r in records if "US" in common.countries(r)) n_ca = sum(1 for r in records if "CA" in common.countries(r)) - body = f"""
    + # One compact row at the very top, whatever the screen: the states and provinces and each kind of + # place that has pages, each with its exact number of pages. + row = (f'') if kinds else "" + body = f"""
    {row}

    Places

    The {len(records)} trails by state and province, grouped into parts of the United States ({n_us}) and Canada ({n_ca}). A trail that crosses several states is on each one’s page.{lede_more}

    -
    +
    {blocks}
    {foot}""" description = (f"Where the {len(records)} long trails and routes are: {n_us} in the United States and {n_ca} in Canada, " f"by state and province, with the number in each.") diff --git a/web/tests/test_place_links.py b/web/tests/test_place_links.py index 4e66214..7cf065a 100644 --- a/web/tests/test_place_links.py +++ b/web/tests/test_place_links.py @@ -48,18 +48,24 @@ class HubTest(unittest.TestCase): self.assertIn("Parks, mountain ranges and wilderness areas with three or more " "trails have pages too.", re.sub(r"\s+", " ", body)) - def test_the_shortcut_strip_links_each_kind_that_has_pages(self): + def test_a_jump_row_tops_the_hub_with_exact_counts_of_pages(self): _, _, body = regions.regions_index_page(self.records, S, infos=self.infos) - strip = str(body)[str(body).index('
    """ diff --git a/web/olt/pages.py b/web/olt/pages.py index dbd4241..45abd0f 100644 --- a/web/olt/pages.py +++ b/web/olt/pages.py @@ -125,7 +125,7 @@ def render_site(records, out_dir, repo_root, site=None): image=card, image_alt=card_alt)) dates[path] = seo.modified(rec) pages += 1 - body = home.render(records, site, repo_root) + body = home.render(records, site, repo_root, place_kinds={i["kind"] for i in place_infos.values()}) layout.write_page(out_dir, "/", layout.layout("", body, path="/", maps=True, site=site, description=home.description(records), jsonld=seo.home_jsonld(site))) diff --git a/web/tests/test_place_links.py b/web/tests/test_place_links.py index 7cf065a..b322603 100644 --- a/web/tests/test_place_links.py +++ b/web/tests/test_place_links.py @@ -29,6 +29,31 @@ def infos(records): return places.collect(records, registry()) +class HomeWayInTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.records = wind_records(4) + yosemite_records(3) + + def test_below_the_rows_a_line_links_each_kind_that_has_pages(self): + body = str(home.render(self.records, S, ROOT, place_kinds=["park", "range", "wilderness"])) + line = re.search(r'

    (.*?)

    ', body, re.S).group(1) + self.assertEqual( + re.sub(r"<[^>]+>", "", line), + "Browse by park, by mountain range or by wilderness area.") + for frag in ('href="/regions/#parks">park', 'href="/regions/#ranges">mountain range', + 'href="/regions/#wilderness">wilderness area'): + self.assertIn(frag, line) + # after the rows and the map, in the notes at the foot, never in the intro + self.assertGreater(body.index("finder__places"), body.rindex('
  • "), body.index("finder__places")) + + def test_only_the_kinds_with_pages_and_none_when_there_are_none(self): + line = re.search(r'finder__places">(.*?)

    ', str(home.render(self.records, S, ROOT, place_kinds=["range"])), re.S).group(1) + self.assertEqual(re.sub(r"<[^>]+>", "", line), "Browse by mountain range.") + self.assertNotIn("finder__places", str(home.render(self.records, S, ROOT))) + + class HubTest(unittest.TestCase): @classmethod def setUpClass(cls): From 742f5da4f11d20a39e3817d9e3e613ac2cf88722 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 13:51:50 -0700 Subject: [PATCH 4/7] Say in the changelog what the filter bar and the new ways in to the place pages change for a visitor --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2adc7fe..122cb64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2026-11-20 - The search box and filters on every page, and ways in to the places + +- Every page that lists trails now has the search box and the filters, however few trails it holds. Until now the 48 state and province pages with fewer than ten trails, the small lists and each route author's page showed the rows alone. The filters shown are the ones that have something to offer: a page with two trails offers the choices those two trails differ on, with the number that each choice leaves, and a page with one trail has the search box alone. Nothing is offered that would show no trails. +- The Places page now begins with one row of links, visible at every screen size: States and provinces, Parks, Mountain ranges and Wilderness areas, each with its number of pages. They go to the parts of the page that were at the bottom, below sixty states and provinces. +- The home page ends with a line under the rows and the map: Browse by park, by mountain range or by wilderness area, each going to its part of the Places page. The first screen is as it was. + ## 2026-11-20 - Pages for national parks, mountain ranges and wilderness areas - There are now 81 pages for named places: 21 national parks and other Park Service units (such as the Blue Ridge Parkway and Glen Canyon National Recreation Area), 36 mountain ranges and other named landforms (the Colorado Plateau and the Mogollon Rim are labelled and worded as what they are, "on the Colorado Plateau") and 24 wilderness areas, each with 3 or more trails. Every page has the search box and the filters that have something to offer, however few trails it holds, and every title keeps its count of trails. They answer searches such as "Wind River Range hikes" or "backpacking in Glacier National Park", and each has the same filter bar, trail rows and map as a state page. A place with fewer than 3 trails has no page: the Uinta Mountains have one. A range or wilderness area that holds exactly the trails of the park of the same name (Great Smoky Mountains, Olympic Mountains) has no page of its own either, and six places that were only another name for trails already on a neighbour's page are left out: the Longfellow Mountains, Finger Lakes, Gore Range, Mosquito Range, Great Western Divide and Russian Wilderness. From f669a6695a41ff2b6c9dcf0f092d40abbe6f9455 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 13:54:27 -0700 Subject: [PATCH 5/7] Mark the places checklist's sub-steps with asterisks so the audit document keeps the house wording the seasons check reads --- docs/audit.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/audit.md b/docs/audit.md index e027715..aac36f3 100644 --- a/docs/audit.md +++ b/docs/audit.md @@ -17,11 +17,11 @@ down the list in order and stop at the first step that fails. `python3 -m unittest discover -s web/tests` must both pass. 6. **Check the places.** `python3 tools/place_trails.py --check --refresh` downloads every outline again (without `--refresh` it reuses the files already in the cache, which are the ones first downloaded), measures every track again and prints each difference from the records, one per line: - - a place gained or lost by a trail: re-run `place_trails.py propose`, read the line, and + * a place gained or lost by a trail: re-run `place_trails.py propose`, read the line, and apply it only when the new outline is right; - - a boundary that moved (a new source version): the owner rules whether the new outline + * a boundary that moved (a new source version): the owner rules whether the new outline replaces the old one; - - a place that crossed the 3-trail line: its page appears or goes, so check its links and the + * a place that crossed the 3-trail line: its page appears or goes, so check its links and the counts that name it. The monthly workflow `.github/workflows/places.yml` runs this step by itself and fails with the list; this step is the one you run when it has failed, and before a release. From fc66f541a30943762863cb27a618eaa7a3627391 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 14:08:34 -0700 Subject: [PATCH 6/7] Let a set with no trails build its filter bar, and pin the Places page's new jump-link anchor in the state-pages golden file In the golden file only the hash of /regions/ changed, by the anchor the jump row's first link goes to. --- web/olt/home.py | 2 +- web/tests/golden/state-pages.json | 2 +- web/tests/test_filter_bar.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/olt/home.py b/web/olt/home.py index 876a298..9b6ff48 100644 --- a/web/olt/home.py +++ b/web/olt/home.py @@ -336,7 +336,7 @@ def finder_form(records, c=None, steps=None, where="all", bare_if_empty=False): """) - kms = [r["length_km"] for r in records] + kms = [r["length_km"] for r in records] or [0] if any(min(kms) < n * words.KM_PER_MI <= max(kms) for n in steps): first.append(f"""
    {facets.LENGTH} diff --git a/web/tests/golden/state-pages.json b/web/tests/golden/state-pages.json index 6d57e57..732244e 100644 --- a/web/tests/golden/state-pages.json +++ b/web/tests/golden/state-pages.json @@ -1,5 +1,5 @@ { - "/regions/": "e70a9608ef0ee6a97d0591ad582abff1b165371dee5111e3277df06a53a554e1", + "/regions/": "aa351d1ce7ddcb555bcee2b2b795d87f2ed3b2a130c5b10c3873fcab4f1becf5", "/regions/atlantic-canada/": "5146b4b9d1940a268cfd2345f1eee2263fd6c7e2dfd28adfdffc3fff0e698c93", "/regions/ca-on/": "d4e543c6f163ba188a34444b42c494a3dbbd26c02f2b141339bbc230cd91f84e", "/regions/central-canada/": "d7478ad682d715705770d35cc902c80c40d27719e7f9f5a1d99ec702d3f7a43e", diff --git a/web/tests/test_filter_bar.py b/web/tests/test_filter_bar.py index 1911f9a..426f6a9 100644 --- a/web/tests/test_filter_bar.py +++ b/web/tests/test_filter_bar.py @@ -129,6 +129,9 @@ class WhichPagesHaveTheBarTest(unittest.TestCase): body = authors.author_page(g, self.records, SITE, groups)[2] self.assertIn('id="finder-form"', str(body), g["name"]) + def test_a_set_with_no_trails_still_builds(self): + self.assertIn(" Date: Fri, 20 Nov 2026 14:21:57 -0700 Subject: [PATCH 7/7] Keep the jump row's first anchor outside the Places page's grid so the first group is not pushed right on a wide screen --- web/olt/regions.py | 3 ++- web/tests/golden/state-pages.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/olt/regions.py b/web/olt/regions.py index f164d8b..c88e91f 100644 --- a/web/olt/regions.py +++ b/web/olt/regions.py @@ -166,7 +166,7 @@ def regions_index_page(records, site, infos=()): a page (olt/places.py collect); each kind that has any gets a section of its own.""" by_slug, across = collect_regions(records) place_infos = list(infos.values()) if isinstance(infos, dict) else list(infos or ()) - blocks = '' + blocks = "" jump = [] kinds = [] for g, name, keys in facets.PLACE_GROUPS: @@ -226,6 +226,7 @@ def regions_index_page(records, site, infos=()): United States ({n_us}) and Canada ({n_ca}). A trail that crosses several states is on each one’s page.{lede_more}

    +
    {blocks}
    {foot}""" description = (f"Where the {len(records)} long trails and routes are: {n_us} in the United States and {n_ca} in Canada, " f"by state and province, with the number in each.") diff --git a/web/tests/golden/state-pages.json b/web/tests/golden/state-pages.json index 732244e..7fa44c1 100644 --- a/web/tests/golden/state-pages.json +++ b/web/tests/golden/state-pages.json @@ -1,5 +1,5 @@ { - "/regions/": "aa351d1ce7ddcb555bcee2b2b795d87f2ed3b2a130c5b10c3873fcab4f1becf5", + "/regions/": "7430cb0e32ffb89d0bc0bd89c476bccf9fc76e2d84175ebacd7370dc3bb20d1e", "/regions/atlantic-canada/": "5146b4b9d1940a268cfd2345f1eee2263fd6c7e2dfd28adfdffc3fff0e698c93", "/regions/ca-on/": "d4e543c6f163ba188a34444b42c494a3dbbd26c02f2b141339bbc230cd91f84e", "/regions/central-canada/": "d7478ad682d715705770d35cc902c80c40d27719e7f9f5a1d99ec702d3f7a43e",