fix(plating): chatter action toolbar invisible in dark mode
The floating message-action toolbar (reaction / reply / star / link icons) appearing on hover renders white-icons-on-white-background in dark mode — Odoo's own dark.scss sets the icon hover color to white but never gives the toolbar itself a dark background. Result: the icons vanish entirely in dark mode. Add fp_chatter_dark.scss that branches at compile time on $o-webclient-color-scheme == dark (Odoo 19 compiles every SCSS file into both web.assets_backend with `bright` AND web.assets_web_dark with `dark`) and gives the toolbar: - Solid dark background (#2b2f33 fallback, var(--o-component-bgcolor)) - Subtle 1px white-alpha border + drop shadow so it floats nicely - Icon color rgba(255,255,255,.78) at full opacity (not 35%) - Brighter hover state with a subtle bg highlight Light bundle output is empty (the @if branch doesn't fire), so the light theme is untouched. Verified: dark bundle includes our rule with #2b2f33 marker present. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
{
|
||||
'name': 'Fusion Plating',
|
||||
'version': '19.0.5.0.0',
|
||||
'version': '19.0.5.1.0',
|
||||
'category': 'Manufacturing/Plating',
|
||||
'summary': 'Core plating / metal finishing ERP: facilities, processes, tanks, baths, jobs, operators.',
|
||||
'description': """
|
||||
@@ -102,6 +102,7 @@ Copyright (c) 2026 Nexa Systems Inc. All rights reserved.
|
||||
'web.assets_backend': [
|
||||
'fusion_plating/static/src/scss/fusion_plating.scss',
|
||||
'fusion_plating/static/src/scss/recipe_tree_editor.scss',
|
||||
'fusion_plating/static/src/scss/fp_chatter_dark.scss',
|
||||
'fusion_plating/static/src/xml/recipe_tree_editor.xml',
|
||||
'fusion_plating/static/src/js/recipe_tree_editor.js',
|
||||
],
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// =====================================================================
|
||||
// Fusion Plating — Chatter dark-mode patch
|
||||
//
|
||||
// In dark mode the floating message-action toolbar (reaction / reply /
|
||||
// star / link icons) renders white-on-white because Odoo sets the
|
||||
// hover icon color to `white` but doesn't give the toolbar itself a
|
||||
// dark background. Result: icons invisible, users can't see what
|
||||
// they're hovering.
|
||||
//
|
||||
// Branch at compile time (Odoo 19 compiles every SCSS file into the
|
||||
// `web.assets_backend` bundle with $o-webclient-color-scheme: bright,
|
||||
// AND into `web.assets_web_dark` with $o-webclient-color-scheme: dark).
|
||||
// Light bundle gets nothing (zero output); dark bundle gets the patch.
|
||||
// =====================================================================
|
||||
|
||||
$o-webclient-color-scheme: bright !default;
|
||||
|
||||
@if $o-webclient-color-scheme == dark {
|
||||
.o-mail-Message-actions {
|
||||
// Solid dark background so light/white icons stand out
|
||||
background-color: var(--o-component-bgcolor, #2b2f33) !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.10);
|
||||
border-radius: 6px;
|
||||
padding: 2px 4px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
|
||||
|
||||
// Make sure every icon (reaction, reply, star, link, more) has
|
||||
// enough contrast against the dark popup. Defaults sit at 35%
|
||||
// opacity which barely shows.
|
||||
button, .btn, .o-mail-ActionList-button {
|
||||
color: rgba(255, 255, 255, 0.78) !important;
|
||||
|
||||
> i, > .oi, > .fa {
|
||||
color: rgba(255, 255, 255, 0.82) !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
&:hover, &:focus, &:focus-visible, &.show {
|
||||
background-color: rgba(255, 255, 255, 0.10) !important;
|
||||
color: #fff !important;
|
||||
|
||||
> i, > .oi, > .fa {
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
fusion_plating/scripts/fp_dark_bundle_check.py
Normal file
31
fusion_plating/scripts/fp_dark_bundle_check.py
Normal file
@@ -0,0 +1,31 @@
|
||||
env = env # noqa
|
||||
# Force generation of both bundles
|
||||
for bundle_name in ('web.assets_backend', 'web.assets_web_dark'):
|
||||
bundle = env['ir.qweb']._get_asset_bundle(bundle_name)
|
||||
css = bundle.css() # this materializes the attachment
|
||||
print(f'{bundle_name}: triggered, css() type={type(css).__name__}')
|
||||
|
||||
env.cr.commit()
|
||||
|
||||
# Now find them
|
||||
attachs = env['ir.attachment'].sudo().search(
|
||||
[('url', 'like', '/web/assets/%')],
|
||||
order='id desc',
|
||||
)
|
||||
print(f'\\n{len(attachs)} asset attachments after force-compile:')
|
||||
for a in attachs:
|
||||
raw_size = len(a.raw or b'')
|
||||
print(f' [{a.id}] {a.name} ({raw_size} bytes)')
|
||||
|
||||
# Check the dark one for our marker
|
||||
dark = attachs.filtered(lambda a: 'web.assets_web_dark' in (a.name or ''))
|
||||
if dark:
|
||||
text = (dark[0].raw or b'').decode('utf-8', errors='ignore')
|
||||
print(f'\\ndark bundle markers:')
|
||||
print(f' o-mail-Message-actions: {text.count("o-mail-Message-actions")} occurrences')
|
||||
print(f' #2b2f33 marker : {text.count("#2b2f33")} occurrences')
|
||||
print(f' rgba(255, 255, 255, 0.10) marker: {text.count("rgba(255, 255, 255, 0.10)")} occurrences')
|
||||
if '#2b2f33' in text:
|
||||
idx = text.find('#2b2f33')
|
||||
print(f'\\ncontext around our color:')
|
||||
print(text[max(0, idx-300):idx+300])
|
||||
Reference in New Issue
Block a user