Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.237.005"
VERSION = "0.237.006"


SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,23 @@ function createSidebarConversationItem(convo) {
const originalTitleElement = headerRow ? headerRow.querySelector('.sidebar-conversation-title') : null;

if (headerRow && dropdownElement && originalTitleElement) {
// Verify the dropdown is actually a child of headerRow before attempting manipulation
if (!headerRow.contains(dropdownElement)) {
console.error('Dropdown element is not a child of headerRow', { headerRow, dropdownElement });
return convoItem;
}

const titleWrapper = document.createElement('div');
titleWrapper.classList.add('sidebar-conversation-header', 'd-flex', 'align-items-center', 'flex-grow-1', 'overflow-hidden', 'gap-2');

// Insert the wrapper before the dropdown first
headerRow.insertBefore(titleWrapper, dropdownElement);
// Remove the original title from headerRow
originalTitleElement.remove();

// Now move the title element into the wrapper
// Add styling to title
originalTitleElement.classList.add('flex-grow-1', 'text-truncate');
originalTitleElement.style.minWidth = '0';

// Add title to wrapper
titleWrapper.appendChild(originalTitleElement);

const isGroupConversation = (convo.chat_type && convo.chat_type.startsWith('group')) || groupName;
Expand All @@ -162,6 +170,9 @@ function createSidebarConversationItem(convo) {
badge.title = groupName ? `Group conversation: ${groupName}` : 'Group conversation';
titleWrapper.appendChild(badge);
}

// Insert the wrapper before the dropdown
headerRow.insertBefore(titleWrapper, dropdownElement);
}

// Add double-click editing to title
Expand Down
11 changes: 11 additions & 0 deletions docs/explanation/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<!-- BEGIN release_notes.md BLOCK -->
# Feature Release

### **(v0.237.006)**

#### Bug Fixes

* **Sidebar Conversations DOM Manipulation Fix**
* Fixed JavaScript error "Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node" that prevented sidebar conversations from loading.
* **Root Cause**: In `createSidebarConversationItem()`, the code was attempting DOM manipulation in the wrong order. When `originalTitleElement` was appended to `titleWrapper`, it was removed from `headerRow`, making the subsequent `insertBefore(titleWrapper, dropdownElement)` fail because `dropdownElement` was no longer a valid child reference in the expected DOM position.
* **Impact**: Users experienced a complete failure loading the sidebar conversation list, with the error appearing in browser console and preventing any conversations from displaying in the sidebar. This affected all users attempting to view their conversation history.
* **Solution**: Reordered DOM manipulation to remove `originalTitleElement` from DOM first, style it, add it to `titleWrapper`, then insert the complete `titleWrapper` before `dropdownElement`. Added validation to check if `dropdownElement` is a valid child before attempting insertion.
* (Ref: `chat-sidebar-conversations.js`, `createSidebarConversationItem()`, DOM manipulation order, line 150)

### **(v0.237.005)**

#### Bug Fixes
Expand Down