garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/notes/map-chrome.md

raw


topic: ui triggers: [ui.rs, geo_nav.rs, dock.rs, hud.rs, welcome.rs, MainMenu, "face sheet", "World | Community", "space switch", chat.rs, splash.rs, systems/gui/theme, "top bar", "menu bar", "address bar", "search bar", "main menu", "hamburger", "bottom bar", dock, logo, mark, wordmark, "suggestion", "map controls", compass, "status hud", lib_chrome.rs, lib_main_menu.rs, brand-mark.ts, "box grows", "stretches across the screen"] updated: 2026-11-26

The map chrome

Where the search, the menu and the readouts live, and what the four shapes tried so far each cost. (This was address-bar.md while the answer was a bar.)

Rejected: the full-width strip

The first version was a strip spanning the viewport, in the manner of a desktop-app menu bar. It carries roughly 400 pt of controls, so on any window wider than that most of the band existed only to hold a background — an opaque 46 pt slab across the top of the map, permanently, for nothing. It also forced every future control to be placed relative to a bar, not to a corner.

Until 2026-11-26 egui drew the chrome, and its layout kept boxes wide after the strip was gone: egui::MenuBar stretched a card to the available width, and any anchored size-to-content Area holding something that reached for the available width grew a little each frame until it spanned the screen (the old status HUD, driver mode's first bottom bar). The component library has no such frame-to-frame feedback.

Rejected: the hover-reveal card

The second version shrank to a card and hid itself, dropping in when the pointer grazed the top ~6 pt of the window. Two problems, both fatal:

It also needed a keep-alive zone that grew to cover the card and its suggestion dropdown, because the dropdown hangs below the bar and reaching for a suggestion would otherwise dismiss the thing that owns it. That plumbing is a symptom: a surface whose visibility is a function of pointer position needs a model of everywhere the pointer might legitimately be.

Rejected: the mark in the corner is the switch

The third version put one always-visible app mark in the top-left corner, which unfolded the rest of the card to the right and folded it back. It fixed both of the hover card's problems and lasted until it met a phone held in one hand.

What it cost:

What it is now: two spaces, one switch, your face (2026-11-10)

The person approved the v2 navigation (docs/mockups/redesign, 2026-11-08, built 2026-11-10): the app is two spaces, World (the map with round buttons on it) and Community (chats, groups, the calendar — the RightPanel::Chat page, the whole screen on a phone and a side panel on a desktop). The dock below had mixed the two in one row, and "the navigation is not intuitive" was about that. All of it is dock.rs:

bottom, centredWorld | Community, always — signed out too, in both spaces, in the same place. A 48 pt pill (theme::p().surface, the chosen side the accent plate with white ink, the unread count a gold p().gold/on_gold badge on Community)
topa "Search places" pill that opens the Search panel (Ctrl+L still does), anchored at the map's top right, at most 420 pt; your face at its end
right column, under the barLayers, the view mode (Follow → Fly → Earth, its word under it), Locate (drawn by hud at the slot dock::right_column gives it, its caption to its left), Camera where there is one
left column, under the barthe compass, the lens, the light disc, and Say in a session (dock::left_slot)

Your face replaced the ☰ menu and opens the same sheet from the search bar and from the Community page's top right (ui::render_main_menu; one face, not two — on a desktop with Community open the bar drops its own). It is a bottom sheet on a phone and a 320 pt card under the face on a desktop: who you are (signed out a grey person, "Not signed in", and Sign in…), Your profile and Share link (the Community's You page), then list rows: Avatar, Saved places, Models · Settings, Admin, About · Developer tools and Share diagnostics with the developer setting · Exit on the desktop, and Sign out… last, in red, arming before it acts. Saved places lost its dock disc to it: the places are yours, not the map's. Community left it: that is the switch.

Signed out, Community is not a dead end. It is the card that says what signing in is for (welcome::Welcome::community, the first-launch card), with Sign in, Create account and "Not now, just the map"; signing in from it opens the Community page. Back and Escape put it away as a rung of their own (dismiss::Rung::SignedOutCommunity, last).

On a phone the switch stays over Community — it is the way back — and the page leaves reserved_bottom free under it; inside a chat it stands down, since the composer has the bottom edge. Over every other full-screen panel the map's chrome drops, as before.

It places against last frame's map. On a desktop a side panel takes the right of the window, and the bar and the switch have to sit over the map that is left — UiInput::map_rect, known only once the panels are laid out (lib_host::measure_map_room), so a frame late. The chrome is drawn by lib_chrome.rs from what dock::drive_dock publishes in MapChrome. A tap on a face is a tap outside the sheet when the sheet tests for one: ui::MainMenu::face is last frame's face rect, which the sheet leaves to the face to answer.

Measured fits (unit tests, the phone being 274 × 600 pt — the shots' 412 × 900 px at 1.5 — and the web phone 214 pt wide): the switch and the bar take the viewport less the margins, so both fit by construction (dock::the_switch_and_the_bar_fit_a_phone); the right column ends at 268 pt with Locate and Camera. Follow's touch controls stop at 334 pt — 66 pt of room — since 2026-11-11, when the face and hand discs moved beside the jump disc (then a jump/flight pair) instead of in tiers above it (they stood at 276, 8 pt off the column; map_osd::the_right_edge_controls_clear_the_column_of_round_buttons now asks for a group gap). The locate caption sits to the left of its disc rather than under it. Earth's zoom rail stands over the switch on a phone (top at 300 pt) and hangs under the column on a desktop (MapChrome::right_bottom, last frame's); centred on the edge, it met the column on a short window. The floor picker hangs there too.

On its side the columns lie down (2026-11-12). Every fit above was for a phone upright, and the person's OnePlus 15 on its side is 924 × 424 pt (2772 × 1272 px at 3 px a point): the right column (to 268 pt) and Follow's stack (266 pt up from the bottom) need 552, so the column stood on the jump disc, the locate caption sat under the face disc, and Say on the left stood under the scale bar over the stick. Now, when the screen is wider than tall and shorter than that (dock::lying), both sets are rows in the search bar's own band: compass, lens, light, Say from the left corner; Layers, the mode, Locate, Camera leftwards from the bar, Layers nearest it so no disc moves when Locate or Camera comes or goes. The bar narrows to keep out of both rows at their fullest (dock::search_width), Locate's caption and the light's choices go under their discs, and the Midas disc takes the margin under the bar. The right edge's touch pairs stand side by side along the bottom (map_osd::spots: zoom at the corner, jump, then face/hand), 160 pt tall instead of 266 — under the thumbs of a phone held in two hands, with the middle of both edges free for the map. Everything anchored at reserved_top keeps it, so the chips and pills did not move. Slots are a function of the viewport now (left_slot(view, i), right_column(view, …)): a caller that asks without one is how a disc stays in the column while its neighbours lie down. Not yet: Earth's zoom rail is 300 pt tall over the switch and fits the OnePlus on its side (424 pt) but not the 274-pt reference phone on its side.

Overlays keep off the columns (2026-11-11): a friend's marker drew over the right column in Earth mode, and a pin over a button takes its taps. The dock publishes both columns' rects each frame (MapChrome::holes), and the pins, the people's markers, place names, the Plans dots and the device arrow cull a tip that falls in one, grown by how far a pin hangs above its tip (place_pins::clear_of_chrome).

Your face's sheet stands on the switch on a phone, a card with the screen's margins, not a bottom sheet over it (2026-11-11): the bottom sheet hid the switch and put Sign out under the fold. Its rows were made 44 pt (66 dp) and Exit a row of the app's group so the fullest sheet — signed in, an admin — fits 600 pt with Sign out in sight.

Community's + is in its title row, between the name and your face, since 2026-11-11: as a floating button at the bottom right it sat over the last conversations and beside the switch.

Everything else that sat at the top edge moved under the bar (dock::reserved_top): the location-sharing chip, the update pill, the camera-attach chip, the lens's column, the Midas link button (a second column, left of the right one) and the community filter chip (truncated to the room between the two columns). The walk guide's turn card keeps the top: the bar stands down while a walk is guided, as it does in a chat's World view, whose header has the top.

Consequences worth knowing

Superseded: the dock owns the chrome (2026-08 → 2026-11-10)

Up to six discs along the bottom edge, left to right, each with its word under it: Search, Say, the view mode, Camera, Saved, Menu; Layers and the lens in the top-left corner above the compass; a Community | World switch at the top of the map, signed in only. What it taught, and what the face's sheet kept:

The mark is the icon's SVG, never the PNG

The brand pin on Groningen's street plan (tools/brand-mark.ts writes assets/icon/cartopolis.svg, the PNG, the .ico and index.html's loader copy; the isometric tower cluster before 2026-10-10). The wordmark is the name in two tones (cream carto, accent polis), as the atlas web UI's .app-header .wordmark writes it. The splash include_str!s the SVG (lib_splash; the sign-in card leaves the mark out for now): rasterised once with tiny-skia at the window's physical pixels on the Bevy backend, a data:image/svg+xml source on the web. Why not the PNG:

Until 2026-11-26 egui painted a reduced mark from a geometry table (theme::paint_mark: a flat tile, a disc-over-triangle pin), since egui has no mip chain and a 256 px image shimmered on a 20 pt disc. The table survives in theme/brand.rs only as the tool's output its tests check.

The suggestion rows carry a distance, and that is the point

Nominatim answers with one flattened display_name — "Amsterdam, North Holland, Netherlands". Rendered as a single truncated line, the eight Amsterdams a public index returns are eight identical rows: everything that tells them apart lives past the first comma, which is exactly what truncation eats. So a hit is split at parse time into name / kind / address context (GeoSuggestion::from_nominatim) and drawn on two lines, with the great-circle distance and compass bearing from the current camera position leading the second.

Two things about that:

The bearing is the great-circle initial bearing, so a hit in the American Midwest reads NW from the Netherlands rather than W. That is correct and occasionally surprising.

In a panel the list is inline, not a dropdown under the field, and it does not close when the field loses focus. A dropdown over the map has to disappear the moment attention leaves it; a panel has no such duty, and the list is what the panel is for. It comes down when a hit is picked, when the query is retyped, or with the panel.

Two pieces of chrome a shot cannot ask for

Every panel is a boolean a scripted run can set, and --ui sets them. Two are not quite booleans: