app: default app home view to new chat instead of launch (#15312)

This commit is contained in:
Jeffrey Morgan
2026-04-03 21:50:55 -07:00
committed by GitHub
parent 4bc2728047
commit 4589fa2cf5
4 changed files with 6 additions and 5 deletions

View File

@@ -82,7 +82,7 @@ func (db *database) init() error {
websearch_enabled BOOLEAN NOT NULL DEFAULT 0,
selected_model TEXT NOT NULL DEFAULT '',
sidebar_open BOOLEAN NOT NULL DEFAULT 0,
last_home_view TEXT NOT NULL DEFAULT 'launch',
last_home_view TEXT NOT NULL DEFAULT 'chat',
think_enabled BOOLEAN NOT NULL DEFAULT 0,
think_level TEXT NOT NULL DEFAULT '',
cloud_setting_migrated BOOLEAN NOT NULL DEFAULT 0,
@@ -527,7 +527,7 @@ func (db *database) migrateV14ToV15() error {
// migrateV15ToV16 adds the last_home_view column to the settings table
func (db *database) migrateV15ToV16() error {
_, err := db.conn.Exec(`ALTER TABLE settings ADD COLUMN last_home_view TEXT NOT NULL DEFAULT 'launch'`)
_, err := db.conn.Exec(`ALTER TABLE settings ADD COLUMN last_home_view TEXT NOT NULL DEFAULT 'chat'`)
if err != nil && !duplicateColumnError(err) {
return fmt.Errorf("add last_home_view column: %w", err)
}

View File

@@ -393,7 +393,7 @@ func (s *Store) Settings() (Settings, error) {
}
if settings.LastHomeView == "" {
settings.LastHomeView = "launch"
settings.LastHomeView = "chat"
}
return settings, nil

View File

@@ -52,7 +52,7 @@ export function useSettings() {
thinkLevel: settingsData?.settings?.ThinkLevel ?? "none",
selectedModel: settingsData?.settings?.SelectedModel ?? "",
sidebarOpen: settingsData?.settings?.SidebarOpen ?? false,
lastHomeView: settingsData?.settings?.LastHomeView ?? "launch",
lastHomeView: settingsData?.settings?.LastHomeView ?? "chat",
}),
[settingsData?.settings],
);

View File

@@ -7,7 +7,8 @@ export const Route = createFileRoute("/")({
queryKey: ["settings"],
queryFn: getSettings,
});
const chatId = settingsData?.settings?.LastHomeView === "chat" ? "new" : "launch";
const lastHomeView = settingsData?.settings?.LastHomeView ?? "chat";
const chatId = lastHomeView === "chat" ? "new" : "launch";
throw redirect({
to: "/c/$chatId",