[FIX] viin_brand_website, viin_backend_theme: one click into the backend, and type to search
Killed
130m
merged
Commit message
[IMP] viin_brand_website: one click from the site into the backend Clicking the apps grid on the website used to open a dropdown listing the internal user's apps, so reaching the backend cost an extra click every time. The button now links straight to /odoo and no longer toggles anything. /odoo can take a noticeable moment on an install with many modules, so the icon swaps to a spinner on click: the user can see the click registered. A Ctrl/Cmd/Shift or middle click opens the backend in a new tab and leaves the current page's icon alone, and a Back-button restore from the browser's cache puts the icon back rather than leaving it spinning for good. That spinner is wired by a delegated listener on the document, not by a public Interaction. It was written as an Interaction first and it never ran: the interaction service scans from #wrapwrap, and this button renders outside it, under body > .o_frontend_to_backend_nav > .o_frontend_to_backend_buttons. Core drives this same bar from a plain frontend module for the same reason. Both click and auxclick are bound, because a non-primary click fires the latter and core treats the two as a pair. Core's own dropdown markup beside the button is left exactly as core renders it, including the ir.ui.menu lookup it performs on every frontend page. Taking it out looked like a free win and was tried twice; core's website_backend_menus_redirect tour opens that dropdown and clicks an entry inside it, and the entry only exists when the lookup runs. The de-branded title on the button is unchanged. Tests: the click, modifier and cache-restore behaviour are covered on a real DOM rather than by matching the text of an inline handler, which an implementation with the transitions swapped passed just as happily. A tour drives the button on a real rendered page and asserts both that the icon swaps and that the button is NOT inside #wrapwrap, so if a future Odoo moves it the guard fails loudly instead of passing for the wrong reason - a unit test cannot make that assertion, because the test helper fabricates a #wrapwrap of its own, which is precisely why nine green unit tests hid a feature that did not work. Bundle guards assert the module really reaches the browser. Also here, and separable from the behaviour: comments in this module's tests cited source by line number. Each now names the symbol instead. One had already rotted badly, naming a method while pointing fifteen lines above its real definition.