Merged
Conversation
Comment on lines
+274
to
+278
| existing.line_numbers = preferences.showLineNumbers; | ||
| existing.wrap_lines = preferences.wrapLines; | ||
| existing.hunk_headers = preferences.showHunkHeaders; | ||
| existing.agent_notes = preferences.showAgentNotes; | ||
|
|
There was a problem hiding this comment.
Bug: The system-detected theme is incorrectly persisted on first launch, which prevents the application from automatically following system theme changes on subsequent runs.
Severity: HIGH
Suggested Fix
Modify the persistence logic to only save the theme to the configuration file if the user has explicitly selected one. This can be achieved by tracking whether the theme was user-selected or inferred from the system default, and only persisting it in the former case. This will allow the application to re-detect the system theme on each launch if no explicit theme is set.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/core/config.ts#L274-L278
Potential issue: On the first run, the application detects the user's system theme
(e.g., 'dark' mode resolves to the 'midnight' theme) and immediately persists this theme
to the configuration file. The persistence logic in `src/core/config.ts` always saves
the `preferences.theme` value because the `resolveTheme` function ensures it is never
undefined. As a result, on all subsequent launches, the application uses this saved
theme instead of re-evaluating the current system theme. This prevents the application
from automatically adapting to system theme changes after its initial execution, locking
it into the theme from the first run.
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.
Summary
Details
$XDG_CONFIG_HOME/hunk/config.tomland~/.config/hunk/config.toml.hunk/config.toml.hunk/config.tomlin repos, or global config outside repos[pager],[git],[diff],[patch],[difftool]Validation
bun run typecheckbun testbun run test:tty-smoke