Rebranding: - Changed app name from NotebookLlaMa to Sandbox-NotebookLM - Updated all page titles - Updated dashboard title and welcome message UI Improvements: - Reduced sidebar username size (was too large) - Changed "Welcome, username!" to just "username" with emoji - Email shown as caption below username - Removed redundant bottom-left navigation menu (hidden via CSS) - Sidebar navigation headers reduced to 14px - Logout button now full-width for better UX Typography Refinements: - Sidebar headers: 16px → 14px - Navigation items cleaner - Better visual hierarchy - More professional appearance CSS Changes: - Added [data-testid="stSidebarNav"] display:none to hide duplicate nav - Reduced sidebar h1/h2/h3 to 14px - Better spacing in sidebar - Consistent font weights 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
103 lines
3.5 KiB
Python
103 lines
3.5 KiB
Python
import streamlit as st
|
|
from auth import show_login_page, get_current_user, logout_user
|
|
from styles import apply_custom_styles
|
|
|
|
st.set_page_config(
|
|
page_title="Sandbox-NotebookLM",
|
|
page_icon="🦙",
|
|
layout="wide",
|
|
initial_sidebar_state="expanded"
|
|
)
|
|
|
|
# Apply custom styles
|
|
apply_custom_styles()
|
|
|
|
# Check if user is logged in
|
|
user = get_current_user()
|
|
|
|
if not user:
|
|
show_login_page()
|
|
else:
|
|
# User is logged in - show sidebar with navigation
|
|
with st.sidebar:
|
|
st.markdown(f"**{user.username}** 🦙")
|
|
st.caption(f"{user.email}")
|
|
|
|
if st.button("Logout", use_container_width=True):
|
|
logout_user()
|
|
st.rerun()
|
|
|
|
st.markdown("---")
|
|
st.markdown("**Navigation**")
|
|
st.page_link("App.py", label="🏠 Dashboard")
|
|
st.page_link("pages/1_My_Notebooks.py", label="📚 My Notebooks")
|
|
st.page_link("pages/4_Shared_Notebooks.py", label="🤝 Shared With Me")
|
|
st.page_link("pages/5_Observability_Dashboard.py", label="📊 Observability")
|
|
|
|
# Main dashboard content
|
|
st.title("Sandbox-NotebookLM Dashboard 🦙")
|
|
st.markdown("---")
|
|
|
|
# Import notebook functions
|
|
from notebook_manager import get_user_notebooks, get_notebook_document_count
|
|
|
|
notebooks = get_user_notebooks(user.id)
|
|
total_docs = sum(get_notebook_document_count(nb.id) for nb in notebooks)
|
|
|
|
st.markdown(f"""
|
|
## Welcome to Sandbox-NotebookLM!
|
|
|
|
An open-source, enterprise-ready alternative to Google NotebookLM powered by LlamaIndex.
|
|
|
|
### Your Stats:
|
|
- 📚 **{len(notebooks)} Notebooks**
|
|
- 📄 **{total_docs} Documents**
|
|
|
|
### How It Works:
|
|
1. 📓 **Create a Notebook** - Group related documents together
|
|
2. 📤 **Upload PDFs** - Add 1-20 documents to your notebook
|
|
3. 🤖 **AI Processes** - Generates summaries, Q&A, and highlights
|
|
4. 💬 **Chat** - Ask questions across ALL your documents
|
|
5. 🎙️ **Generate Podcast** - Create audio discussions from your content
|
|
6. 🤝 **Share** - Collaborate with team members
|
|
|
|
### Quick Actions:
|
|
""")
|
|
|
|
col1, col2, col3 = st.columns(3)
|
|
|
|
with col1:
|
|
st.markdown("### 📓 Create Notebook")
|
|
st.markdown("Start a new collection of documents")
|
|
if st.button("Create New Notebook", type="primary", use_container_width=True):
|
|
st.session_state.creating_notebook = True
|
|
st.switch_page("pages/1_My_Notebooks.py")
|
|
|
|
with col2:
|
|
st.markdown("### 📚 My Notebooks")
|
|
st.markdown("View and manage your notebooks")
|
|
if st.button("View Notebooks", use_container_width=True):
|
|
st.switch_page("pages/1_My_Notebooks.py")
|
|
|
|
with col3:
|
|
st.markdown("### 🤝 Shared With Me")
|
|
st.markdown("Access shared notebooks")
|
|
if st.button("View Shared", use_container_width=True):
|
|
st.switch_page("pages/4_Shared_Notebooks.py")
|
|
|
|
st.markdown("---")
|
|
|
|
# Show recent notebooks
|
|
if notebooks:
|
|
st.markdown("### 📊 Recent Notebooks")
|
|
for notebook in notebooks[:5]:
|
|
doc_count = get_notebook_document_count(notebook.id)
|
|
col_nb1, col_nb2 = st.columns([4, 1])
|
|
with col_nb1:
|
|
st.write(f"**{notebook.name}** - {doc_count} document(s)")
|
|
with col_nb2:
|
|
if st.button("View", key=f"view_{notebook.id}"):
|
|
st.session_state.view_notebook_id = notebook.id
|
|
st.switch_page("pages/2_Notebook_Detail.py")
|
|
else:
|
|
st.info("💡 **Get Started:** Create your first notebook to organize and analyze your documents!")
|