Skip to content

Issue 411 Header Buttons Out Of Reach

Ed Mozley edited this page Nov 20, 2026 · 1 revision

🧭 #411 Header buttons out of reach - and what the #393 review missed

GitHub #411, reported and fixed by @cloudcogsio Β· every module, worst in Tickets Β· fixed in 5.8.0 (#3025) Β· a follow-up to #393

What you saw

With a second company (so the company switcher shows), a narrow desktop window - about 770 to 790px - cut off the first button in the Tickets header. Inbox lost 8px past the left edge, and no amount of scrolling the header brought it back. And when the header had switched to icon-only buttons, nothing told you there were more buttons past the right edge: the scrollbar is hidden, so the icons just stopped.

What was wrong

5.6.0 fixed #393 - the header running off the right edge - with assets/js/header-fit.js, which steps the nav down as the window narrows:

  1. tighter buttons,
  2. icon-only buttons,
  3. and if even the icons do not fit, the row scrolls sideways, scrollbar hidden.

Step 3 met an older rule. Every module nav is centred:

/* assets/css/inbox.css, the shared module nav rule (before) */
.tickets-header .header-nav, /* ...and 20 more modules */ {
    flex: 1;
    justify-content: center;
}

When centred content is wider than its box, a flex row spills it past both edges equally. A scroller can only scroll from its start to its end, and the start is the box's left edge - so whatever spilled past the left is not scrollable at all. It is not hidden behind something; it is outside the range scrolling can reach.

Was it more than one place? Every module uses the same rule (People has its own copy in people.css), but only Tickets has enough buttons to overflow in practice. Measured at 770px with a 28-character company name, the first button's offset from the nav's left edge was:

Module Offset at 770px
Tickets -8px (cut off)
Projects, Calendar 0px (fits exactly - a longer company name tips them over)
Assets, Changes, Service Status 12-30px
Tasks, Contracts, Domains, People, Knowledge, Reporting 43-70px

The fix

@cloudcogsio sent the fix on a branch; it is merged with their authorship.

  1. safe center in both shared nav rules:

    justify-content: center;        /* browsers without "safe" keep this */
    justify-content: safe center;   /* centred when it fits; starts at the left edge when it does not */

    The safe keyword exists for exactly this case: it falls back to start instead of letting content overflow where it cannot be reached.

  2. A fade on the edge that has more to scroll to - the right edge at the start, the left at the end, both in between. It is a mask-image driven by a CSS scroll timeline on the nav itself (animation-timeline: scroll(self inline)), so it needs no JavaScript, appears only while the nav really overflows, works on every module's colour and in dark mode, and simply does not show in a browser without scroll timelines.

πŸ“ Files

File Change
πŸ”΅ assets/css/inbox.css safe center; the edge fade (@property, keyframes, @supports block); spacing values name their tokens
πŸ”΅ assets/css/people.css safe center in People's own nav rule
βšͺ ~235 pages inbox.css / people.css cache-busters

How it was verified

On a test install with a temporary second company, a harness page loaded Tickets in frames of fixed widths and measured the first button's left edge against the nav's (with the nav scrolled to its start) and the last button's right edge (scrolled to its end):

Width First button, before First button, after Last button, after
769px - 0 fully visible
775px -8 0 fully visible
790px - 0 fully visible
860px 35 (centred) 35 (centred) -

860px is the control: a nav that fits is still centred, exactly as before. A screenshot at 775px scrolled to the end shows the left edge fading and the last icon whole.

πŸŽ“ What the #393 review missed - and the lessons

#393 was reviewed, reproduced and measured before it was merged. #411 still got through. How?

1. Nobody saw the last step happen. The review reproduced #393 at 1280 and 1366px, where only step 1 (tighter buttons) fires. The branch's own testing went down to 800px - where Tickets still fits, by 5px. Step 3, the sideways scroller, was written, described in the commit message, and never once seen overflowing. Both the review and the branch tested the bug, not the fix.

Lesson: when a change has fallback steps, test every step at a width (or a size, or a count) where it actually fires - including the very edge of the range it covers, which here was 769px, the first pixel above the phone layout.

2. The check measured the wrong thing. The test was "the header's scrollWidth never exceeds the window". That cannot catch this bug, because scrollWidth does not count content that overflows to the start side. At 775px the nav reported clientWidth 316 and scrollWidth 324: the 8px past the right edge were counted, the 8px past the left were not there at all as far as the browser's scroll range is concerned.

Lesson: for "is anything off screen?", check every item, not the container: each button's rectangle must be reachable - inside the box when scrolled to the start, or at the end. A container that fits proves nothing about what it has pushed outside itself.

3. A hidden scrollbar needs a cue. Hiding the scrollbar was accepted without asking how anyone would know there was more. The fade is the answer; the question belonged in the first review.

These are now on Code traps (safe center for a centred row that may scroll) and in how pull requests that change layout are reviewed: the fallback is exercised, and reachability is measured per item.

What this means for you

Update to 5.8.0 and every header button can be scrolled to, with a fade showing which way there is more. Nothing changes where the buttons fit.

Related: #393 The header ran off the screen Β· Code traps

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally