feat(conversation): cheap-default DeepSeek + Enter-send + model pill
- default-interactive@1 model: claude-haiku-4-5 → deepseek/deepseek-chat (input $0.28/$1.12 per 1M; haiku 대비 ~75% 절감). fallback 은 haiku 로 swap. - conversation textarea keydown: - Enter → 전송 (IME composition 중이면 무시) - Shift+Enter → 줄바꿈 - Cmd/Ctrl+Enter → 전송 (백워드 호환) - Placeholder 안내 갱신. - conversation top-bar 에 model pill 추가 (#session-model-pill) — 현재 세션의 활성 model 을 monospace badge 로 표시. 헷갈리던 "어느 모델인가?" 해소. - style.css 에 .conv-model-pill (회색 pill). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -757,6 +757,21 @@ function updateSessionStatePill(state) {
|
||||
pill.className = `conv-session-state state-${state}`;
|
||||
}
|
||||
|
||||
function updateSessionModelPill(model) {
|
||||
const pill = $conv("#session-model-pill");
|
||||
if (!pill) return;
|
||||
if (!model) {
|
||||
pill.textContent = "";
|
||||
pill.className = "conv-model-pill";
|
||||
return;
|
||||
}
|
||||
// Trim the "openrouter:" prefix for display; keep full id in tooltip.
|
||||
const display = model.replace(/^openrouter:/, "");
|
||||
pill.textContent = display;
|
||||
pill.title = `model: ${model}`;
|
||||
pill.className = "conv-model-pill";
|
||||
}
|
||||
|
||||
async function loadSessionList() {
|
||||
try {
|
||||
const list = await jsonFetch("/sessions?limit=50");
|
||||
@@ -797,6 +812,7 @@ async function loadAndAttachSession(sessionId) {
|
||||
return;
|
||||
}
|
||||
updateSessionStatePill(detail.session.state);
|
||||
updateSessionModelPill(detail.session.model);
|
||||
|
||||
const messages = detail.messages || [];
|
||||
for (const m of messages) {
|
||||
@@ -968,17 +984,14 @@ async function bootstrapConversationPage() {
|
||||
setTimeout(() => { input._composing = false; }, 0);
|
||||
});
|
||||
input.addEventListener("keydown", (ev) => {
|
||||
// Honor Cmd/Ctrl+Enter as explicit "send" override even during composition.
|
||||
if ((ev.metaKey || ev.ctrlKey) && ev.key === "Enter") {
|
||||
ev.preventDefault();
|
||||
sendMessage(ev.target.value);
|
||||
return;
|
||||
}
|
||||
// Plain Enter during composition (e.g. Korean IME committing 한글) must
|
||||
// pass through to the textarea — do nothing.
|
||||
if (ev.key === "Enter" && input._composing) {
|
||||
return;
|
||||
}
|
||||
if (ev.key !== "Enter") return;
|
||||
// Shift+Enter → newline (let the textarea handle it natively).
|
||||
if (ev.shiftKey) return;
|
||||
// IME composition (Korean/Japanese/Chinese candidate commit) → never send.
|
||||
if (input._composing) return;
|
||||
// Plain Enter (and Cmd/Ctrl+Enter for backwards compat) → send.
|
||||
ev.preventDefault();
|
||||
sendMessage(ev.target.value);
|
||||
});
|
||||
// v0.3 PR #8: deep link `?session=<id>` auto-loads the named session.
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
Reference in New Issue
Block a user