Polish web UI and SEO metadata#49
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90bf682fa4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (storedTheme()) return; | ||
| const media = window.matchMedia('(prefers-color-scheme: light)'); | ||
| const onChange = () => setTheme(media.matches ? 'light' : 'dark'); | ||
| media.addEventListener('change', onChange); |
There was a problem hiding this comment.
Respect manual theme override on system-theme changes
After mounting with no saved preference, this effect always keeps a matchMedia listener active; when the user later toggles the theme (which writes tokenometer.theme), any OS light/dark change will still call setTheme(...) and override the explicit in-app choice for the rest of that session. This makes the manual toggle non-deterministic whenever system theme changes (for example, scheduled day/night switches).
Useful? React with 👍 / 👎.
| </footer> | ||
| const storedTheme = (): Theme | null => { | ||
| if (typeof window === 'undefined') return null; | ||
| const value = window.localStorage.getItem(THEME_STORAGE_KEY); |
There was a problem hiding this comment.
Guard theme persistence when localStorage is unavailable
This direct localStorage read/write path is not protected against SecurityError/storage-blocked environments (for example privacy-hardened browsers, embedded contexts, or users blocking site data). In those cases, getItem/setItem can throw and break initial render or theme toggling, which regresses availability compared with the pre-theme-toggle version.
Useful? React with 👍 / 👎.
| const INSTALL_LINE = 'claude install skill faraa2m/tokenometer'; | ||
| const CLAUDE_INSTALL = [ | ||
| 'mkdir -p ~/.claude/skills/tokenometer', | ||
| 'cp packages/claude-code-skill/SKILL.md ~/.claude/skills/tokenometer/', |
There was a problem hiding this comment.
Make Claude install snippet runnable from a clean shell
This command assumes the user is already in a checkout containing packages/claude-code-skill, but the page does not include that prerequisite; for users following the web docs directly, cp packages/claude-code-skill/SKILL.md ... fails with “No such file or directory.” The install block should be self-contained (or include an explicit clone/download step) so the documented path works from a typical environment.
Useful? React with 👍 / 👎.
Summary
Changeset
Not included: changes are limited to the private @tokenometer/web app and static site metadata, so no public npm package publish is required.
Verification