mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 03:03:48 +00:00
feat: add Create Session button to empty state, move refresh to header
This commit is contained in:
parent
241bea6eb9
commit
2e47f9cf8d
2 changed files with 47 additions and 26 deletions
|
|
@ -396,6 +396,31 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-header-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-icon-btn {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
background: transparent;
|
||||||
|
border: 1px solid var(--border-2);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: var(--muted);
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-icon-btn:hover {
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-title {
|
.sidebar-title {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|
@ -495,16 +520,6 @@
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-refresh {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 8px;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Chat Panel */
|
/* Chat Panel */
|
||||||
.chat-panel {
|
.chat-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -809,20 +809,28 @@ export default function App() {
|
||||||
<div className="session-sidebar">
|
<div className="session-sidebar">
|
||||||
<div className="sidebar-header">
|
<div className="sidebar-header">
|
||||||
<span className="sidebar-title">Sessions</span>
|
<span className="sidebar-title">Sessions</span>
|
||||||
<button
|
<div className="sidebar-header-actions">
|
||||||
className="sidebar-add-btn"
|
<button
|
||||||
onClick={createNewSession}
|
className="sidebar-icon-btn"
|
||||||
title="New session"
|
onClick={fetchSessions}
|
||||||
>
|
title="Refresh sessions"
|
||||||
<Plus size={14} />
|
>
|
||||||
</button>
|
<RefreshCw size={14} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="sidebar-add-btn"
|
||||||
|
onClick={createNewSession}
|
||||||
|
title="New session"
|
||||||
|
>
|
||||||
|
<Plus size={14} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="session-list">
|
<div className="session-list">
|
||||||
{sessions.length === 0 ? (
|
{sessions.length === 0 ? (
|
||||||
<div className="sidebar-empty">
|
<div className="sidebar-empty">
|
||||||
No sessions yet.<br />
|
No sessions yet.
|
||||||
Create one to get started.
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
sessions.map((session) => (
|
sessions.map((session) => (
|
||||||
|
|
@ -841,12 +849,6 @@ export default function App() {
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sidebar-refresh">
|
|
||||||
<button className="button ghost small" onClick={fetchSessions}>
|
|
||||||
<RefreshCw size={12} /> Refresh
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Chat Panel */}
|
{/* Chat Panel */}
|
||||||
|
|
@ -868,8 +870,12 @@ export default function App() {
|
||||||
<MessageSquare className="empty-state-icon" />
|
<MessageSquare className="empty-state-icon" />
|
||||||
<div className="empty-state-title">No Session Selected</div>
|
<div className="empty-state-title">No Session Selected</div>
|
||||||
<p className="empty-state-text">
|
<p className="empty-state-text">
|
||||||
Click + in the sidebar to create a new session, or select an existing one.
|
Create a new session to start chatting with an agent.
|
||||||
</p>
|
</p>
|
||||||
|
<button className="button primary" onClick={createNewSession} style={{ marginTop: 16 }}>
|
||||||
|
<Plus className="button-icon" />
|
||||||
|
Create Session
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : transcriptMessages.length === 0 && !sessionError ? (
|
) : transcriptMessages.length === 0 && !sessionError ? (
|
||||||
<div className="empty-state">
|
<div className="empty-state">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue