Web UI: theme preference is persisted but never restored; session-trial theme leaks into localStorage
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Start in web/src/App.tsx at the theme state initializer, initializeFromConfig, handleConfigLoaded, and the persistence effect; also read utils/theme.ts for how auto is resolved. Check the existing theme-related tests or add coverage for restoring a saved preference and preventing a session-trial theme from being saved. Done when the saved theme is restored, config themes still override it, and trial themes do not leak into localStorage.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
localStorage.setItem("profiles-theme", …) is written in two places (App.tsx:564, App.tsx:1450), but a full grep of web/src, index.html and the desktop shell finds zero getItem("profiles-theme") reads; initial state is hardcoded useState<"dark" | "light">("dark") (line 66). The persistence is dead — theme resets to dark every session.
Additionally, handleConfigLoaded's comment (App.tsx:377-380) promises a dropped/session-trial config's theme "must NOT persist… that would leak the trial into the next session" — but setTheme(...) from the trial fires the persistence effect (App.tsx:1447-1454), which writes the trial theme to localStorage anyway. Today that's harmless only because nothing reads it; the moment someone implements the read side, the leak activates.
Suggested fix
- Initialize theme from
localStorage.getItem("profiles-theme")in theuseStateinitializer. - Track theme provenance in a ref; skip the write when the theme came from a session-trial config.
- Keep config-file theme as the override in
initializeFromConfig. - While in there: consider honoring
theme: autoviamatchMedia("(prefers-color-scheme: light)")—resolveSessionTheme(utils/theme.ts:6-8) currently flattens auto to dark.
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 4 h 46 min
- PR fusionados (30 d)
- 55
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de falbany/ProFiles
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
falbany/ProFiles#187 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Web UI: config handoff from a second launch leaves the open YAML editor showing stale contentAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de falbany/ProFiles
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ip-tools/patzilla#219 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesAbiertopriority:p3 technical-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
jimmy058910/jmo-security-repo#1673 ·
Los mantenedores suelen responder en 1 día
-
enhancement ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
integration: frontier_silicon
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
home-assistant/core#193176 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
task create and task update take --body-file and --stdinPosiblemente ocupada @JuanBarriosS la tomó hoy. Abiertocli enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
pyrite-wiki/pyrite#1687 · 1 comentario ·
Los mantenedores suelen responder en 1 día