Web UI: theme preference is persisted but never restored; session-trial theme leaks into localStorage
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 4 giờ 46 phút
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của falbany/ProFiles
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
falbany/ProFiles#187 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Web UI: config handoff from a second launch leaves the open YAML editor showing stale contentĐang mởbug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của falbany/ProFiles
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ip-tools/patzilla#219 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesĐang mởpriority:p3 technical-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jimmy058910/jmo-security-repo#1673 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
integration: frontier_silicon
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
home-assistant/core#193176 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
task create and task update take --body-file and --stdinCó thể đã có người làm @JuanBarriosS đã nhận hôm nay. Đang mởcli enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
pyrite-wiki/pyrite#1687 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày