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
11 changes: 11 additions & 0 deletions application/single_app/functions_conversation_contents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# functions_conversation_contents.py

Check warning on line 1 in application/single_app/functions_conversation_contents.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.


def is_conversation_contents_drawer_enabled(app_settings, user_settings):

Check warning on line 4 in application/single_app/functions_conversation_contents.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
"""Return whether both the admin gate and current-user preference allow the drawer."""
normalized_app_settings = app_settings if isinstance(app_settings, dict) else {}
normalized_user_settings = user_settings if isinstance(user_settings, dict) else {}
return bool(
normalized_app_settings.get('enable_conversation_contents_drawer', True)

Check warning on line 9 in application/single_app/functions_conversation_contents.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
and normalized_user_settings.get('conversationContentsDrawerEnabled', True)

Check warning on line 10 in application/single_app/functions_conversation_contents.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
)
1 change: 1 addition & 0 deletions application/single_app/functions_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,7 @@
'require_public_workspace_assignment_for_file_downloads': False,
'file_download_allowed_public_workspace_ids': [],
'enable_chat_file_uploads': True,
'enable_conversation_contents_drawer': True,

Check warning on line 984 in application/single_app/functions_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
'require_member_of_chat_file_upload_user': False,
'enforce_workspace_scope_lock': True,

Expand Down
5 changes: 5 additions & 0 deletions application/single_app/route_backend_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
'navbar_layout', 'chatLayout', 'showChatTitle', 'chatSplitSizes',
'deepResearchDefaultEnabled',
'sidebarToggleStyle', 'sidebarMenuState', 'fontSizePreference',
'conversationContentsDrawerEnabled',

Check warning on line 510 in application/single_app/route_backend_users.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
LATEST_FEATURES_HIDDEN_VERSION_SETTING,
# Microphone permission settings
'microphonePermissionPreference', 'microphonePermissionState',
Expand Down Expand Up @@ -550,6 +551,10 @@
return jsonify({"error": "Invalid font size preference"}), 400
settings_to_update["fontSizePreference"] = font_size_preference

if "conversationContentsDrawerEnabled" in settings_to_update:

Check warning on line 554 in application/single_app/route_backend_users.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
if not isinstance(settings_to_update["conversationContentsDrawerEnabled"], bool):

Check warning on line 555 in application/single_app/route_backend_users.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
return jsonify({"error": "Invalid conversation contents drawer preference"}), 400

Check warning on line 556 in application/single_app/route_backend_users.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

if "sidebarMenuState" in settings_to_update:
sidebar_menu_state = settings_to_update.get("sidebarMenuState")
allowed_sidebar_menu_keys = {
Expand Down
3 changes: 3 additions & 0 deletions application/single_app/route_frontend_admin_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
settings['require_member_of_create_public_workspace'] = False
if 'enable_chat_file_uploads' not in settings:
settings['enable_chat_file_uploads'] = True
if 'enable_conversation_contents_drawer' not in settings:

Check warning on line 188 in application/single_app/route_frontend_admin_settings.py

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
settings['enable_conversation_contents_drawer'] = True
if 'require_member_of_chat_file_upload_user' not in settings:
settings['require_member_of_chat_file_upload_user'] = False
if 'require_member_of_safety_violation_admin' not in settings:
Expand Down Expand Up @@ -1989,6 +1991,7 @@
'enable_public_workspaces': form_data.get('enable_public_workspaces') == 'on',
'enable_file_sharing': form_data.get('enable_file_sharing') == 'on',
'enable_chat_file_uploads': form_data.get('enable_chat_file_uploads') == 'on',
'enable_conversation_contents_drawer': form_data.get('enable_conversation_contents_drawer') == 'on',
'require_member_of_chat_file_upload_user': require_member_of_chat_file_upload_user,
'allow_user_workflows': form_data.get('allow_user_workflows') == 'on',
'require_member_of_workflow_user': require_member_of_workflow_user,
Expand Down
6 changes: 6 additions & 0 deletions application/single_app/route_frontend_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
serialize_collaboration_conversation,
serialize_collaboration_message,
)
from functions_conversation_contents import is_conversation_contents_drawer_enabled
from functions_source_review import get_deep_research_config, is_source_review_enabled_for_user, is_url_access_enabled_for_user
from functions_documents import *
from functions_group import (
Expand Down Expand Up @@ -700,6 +701,10 @@ def chats():
public_settings['enable_url_access'] = url_access_enabled_for_user
public_settings['enable_chat_file_uploads'] = chat_file_upload_enabled_for_user
public_settings['allow_user_workflows'] = user_workflows_enabled_for_user
conversation_contents_drawer_enabled = is_conversation_contents_drawer_enabled(
public_settings,
user_settings_dict,
)
public_settings['enable_deep_source_review'] = bool(
source_review_enabled_for_user and settings.get('enable_deep_source_review', False)
)
Expand Down Expand Up @@ -868,6 +873,7 @@ def chats():
chat_agent_options=chat_agent_options,
chat_model_options=chat_model_options,
initial_chat_model_selection=initial_chat_model_selection,
conversation_contents_drawer_enabled=conversation_contents_drawer_enabled,
)

@bp.route('/workflow-activity', methods=['GET'])
Expand Down
87 changes: 87 additions & 0 deletions application/single_app/static/css/chats.css
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,93 @@ body.layout-split .gutter {
flex-direction: column;
height: 100%;
min-height: 0;
position: relative;
}

.conversation-contents-drawer {
--bs-offcanvas-width: min(22rem, 88vw);
}

.conversation-contents-list {
display: grid;
gap: 0.25rem;
}

.conversation-contents-entry {
border-radius: 0.375rem;
color: var(--bs-body-color);
display: block;
overflow: hidden;
padding: 0.625rem 0.75rem;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}

.conversation-contents-entry:hover,
.conversation-contents-entry:focus-visible {
background: var(--bs-tertiary-bg);
}

.conversation-contents-entry[aria-current="location"] {
background: rgba(var(--bs-primary-rgb), 0.12);
color: var(--bs-primary);
font-weight: 600;
}

.conversation-contents-destination {
animation: conversation-contents-highlight 1.6s ease-out;
border-radius: 0.5rem;
}

@keyframes conversation-contents-highlight {
0%,
35% {
box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.3);
}
100% {
box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
}
}

@media (min-width: 1200px) {
.chat-container {
transition: padding-right 180ms ease;
}

.chat-container.conversation-contents-open {
padding-right: 19rem;
}

.conversation-contents-drawer {
--bs-offcanvas-width: 19rem;
bottom: 0;
height: 100%;
position: absolute;
top: 0;
transform: translateX(100%);
transition: transform 180ms ease, visibility 180ms ease;
visibility: hidden;
z-index: 5;
}

.chat-container.conversation-contents-open .conversation-contents-drawer {
transform: none;
visibility: visible;
}
}

@media (prefers-reduced-motion: reduce) {
.chat-container,
.conversation-contents-drawer {
transition: none;
}

.conversation-contents-destination {
animation: none;
box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.3);
}
}

html[data-font-size="l"] .chat-shell-header,
Expand Down
Loading
Loading