Skip to content

Commit 9acfc97

Browse files
committed
Release v1.0.16: UI/UX stability overhaul, theme persistence, and high-visibility dividers.
1 parent d4c5cb2 commit 9acfc97

4 files changed

Lines changed: 49 additions & 10 deletions

File tree

src/main/java/uno/anahata/ai/swing/ChatPanel.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import uno.anahata.ai.swing.render.editorkit.EditorKitProvider;
66
import uno.anahata.ai.swing.render.editorkit.DefaultEditorKitProvider;
77
import java.awt.BorderLayout;
8+
import java.awt.Color;
89
import java.awt.Component;
10+
import java.awt.Dimension;
911
import java.awt.FlowLayout;
1012
import java.awt.datatransfer.DataFlavor;
1113
import java.awt.dnd.DnDConstants;
@@ -228,6 +230,10 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
228230
JPanel mainSouthPanel = new JPanel(new BorderLayout());
229231
mainSouthPanel.add(inputPanel, BorderLayout.CENTER);
230232
mainSouthPanel.add(statusPanel, BorderLayout.SOUTH);
233+
// Ensure the south panel has a minimum height so the split pane divider is always visible and usable
234+
mainSouthPanel.setMinimumSize(new Dimension(0, 150));
235+
// Add a top border to create a visible seam with the divider
236+
mainSouthPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY));
231237

232238
// --- CENTER Panel (Tabs) ---
233239
chatPanel = new ConversationPanel(this);
@@ -248,6 +254,8 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
248254
tabbedPane.addTab("Tools", functionsPanel);
249255
tabbedPane.addTab("Gemini API Keys", geminiKeysPanel);
250256
tabbedPane.addTab("Support", supportPanel);
257+
// Add a bottom border to create a visible seam with the divider
258+
tabbedPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY));
251259

252260
tabbedPane.addChangeListener(e -> {
253261
Component selected = tabbedPane.getSelectedComponent();
@@ -264,8 +272,11 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
264272
mainSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tabbedPane, mainSouthPanel);
265273
mainSplitPane.setResizeWeight(0.8); // Give more space to the chat history initially
266274
mainSplitPane.setOneTouchExpandable(true);
267-
mainSplitPane.setDividerSize(10); // Make it easier to grab
268-
mainSplitPane.putClientProperty("JSplitPane.dividerStyle", "grip"); // Force the grip style for visibility
275+
mainSplitPane.setContinuousLayout(true);
276+
mainSplitPane.setDividerSize(8); // Sane size
277+
278+
// Force FlatLaf grip style
279+
mainSplitPane.putClientProperty("FlatLaf.style", "dividerStyle: grip");
269280

270281
add(mainSplitPane, BorderLayout.CENTER);
271282

src/main/java/uno/anahata/ai/swing/InputPanel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ private void initComponents() {
7070
inputTextArea = new JXTextArea("Type your message here (Ctrl+Enter to send)");
7171
inputTextArea.setLineWrap(true);
7272
inputTextArea.setWrapStyleWord(true);
73+
inputTextArea.setRows(5); // Ensure it has some initial height and handles resizing well
7374

7475
// Undo/Redo Support
7576
inputTextArea.getDocument().addUndoableEditListener(e -> undoManager.addEdit(e.getEdit()));

src/main/java/uno/anahata/ai/swing/SwingFunctionPrompter.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.genai.types.FunctionCall;
55
import com.google.genai.types.Part;
66
import java.awt.BorderLayout;
7+
import java.awt.Color;
78
import java.awt.FlowLayout;
89
import java.awt.Window;
910
import java.awt.event.ActionEvent;
@@ -17,11 +18,13 @@
1718
import java.util.List;
1819
import java.util.Map;
1920
import javax.swing.AbstractAction;
21+
import javax.swing.BorderFactory;
2022
import javax.swing.JButton;
2123
import javax.swing.JComponent;
2224
import javax.swing.JDialog;
2325
import javax.swing.JPanel;
2426
import javax.swing.JScrollPane;
27+
import javax.swing.JSplitPane;
2528
import javax.swing.JTextArea;
2629
import javax.swing.KeyStroke;
2730
import javax.swing.SwingUtilities;
@@ -120,10 +123,17 @@ private void initComponents(ChatMessage modelMessage) {
120123
contentWrapper.add(renderedContent, BorderLayout.CENTER);
121124

122125
JScrollPane scrollPane = new JScrollPane(contentWrapper);
123-
add(scrollPane, BorderLayout.CENTER);
126+
// Add a bottom border to create a visible seam with the divider
127+
scrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY));
128+
129+
// Targeted fix for the scroll position:
130+
// We do it in invokeLater to ensure it happens AFTER the focus manager
131+
// has done its initial pass when the dialog becomes visible.
132+
SwingUtilities.invokeLater(() -> {
133+
scrollPane.getVerticalScrollBar().setValue(0);
134+
});
124135

125-
JPanel bottomPanel = new JPanel(new BorderLayout(0, 5));
126-
JTextArea commentTextArea = new JTextArea(3, 60);
136+
JTextArea commentTextArea = new JTextArea(5, 60);
127137

128138
// Undo/Redo Support for the comment area
129139
UndoManager undoManager = new UndoManager();
@@ -146,7 +156,21 @@ public void actionPerformed(ActionEvent e) {
146156
JPanel commentPanel = new JPanel(new BorderLayout());
147157
commentPanel.setBorder(new TitledBorder("Add Comment (Optional)"));
148158
commentPanel.add(new JScrollPane(commentTextArea), BorderLayout.CENTER);
149-
bottomPanel.add(commentPanel, BorderLayout.CENTER);
159+
// Add a top border to create a visible seam with the divider
160+
commentPanel.setBorder(BorderFactory.createCompoundBorder(
161+
BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY),
162+
commentPanel.getBorder()
163+
));
164+
165+
// Use a JSplitPane to make the comment area resizable relative to the tool output
166+
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, commentPanel);
167+
splitPane.setResizeWeight(0.8);
168+
splitPane.setOneTouchExpandable(true);
169+
splitPane.setContinuousLayout(true);
170+
splitPane.setDividerSize(10);
171+
splitPane.putClientProperty("FlatLaf.style", "dividerStyle: grip");
172+
173+
add(splitPane, BorderLayout.CENTER);
150174

151175
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
152176
JButton approveButton = new JButton("Confirm");
@@ -180,8 +204,7 @@ public void windowClosing(WindowEvent e) {
180204

181205
buttonPanel.add(cancelButton);
182206
buttonPanel.add(approveButton);
183-
bottomPanel.add(buttonPanel, BorderLayout.SOUTH);
184-
add(bottomPanel, BorderLayout.SOUTH);
207+
add(buttonPanel, BorderLayout.SOUTH);
185208
}
186209

187210
private Map<FunctionCall, FunctionConfirmation> collectResultsFromInteractiveRenderers(ChatConfig config) {

tasks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
This document is the single source of truth for all actionable work items, technical debt, and future enhancements for the `gemini-java-client` project.
44

5-
## Phase 1: Release 1.0.14 (Theme & UI Overhaul)
5+
## Phase 1: Release 1.0.17 (UI/UX Stability & Theme Overhaul)
66
- [x] **Theme-Independent UI Engine**: Implemented `UITheme` with Auto, Light, Dark, and Minimalist modes.
77
- [x] **Vector Icon System**: Replaced PNG icons with programmatically drawn, theme-aware `ThemedIcon`s for perfect scaling and contrast.
88
- [x] **Enhanced Rendering**: Overhauled all `PartRenderer` implementations to respect theme colors and improve readability in "Metal" and other classic LAFs.
99
- [x] **Context Heatmap Refinement**: Role-based color coding for both the table and the pie chart, with descriptive "gist" labels.
1010
- [x] **Refactor ChatPanel**: Simplified constructor and integration points.
11+
- [x] **UI/UX Stability Fixes**:
12+
- [x] **Modal Hang Fix**: Corrected `SwingFunctionPrompter` parenting to prevent IDE lockups.
13+
- [x] **Input Area Overhaul**: Added `UndoManager` (Ctrl+Z/Y) and improved resizability within the split pane.
14+
- [x] **Split Pane Visibility**: Forced "grip" styling and added "Border Seams" for high-visibility dividers across all Look & Feels.
1115
- [x] **Documentation**: Updated README with deep IDE integration examples and correct screenshot placement.
1216

13-
## Phase 2: Known bugs (Deferred to after 1.0.14 release)
17+
## Phase 2: Known bugs (Deferred to after 1.0.17 release)
1418
- [ ] **Fix Async Job Delivery:** Implement a queueing mechanism in `Chat` to ensure that asynchronous job results are reliably delivered and not dropped when a tool loop is already in progress.
1519
- [X] **Cancellation Framework:** Implement a robust cancellation mechanism (`ExecutorService`/`Future`) for API calls, tool loops, and individual tool executions.

0 commit comments

Comments
 (0)