From 20e3c8035fc4909fbc554124db92b4ef7277b5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Thu, 20 Aug 2026 10:21:18 -0600 Subject: [PATCH] =?UTF-8?q?Lleva=20el=20lanzador=20al=20Men=C3=BA=20Princi?= =?UTF-8?q?pal=20v3=20y=20lo=20pone=20de=20pantalla=20de=20inicio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El lanzador pasa al diseño firmado: título, dos filas de tres bloques iguales y la firma al pie. La fila de tarjetas chicas desaparece, y con ella el catch-all que barría hacia ahí toda app sin mapear. Seis bloques cubren lo que un rol Beyond ve —Venta, Panel General, QR, Inventario, Contactos y Tableros—; lo demás vive dentro del Panel General o está escondido por las limpiezas de menú, así que un catch-all solo habría devuelto a la pantalla lo que se decidió sacar. Entran tres colores de módulo nuevos como variables locales: la regla escrita en beyond_variables.scss es que un color sube a token cuando lo necesita una segunda pantalla, y ninguna los usa todavía. El Menú Principal pasa a ser lo primero que se ve al entrar. El enganche es WebClient._loadDefaultApp, que Odoo llama exactamente cuando la URL no trae acción —el /odoo pelado donde aterriza el login— y nunca cuando sí: un deep link resuelve su estado y va directo a su destino, sin que tengamos que adivinar rutas. La app por defecto sigue cargando DETRÁS, invisible bajo el lanzador, para que cerrarlo sin elegir caiga en una pantalla real y no en un cliente vacío. El dropdown recibe un state controlable en vez de que alguien le pique el botón desde el DOM, y al abrirse solo el foco queda donde lo dejaría un clic en la casa: sin eso el lanzador quedaba encima pero el teclado seguía abajo, en la app que carga detrás, y la primera flecha movía una lista que nadie ve. El anillo de foco es solo de teclado, también en las filas del diálogo QR, que eran lo único que aún se teñía con un :focus de clic. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/kiosco_abrir/kiosco_abrir_dialog.scss | 4 +- addons/beyond_base/__manifest__.py | 1 + .../static/src/webclient/beyond_launcher.js | 57 ++++++ .../static/src/webclient/beyond_launcher.scss | 188 +++++++++--------- .../static/src/webclient/beyond_launcher.xml | 159 +++++++-------- 5 files changed, 223 insertions(+), 186 deletions(-) create mode 100644 addons/beyond_base/static/src/webclient/beyond_launcher.js diff --git a/addons/beyond_attendance_qr/static/src/kiosco_abrir/kiosco_abrir_dialog.scss b/addons/beyond_attendance_qr/static/src/kiosco_abrir/kiosco_abrir_dialog.scss index 1e5c96b..06d2728 100644 --- a/addons/beyond_attendance_qr/static/src/kiosco_abrir/kiosco_abrir_dialog.scss +++ b/addons/beyond_attendance_qr/static/src/kiosco_abrir/kiosco_abrir_dialog.scss @@ -234,8 +234,10 @@ $beyond-qr-font: Manrope, ui-sans-serif, system-ui, sans-serif; text-align: left; transition: background 140ms ease; + // Keyboard only, like the launcher blocks: a plain :focus also fires + // on click and left the row tinted after the pointer had moved on. &:hover, - &:focus { background: $beyond-surface-hover; } + &:focus-visible { background: $beyond-surface-hover; } // The design marks focus with the same tint as hover, which a keyboard // user cannot tell apart from the row under the pointer. The ring is // added on top, using the launcher's focus value. diff --git a/addons/beyond_base/__manifest__.py b/addons/beyond_base/__manifest__.py index 38814d5..4e661c6 100644 --- a/addons/beyond_base/__manifest__.py +++ b/addons/beyond_base/__manifest__.py @@ -37,6 +37,7 @@ vivirán en este módulo. ], 'web.assets_backend': [ 'beyond_base/static/src/webclient/beyond_launcher.scss', + 'beyond_base/static/src/webclient/beyond_launcher.js', 'beyond_base/static/src/webclient/beyond_launcher.xml', ], }, diff --git a/addons/beyond_base/static/src/webclient/beyond_launcher.js b/addons/beyond_base/static/src/webclient/beyond_launcher.js new file mode 100644 index 0000000..75512ab --- /dev/null +++ b/addons/beyond_base/static/src/webclient/beyond_launcher.js @@ -0,0 +1,57 @@ +/** Part of Beyond. Collina Systems proprietary module. */ +import { patch } from "@web/core/utils/patch"; +import { useBus } from "@web/core/utils/hooks"; +import { useRef } from "@odoo/owl"; +import { useDropdownState } from "@web/core/dropdown/dropdown_hooks"; +import { NavBar } from "@web/webclient/navbar/navbar"; +import { WebClient } from "@web/webclient/webclient"; + +const OPEN_LAUNCHER = "BEYOND:OPEN_LAUNCHER"; + +/** + * The apps dropdown gets a state the rest of the client can drive + * (@see useDropdownState), so the launcher can be opened without reaching + * into the DOM for the toggle button. The template hands this state to the + * Dropdown (beyond_launcher.xml). + */ +patch(NavBar.prototype, { + setup() { + super.setup(); + this.beyondLauncher = useDropdownState(); + this.beyondLauncherToggle = useRef("beyondLauncherToggle"); + useBus(this.env.bus, OPEN_LAUNCHER, () => { + this.beyondLauncher.open(); + // Focus goes where a click on the house would leave it. Without + // this the launcher is on top but the keyboard is still down in + // the app behind, and the first arrow key scrolls a list nobody + // can see. + this.beyondLauncherToggle.el?.focus(); + }); + }, +}); + +patch(WebClient.prototype, { + /** + * The Menú Principal is the first screen (20-aug-2026). + * + * Odoo calls this exactly when the URL carries no action — a bare /odoo, + * which is where login lands — and otherwise never: a deep link sets + * stateLoaded and goes straight to its destination. That makes it the + * seam for "the launcher is home", with no route guessing on our side. + * + * The first app still loads BEHIND the launcher, which is what super + * does. The user does not see it (the launcher is full screen and opens + * synchronously, before the action resolves) but closing the launcher + * without choosing then lands on a real screen instead of an empty + * client. Picking a block navigates normally and nothing re-opens. + */ + async _loadDefaultApp() { + this.env.bus.trigger(OPEN_LAUNCHER); + const cargada = await super._loadDefaultApp(); + // Twice on purpose: the app that loads behind grabs focus for its own + // search box as it mounts, which happens after the first call. Opening + // an open dropdown is a no-op, so only the focus is re-applied. + this.env.bus.trigger(OPEN_LAUNCHER); + return cargada; + }, +}); diff --git a/addons/beyond_base/static/src/webclient/beyond_launcher.scss b/addons/beyond_base/static/src/webclient/beyond_launcher.scss index 3ee2e51..a6439ef 100644 --- a/addons/beyond_base/static/src/webclient/beyond_launcher.scss +++ b/addons/beyond_base/static/src/webclient/beyond_launcher.scss @@ -1,28 +1,47 @@ // ============================================================================= -// C-005/C-006 · Beyond launcher v2 (ADR-005) +// C-005/C-006 · Beyond launcher v3 (ADR-005) // -// Faithful translation of the signed-off "Lanzador v2" design. Every colour, +// Faithful translation of the signed-off "Menú Principal". Every colour, // radius, size, gap, duration and font weight below comes from that file; the // few rules that have no counterpart there are marked ENGINEERING and explain -// what they protect against (an app-less band, a long fallback row, a short -// viewport) — the design only covers the nominal case. +// what they protect against — the design only covers the nominal case. // // It is still the native apps dropdown, restyled: the popover is forced full // screen with :has() + !important, which beats the inline positioning the // popover service writes. :has() is supported by the target browsers // (BRIEF §8). // -// Local, on purpose: the orange below is this one block's colour-coding, not a -// brand colour, so it is NOT a token in scss/beyond_variables.scss. The purple -// used to live here too and graduated to $beyond-kiosco once the kiosk page and -// the "Abrir código QR" dialog started using it. See the SCOPE note there. +// Local, on purpose: the four block colours below are this screen's +// colour-coding, not brand colours, so they are NOT tokens in +// scss/beyond_variables.scss. That file's rule is that a colour graduates to a +// token when a SECOND screen needs it — which is how the purple became +// $beyond-kiosco once the kiosk page and the QR dialog started using it. The +// blue, gold and grey are new in v3 and no second screen uses them yet. // ============================================================================= -// "Panel General" block +// "Panel General" $beyond-launcher-panel: #C55A22; $beyond-launcher-panel-hover: #B14E1B; $beyond-launcher-panel-active: #984115; +// "Inventario" +$beyond-launcher-inventario: #3D6A8A; +$beyond-launcher-inventario-hover: #345C79; +$beyond-launcher-inventario-active: #2C4E67; + +// "Contactos" +$beyond-launcher-contactos: #A8802C; +$beyond-launcher-contactos-hover: #957025; +$beyond-launcher-contactos-active: #7F5F1F; + +// "Tableros" +$beyond-launcher-tableros: #55606E; +$beyond-launcher-tableros-hover: #4A545F; +$beyond-launcher-tableros-active: #3F4750; + +// Decorative rule under the title +$beyond-launcher-rule: #DCD8CE; + $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; // ----------------------------------------------------------------------------- @@ -101,16 +120,42 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; color: $beyond-ink; font-family: $beyond-font-family; -webkit-font-smoothing: antialiased; - // ENGINEERING — the design assumes a viewport tall enough for the whole - // layout, where nothing scrolls. Below that, scrolling the shell beats - // clipping tiles out of reach (see .beyond_launcher_primary). - overflow-x: hidden; - overflow-y: auto; + // Nothing scrolls: the design absorbs a short viewport in the icons, + // which shrink with min(140px, 22vh) inside rows that can squash. + overflow: hidden; - // The signature strip + // The title block + .beyond_launcher_header { + flex: none; + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 22px 22px 10px; + } + + .beyond_launcher_title { + font-size: 34px; + font-weight: 800; + letter-spacing: 0.16em; + text-transform: uppercase; + color: $beyond-ink; + } + + .beyond_launcher_rule { + display: block; + width: 64px; + height: 4px; + border-radius: 2px; + background: $beyond-launcher-rule; + } + + // The signature, at the foot .beyond_launcher_brand { flex: none; - padding: 18px 22px 6px; + display: flex; + justify-content: flex-end; + padding: 4px 22px 14px; span { font-size: 13px; @@ -120,56 +165,32 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; } } - // ENGINEERING — a band with no apps for this role must not leave a ghost + // ENGINEERING — a row with no apps for this role must not leave a ghost // strip. :has() rather than :empty so template whitespace cannot fool it. - .beyond_launcher_primary:not(:has(.beyond_block)), - .beyond_launcher_secondary:not(:has(.beyond_tile)) { + .beyond_launcher_band:not(:has(.beyond_block)) { display: none; } - .beyond_launcher_primary { - // Design says `flex: 1; min-height: 0`. `1 0 auto` renders identically - // wherever the layout fits and, when it does not, pushes the shell into - // scrolling instead of squashing the blocks. - flex: 1 0 auto; + // Two rows of three. Both grow, so the blocks split the height evenly. + .beyond_launcher_band { + flex: 1; + min-height: 0; display: flex; gap: 6px; - padding: 8px 6px 0; } - .beyond_launcher_secondary { - flex: none; - height: 128px; - display: flex; - align-items: center; - gap: 8px; - padding: 0 6px; - // ENGINEERING — the row also catches every unmapped app, so it can grow - // past the viewport. Scrolling sideways keeps them reachable without - // breaking the fixed 128px band. The design's centring is done with - // auto margins rather than justify-content on purpose: centred flex - // content overflows in BOTH directions, pushing the first tiles off - // the left edge where scrolling cannot reach them. Auto margins - // collapse to 0 once there is no free space, so the row simply starts - // at the left and scrolls right. - justify-content: flex-start; - overflow-x: auto; + .beyond_launcher_row1 { padding: 8px 6px 0; } + .beyond_launcher_row2 { padding: 6px 6px 8px; } - .beyond_tile:first-child { margin-inline-start: auto; } - .beyond_tile:last-child { margin-inline-end: auto; } - } - - // Shared reset: DropdownItem renders an , so Bootstrap's - // block layout, padding, colour and nowrap have to go before the design's - // own box takes over. - .beyond_block, - .beyond_tile { + // Reset: DropdownItem renders an , so Bootstrap's block + // layout, padding, colour and nowrap have to go before the design's own + // box takes over. + .beyond_block { box-sizing: border-box; display: flex !important; flex-direction: column; align-items: center; width: auto; - background: none; border: 0; text-align: center; text-decoration: none; @@ -180,11 +201,12 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; // Main band: three colour-coded blocks sharing the width // ------------------------------------------------------------------------- .beyond_block { - flex: 1 1 0; + flex: 1; min-width: 0; + min-height: 0; justify-content: center; - gap: 34px; - padding: 0; + gap: 28px; + padding: 18px 12px; border-radius: 28px; transition: flex-grow 220ms ease, background 180ms ease; @@ -193,11 +215,9 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; flex-grow: 1.18; } - // Keyboard only (18-aug-2026). A plain :focus also fired on click, and - // now that the QR block answers in place the launcher stays up with a - // ring around whatever the pointer last hit. The current app no longer - // reuses this ring either: it would be a contour a mouse user never - // asked for. + // Keyboard only. A plain :focus also fires on click, and since the QR + // block answers in place the launcher stays up with a ring around + // whatever the pointer last hit. &:focus-visible { outline: 4px solid $beyond-ink; outline-offset: -6px; @@ -205,7 +225,7 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; } .beyond_block_name { - font-size: 30px; + font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: #FFFFFF; @@ -232,42 +252,24 @@ $beyond-font-family: Manrope, ui-sans-serif, system-ui, sans-serif; &:active { background: $beyond-kiosco-darker; } } - // ------------------------------------------------------------------------- - // Secondary row: small tiles (~132x98, well over the 48px touch floor) - // ------------------------------------------------------------------------- - .beyond_tile { - flex: none; - width: 132px; - padding: 14px 0; - gap: 10px; - border-radius: 20px; - transition: background 140ms ease; + .beyond_block_inventario { + background: $beyond-launcher-inventario; - // Same rule as the blocks for the contour; the tint stays on the - // current app because a background is not a focus ring. - &:hover, - &:focus-visible, - &.focus { - background: $beyond-surface-hover; - } + &:hover { background: $beyond-launcher-inventario-hover; } + &:active { background: $beyond-launcher-inventario-active; } } - .beyond_tile_name { - font-size: 13px; - font-weight: 700; - color: $beyond-ink-soft; - // ENGINEERING — fallback app names are arbitrary; clip them rather than - // let a long one wrap and push the tile out of the 128px band. - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + .beyond_block_contactos { + background: $beyond-launcher-contactos; + + &:hover { background: $beyond-launcher-contactos-hover; } + &:active { background: $beyond-launcher-contactos-active; } } - // Native icon, sized like the designed 42px glyphs it stands in for. - .beyond_tile_icon { - width: 42px; - height: 42px; - object-fit: contain; + .beyond_block_tableros { + background: $beyond-launcher-tableros; + + &:hover { background: $beyond-launcher-tableros-hover; } + &:active { background: $beyond-launcher-tableros-active; } } } diff --git a/addons/beyond_base/static/src/webclient/beyond_launcher.xml b/addons/beyond_base/static/src/webclient/beyond_launcher.xml index bc2b235..f011932 100644 --- a/addons/beyond_base/static/src/webclient/beyond_launcher.xml +++ b/addons/beyond_base/static/src/webclient/beyond_launcher.xml @@ -1,24 +1,30 @@ + + + beyondLauncher + + + + beyondLauncherToggle + - - - -
- Powered by Collina Systems +
+ Menú Principal +
- -
+ +
-
- -
+ +
- Inventario + Inventario - Contactos - - - - - - Mensajes - - - - - - - Empleados + Contactos - Tableros - - - - - - - + Tableros
+ +
+ Powered by Collina Systems +