Open
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #14847
Type of change
What does this PR do?
Custom themes in the XDG config directory (~/.config/opencode/themes/) now reload automatically when edited. Previously you had to restart the TUI or send a SIGUSR2 signal to pick up changes.
I added a @parcel/watcher subscription inside the ThemeProvider that watches the themes directory. When a .json file is created, modified, or deleted, it re-reads the custom themes and syncs them to the store. There's a 300ms debounce to handle atomic writes. editors like Vim and VS Code write to a temp file then rename, which fires multiple watcher events.
Only the XDG config directory is watched, since that's where users iterate on personal themes. Project-level .opencode/themes/ directories are typically set once and rarely changed. Could add a setting to disable it but I don't see much reason.
How did you verify your code works?
Wrote 5 unit tests covering: new theme file added, existing theme modified, theme file deleted, missing directory handling, non-JSON file ignored. I of course manually tested in the TUI. I edited a theme JSON file and confirmed the changes appeared within approx 300ms consistently. It passes all type checking, too.
Screenshots / recordings
N/A — no visual changes, just background file watching behavior.
Checklist