Skip to content

Commit

Permalink
Fix #382: Restore the correct switch button states
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanj committed Dec 12, 2024
1 parent f05c62b commit 03e4739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/devoxx/genie/ui/panel/SearchOptionsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
public class SearchOptionsPanel extends JPanel {
private final List<InputSwitch> switches = new ArrayList<>();
private static final int DEFAULT_HEIGHT = JBUI.scale(30);
private Project project;

public SearchOptionsPanel(Project project) {
super(new FlowLayout(FlowLayout.LEFT, JBUI.scale(10), 0));
Expand Down Expand Up @@ -53,10 +52,10 @@ public SearchOptionsPanel(Project project) {
// Initialize visibility based on state service
updateInitialVisibility(stateService);

// Load saved state for enabled switches
ragSwitch.setSelected(stateService.getRagEnabled());
gitDiffSwitch.setSelected(stateService.getGitDiffEnabled());
webSearchSwitch.setSelected(stateService.getEnableWebSearch());
// Load saved states for enabled switches
ragSwitch.setSelected(stateService.getRagActivated());
gitDiffSwitch.setSelected(stateService.getGitDiffActivated());
webSearchSwitch.setSelected(stateService.getWebSearchActivated());

// Ensure only one switch is initially active
enforceInitialSingleSelection();
Expand All @@ -67,6 +66,7 @@ public SearchOptionsPanel(Project project) {
deactivateOtherSwitches(ragSwitch);
}

// Change input field placeholder based on RAG state
project.getMessageBus()
.syncPublisher(AppTopics.RAG_ACTIVATED_CHANGED_TOPIC)
.onRAGStateChanged(selected);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<h2>V0.4.5</h2>
<UL>
<LI>Feat #379: Cache file icons to increase performance</LI>
<LI>Fix #382: Restore the correct switch buttons states for RAG, Search, GitDiff</LI>
</UL>
<h2>v0.4.4</h2>
<UL>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu Dec 12 16:17:56 CET 2024
version=0.4.4
#Thu Dec 12 18:13:55 CET 2024
version=0.4.5

0 comments on commit 03e4739

Please sign in to comment.