App Sidebar - edmozley/freeitsm GitHub Wiki
๐งญ The sidebar
An optional rail of module icons down the left of every screen, for anybody who would rather see their modules than open the waffle menu each time (discussion #124). The waffle menu stays where it is unless you choose to hide its button.
Turning it on
Preferences โ Display โ Sidebar (or the โ sliders button at the bottom of the sidebar itself).
- Switch on Show the sidebar.
- Tick the modules you want on it. Only modules you can open are offered.
It appears from the next page you open. It is off until you switch it on, and it is yours alone - nobody else's screen changes.
What is on it
- Your modules, in your module order - the same order as your waffle menu, set just above on the same tab under Module order. Reorder there and the sidebar follows.
- The module you are in is highlighted, with a bar at its left edge.
- Scroll arrows (4.0.0) - when your modules do not all fit, an up and a down arrow appear on rows of their own above and below the list. Click one to glide to the top or the bottom. Each only shows while there is more that way - no empty gap - and a list that fits has neither. The module you are in is scrolled into view when you open a page.
- Module names (3.13.0) - Preferences -> Display -> Sidebar -> Module names:
- Icons only (the default, as it has always been) - hover an icon for its name.
- Open with names when you point at the sidebar - the rail widens to show every name when you point at it, or tab into it with the keyboard. It opens over the page, so nothing you are working on moves. A short pause before it opens stops it flashing when the pointer only passes over the edge.
- Always open with names - the rail stays wide and the page moves over to make room.
- With names on, a ๐ Pin / Unpin button at the bottom switches between the last two on the spot, and remembers it.
- ๐ Recent at the bottom opens the waffle's Recent trail - everything you have opened lately, grouped by module, with its own search. It opens beside the sidebar at the bottom left, next to the button.
- โ the sliders button takes you straight to the sidebar's settings.
Hiding the waffle button (4.0.0)
Once the sidebar is on, Preferences โ Display โ Sidebar โ Waffle button can be set to Hide, for anybody who finds two module menus one too many. The default is Show, so nothing changes unless you choose it.
Only the button goes. ๐ Recent on the sidebar still opens the same panel, search included, so nothing is lost. On a phone the waffle button always shows, whatever this says - a phone has no sidebar, so the waffle is its only menu.
A module you lose access to drops off the sidebar on its own, and one you gain appears in the tick list.
On a phone
The sidebar is not shown on a phone; the phone keeps its compact menu (the waffle button too, even if you hid it on the desktop), and its screens do not move.
For developers
includes/app_sidebar.php-appSidebarPrefs()(one query, per request),appSidebarModules()(the modules fromanalystVisibleModules(), narrowed to the ticked ones) andrenderAppSidebar().- It is drawn by
renderWaffleMenuPanel()inincludes/waffle-menu.php, which every analyst header already calls - so a new module or a new page needs nothing to have it. assets/css/app-sidebar.css, linked by the sidebar itself only when it is on. Desktop only (min-width: 769px);body:has(.app-sidebar)moves the page right 54px. TRAP: anything pinned to the window's left edge withposition: fixed; left: 0lies under the rail - Files' desktop, taskbar and start menu are moved over by hand in that file. A new full-window layer needs the same.- Preferences:
app_sidebar('1'= on),app_sidebar_modules(a JSON list of module keys; absent = every module)app_sidebar_names(iconsor absent /hover/pinned) andapp_sidebar_waffle(hide; absent or empty = show), all inuser_preferences- no schema change. - Names: every link carries its name in
.app-sidebar-name; the rail isoverflow: hidden, so at 54px only the icons show and widening it uncovers the names without moving the icons. The nav's class isapp-sidebar--icons|hover|pinned;body:has(.app-sidebar--pinned)pads the page 220px (and moves Files' layers), while--hoverwidens on:hover/:focus-withinwith no padding, so it overlays. The pin button flips the class and savesapp_sidebar_names- no reload. - Scroll arrows:
.app-sidebar-scrollwraps#appSidebarListand the two.app-sidebar-arrowrows. A row is open only with its arrow (.show, height 0 -> 24px). TRAP: a click opens the FAR row at once and setslist.headinguntil the end is reached - otherwise the far row opens mid-glide, takes 24px off the list after the browser fixed the target, and the scroll stops 24px short. Transitions only after.ready(two frames after load), so rows do not slide open on every page. SmoothscrollTo,autounderprefers-reduced-motion. - Recent from the rail:
appSidebarRecent()addswaffle-panel--railto#wafflePanel(fixed, bottom left beside the rail) andcloseWaffleMenu()takes it off. TRAP: the rail (z-index 1500) sits above the panel (1000), so a--hoverrail is held at 54px while the panel is open, and the button blurs so:focus-withincannot hold it wide. - Waffle button:
app_sidebar_waffle = hideaddsapp-sidebar--nowaffleto the nav, andbody:has(.app-sidebar--nowaffle) .waffle-btn { display: none }sits inside the desktop media query on purpose, so a phone always keeps the button. Only the button is hidden -#wafflePanelstays in the page, because the rail's Recent button opens it. - The order is
module_order(Display order - Developer Guide); the sidebar never stores an order of its own, so it can never disagree with the waffle.
See also
-
Preference templates - give the same sidebar to a whole team, or to every new analyst.
-
Display order - Developer Guide ยท Recent trail - Developer Guide