Skip to content

Commit 5d0a40f

Browse files
authored
Always show message actions for mobile UI + improvements for user message sizing (#16076)
1 parent d12a983 commit 5d0a40f

File tree

13 files changed

+268
-138
lines changed

13 files changed

+268
-138
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ poetry.toml
149149
/run-chat.sh
150150
.ccache/
151151

152-
# Code Workspace
152+
# IDE
153153
*.code-workspace
154-
154+
.windsurf/

.windsurf/rules/css-architecture.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.windsurf/rules/sveltekit-architecture.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

.windsurf/rules/tests.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.windsurf/rules/typescript-architecture.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

tools/server/public/index.html.gz

293 Bytes
Binary file not shown.

tools/server/webui/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite dev --host 0.0.0.0 & storybook dev -p 6006 --ci",
7+
"dev": "bash scripts/dev.sh",
88
"build": "vite build && ./scripts/post-build.sh",
99
"preview": "vite preview",
1010
"prepare": "svelte-kit sync || echo ''",
@@ -20,7 +20,8 @@
2020
"test:ui": "vitest --project=ui",
2121
"test:unit": "vitest",
2222
"storybook": "storybook dev -p 6006",
23-
"build-storybook": "storybook build"
23+
"build-storybook": "storybook build",
24+
"cleanup": "rm -rf .svelte-kit build node_modules test-results"
2425
},
2526
"devDependencies": {
2627
"@chromatic-com/storybook": "^4.0.1",

tools/server/webui/scripts/dev.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/bash
2+
3+
cd ../../../
4+
5+
# Check and install git hooks if missing
6+
check_and_install_hooks() {
7+
local hooks_missing=false
8+
9+
# Check for required hooks
10+
if [ ! -f ".git/hooks/pre-commit" ] || [ ! -f ".git/hooks/pre-push" ] || [ ! -f ".git/hooks/post-push" ]; then
11+
hooks_missing=true
12+
fi
13+
14+
if [ "$hooks_missing" = true ]; then
15+
echo "🔧 Git hooks missing, installing them..."
16+
cd tools/server/webui
17+
if bash scripts/install-git-hooks.sh; then
18+
echo "✅ Git hooks installed successfully"
19+
else
20+
echo "⚠️ Failed to install git hooks, continuing anyway..."
21+
fi
22+
cd ../../../
23+
else
24+
echo "✅ Git hooks already installed"
25+
fi
26+
}
27+
28+
# Install git hooks if needed
29+
check_and_install_hooks
30+
31+
# Check if llama-server binary already exists
32+
if [ ! -f "build/bin/llama-server" ]; then
33+
echo "Building llama-server..."
34+
cmake -B build && cmake --build build --config Release -t llama-server
35+
else
36+
echo "llama-server binary already exists, skipping build."
37+
fi
38+
39+
# Start llama-server and capture output
40+
echo "Starting llama-server..."
41+
mkfifo server_output.pipe
42+
build/bin/llama-server -hf ggml-org/gpt-oss-20b-GGUF --jinja -c 0 --no-webui > server_output.pipe 2>&1 &
43+
SERVER_PID=$!
44+
45+
# Function to wait for server to be ready
46+
wait_for_server() {
47+
echo "Waiting for llama-server to be ready..."
48+
local max_wait=60
49+
local start_time=$(date +%s)
50+
51+
# Read server output in background and look for the ready message
52+
(
53+
while IFS= read -r line; do
54+
echo "🔍 Server: $line"
55+
if [[ "$line" == *"server is listening on http://127.0.0.1:8080 - starting the main loop"* ]]; then
56+
echo "✅ llama-server is ready!"
57+
echo "READY" > server_ready.flag
58+
break
59+
fi
60+
done < server_output.pipe
61+
) &
62+
63+
# Wait for ready flag or timeout
64+
while [ ! -f server_ready.flag ]; do
65+
local current_time=$(date +%s)
66+
local elapsed=$((current_time - start_time))
67+
68+
if [ $elapsed -ge $max_wait ]; then
69+
echo "❌ Server failed to start within $max_wait seconds"
70+
rm -f server_ready.flag
71+
return 1
72+
fi
73+
74+
sleep 1
75+
done
76+
77+
rm -f server_ready.flag
78+
return 0
79+
}
80+
81+
# Cleanup function
82+
cleanup() {
83+
echo "🧹 Cleaning up..."
84+
kill $SERVER_PID 2>/dev/null
85+
rm -f server_output.pipe server_ready.flag
86+
exit
87+
}
88+
89+
# Set up signal handlers
90+
trap cleanup SIGINT SIGTERM
91+
92+
# Wait for server to be ready
93+
if wait_for_server; then
94+
echo "🚀 Starting development servers..."
95+
cd tools/server/webui
96+
storybook dev -p 6006 --ci & vite dev --host 0.0.0.0 &
97+
98+
# Wait for all background processes
99+
wait
100+
else
101+
echo "❌ Failed to start development environment"
102+
cleanup
103+
fi

0 commit comments

Comments
 (0)