v0.5.0 - rework the sidebar #6

Merged
godber merged 3 commits from restructure-sidebar into main 2025-09-13 14:59:48 -07:00
18 changed files with 300 additions and 321 deletions
Showing only changes of commit c29160c9e9 - Show all commits

View File

@@ -18,9 +18,9 @@ def create_app():
__name__,
external_stylesheets=[
dbc.themes.BOOTSTRAP,
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",
],
assets_folder=assets_path
assets_folder=assets_path,
)
# Allow callbacks to components that are dynamically created in tabs

View File

@@ -20,4 +20,3 @@ class InteractionCallbacks:
return dash.no_update, dash.no_update
return None, None

View File

@@ -208,7 +208,6 @@ class DataSourceComponent:
]
)
def _create_opensearch_section(self, section_type):
"""Create a complete OpenSearch section for either 'data' or 'prompts'."""
section_id = section_type # 'data' or 'prompts'

View File

@@ -87,15 +87,17 @@ class SidebarComponent:
[
self.textinput_component.create_text_input_interface(),
],
title=html.Span([
title=html.Span(
[
"Generate Embeddings ",
html.I(
className="fas fa-info-circle text-muted",
style={"cursor": "pointer"},
id="generate-embeddings-info-icon",
title="Create new embeddings from text input using various in-browser models"
)
]),
title="Create new embeddings from text input using various in-browser models",
),
]
),
item_id="generate-embeddings-accordion",
)
@@ -106,15 +108,17 @@ class SidebarComponent:
self.datasource_component.create_success_alert(),
self.datasource_component.create_tabbed_interface(),
],
title=html.Span([
title=html.Span(
[
"Load Embeddings ",
html.I(
className="fas fa-info-circle text-muted",
style={"cursor": "pointer"},
id="load-embeddings-info-icon",
title="Load existing embeddings: upload files or read from OpenSearch"
)
]),
title="Load existing embeddings: upload files or read from OpenSearch",
),
]
),
item_id="data-sources-accordion",
)
@@ -124,14 +128,16 @@ class SidebarComponent:
+ self._create_color_dropdown()
+ self._create_dimension_toggle()
+ self._create_prompts_toggle(),
title=html.Span([
title=html.Span(
[
"Visualization Controls ",
html.I(
className="fas fa-info-circle text-muted",
style={"cursor": "pointer"},
id="visualization-controls-info-icon",
title="Configure plot settings: select dimensionality reduction method, colors, and display options"
)
]),
title="Configure plot settings: select dimensionality reduction method, colors, and display options",
),
]
),
item_id="visualization-controls-accordion",
)

View File

@@ -294,7 +294,6 @@ class TextInputComponent:
]
)
def _create_status_section(self):
"""Create status alerts and results preview."""
return html.Div(

View File

@@ -5,17 +5,20 @@ import dash_bootstrap_components as dbc
class UploadComponent:
@staticmethod
def create_data_upload():
return html.Div([
return html.Div(
[
dcc.Upload(
id="upload-data",
children=html.Div([
children=html.Div(
[
"Upload Data ",
html.I(
className="fas fa-info-circle",
style={"color": "#6c757d", "fontSize": "14px"},
id="data-upload-info"
)
]),
id="data-upload-info",
),
]
),
style={
"width": "100%",
"height": "60px",
@@ -31,23 +34,27 @@ class UploadComponent:
dbc.Tooltip(
"Click here or drag and drop NDJSON files containing document embeddings",
target="data-upload-info",
placement="top"
placement="top",
),
]
)
])
@staticmethod
def create_prompts_upload():
return html.Div([
return html.Div(
[
dcc.Upload(
id="upload-prompts",
children=html.Div([
children=html.Div(
[
"Upload Prompts ",
html.I(
className="fas fa-info-circle",
style={"color": "#6c757d", "fontSize": "14px"},
id="prompts-upload-info"
)
]),
id="prompts-upload-info",
),
]
),
style={
"width": "100%",
"height": "60px",
@@ -64,9 +71,10 @@ class UploadComponent:
dbc.Tooltip(
"Click here or drag and drop NDJSON files containing prompt embeddings",
target="prompts-upload-info",
placement="top"
placement="top",
),
]
)
])
@staticmethod
def create_reset_button():

2
uv.lock generated
View File

@@ -412,7 +412,7 @@ wheels = [
[[package]]
name = "embeddingbuddy"
version = "0.4.0"
version = "0.5.0"
source = { editable = "." }
dependencies = [
{ name = "dash" },