Skip to content

Commit 7e6e1ca

Browse files
Copilotyiwang
andcommitted
Add is_brand_new to HTTP status and show welcome in web UI
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
1 parent 2546c19 commit 7e6e1ca

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

crates/server/src/http.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ struct StatusResponse {
388388
model: String,
389389
memory_chunks: usize,
390390
active_sessions: usize,
391+
is_brand_new: bool,
391392
}
392393

393394
async fn status(State(state): State<Arc<AppState>>) -> Json<StatusResponse> {
@@ -398,6 +399,7 @@ async fn status(State(state): State<Arc<AppState>>) -> Json<StatusResponse> {
398399
model: state.config.agent.default_model.clone(),
399400
memory_chunks: state.memory.chunk_count().unwrap_or(0),
400401
active_sessions: sessions.len(),
402+
is_brand_new: state.memory.is_brand_new(),
401403
})
402404
}
403405

crates/server/ui/app.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,32 @@ function showEmptyState() {
7373
}
7474
}
7575

76+
function showFirstRunWelcome() {
77+
const messages = document.getElementById('messages');
78+
if (messages.children.length === 0) {
79+
messages.innerHTML = `
80+
<div class="empty-state welcome">
81+
<h1>Welcome to LocalGPT</h1>
82+
<p>This is your first session. I've set up a fresh workspace for you.</p>
83+
<h3>Quick Start</h3>
84+
<ol>
85+
<li><strong>Just chat</strong> - I'm ready to help with coding, writing, research, or anything else</li>
86+
<li><strong>Your memory files</strong> are in the workspace:
87+
<ul>
88+
<li><code>MEMORY.md</code> - I'll remember important things here</li>
89+
<li><code>SOUL.md</code> - Customize my personality and behavior</li>
90+
<li><code>HEARTBEAT.md</code> - Tasks for autonomous mode</li>
91+
</ul>
92+
</li>
93+
</ol>
94+
<h3>Tell Me About Yourself</h3>
95+
<p>What's your name? What kind of projects do you work on? Any preferences for how I should communicate?</p>
96+
<p><em>I'll save what I learn to MEMORY.md so I remember it next time.</em></p>
97+
</div>
98+
`;
99+
}
100+
}
101+
76102
function clearEmptyState() {
77103
const emptyState = document.querySelector('.empty-state');
78104
if (emptyState) {
@@ -440,6 +466,11 @@ async function loadStatus() {
440466
const heartbeat = await heartbeatRes.json();
441467

442468
updateStatusPanel(status, heartbeat);
469+
470+
// Show detailed welcome message on first run
471+
if (status.is_brand_new) {
472+
showFirstRunWelcome();
473+
}
443474
} catch (err) {
444475
console.error('Failed to load status:', err);
445476
}

0 commit comments

Comments
 (0)