Skip to content

[ADD] web_theme_focus: minimal focus backend theme - larger icons, hidden search, transparent navbar - #3648

Open
volkantasci wants to merge 1 commit into
OCA:19.0from
volkantasci:19.0-add-web_theme_focus
Open

volkantasci wants to merge 1 commit into
OCA:19.0from
volkantasci:19.0-add-web_theme_focus

Conversation

@volkantasci

Copy link
Copy Markdown

What does this PR do?

Adds the web_theme_focus addon: a new Focus option for web_responsive's app-menu theme picker (⚙ Apps Menu Preferences → Theme).

  • res.users.apps_menu_theme gains the focus selection value.
  • When active, the app drawer gets the Enterprise-like "Focus" look, clean-room reconstructed from the gradient artwork: larger app icons with more spacing, the search bar hidden, and a full-bleed gradient behind a transparent top navbar (the action area is hidden while the drawer is open).
  • Light and dark variants are provided; the dark SCSS files are registered in web.assets_web_dark so they only load under the dark color scheme (requires web_dark_mode).
  • Theme application is done by mirroring session.apps_menu.theme on <body data-app-theme> from a WebClient.setup patch, so CSS can reach the navbar and the app-menu container, which live outside .o_grid_apps_menu.

The module does not aim to fully replicate Odoo Enterprise and explicitly excludes web_enterprise.

Tests

  • test_selection_includes_focus / test_user_can_be_set_to_focus: the selection value exists and is assignable.
  • test_dark_bundle_registers_focus_assets: web.assets_web_dark resolves both focus .dark.scss files.
  • test_webclient_bootstrap_renders: the webclient bootstrap page renders (HTTP 200) with the module installed.
  • test_session_info_reports_focus_theme: a user with apps_menu_theme=focus receives apps_menu.theme == "focus" in the webclient session info.

All 5 tests pass against a live Odoo 19.0 run (0 failed, 0 error(s) of 5 tests), with both web.assets_web.min.css and web.assets_web_dark.min.css compiling successfully.

Screenshots

The gradient artwork (app_switcher_background_light.svg / _dark.svg) is clean-room reconstructed — no proprietary Enterprise source is copied.

Notes to reviewers

  • Turkish users get a translated theme label via i18n/tr.po ("Focus" → "Odak"), mirroring how web_responsive translates "Milk"/"Community".
  • The focus .dark.scss rules are defined on body[data-app-theme="focus"]; the compiled dark bundle places them after the embedded light rules, so the dark gradient/text colors win as intended (verified in the compiled bundle).
  • Depends: web, web_dark_mode, web_responsive; the theme piggy-backs on web_responsive's apps_menu session info, preferences dialog, reload_context flow and .o_apps_menu_opened body class.

@legalsylvain
legalsylvain marked this pull request as draft September 1, 2026 13:09
@volkantasci
volkantasci marked this pull request as ready for review September 1, 2026 14:10

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artwork is copied from enterprise, they have the same checksum.

Adds a "Focus" option to web_responsive's app-menu theme picker
(res.users.apps_menu_theme): larger app icons with more spacing, no
search bar on the home screen, and a full-bleed gradient behind a
transparent top navbar.

- Light background reuses web_responsive's Milk theme overlay
  (OCA/web, LGPL-3) with the Milk gradient.
- Dark background is a pure CSS gradient (no image), loaded via the
  web.assets_web_dark bundle.
- The active theme is mirrored onto <body data-app-theme> from a
  WebClient.setup patch so CSS can style the navbar and app-menu
  container outside .o_grid_apps_menu.
- Tests cover the selection value, the dark-bundle asset registration,
  and session-info theme propagation.
@volkantasci

Copy link
Copy Markdown
Author

Thanks for the catch @tarteo — the copied artwork is gone.

  • Light background now reuses web_responsive's own Milk theme overlay (home-menu-bg-overlay.svg, OCA/web, LGPL-3) with the Milk gradient — no Enterprise-derived file.
  • Dark background is now a pure CSS gradient (the SVG was removed entirely).

Also, per the earlier review feedback, the branch is squashed to a single [ADD] commit and rebased on the current 19.0 tip. Verified locally: both web.assets_web.min.css and web.assets_web_dark.min.css compile, all 5 tests pass, and the compiled bundles contain no Enterprise artwork references.

@volkantasci

Copy link
Copy Markdown
Author

Hi @tarteo 👋

Following up on your review — the Enterprise-derived artwork is gone. In commit 9dede9ae:

  • The old app_switcher_background_light.svg (1920×1080, the o_app_switcher_gradient_01/02 file whose checksum matched Enterprise) has been replaced by a small polygon overlay that carries an explicit attribution comment to web_responsive's Milk theme overlay (OCA/web, LGPL-3).
  • The dark background SVG was removed and is now a pure CSS gradient.

All checks are green (pre-commit, Odoo/OCB tests, codecov, runboat) and the PR is a single squashed commit.

Could you take another look when you have a moment? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants