Feature request: Productivity dashboard System / Light / Dark theme selector

Abierto
#1,218 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
78/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
css, html, javascript
Área
frontend

Línea de trabajo

Start with productivity/skills/dashboard.html and review the referenced implementation and dashboard-only diff. Check the theme initialization, CSS variables, selector markup, and affected dashboard views, then run the available automated regression and browser checks. Done means System, Light, and Dark work with persistence and blocked storage without changing task or memory files.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Feature request

Please add a System / Light / Dark theme selector to the Productivity dashboard (productivity/skills/dashboard.html).

The current dashboard uses a fixed light palette. A dark option would make it more comfortable to use in low-light environments and consistent with a device's appearance preference.

Proposed behaviour
  • System is the default and follows prefers-color-scheme, including changes while the dashboard is open.
  • Light and Dark provide explicit overrides.
  • Remember the selection in browser storage when available; switching should still work when storage is blocked.
  • Apply the selected theme before styles load to avoid a flash of the wrong theme.
  • Keep task cards, list view, memory views, dialogs and native form controls consistent, with a labelled, keyboard-accessible selector.
  • Theme changes should not modify task or memory files.

Sample implementation and diff

I have implemented a working example in a fork:

The dashboard-only sample diff is included below. This is a feature request with a reference implementation, rather than a pull request.

Validation

  • 10 automated regression tests passed.
  • Browser checks passed for live system changes, both manual overrides, persistence after reload, keyboard selection, and blocked storage.
  • Board, List, Memory and dialog views were exercised with synthetic data.
  • Header controls remained reachable at 1280px, 768px and 390px widths.
  • Task content remained unchanged when switching themes.
  • Both palettes were visually reviewed.
Dashboard-only sample diff
diff --git a/productivity/skills/dashboard.html b/productivity/skills/dashboard.html
index e2ca8a7..f570d7c 100644
--- a/productivity/skills/dashboard.html
+++ b/productivity/skills/dashboard.html
@@ -4,6 +4,44 @@
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Productivity</title>
+  <script id="theme-init">
+    // Apply the saved choice before styles load to avoid a flash of the wrong theme.
+    (() => {
+      const storageKey = 'productivity-theme';
+      const systemTheme = window.matchMedia('(prefers-color-scheme: dark)');
+      let preference = 'system';
+
+      try {
+        const saved = localStorage.getItem(storageKey);
+        if (['light', 'dark', 'system'].includes(saved)) preference = saved;
+      } catch {
+        // Local files and privacy settings can make browser storage unavailable.
+      }
+
+      function applyTheme() {
+        document.documentElement.dataset.theme = preference === 'system'
+          ? (systemTheme.matches ? 'dark' : 'light')
+          : preference;
+      }
+
+      applyTheme();
+      systemTheme.addEventListener('change', applyTheme);
+
+      document.addEventListener('DOMContentLoaded', () => {
+        const selector = document.getElementById('themeSelect');
+        selector.value = preference;
+        selector.addEventListener('change', () => {
+          preference = selector.value;
+          applyTheme();
+          try {
+            localStorage.setItem(storageKey, preference);
+          } catch {
+            // The selection still works for this page when it cannot be saved.
+          }
+        });
+      });
+    })();
+  </script>
   <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='4' y='2' width='24' height='28' rx='4' fill='%23faf9f5' stroke='%23D97757' stroke-width='2'/%3E%3Crect x='8' y='0' width='16' height='5' rx='2.5' fill='%23D97757'/%3E%3Cpath d='M9 13l3 3 5-5' fill='none' stroke='%23D97757' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='20' y='12' width='5' height='2' rx='1' fill='%23c4c4c2'/%3E%3Crect x='9' y='20' width='10' height='2' rx='1' fill='%23c4c4c2'/%3E%3Crect x='9' y='25' width='7' height='2' rx='1' fill='%23c4c4c2'/%3E%3C/svg%3E">
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -12,6 +50,7 @@
     * { box-sizing: border-box; margin: 0; padding: 0; }
 
     :root {
+      color-scheme: light;
       --bg-primary: #faf9f5;
       --bg-secondary: #F5F4EF;
       --bg-card: #ffffff;
@@ -20,12 +59,31 @@
       --text-muted: #8c8c8a;
       --accent: #D97757;
       --accent-hover: #c4684a;
+      --text-on-accent: #241610;
+      --accent-soft: rgba(217, 119, 87, 0.05);
       --border: #e5e4df;
       --border-light: #eeeee9;
       --shadow: rgba(20, 20, 19, 0.04);
       --shadow-hover: rgba(20, 20, 19, 0.08);
     }
 
+    :root[data-theme="dark"] {
+      color-scheme: dark;
+      --bg-primary: #181918;
+      --bg-secondary: #21221f;
+      --bg-card: #272925;
+      --text-primary: #f0f0e9;
+      --text-secondary: #c3c5bb;
+      --text-muted: #a0a397;
+      --accent: #e89a7d;
+      --accent-hover: #f3ad92;
+      --border: #4b4e46;
+      --border-light: #363932;
+      --accent-soft: rgba(232, 154, 125, 0.12);
+      --shadow: rgba(0, 0, 0, 0.2);
+      --shadow-hover: rgba(0, 0, 0, 0.35);
+    }
+
     body {
       font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
       background: var(--bg-primary);
@@ -40,6 +98,8 @@
 
     header {
       display: flex;
+      flex-wrap: wrap;
+      gap: 12px;
       justify-content: space-between;
       align-items: center;
       margin-bottom: 16px;
@@ -58,6 +118,7 @@
 
     .header-left {
       display: flex;
+      flex-wrap: wrap;
       align-items: flex-start;
       gap: 0;
     }
@@ -91,7 +152,30 @@
       box-shadow: 0 1px 3px var(--shadow);
     }
 
-    .buttons { display: flex; gap: 12px; }
+    .buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
+
+    .theme-control {
+      display: inline-flex;
+      align-items: center;
+      gap: 8px;
+      color: var(--text-secondary);
+      font-size: 13px;
+    }
+
+    .theme-control select {
+      background: var(--bg-card);
+      color: var(--text-primary);
+      border: 1px solid var(--border);
+      border-radius: 8px;
+      padding: 10px 12px;
+      font: inherit;
+      cursor: pointer;
+    }
+
+    .theme-control select:focus-visible {
+      outline: 2px solid var(--accent);
+      outline-offset: 2px;
+    }
 
     button {
       background: var(--bg-card);
@@ -113,7 +197,7 @@
 
     button.primary {
       background: var(--accent);
-      color: white;
+      color: var(--text-on-accent);
       border-color: var(--accent);
     }
 
@@ -196,7 +280,7 @@
     }
 
     .cards.drag-over {
-      background: rgba(217, 119, 87, 0.05);
+      background: var(--accent-soft);
       border-radius: 8px;
     }
 
@@ -315,7 +399,7 @@
       content: '';
       width: 5px;
       height: 9px;
-      border: solid white;
+      border: solid var(--text-on-accent);
       border-width: 0 2px 2px 0;
       transform: rotate(45deg);
       margin-bottom: 2px;
@@ -332,7 +416,7 @@
       padding: 14px 28px;
       background: var(--accent);
       border: none;
-      color: white;
+      color: var(--text-on-accent);
     }
 
     .empty-state button:hover {
@@ -433,7 +517,7 @@
     }
 
     .list-section.drag-over {
-      background: rgba(217, 119, 87, 0.05);
+      background: var(--accent-soft);
       border-radius: 8px;
       margin: 0 -12px 32px;
       padding: 0 12px;
@@ -1214,6 +1298,14 @@
       </div>
     </div>
     <div class="buttons">
+      <label class="theme-control" for="themeSelect">
+        Theme
+        <select id="themeSelect">
+          <option value="system">System</option>
+          <option value="light">Light</option>
+          <option value="dark">Dark</option>
+        </select>
+      </label>
       <button id="openTaskBtn">Select File</button>
       <button id="openMemoryBtn" style="display: none;">Open Folder</button>
       <button id="saveBtn" class="primary" disabled style="display: none;">Save</button>
Lenguaje dominante
Python
Estrellas
36.8k
Forks
4.1k
Merge medio
1 d 23 h
PR fusionados (30 d)
17

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anthropics/knowledge-work-plugins

Todos los issues de anthropics/knowledge-work-plugins

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.