Web UI: theme preference is persisted but never restored; session-trial theme leaks into localStorage
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 1
- フォーク
- 1
- 平均マージ
- 4時間 46分
- マージ済み PR(30日)
- 55
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
falbany/ProFiles のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
falbany/ProFiles#187 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
falbany/ProFiles の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ip-tools/patzilla#219 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
EPSSClient commits to its SQLite cache once per score: a 100-CVE bulk fetch makes 101 disk flushesオープンpriority:p3 technical-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jimmy058910/jmo-security-repo#1673 ·
メンテナーはふだん 1 日以内に返信
-
enhancement ready
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
integration: frontier_silicon
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
home-assistant/core#193176 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
task create and task update take --body-file and --stdin対応中かも @JuanBarriosS が今日担当しました。 オープンcli enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
pyrite-wiki/pyrite#1687 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信