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
Contributor

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.

@volkantasci

Copy link
Copy Markdown
Contributor 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
Contributor 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!

@volkantasci
volkantasci force-pushed the 19.0-add-web_theme_focus branch from 9dede9a to 5c41389 Compare October 6, 2026 20:51
@volkantasci

Copy link
Copy Markdown
Contributor Author

Hi @tarteo 👋

I've rebased the branch onto the latest 19.0 and all checks are green again (pre-commit, Odoo/OCB tests, codecov, runboat). The fixes from my previous message are unchanged — now in commit 5c41389: the Enterprise-derived artwork is gone (small Milk-theme overlay with explicit attribution, pure CSS dark gradient).

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

@volkantasci

Copy link
Copy Markdown
Contributor Author

Hi @tarteo 👋 — gentle reminder: the changes you requested are in place (5c41389), all checks are green and the PR is mergeable (CLEAN). Could you take another look when you have a moment? Thanks!

@volkantasci

Copy link
Copy Markdown
Contributor Author

Hi @pedrobaeza 👋 — the changes requested by @tarteo have been addressed (5c41389), all checks are green and the PR is mergeable. I've pinged @tarteo a couple of times but haven't heard back — in case he's busy, would you (or another maintainer) be able to take a look when you have a moment? Thanks!

@pedrobaeza pedrobaeza added this to the 19.0 milestone Oct 22, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

I think he's on holidays. Let's wait till next week.

@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.

This is my last review for this PR, I won't spend more time reviewing code entirely generated by AI. Otherwise I might as well just let my AI review your AI's code. The same applies for AI generated replies.

Comment thread web_theme_focus/models/res_users.py Outdated

apps_menu_theme = fields.Selection(
selection_add=[("focus", "Focus")],
ondelete={"focus": "cascade"},

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.

On uninstall this will delete users that use this theme

@volkantasci
volkantasci force-pushed the 19.0-add-web_theme_focus branch from cbebf19 to 91aa02b Compare October 23, 2026 19:34
@volkantasci

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up, @pedrobaeza 🙏 — we'll wait until next week then. In the meantime I've fixed the pre-commit formatting on the latest commit (91aa02bb), so all checks are green again.

@volkantasci
volkantasci force-pushed the 19.0-add-web_theme_focus branch from 91aa02b to 7ea6ef4 Compare October 26, 2026 12:52
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.

4 participants