agentgui 1.0.23 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ # Conversation Display Fix - Root Cause and Solution
2
+
3
+ ## Problem
4
+ Conversations were not visible in the AgentGUI on the remote server, even though:
5
+ - ✅ API was returning 83 conversations correctly
6
+ - ✅ Database had conversations stored
7
+ - ✅ App.js initialization logic was sound
8
+
9
+ ## Root Cause
10
+ **The sidebar was hidden on narrow/mobile screens due to CSS responsive design.**
11
+
12
+ ### CSS Behavior
13
+ The responsive CSS (at `styles.css` line 1181) applies at screens < 768px:
14
+ ```css
15
+ @media (max-width: 768px) {
16
+ .sidebar {
17
+ transform: translateX(-100%); /* Hidden by default */
18
+ position: absolute;
19
+ }
20
+ .sidebar.open {
21
+ transform: translateX(0); /* Only visible with .open class */
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### What Was Happening
27
+ 1. Page loads on narrow screen (or browser window narrower than 768px)
28
+ 2. Conversations ARE fetched and loaded into the app ✅
29
+ 3. renderChatHistory() IS called and renders conversation items ✅
30
+ 4. BUT: The sidebar is hidden with `transform: translateX(-100%)` by default
31
+ 5. Users can't see the conversation list because sidebar is off-screen
32
+
33
+ ## Solution Implemented
34
+ Modified `init()` method in `static/app.js` to:
35
+
36
+ 1. **Detect screen width** on page load
37
+ 2. **On mobile/narrow screens (< 768px)**:
38
+ - Add the `open` class to sidebar
39
+ - This applies `transform: translateX(0)` which makes sidebar visible
40
+ 3. **On desktop screens (≥ 768px)**:
41
+ - Ensure sidebar doesn't have `open` class
42
+ - Desktop CSS keeps sidebar visible without the class
43
+
44
+ ```javascript
45
+ const sidebar = document.getElementById('sidebar');
46
+ if (window.innerWidth >= 768 && sidebar) {
47
+ sidebar.classList.remove('open'); // Desktop: always visible
48
+ } else if (sidebar) {
49
+ sidebar.classList.add('open'); // Mobile: toggle visibility on
50
+ }
51
+ ```
52
+
53
+ ## Additional Improvements Made
54
+
55
+ ### 1. Robust DOM Ready Check
56
+ Wrapped app instantiation in `initializeApp()` function that:
57
+ - Waits for `#chatList` element to be present
58
+ - Retries every 100ms if element not found
59
+ - Prevents errors if app loads before DOM
60
+
61
+ ### 2. Enhanced Error Logging
62
+ Added detailed error checking in `fetchConversations()`:
63
+ - Check HTTP response status
64
+ - Log full error details and stack traces
65
+ - Warn if conversations size becomes 0
66
+ - Log response data for debugging
67
+
68
+ ### 3. Window Width Logging
69
+ Added `[DEBUG] Init: Window width:` log to help diagnose screen size issues
70
+
71
+ ## Testing Checklist
72
+
73
+ After deploying, verify:
74
+
75
+ - [ ] Open on desktop (> 768px width) - sidebar should be visible with conversations
76
+ - [ ] Open on mobile/narrow window (< 768px) - sidebar should be hidden but clickable via hamburger icon
77
+ - [ ] Check browser console - should see `[DEBUG]` logs showing:
78
+ - Window width
79
+ - Conversation count loaded
80
+ - chatList innerHTML length
81
+ - [ ] Page title should show "GMGUI (83 chats)" or similar
82
+ - [ ] Clicking conversation item should load it
83
+ - [ ] New conversations should appear immediately
84
+
85
+ ## Files Modified
86
+ - `static/app.js` - Added sidebar visibility logic and improved initialization
87
+
88
+ ## Commit
89
+ ```
90
+ fix: Ensure sidebar is visible and conversations display on all screen sizes
91
+
92
+ - Made DOM ready check more robust with polling
93
+ - Moved app instantiation to safe initialization function
94
+ - Added window width logging to detect screen size issues
95
+ - Auto-open sidebar on mobile/narrow screens (< 768px)
96
+ - Ensure sidebar doesn't have 'open' class on desktop to prevent transform
97
+ - Enhanced fetchConversations error logging and checks
98
+ ```
99
+
100
+ ## Browser Compatibility
101
+ - Works on all screen sizes
102
+ - Responsive design preserved
103
+ - Mobile users can click hamburger icon to toggle sidebar
104
+ - Desktop users see full sidebar
105
+
106
+ ## Next Steps if Issue Persists
107
+ 1. Check browser console for `[DEBUG]` logs
108
+ 2. Verify page title shows conversation count
109
+ 3. Check window width log to confirm screen size detection
110
+ 4. Verify `#chatList` element exists in DOM (F12 → Elements tab)
111
+ 5. Check if any JavaScript errors prevent initialization
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",