web: keep mobile composition stable across keyboard and Back navigation

This commit is contained in:
2026-10-20 16:04:09 +01:00
parent 90cd43bdd7
commit 1d9cb80cdb
9 changed files with 193 additions and 10 deletions
+8
View File
@@ -2,6 +2,7 @@ package server
import (
"context"
"fmt"
"net/http/httptest"
"os"
"os/exec"
@@ -44,6 +45,13 @@ func TestChatBrowserLifecycleAndModelDialog(t *testing.T) {
fake := scriptedChat()
fake.block = true
fake.sessions = []protocol.ChatSession{session}
for i := 0; i < 30; i++ {
other := protocol.ChatSession{ID: fmt.Sprintf("ses_browser_%d", i), Title: fmt.Sprintf("Scratch chat %d", i), Directory: directory}
if err := store.RecordOperatorSession(ctx, other.ID, directory, other.Title, protocol.ChatSessionTagOperator); err != nil {
t.Fatal(err)
}
fake.sessions = append(fake.sessions, other)
}
fake.models = []protocol.ChatModel{{ID: "model-a", Provider: "fixture", Name: "Model Alpha"}, {ID: "model-b", Provider: "fixture", Name: "Model Beta"}}
fake.messages = []protocol.ChatMessage{
{ID: "msg_user", Role: protocol.ChatRoleUser, Parts: []protocol.ChatPart{{Type: "text", Text: "Scratch prompt"}}},