refactor name the compact nav by form, not by device

site_nav and repo_nav name the scope their links cover; mobile_nav named a device class instead, breaking the family's axis. It is repository-scoped like repo_nav, differing only in being condensed and pinned to the bottom, and nothing in the module knows what hardware is in use — CSS reveals it by viewport width. Rename it compact_repo_nav, which places it on the same axis as its siblings and states its relationship to repo_nav. Layout's bindings follow suit: mobile becomes compact_nav, and header_node becomes banner to match Ui.page_banner. This also changes the landmark's accessible name from "Mobile navigation" to "Compact navigation", the one rendered-HTML change in the series. The old label told screen-reader users something untrue, since the nav depends on viewport width rather than device. Verified as the only markup difference: 26 changed lines across 13 pages, all this attribute.

Commit
9b3af5480be775162e6b496cff0315f331805bbe
Author
Claude Sonnet 4 <claude@anthropic.invalid>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/views/components.ml
index 72588432..439dd9ab 100644..100644
@@ -141,10 +141,14 @@
141 141 [ Summary; Commits; Files; Branches; Tags; Readme ]);
142 142 ]
143 143
144 Removed: (** Condensed navigation pinned to the bottom of the viewport, revealed by CSS
145 Removed: on narrow screens where the top link list is hidden. *)
146 Removed: let mobile_nav ~active repo =
147 Removed: Ui.navigation ~id:"bottom-nav" ~label:"Mobile navigation"
144 Added: (** The same repository destinations as {!repo_nav}, condensed and pinned to the
145 Added: bottom of the viewport. CSS reveals it on narrow viewports, where the top
146 Added: link list is hidden.
147 Added:
148 Added: Named for its form rather than for a device: the viewport width decides when
149 Added: it appears, and this module has no notion of what hardware is in use. *)
150 Added: let compact_repo_nav ~active repo =
151 Added: Ui.navigation ~id:"bottom-nav" ~label:"Compact navigation"
148 152 [
149 153 Ui.nav_links ~id:"bottom-nav-links" ~item_class:"bottom-nav-item"
150 154 (List.map (page_link repo ~active) [ Summary; Commits; Files; Readme ]);
lib/views/layout.ml
index b48d9c2b..3b809284 100644..100644
@@ -99,7 +99,7 @@
99 99 | Some _, _ :: _ -> Some "has-toolbar"
100 100 | _ -> None
101 101 in
102 Removed: let navigation, toolbar, header_node, mobile =
102 Added: let navigation, toolbar, banner, compact_nav =
103 103 match page_data.repo with
104 104 | None ->
105 105 ( Components.site_nav ~title:site.root_title ~logo:site.nav_logo
@@ -111,15 +111,15 @@
111 111 ( Components.repo_nav ~active:page_data.active ~logo:site.nav_logo repo,
112 112 Components.toolbar page_data.toolbar,
113 113 header ~has_repo:true page_data.title page_data.subtitle,
114 Removed: Components.mobile_nav ~active:page_data.active repo )
114 Added: Components.compact_repo_nav ~active:page_data.active repo )
115 115 in
116 116 Ui.document_body ?class_:body_class
117 117 [
118 118 Ui.skip_link ~href:"#main" "Skip to content";
119 119 navigation;
120 120 toolbar;
121 Removed: Ui.page_content ~id:"main" (header_node :: page_data.content);
122 Removed: mobile;
121 Added: Ui.page_content ~id:"main" (banner :: page_data.content);
122 Added: compact_nav;
123 123 footer site.user_name;
124 124 Ui.inline_script highlight_blob;
125 125 ]