-
Notifications
You must be signed in to change notification settings - Fork 10k
feat: move diff_style from config to kv.json and add toggle menu items in command_list #10713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: move diff_style from config to kv.json and add toggle menu items in command_list #10713
Conversation
- Remove diff_style from TUI config schema - Update diff rendering to read from kv.json instead of config - Change 'stacked' value to 'unified' for consistency - Add System menu item to toggle between auto and unified diff styles - Menu items immediately update diffs when toggled
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
I think moving it to KV makes more sense, since we already have similar commands in the TUI, it also helps with improving the visibility of the feature, much easier for users to find this setting in command palette rather than the config file. And as this is a visual feature that can be easily toggled, I don't think anyone is going to complaint about it not being in the config anymore. |
- Kept both diff_style toggle (from feat branch) and diff_wrap_mode toggle (from dev) - Both features now coexist in the commands menu
|
Can we just keep it in config and use kv, I'd prefer not to break configs if we can help it |
|
@rekram1-node I'm slightly confused - why would it need to be both in config and KV at the same time? The change would not break any existing configs since the Happy to take it down whichever route you'd prefer, just need a little clarification on what it would mean to both have the config property and to use KV at the same time, it seems to me that this'd be a one or the other situation, but perhaps I am overlooking something. |
|
if someone has a field in their config, and next time they start the app, it isn't respecting that field, and there is no clear indication as to why, then that appears as a bug to them |
|
@rekram1-node Fair enough. I'm still uncertain as to what was meant by "keep it in config and use kv," - what does the "and" here imply? I'm not clear on what using both would look like. Would the config's state be the initial state at startup, but it could then be toggled temporarily using the value in KV, something like that? Just trying to be sure of the correct interpretation of what you'd said. |
|
yeah I think it's fair enough to consider if someone already have it added in their config, due to sheer number of users OC have this can mean alot of users. Here are my suggestions:
|
|
@IdrisGit Both of those sound like they could be fair options to me. But of course, @rekram1-node is the boss here and I'm happy to take it down whichever path he'd prefer. |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
…encode into feat/kv-diff-style-clean
…encode into feat/kv-diff-style-clean
What does this PR do?
This improves the UX by allowing the diff style to be toggled dynamically while OpenCode is running and improves consistency relative to other similar options already in Opencode. Since the TUI group in the configuration file is not validated strictly, this will not be a breaking change for any existing configurations.
When diff_style is unified, option to switch to automatic diff_style is offered:
When diff_style is auto, option to switch to unified diff_style is offered:
Resolves #10711
How did you verify your code works?
Manual testing,
bun typecheck,bun test.