# Design: the header WeKan has **one** header bar. It is always on screen, it says where you are, and it holds the controls of whatever page you are on. There used to be two. The first was a thin strip with the house icon, the logo and your account; the second was a coloured block that every page filled with its own title and its own buttons. That second bar is gone from every page but the few that still have something only it can hold, and `#header` is not rendered at all where a page has none — it is a coloured block with a height of its own, so leaving it in painted a tall empty strip under the first bar. ## What the bar says The header starts with the **Home icon**, the **collapse control**, then **the page you are on**. The collapse control sits immediately to the right of Home in left-to-right languages, before the page or board title. It hides the icons from the mobile/desktop toggle through the notification bell; Home, the collapse control and the title remain visible. The order follows the writing direction in right-to-left languages. The title used to read "All Boards" on every page, so the one bar that is always on screen named a place you were not. `models/lib/pageTitles.js` maps a route name to a translation key. Three sources, in order: 1. **the board's title**, wherever there is a board — the one thing worth having there; 2. **a custom title** — Support and Accessibility can be renamed by an admin, and Import names its source ("Import / Trello"); 3. **the key** for everything else. A board title and a custom title both come back as `title` rather than `key`, because both are text to print as-is: neither may go through the translator, and a board called "settings" is not the Admin Panel. A route nobody has added answers with nothing and the bar shows nothing — better than naming the wrong page. ### …and the path, in its tooltip Two pages are several places under one name. The bar shows the **root** — `All Boards`, `Admin Panel` — and the whole path is the title's **tooltip**: ``` All Boards / Workspaces / Engineering / Backend Admin Panel / Settings / Version ``` The path is what the page *is*, but it grows — a workspace nests as deep as its tree does — and this bar is the one strip always on screen and already short of width. So the root names the place and the tooltip carries the rest. `headerTitleFullPath()` in `client/components/main/header.js` resolves it to one string, because a `title` attribute is plain text and cannot hold the `{{_ }}` calls the visible version used. It reads the **same** `headerTitle()` and the same trail the visible name does, so the two cannot disagree about where you are. A workspace's own name still does not go through the translator. The trail itself is `headerTitleTrailOf()`, a **plain function rather than a helper**: the tooltip needs it too, and a Blaze helper cannot call a sibling helper — `this` there is the data context, not the helpers object. It is **one list** rather than a helper per segment, because the two pages do not have the same number of them: the Admin Panel always has two, and a workspace has as many as its tree is deep. Each entry is one of the two forms a left-menu entry has — `key` for something translated, `title` for text that must not be. The words are the ones the navigation beside it already uses — the Admin Panel's tab key and its menu row's label ([Admin Panel URLs](../Admin-Panel/Admin-Panel-URLs.md)), the All Boards left-menu key and the workspace's own name ([All Boards URLs](../All-Boards/URLs.md)) — so the tooltip and the thing highlighted next to it cannot say different things about one place. It is read from the **URL** and from the user document, never from the pages themselves. The header is a separate Blaze instance, and importing a page module from it once ran that module before its own template was registered; the throw aborted every module after it, which is why `client/lib/pageTitleSources.js` exists — it registers no template and touches no DOM, so it is safe to load early. ## What the bar holds In source order: the house and the page title, the logo, the full screen button, the phone/desktop toggle, the drag-handles toggle, and then everything else. **Full screen.** A button to the right of the logo puts the whole page in full screen and takes it out again, with the Fullscreen API (`models/lib/fullscreen.js`): the icon is an expand arrow, and a compress arrow while the page is in full screen, and it follows the browser's own way out (Esc) too. Its label is the existing "Maximize", and "Minimize" while the page is in full screen, so the same button says how to leave (Esc and the browser's own control work too). It is drawn only where the browser offers the API and the page may use it - iPad Safari, desktop browsers and Android browsers do; **iPhone Safari does not** (the API is for video there) and neither does a page inside an `