Skip to content

Commit d05dd3d

Browse files
Miguel0888claude
andauthored
comic-controls abgleichen: gelbe Blase schneidet die letzte Zeile nicht mehr ab (#1754)
* Chat: Blase zeigt nach dem letzten Werkzeug „Überlegt …“, NDV-Suche zählt Funde, jedes Werkzeug im App-Log Bisher blieb der fertige Schritt (etwa „Sucht NDV-Objekte“) als laufend stehen, während schon das Modell arbeitete. Die NDV-Suche meldet je Seite, wie viele Objekte sie gefunden hat (ToolProgress, wie ChatRoom threadgebunden). Beginn und Dauer jedes Werkzeugs stehen im App-Log, nicht nur die des Browsers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SsbVHacUcSP8HJ3EJtCp6d * comic-controls abgleichen: gelbe Blase schneidet die letzte Zeile nicht mehr ab (EAC #266) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SsbVHacUcSP8HJ3EJtCp6d --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 392d762 commit d05dd3d

4 files changed

Lines changed: 78 additions & 8 deletions

File tree

‎comic-controls/UPSTREAM.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Unveränderte Kopie der Swing-/Java2D-Comic-Bibliothek `comic-controls` aus
66
ohne dessen Oberfläche oder Fachlogik zu kopieren.
77

88
Der genaue Upstream-Commit steht in der ersten Zeile von [`UPSTREAM.sha256`](UPSTREAM.sha256); derzeit
9-
`12d3a682819b7c93084c0c8bf827b2fe9b8db597` (Kopf-Knöpfe rechts vor dem Zeitstempel und QR-Knopf, EAC #240).
9+
`cc86c149837d22ee32a1e60eed4bf6784ee75e99` (EAC-main mit #266 Höhe der Aktivitätsblase, dazu der noch offene EAC #240 Kopf-Knöpfe und QR-Knopf).
1010

1111
## Inhalt und Lizenz
1212

‎comic-controls/UPSTREAM.sha256‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# upstream https://github.com/aresstack/enterprise-ai-client.git 12d3a682819b7c93084c0c8bf827b2fe9b8db597
1+
# upstream https://github.com/aresstack/enterprise-ai-client.git cc86c149837d22ee32a1e60eed4bf6784ee75e99
22
51b332c97f18977459a53e680970e822e6ea8cfbb12b5fd63ea88ad65eb9c2d4 LICENSE
33
765d09baf95be1883d2d4adf2dd0ae431c8570ef29bb0d39a67252d3c5ce66c1 src/main/java/com/aresstack/enterpriseai/ui/comic/border/ComicBorder.java
44
27f9434d0a518aa63b3f45f610ff949d996d240ee98001a792f68402161abbd2 src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/AgentActivityBubblePanel.java
5-
a9cb4eabfd58da0535ff82c2a022fb0ce85c265d8f61c4b6d7947bf77550694e src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/AnimatedThoughtBubblePanel.java
5+
c6eb54a41e4e02eef2997c705047d9120c670774fb2bd756d5e258f4ac585edc src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/AnimatedThoughtBubblePanel.java
66
b52cf5f32f4fe9cfc8208c91838299defab181250705a4ad3e2c942ac1b997e9 src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/AssistantThinkingBubblePanel.java
77
15154758fc96a97e88e15553d49ad11015598c06331f580db91d224bc7f973bc src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/BubbleMessageRow.java
88
4f7341aa10544b8944d59e11482abd0fbc74179d9732fcf92440b11794e23064 src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/BubblePalette.java
@@ -58,6 +58,7 @@ d573b2b058033c6dc1641ac27c544e0938511a7543fd9d7b181a19a65c2ed8cd src/main/java/
5858
2de3cdf852c7fe5d0a66e76c73a129477ef9062def343f9ad4a1fe70d1ec4c17 src/main/java/com/aresstack/enterpriseai/ui/comic/theme/ResearchUiPainter.java
5959
02b1033f3c38decd5d00e7166caf05431b98b075455db03a128e37747008a889 src/main/java/com/aresstack/enterpriseai/ui/comic/theme/ResearchUiPalette.java
6060
5ba23507f753928400aaecaad25fed70281a431e0fed7d6a4ee943511dbcca85 src/main/java/com/aresstack/enterpriseai/ui/comic/theme/ResearchUiTypography.java
61+
db27be82ba96c7b6d5f27284d8115e8757596239d00f627e7c66602ba839b6af src/test/java/com/aresstack/enterpriseai/ui/comic/bubble/ActivityBubbleHeightTest.java
6162
ba25fd4d61ad5267dd2acc3273206d051700ff84c2cd0266a40256d55bac18a3 src/test/java/com/aresstack/enterpriseai/ui/comic/bubble/BubbleLayoutTest.java
6263
8aae96c1c0d075df3f5f72738719b7366b53e0022fecc07bb95a5f564da93480 src/test/java/com/aresstack/enterpriseai/ui/comic/bubble/HeaderTrailingAccessoryTest.java
6364
c55dd72092c2bf0cfce4e982c94ba01d11a56ed5c961faf884042a17324cdc56 src/test/java/com/aresstack/enterpriseai/ui/comic/bubble/InlineActionsTest.java

‎comic-controls/src/main/java/com/aresstack/enterpriseai/ui/comic/bubble/AnimatedThoughtBubblePanel.java‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public interface SummaryFloatHandler {
6363
private static final int CONNECTOR_SPACE = 58;
6464
private static final int ARC = 24;
6565
private static final int CONTENT_PADDING = 17;
66+
/** Vertical gap of the BorderLayout between title, text and the south stack. */
67+
private static final int ROW_GAP = 5;
6668
private static final int MINIMUM_HEIGHT = 104;
6769
private static final int DEFAULT_MAXIMUM_WIDTH = 600;
6870
private static final int TIMER_DELAY_MILLIS = 33;
@@ -313,13 +315,13 @@ public Dimension getPreferredSize() {
313315
explanationArea.setSize(new Dimension(measureWidth, Short.MAX_VALUE));
314316
Dimension explanationSize = explanationArea.getPreferredSize();
315317
Dimension titleSize = headerRow.getPreferredSize();
316-
int south = southStack.isVisible() && southStack.getComponentCount() > 0
317-
? southStack.getPreferredSize().height : 0;
318+
// Exactly as BorderLayout lays out: a VISIBLE south stack costs its gap even while its bar is hidden
319+
// (height 0). Leaving that gap out once clipped the last text line by those pixels.
320+
int south = southStack.isVisible() ? southStack.getPreferredSize().height + ROW_GAP : 0;
318321
int width = Math.max(reportedContentWidth, titleSize.width)
319322
+ (CONTENT_PADDING * 2)
320323
+ CONNECTOR_SPACE;
321-
int height = CONTENT_PADDING * 2 + titleSize.height + 5 + explanationSize.height
322-
+ (south > 0 ? south + 5 : 0);
324+
int height = CONTENT_PADDING * 2 + titleSize.height + ROW_GAP + explanationSize.height + south;
323325
return new Dimension(Math.min(maximumBubbleWidth, width), Math.max(MINIMUM_HEIGHT, height));
324326
}
325327

@@ -343,7 +345,7 @@ protected void paintComponent(Graphics graphics) {
343345

344346
private void buildUi() {
345347
setOpaque(false);
346-
setLayout(new BorderLayout(0, 5));
348+
setLayout(new BorderLayout(0, ROW_GAP));
347349
setBorder(createContentBorder());
348350
headerRow.setOpaque(false);
349351
// WEST/EAST instead of a box with glue: the stamp is right-aligned however wide the
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package com.aresstack.enterpriseai.ui.comic.bubble;
2+
3+
import org.junit.Test;
4+
5+
import javax.swing.BoxLayout;
6+
import javax.swing.JPanel;
7+
import javax.swing.JTextArea;
8+
import javax.swing.SwingUtilities;
9+
import java.awt.Component;
10+
import java.awt.Container;
11+
12+
import static org.junit.Assert.assertTrue;
13+
14+
/** Die gelbe Aktivitätsblase wächst mit ihren Zeilen: die letzte Zeile wird nie abgeschnitten. */
15+
public class ActivityBubbleHeightTest {
16+
17+
@Test
18+
public void everyLineOfTheActivityFitsWithAndWithoutProgressBar() throws Exception {
19+
SwingUtilities.invokeAndWait(new Runnable() {
20+
public void run() {
21+
AgentActivityBubblePanel bubble = new AgentActivityBubblePanel(BubbleSide.LEFT,
22+
BubblePalette.windowsPhoneInspired(), "Antwort wird vorbereitet", "Überlegt …");
23+
bubble.setHeaderTimestamp(0L);
24+
bubble.setMaximumBubbleWidth(640);
25+
JPanel transcript = new JPanel();
26+
transcript.setLayout(new BoxLayout(transcript, BoxLayout.Y_AXIS));
27+
BubbleMessageRow row = new BubbleMessageRow(bubble, BubbleSide.LEFT);
28+
transcript.add(row);
29+
transcript.setSize(800, 2000);
30+
StringBuilder body = new StringBuilder("Erster Schritt");
31+
try {
32+
for (int line = 2; line <= 8; line++) {
33+
body.append("\nSchritt ").append(line);
34+
for (String marker : new String[]{"", " [[bar:1/3]]"}) {
35+
bubble.updateActivity("Antwort wird vorbereitet", body + marker);
36+
layOut(transcript);
37+
JTextArea text = textOf(bubble);
38+
assertTrue(line + " Zeilen" + marker + ": Text " + text.getHeight() + " px, braucht "
39+
+ text.getPreferredSize().height + " px",
40+
text.getHeight() >= text.getPreferredSize().height);
41+
}
42+
}
43+
} finally {
44+
bubble.stopAnimation();
45+
}
46+
}
47+
});
48+
}
49+
50+
private static JTextArea textOf(Container bubble) {
51+
for (Component child : bubble.getComponents()) {
52+
if (child instanceof JTextArea) {
53+
return (JTextArea) child;
54+
}
55+
}
56+
throw new AssertionError("kein Text in der Blase");
57+
}
58+
59+
private static void layOut(Component component) {
60+
component.doLayout();
61+
if (component instanceof Container) {
62+
for (Component child : ((Container) component).getComponents()) {
63+
layOut(child);
64+
}
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)