https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31802 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I have audited where alerts are placed across the staff interface (templates under koha-tmpl/intranet-tmpl/prog/en/modules on main, plus the Vue apps) and I would like to turn this bug into a concrete proposal. The full audit and a draft specification are attached. How I counted: a script walks each template's div nesting and records, for every div.alert / div.dialog, whether it comes before or after the first h1 in the same file, and whether it sits inside a page-section, form, fieldset, tab pane or modal. It is a static scan, so it cannot tell a status message from an inline hint, and it cannot see an h1 that comes from an include. Treat the numbers as a map of where to look. Results: 837 alerts in 236 templates. * 152 at page level, above the h1 * 480 at page level, below the h1, outside any card * 34 inside a .page-section card * 53 inside a form or fieldset * 5 inside a tab pane * 113 inside a modal (expected) * 57 templates mix more than one placement on the same page Against toolbars (first toolbar in the file, page-level alerts only, 404 alerts in templates that have a toolbar): 172 are toolbar, h1, alert; 78 are alert, then toolbar and h1; 67 are h1, toolbar, alert; 60 are h1, alert, toolbar; 26 are toolbar, alert, h1. So all the orderings in the description of this bug really do occur. Where it comes from: * main-container.inc already renders messages_block and messages.inc at the very top of <main>, above the content and so above the h1. * Many admin templates add their own "FOR m IN messages" alert loop at the top of the content (66 hits above the h1). * Most other templates put a plain alert directly under the h1. * A few put it inside a .page-section card. * circ/renew.tt uses the alert as the page heading, with the h1 inside it. * Vue: ERM, ILL, Preservation, SIP2, Vendors and Circulation Triggers render <Dialog /> first inside <main>. ItemLists and RecordSources render it outside <main>. The new check-in page has its own alerts and does not use <Dialog />. * pos, rotating_collections and installer are mostly above the h1, while neighbouring modules are below it. Alerts that are not messages: while classifying these I noticed that many alert-info boxes are not messages at all. Of 304 alert-info alerts I could classify (keyword matching plus my own reading, so the counts are approximate): about 110 report the result of an action, about 125 are empty states ("There are no desks defined"), about 28 are persistent "this feature is switched off" notices (for example "Recalls have not been enabled" is copied into 7 templates), and about 45 are standing documentation (the Elasticsearch reindex note, the "Reminder: this action will modify all selected..." text in the batch tools, instructions). I did not review alert-warning for the same thing. The info card we want already exists as div.page-section.bg-info (Circulation Triggers, tools/notices.tt), but it has no shared style: Circulation Triggers overrides the colour locally, and two templates use bg-info-subtle instead. The specification therefore proposes that alerts are for events only, and that documentation moves to that card, placed with the content it explains, after the card gets a shared definition. That is a separate step in the rollout and should not block the placement work. Empty states are a third case that I suggest handling as their own block inside the table or section. Proposal (details in the attached specification): 1. Status and result messages (saved, error, not found, blocking) go in one full-width region at the top of <main>, above the toolbar and h1 and outside any page-section. In TT that is the existing messages_block / messages.inc slot. In Vue it is <Dialog /> first in <main>. 2. Notes about one thing (a table, a field) stay inside the section or field they describe. 3. Modals keep their alerts in the modal body. 4. An alert is never the page heading. 5. Use alert alert-*, not the old "dialog message" / "dialog alert". 6. Standing guidance goes in an info card with the content it explains, not in an alert (see above). The wrapper slot and the Vue apps already behave like point 1, which is why I lean that way, but below-the-h1 has more hits (the count includes inline hints, so it is not a clean comparison). I would like feedback on that choice before anyone starts converting templates. Katrin's suggestion in comment 1 (split frontend rules into a GUI/style guideline) fits well: I propose the standard goes there as a short "Page layout: messages" section rather than into the coding guidelines. I have not changed any templates. If the direction is agreed I would file one dependent bug per step in the rollout plan, starting with the admin message loops, which is the largest and most mechanical cluster. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.