feat: no baked-in default model — the new-session controls ARE the default settings page
Owner reframe (2026-09-18): the model + thinking + context controls on
the home graph view and /chat/new are not a draft overlay on a baked-in
default — they ARE the settings page for the default model, and the
user's last choice IS the default. BYOK first boot has no keys and
possibly no OpenRouter, so there is NO default to show: the controls
render 'no model' ('—') until the first pick.
The flash was the deeper symptom: the surfaces rendered from client
state that started empty and fetched truth afterward, so every visit
flashed the config pin (GLM/low — a dev artifact) for a few frames.
Fix at the root: both pages are now force-dynamic server components
that read the record (readDefaultSettings → initialSettings) and hand
it to the client — the first frame shows truth. Dynamic routes aren't
cached client-side (staleTimes.dynamic = 0), so every navigation
re-reads the record; the useDefaultSettings hook keeps only save-side
state (optimistic set + PUT). The GET-on-mount and its touch-guard are
gone.
ModelControl gains noDefaultModel (the default surfaces only): unset
settings render no model/level, never the catalog pin; the thinking
menu no-ops until a model exists. Chat surfaces keep the catalog
fallback — the engine runs the config pin when a session record has no
override, so the control keeps showing what will actually run.
Renamed draft→default throughout: data/default-settings.json,
GET/PUT /api/settings/defaults, useDefaultSettings. New sessions
still inherit the default on creation exactly as before.
Live-verified: first-boot 'no model' with zero flash, picker +
Shift+Tab cycle, values held across session→/chat/new→home roundtrips
and a reload (10×100ms samples, never the old default), zero console
errors.
This commit is contained in:
@@ -6,7 +6,7 @@ import { Conversation, ConversationContent, ConversationEmptyState } from "@/com
|
||||
import { Composer } from "@/components/composer";
|
||||
import { DictationBar, useDictation } from "@/components/dictation";
|
||||
import { GraphContextControl, effectiveContextTokens } from "@/components/graph-context-control";
|
||||
import { useDraftSettings } from "@/components/draft-settings";
|
||||
import { useDefaultSettings } from "@/components/default-settings";
|
||||
import { PhaseChip } from "@/components/phase-divider";
|
||||
import { SidebarToggle } from "@/components/sidebar";
|
||||
import { StatsBar } from "@/components/stats-bar";
|
||||
@@ -124,6 +124,7 @@ export function DraftShell({
|
||||
dictationSlot={<DictationBar dictation={dictation} />}
|
||||
turns={[]}
|
||||
chatId=""
|
||||
noDefaultModel
|
||||
settings={settings}
|
||||
onSettingsSaved={onSettingsSaved}
|
||||
// The session-data slot (owner, 2026-09-15): pre-chat the left
|
||||
@@ -147,17 +148,17 @@ export function DraftShell({
|
||||
);
|
||||
}
|
||||
|
||||
export function NewSession() {
|
||||
export function NewSession({ initialSettings }: { initialSettings: ChatSettings | null }) {
|
||||
const router = useRouter();
|
||||
const [text, setText] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
// The pre-chat model+thinking+context selection — the SHARED draft
|
||||
// record (draft-settings wave, 2026-09-18): /chat/new and the home
|
||||
// topic dock read and write ONE persisted choice, so what the learner
|
||||
// last left the controls on is what shows on return. ModelControl with
|
||||
// an empty chatId never PUTs — it hands the choice up; it still rides
|
||||
// the session POST then PUT-on-create.
|
||||
const { settings, save: saveDraft } = useDraftSettings();
|
||||
// THE default settings (owner, 2026-09-18): this surface and the home
|
||||
// topic dock ARE the settings page for the default model — no baked-in
|
||||
// default exists; the user's last choice (server-rendered in via
|
||||
// initialSettings, shared with home through data/default-settings.json)
|
||||
// IS the default. ModelControl with an empty chatId never PUTs — it
|
||||
// hands the choice up; it still rides the session POST then PUT-on-create.
|
||||
const { settings, save: saveDraft } = useDefaultSettings(initialSettings);
|
||||
|
||||
const send = useCallback(() => {
|
||||
if (!text.trim() || busy) return;
|
||||
|
||||
Reference in New Issue
Block a user