From 0027c680876ff3d7287d75fa37455c9b75b4faa8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 06:54:38 +0000 Subject: [PATCH 1/2] feat(ui): Add per-module configurable table background colors This commit introduces the ability for you to customize the background color of tables individually for each application module (Empleados, Tareas, Planillas, Asistencias, Configuracion). This enhances user experience by providing more granular control over the application's appearance, similar to the existing per-module accent colors. Key changes: - **UI Store (`ui/src/stores/useUi.js`):** - Removed the previous single `tableBackgroundColor` state. - Added new state properties for each module's table background: - `tableBgColorEmpleados` - `tableBgColorTareas` - `tableBgColorPlanillas` - `tableBgColorAsistencias` - `tableBgColorConfiguracion` - These are included in `appearanceSettingKeys` for local storage persistence and initialized to `#FFFFFF` (white) by default. - Added corresponding actions (e.g., `setTableBgColorEmpleados`) for each new property. - **Settings View (`ui/src/views/SettingsView.vue`):** - Removed the previous single global table background color input. - Added new color picker inputs for each module's table background color, integrated within the "Module Colors" section. - These inputs are bound to their respective store properties and actions. - **Global Styles & Application (`ui/src/App.vue` & component styles):** - The previous global `--table-bg-color` CSS variable was removed. - `App.vue` now dynamically creates and updates CSS variables for each module's table background color on the root element (e.g., `--table-bg-color-empleados`). - Table components within each module (e.g., `tablaAsistencias.vue`, `tablaEmpleados.vue`, etc.) have been updated to use their respective CSS variable for the `background-color` property, typically by applying it to a module-specific class on the table. - **Reverted Previous Implementation:** - The initial implementation for a single, global table background color was reverted before implementing this per-module approach. This feature allows for a more personalized and visually distinct experience across different sections of the application. --- ui/src/App.vue | 10 +++++ .../asistencias/tablaAsistencias.vue | 2 + .../components/empleados/tablaEmpleados.vue | 6 ++- .../components/planillas/tablaPlanillas.vue | 1 + ui/src/components/tareas/tablaTareas.vue | 1 + ui/src/stores/useUi.js | 34 +++++++++++++++ ui/src/views/SettingsView.vue | 42 +++++++++++++++++-- 7 files changed, 91 insertions(+), 5 deletions(-) diff --git a/ui/src/App.vue b/ui/src/App.vue index 29901c9..5b8edf1 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -21,6 +21,16 @@ watchEffect(() => { root.style.setProperty('--accent-color-tareas', ui.accentColorTareas) root.style.setProperty('--accent-color-planillas', ui.accentColorPlanillas) root.style.setProperty('--accent-color-asistencias', ui.accentColorAsistencias) + // Note: Configuracion accent color is missing here, should be added if used for CSS vars. + // root.style.setProperty('--accent-color-configuracion', ui.accentColorConfiguracion) + + + // Per-module table background colors + root.style.setProperty('--table-bg-color-empleados', ui.tableBgColorEmpleados) + root.style.setProperty('--table-bg-color-tareas', ui.tableBgColorTareas) + root.style.setProperty('--table-bg-color-planillas', ui.tableBgColorPlanillas) + root.style.setProperty('--table-bg-color-asistencias', ui.tableBgColorAsistencias) + root.style.setProperty('--table-bg-color-configuracion', ui.tableBgColorConfiguracion) if (ui.theme === 'dark') { root.classList.add('theme-dark') diff --git a/ui/src/components/asistencias/tablaAsistencias.vue b/ui/src/components/asistencias/tablaAsistencias.vue index 1cf0671..b2848fe 100644 --- a/ui/src/components/asistencias/tablaAsistencias.vue +++ b/ui/src/components/asistencias/tablaAsistencias.vue @@ -94,6 +94,8 @@ const deleteAsistenciaInternal = async (id) => { } .tabla-asistencias { + /* Apply module-specific background color */ + background-color: var(--table-bg-color-asistencias); width: 100%; border-collapse: collapse; margin-top: 1em; diff --git a/ui/src/components/empleados/tablaEmpleados.vue b/ui/src/components/empleados/tablaEmpleados.vue index 9abef7b..7e55739 100644 --- a/ui/src/components/empleados/tablaEmpleados.vue +++ b/ui/src/components/empleados/tablaEmpleados.vue @@ -1,6 +1,6 @@