refactor(tui): extract shared setting edit overlay#1776
Merged
TaylorMutch merged 1 commit intoJun 5, 2026
Conversation
The draw_edit_overlay function in sandbox_settings and global_settings was nearly identical — the only difference was which settings slice the entry was resolved from (app.sandbox_settings vs app.global_settings). Extract the common rendering logic into draw_setting_edit_overlay in ui/mod.rs, taking key/kind/edit/area/theme as parameters. Each pane now resolves its own entry and delegates to the single implementation. Net: -75 lines, +61 lines across the three files.
Contributor
|
agent review:
I also tested it manually and both affected code paths still look fine in the TUI. lgtm. |
Collaborator
|
/ok to test baf8eb4 |
TaylorMutch
approved these changes
Jun 5, 2026
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
The `draw_edit_overlay` function in `sandbox_settings.rs` and `global_settings.rs` was nearly identical — the only difference was which settings slice the entry was resolved from (`app.sandbox_settings` vs `app.global_settings`).
Extract the common rendering logic into a single `draw_setting_edit_overlay` function in `ui/mod.rs`, parameterized by `key`, `kind`, `edit`, `area`, and `theme`. Each pane now resolves its own entry and delegates to the shared implementation.
Related Issue
N/A — identified via codebase duplication audit.
Changes
Net diff: -75 lines, +61 lines across the three files.
Testing
Checklist