* feat: add option to hide new-chat welcome panel * Release: add preference to hide new-chat welcome panel (#6183, @vaidu-ai) --------- Co-authored-by: vaidu-ai <im@vaidu.net> Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
This commit is contained in:
8 files changed
+196
No files matched your search
@@ -19,6 +19,8 @@
|
||||
|
||||
### Fixed
|
||||
|
||||
- **New chat: you can now hide the entire welcome panel, not just the suggestions.** A new opt-in Settings → Preferences toggle, "Hide new-chat welcome panel," hides the whole empty-state block (logo, heading, subtitle, and suggestion buttons) on an empty new conversation while keeping the composer available and focused. It extends the existing "hide new-chat suggestions" preference with the same persisted, hot-applied pattern; default is unchanged (panel shown). Thanks @vaidu-ai. (#6183, #6160)
|
||||
|
||||
- **Workspace Artifacts pane: long filenames are fully readable and long parent directories stay inside the drawer.** A long artifact filename used to be ellipsized (so you couldn't tell files apart), and an unusually long immediate-parent directory could expand the Artifacts drawer horizontally and bleed past its edge. The list now shows the filename first with parent-preserving path truncation, and the directory tail is width-capped (`min-width: 0` + `overflow: hidden` + `text-overflow: ellipsis`) so it clips inside the card instead of blowing out the drawer. Adds behavioral/locale coverage for the artifact path lifecycle. Thanks @rodboev. (#6078, #6067)
|
||||
|
||||
- **The Kanban "New task" modal is reachable on phones again.** On a narrow viewport, a tall create-task modal was vertically centered, pushing its top (the title and first input) above the top of the screen with no way to scroll back to it. The mobile overlay now uses `align-items: safe center` and `overflow-y: auto`, so an overflowing modal keeps its top on-screen and scrolls as needed; desktop and wider layouts are unchanged. Thanks @jpalazz2. (#6301)
|
||||
|
||||
@@ -9139,6 +9139,7 @@ _SETTINGS_DEFAULTS = {
|
||||
"show_conversation_outline": False, # show opt-in desktop jump-to-question outline panel
|
||||
"show_busy_placeholder_hint": False, # opt-in busy composer placeholder hint
|
||||
"hide_empty_state_suggestions": False, # hide the default new-chat suggestion buttons
|
||||
"hide_empty_state_panel": False, # hide the complete new-chat welcome panel
|
||||
"new_chat_on_workspace_switch": False, # #5473 opt-in: switching to a DIFFERENT workspace starts a new chat (leaving the current conversation on its original workspace) instead of mutating the current session's workspace in place. Default OFF preserves the shipped in-place-switch behavior.
|
||||
"virtualize_transcript": False, # #4343: virtualize long (>80 msg) transcripts. EXPERIMENTAL, opt-IN (default OFF). Was opt-out/default-on in #4325 but caused scroll-up flicker on long sessions with tall tool-call rows (variable-height anchor oscillation) — flipped off for everyone in #4343; re-enabling requires an explicit opt-in (see virtualize_transcript_optin migration in load_settings).
|
||||
"virtualize_transcript_optin": False, # #4343 migration marker: True only once the user explicitly enables virtualize_transcript AFTER the default-off flip. A stored virtualize_transcript=True WITHOUT this marker is a stale pre-flip value and is reset to False on load (force-off-for-everyone migration).
|
||||
@@ -9461,6 +9462,7 @@ _SETTINGS_BOOL_KEYS = {
|
||||
"show_conversation_outline",
|
||||
"show_busy_placeholder_hint",
|
||||
"hide_empty_state_suggestions",
|
||||
"hide_empty_state_panel",
|
||||
"new_chat_on_workspace_switch",
|
||||
"virtualize_transcript",
|
||||
"virtualize_transcript_optin",
|
||||
|
||||
@@ -2538,6 +2538,11 @@ function applyEmptyStateSuggestionPref(){
|
||||
$('emptyState').classList.toggle('no-suggestions',window._hideEmptyStateSuggestions===true);
|
||||
}
|
||||
|
||||
function applyEmptyStatePanelPref(){
|
||||
if(!$('emptyState')) return;
|
||||
$('emptyState').classList.toggle('no-welcome',window._hideEmptyStatePanel===true);
|
||||
}
|
||||
|
||||
window.addEventListener('resize',()=>{
|
||||
_syncWorkspacePanelInlineWidth();
|
||||
syncWorkspacePanelState();
|
||||
@@ -3224,6 +3229,8 @@ window._mirrorSpeechSettingsFromServer=_mirrorSpeechSettingsFromServer;
|
||||
if(typeof applyConversationOutlinePreference==='function') applyConversationOutlinePreference();
|
||||
window._hideEmptyStateSuggestions=s.hide_empty_state_suggestions===true;
|
||||
applyEmptyStateSuggestionPref();
|
||||
window._hideEmptyStatePanel=s.hide_empty_state_panel===true;
|
||||
applyEmptyStatePanelPref();
|
||||
// #4343: transcript virtualization is EXPERIMENTAL/opt-IN (default OFF).
|
||||
// #4346 Phase B (footer-jitter suppression during virtual-scroll
|
||||
// measurement re-renders) resolved the scroll-up flicker root cause,
|
||||
@@ -3381,6 +3388,8 @@ window._mirrorSpeechSettingsFromServer=_mirrorSpeechSettingsFromServer;
|
||||
if(typeof applyConversationOutlinePreference==='function') applyConversationOutlinePreference();
|
||||
window._hideEmptyStateSuggestions=false;
|
||||
applyEmptyStateSuggestionPref();
|
||||
window._hideEmptyStatePanel=false;
|
||||
applyEmptyStatePanelPref();
|
||||
window._virtualizeTranscript=false; // settings-load failed: default-OFF (experimental/opt-in) (#4343)
|
||||
window._showTps=false;
|
||||
window._fadeTextEffect=false;
|
||||
|
||||
@@ -875,6 +875,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Show a desktop-only jump list for user questions in the current conversation. Off by default.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts (experimental)',
|
||||
settings_desc_virtualize_transcript: "Experimental. Renders only the visible portion of very long chat transcripts (over 80 messages) to speed up scrolling. Off by default because it can cause scroll flicker on long sessions with large tool-call blocks. Turn it on to try it; leave it off for the full transcript to render at once (and so the browser's Find (Ctrl+F) matches the whole conversation).",
|
||||
settings_label_token_usage: 'Show token usage',
|
||||
@@ -2632,6 +2634,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Mostra un elenco di salto solo desktop per le domande utente nella conversazione corrente. Disattivato per impostazione predefinita.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: 'Mostra uso token',
|
||||
@@ -4372,6 +4376,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: '現在の会話内のユーザー質問へ移動するデスクトップ専用リストを表示します。デフォルトはオフです。',
|
||||
settings_label_hide_suggestions: '新規チャットの候補を非表示',
|
||||
settings_desc_hide_suggestions: '空の新規チャット画面に表示されるデフォルトの候補ボタン3つを非表示にして、誤タップを防ぎます。',
|
||||
settings_label_hide_empty_state_panel: '新規チャットのウェルカムパネルを非表示',
|
||||
settings_desc_hide_empty_state_panel: '空の新規会話でロゴ、見出し、サブタイトル、候補ボタンを非表示にします。',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: 'トークン使用量を表示',
|
||||
@@ -5816,6 +5822,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Показывает на рабочем столе список переходов к вопросам пользователя в текущей беседе. По умолчанию отключено.',
|
||||
settings_label_hide_suggestions: 'Скрывать подсказки нового чата',
|
||||
settings_desc_hide_suggestions: 'Скрывает три стандартные кнопки-подсказки на пустом экране нового чата, чтобы избежать случайных нажатий.',
|
||||
settings_label_hide_empty_state_panel: 'Скрывать приветственную панель нового чата',
|
||||
settings_desc_hide_empty_state_panel: 'Скрывает логотип, заголовок, подзаголовок и кнопки-подсказки в пустой новой беседе.',
|
||||
settings_label_virtualize_transcript: 'Оптимизировать длинные транскрипты',
|
||||
settings_desc_virtualize_transcript: 'Отрисовывает только видимую часть очень длинных транскриптов чата (более 80 сообщений), чтобы прокрутка была плавнее. Отключите, если заметите проблемы с отрисовкой или прокруткой либо хотите, чтобы поиск браузера (Ctrl+F) находил текст во всей беседе — тогда транскрипт будет отрисован целиком.',
|
||||
settings_label_token_usage: 'Показывать использование токенов',
|
||||
@@ -7509,6 +7517,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Muestra una lista de salto solo en escritorio para las preguntas del usuario en la conversación actual. Desactivado de forma predeterminada.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: 'Mostrar uso de tokens',
|
||||
@@ -9171,6 +9181,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Zeigt eine Desktop-Sprungliste für Benutzerfragen in der aktuellen Konversation. Standardmäßig deaktiviert.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: 'Token-Verbrauch anzeigen',
|
||||
@@ -10894,6 +10906,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: '显示仅限桌面的跳转列表,用于跳转到当前会话中的用户问题。默认关闭。',
|
||||
settings_label_hide_suggestions: '隐藏新聊天建议',
|
||||
settings_desc_hide_suggestions: '隐藏新聊天空白界面上的三个默认建议按钮,以避免误触。',
|
||||
settings_label_hide_empty_state_panel: '隐藏新聊天欢迎面板',
|
||||
settings_desc_hide_empty_state_panel: '隐藏空白新对话中的徽标、标题、副标题和建议按钮。',
|
||||
settings_label_virtualize_transcript: '对长篇聊天记录进行虚拟处理',
|
||||
settings_desc_virtualize_transcript: "对于非常长的聊天记录(超过80条消息),仅渲染可见部分,以实现更流畅的滚动。如果遇到任何渲染或滚动问题,或者希望浏览器的查找(Ctrl + F)匹配整个对话,请关闭此功能 \u2014 这样完整的聊天记录将一次性渲染出来。",
|
||||
settings_label_token_usage: '显示 token 用量',
|
||||
@@ -12870,6 +12884,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: '顯示僅限桌面的跳轉清單,用於跳轉到目前對話中的使用者問題。預設關閉。',
|
||||
settings_label_hide_suggestions: '隱藏新聊天建議',
|
||||
settings_desc_hide_suggestions: '隱藏空白新聊天畫面上的三個預設建議按鈕,避免誤觸。',
|
||||
settings_label_hide_empty_state_panel: '隱藏新聊天歡迎面板',
|
||||
settings_desc_hide_empty_state_panel: '隱藏空白新對話中的標誌、標題、副標題和建議按鈕。',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: '顯示 token 用量',
|
||||
@@ -14503,6 +14519,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Mostra uma lista de atalhos somente no desktop para as perguntas do usuário na conversa atual. Desativado por padrão.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: 'Mostrar uso de tokens',
|
||||
@@ -16142,6 +16160,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: '현재 대화의 사용자 질문으로 이동하는 데스크톱 전용 목록을 표시합니다. 기본값은 꺼짐입니다.',
|
||||
settings_label_hide_suggestions: 'Hide new-chat suggestions',
|
||||
settings_desc_hide_suggestions: 'Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.',
|
||||
settings_label_hide_empty_state_panel: 'Hide new-chat welcome panel',
|
||||
settings_desc_hide_empty_state_panel: 'Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
settings_label_token_usage: '토큰 사용량 표시',
|
||||
@@ -17896,6 +17916,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Afficher une liste de saut réservée au bureau pour les questions utilisateur dans la conversation actuelle. Désactivé par défaut.',
|
||||
settings_label_hide_suggestions: 'Masquer les suggestions de nouvelle conversation',
|
||||
settings_desc_hide_suggestions: 'Masquer les trois boutons de suggestion par défaut sur l\'écran de nouvelle conversation vide pour éviter les clics accidentels.',
|
||||
settings_label_hide_empty_state_panel: 'Masquer le panneau de bienvenue des nouvelles conversations',
|
||||
settings_desc_hide_empty_state_panel: 'Masquer le logo, le titre, le sous-titre et les boutons de suggestion dans une nouvelle conversation vide.',
|
||||
settings_label_virtualize_transcript: 'Virtualiser les longs historiques (expérimental)',
|
||||
settings_desc_virtualize_transcript: 'Expérimental. Affiche uniquement la partie visible des historiques de conversation très longs (plus de 80 messages) pour accélérer le défilement. Désactivé par défaut car cela peut causer des scintillements lors du défilement sur de longues sessions avec de gros blocs d\'appels d\'outils. Activez-le pour essayer ; désactivez-le pour afficher l\'intégralité de l\'historique à la fois (et pour que la recherche du navigateur (Ctrl+F) corresponde à toute la conversation).',
|
||||
settings_label_token_usage: 'Afficher l\'utilisation des jetons',
|
||||
@@ -19741,6 +19763,8 @@ const LOCALES = {
|
||||
settings_label_font_size: 'Velikost písma',
|
||||
settings_label_gateway_status: 'Stav Gateway',
|
||||
settings_label_hide_suggestions: 'Skrýt návrhy nového chatu',
|
||||
settings_label_hide_empty_state_panel: 'Skrýt uvítací panel nového chatu',
|
||||
settings_desc_hide_empty_state_panel: 'Skrýt logo, nadpis, podnadpis a tlačítka návrhů v prázdné nové konverzaci.',
|
||||
settings_label_ignore_agent_updates: 'Ignorovat aktualizace Agenta',
|
||||
settings_label_large_text_paste_as_attachment: 'Přiložit velký vložený text jako soubor',
|
||||
settings_label_notifications: 'Notifikace prohlížeče',
|
||||
@@ -21302,6 +21326,8 @@ const LOCALES = {
|
||||
settings_label_conversation_outline: 'Konuşma ana hattını göster',
|
||||
settings_desc_conversation_outline: 'Geçerli konuşmadaki kullanıcı soruları için yalnızca masaüstünde görünen bir atlama listesi gösterir. Varsayılan kapalıdır.',
|
||||
settings_label_hide_suggestions: 'Yeni sohbet önerilerini gizle',
|
||||
settings_label_hide_empty_state_panel: 'Yeni sohbet karşılama panelini gizle',
|
||||
settings_desc_hide_empty_state_panel: 'Boş bir yeni konuşmadaki logoyu, başlığı, alt başlığı ve öneri düğmelerini gizleyin.',
|
||||
settings_desc_hide_suggestions: 'Yanlışlıkla dokunmayı önlemek için boş yeni sohbet ekranındaki üç varsayılan öneri düğmesini gizleyin.',
|
||||
settings_label_virtualize_transcript: 'Virtualize long transcripts',
|
||||
settings_desc_virtualize_transcript: "Render only the visible portion of very long chat transcripts (over 80 messages) for smoother scrolling. Turn this off if you see any rendering or scroll issues, or want the browser's Find (Ctrl+F) to match the whole conversation \u2014 the full transcript will render at once.",
|
||||
@@ -23057,6 +23083,8 @@ const LOCALES = {
|
||||
settings_desc_conversation_outline: 'Pokazuje desktopową listę skrótów do pytań użytkownika w bieżącej konwersacji. Domyślnie wyłączone.',
|
||||
settings_label_hide_suggestions: 'Ukryj sugestie nowej konwersacji',
|
||||
settings_desc_hide_suggestions: 'Ukryj trzy domyślne przyciski sugestii na pustym ekranie nowej konwersacji, aby zapobiec przypadkowym kliknięciom.',
|
||||
settings_label_hide_empty_state_panel: 'Ukryj panel powitalny nowej konwersacji',
|
||||
settings_desc_hide_empty_state_panel: 'Ukryj logo, nagłówek, podtytuł i przyciski sugestii w pustej nowej konwersacji.',
|
||||
settings_label_virtualize_transcript: 'Wirtualizuj długie transkrypcje',
|
||||
settings_desc_virtualize_transcript: "Renderuj tylko widoczną część bardzo długich zapisów czatu (ponad 80 wiadomości) dla płynniejszego przewijania. Wyłącz to, jeśli zauważysz jakiekolwiek problemy z renderowaniem lub przewijaniem, lub chcesz, aby wyszukiwanie w przeglądarce (Ctrl+F) obejmowało całą konwersację \u2014 pełny zapis wyrenderuje się od razu.",
|
||||
settings_label_token_usage: 'Pokaż zużycie tokenów',
|
||||
@@ -24632,6 +24660,8 @@ const LOCALES = {
|
||||
settings_label_conversation_outline: 'Hiện mục lục cuộc trò chuyện',
|
||||
settings_desc_conversation_outline: 'Hiển thị danh sách nhảy nhanh cho các câu hỏi của người dùng trong cuộc trò chuyện hiện tại trên desktop. Mặc định tắt.',
|
||||
settings_label_hide_suggestions: 'Ẩn gợi ý chat mới',
|
||||
settings_label_hide_empty_state_panel: 'Ẩn bảng chào mừng cuộc trò chuyện mới',
|
||||
settings_desc_hide_empty_state_panel: 'Ẩn biểu trưng, tiêu đề, phụ đề và các nút gợi ý trong cuộc trò chuyện mới trống.',
|
||||
settings_desc_hide_suggestions: 'Ẩn ba nút gợi ý mặc định trên màn hình chat mới để tránh bấm nhầm.',
|
||||
settings_label_token_usage: 'Hiện mức sử dụng token',
|
||||
settings_label_token_speed: 'Hiện tốc độ token (TPS)',
|
||||
|
||||
@@ -1176,6 +1176,13 @@
|
||||
</label>
|
||||
<div style="font-size:11px;color:var(--muted);margin-top:4px" data-i18n="settings_desc_hide_suggestions">Hide the three default suggestion buttons on the empty new-chat screen to avoid accidental taps.</div>
|
||||
</div>
|
||||
<div class="settings-field">
|
||||
<label style="display:flex;align-items:center;gap:8px;cursor:pointer">
|
||||
<input type="checkbox" id="settingsHideEmptyStatePanel" style="width:15px;height:15px;accent-color:var(--accent)">
|
||||
<span data-i18n="settings_label_hide_empty_state_panel">Hide new-chat welcome panel</span>
|
||||
</label>
|
||||
<div style="font-size:11px;color:var(--muted);margin-top:4px" data-i18n="settings_desc_hide_empty_state_panel">Hide the logo, heading, subtitle, and suggestion buttons on an empty new conversation.</div>
|
||||
</div>
|
||||
<div class="settings-field">
|
||||
<label style="display:flex;align-items:center;gap:8px;cursor:pointer">
|
||||
<input type="checkbox" id="settingsVirtualizeTranscript" style="width:15px;height:15px;accent-color:var(--accent)">
|
||||
|
||||
@@ -8642,6 +8642,8 @@ function _preferencesPayloadFromUi(){
|
||||
if(showConversationOutlineCb) payload.show_conversation_outline=showConversationOutlineCb.checked;
|
||||
const hideSuggestionsCb=$('settingsHideSuggestions');
|
||||
if(hideSuggestionsCb) payload.hide_empty_state_suggestions=hideSuggestionsCb.checked;
|
||||
const hideEmptyStatePanelCb=$('settingsHideEmptyStatePanel');
|
||||
if(hideEmptyStatePanelCb) payload.hide_empty_state_panel=hideEmptyStatePanelCb.checked;
|
||||
const virtualizeTranscriptCb=$('settingsVirtualizeTranscript');
|
||||
if(virtualizeTranscriptCb){
|
||||
payload.virtualize_transcript=virtualizeTranscriptCb.checked;
|
||||
@@ -8795,6 +8797,10 @@ async function _autosavePreferencesSettings(payload){
|
||||
window._hideEmptyStateSuggestions=!!(saved&&saved.hide_empty_state_suggestions);
|
||||
if(typeof applyEmptyStateSuggestionPref==='function') applyEmptyStateSuggestionPref();
|
||||
}
|
||||
if(payload&&payload.hide_empty_state_panel!==undefined){
|
||||
window._hideEmptyStatePanel=!!(saved&&saved.hide_empty_state_panel);
|
||||
if(typeof applyEmptyStatePanelPref==='function') applyEmptyStatePanelPref();
|
||||
}
|
||||
if(payload&&payload.show_conversation_outline!==undefined){
|
||||
window._showConversationOutline=!!(saved&&saved.show_conversation_outline);
|
||||
document.documentElement.dataset.conversationOutline=window._showConversationOutline?'enabled':'disabled';
|
||||
@@ -9200,6 +9206,17 @@ async function loadSettingsPanel(){
|
||||
_schedulePreferencesAutosave();
|
||||
},{once:false});
|
||||
}
|
||||
const hideEmptyStatePanelCb=$('settingsHideEmptyStatePanel');
|
||||
if(hideEmptyStatePanelCb){
|
||||
hideEmptyStatePanelCb.checked=settings.hide_empty_state_panel===true;
|
||||
window._hideEmptyStatePanel=hideEmptyStatePanelCb.checked;
|
||||
if(typeof applyEmptyStatePanelPref==='function') applyEmptyStatePanelPref();
|
||||
hideEmptyStatePanelCb.addEventListener('change',()=>{
|
||||
window._hideEmptyStatePanel=hideEmptyStatePanelCb.checked;
|
||||
if(typeof applyEmptyStatePanelPref==='function') applyEmptyStatePanelPref();
|
||||
_schedulePreferencesAutosave();
|
||||
},{once:false});
|
||||
}
|
||||
const virtualizeTranscriptCb=$('settingsVirtualizeTranscript');
|
||||
if(virtualizeTranscriptCb){
|
||||
// #4343: EXPERIMENTAL/opt-IN, default OFF. Honor a stored true only when
|
||||
|
||||
@@ -2513,6 +2513,7 @@
|
||||
@keyframes pulse{0%,80%,100%{opacity:.2;transform:scale(.8)}40%{opacity:.8;transform:scale(1)}}
|
||||
.empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px;color:var(--muted);}
|
||||
.empty-state.no-suggestions .suggestion-grid{display:none}
|
||||
.empty-state.no-welcome{display:none}
|
||||
/* Empty-state brand mark: a free-breathing winged caduceus with a soft
|
||||
"spirit" bloom behind it — no app-icon tile. Glow + mark gradient are
|
||||
tuned separately for dark vs light themes (see --logo-glow / .hm-g* below). */
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
"""Regression coverage for #6160: optional hiding of the full new-chat welcome panel."""
|
||||
from pathlib import Path
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
INDEX = REPO_ROOT / "static" / "index.html"
|
||||
STYLE = REPO_ROOT / "static" / "style.css"
|
||||
PANELS = REPO_ROOT / "static" / "panels.js"
|
||||
BOOT = REPO_ROOT / "static" / "boot.js"
|
||||
I18N = REPO_ROOT / "static" / "i18n.js"
|
||||
CONFIG = REPO_ROOT / "api" / "config.py"
|
||||
|
||||
|
||||
def test_hide_welcome_panel_setting_is_default_off_and_boolean():
|
||||
src = CONFIG.read_text(encoding="utf-8")
|
||||
assert '"hide_empty_state_panel": False' in src
|
||||
assert '"hide_empty_state_panel",' in src
|
||||
|
||||
|
||||
def test_hide_welcome_panel_setting_persists_and_coerces_boolean(monkeypatch, tmp_path):
|
||||
import api.config as config
|
||||
|
||||
settings_path = tmp_path / "settings.json"
|
||||
monkeypatch.setattr(config, "SETTINGS_FILE", settings_path)
|
||||
|
||||
assert config.load_settings()["hide_empty_state_panel"] is False
|
||||
|
||||
saved = config.save_settings({"hide_empty_state_panel": True})
|
||||
assert saved["hide_empty_state_panel"] is True
|
||||
assert json.loads(settings_path.read_text(encoding="utf-8"))["hide_empty_state_panel"] is True
|
||||
|
||||
saved = config.save_settings({"hide_empty_state_panel": 0})
|
||||
assert saved["hide_empty_state_panel"] is False
|
||||
assert config.load_settings()["hide_empty_state_panel"] is False
|
||||
|
||||
|
||||
def test_preferences_expose_hide_welcome_panel_toggle():
|
||||
html = INDEX.read_text(encoding="utf-8")
|
||||
assert 'id="settingsHideEmptyStatePanel"' in html
|
||||
assert 'data-i18n="settings_label_hide_empty_state_panel"' in html
|
||||
assert 'data-i18n="settings_desc_hide_empty_state_panel"' in html
|
||||
|
||||
|
||||
def test_empty_state_has_non_important_full_panel_hide_hook():
|
||||
css = STYLE.read_text(encoding="utf-8")
|
||||
assert ".empty-state.no-welcome{display:none}" in css
|
||||
assert ".empty-state.no-welcome{display:none!important}" not in css
|
||||
|
||||
|
||||
def _boot_function(boot: str, name: str) -> str:
|
||||
start = boot.index(f"function {name}()")
|
||||
end = boot.index("\n}\n", start) + 2
|
||||
return boot[start:end]
|
||||
|
||||
|
||||
def test_boot_preference_hides_and_restores_the_panel_observably():
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "node is required for the frontend behavior harness"
|
||||
|
||||
boot = BOOT.read_text(encoding="utf-8")
|
||||
function_src = _boot_function(boot, "applyEmptyStatePanelPref")
|
||||
harness = f"""
|
||||
const vm=require('vm');
|
||||
const classes=new Set();
|
||||
const emptyState={{classList:{{
|
||||
toggle(name, enabled){{ if(enabled) classes.add(name); else classes.delete(name); }},
|
||||
contains(name){{ return classes.has(name); }}
|
||||
}}}};
|
||||
const sandbox={{window:{{_hideEmptyStatePanel:false}}, $:(id)=>id==='emptyState'?emptyState:null}};
|
||||
vm.createContext(sandbox);
|
||||
vm.runInContext({json.dumps(function_src)},sandbox);
|
||||
sandbox.applyEmptyStatePanelPref();
|
||||
if(emptyState.classList.contains('no-welcome')) throw new Error('default-off hid the panel');
|
||||
sandbox.window._hideEmptyStatePanel=true;
|
||||
sandbox.applyEmptyStatePanelPref();
|
||||
if(!emptyState.classList.contains('no-welcome')) throw new Error('enabled preference did not hide the panel');
|
||||
sandbox.window._hideEmptyStatePanel=false;
|
||||
sandbox.applyEmptyStatePanelPref();
|
||||
if(emptyState.classList.contains('no-welcome')) throw new Error('disabling preference did not restore the panel');
|
||||
"""
|
||||
subprocess.run([node, "-e", harness], check=True, capture_output=True, text=True)
|
||||
|
||||
assert "window._hideEmptyStatePanel=s.hide_empty_state_panel===true" in boot
|
||||
assert "window._hideEmptyStatePanel=false" in boot
|
||||
|
||||
|
||||
def test_restoring_panel_preserves_independent_hide_suggestions_preference():
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "node is required for the frontend behavior harness"
|
||||
|
||||
boot = BOOT.read_text(encoding="utf-8")
|
||||
functions = "\n".join(
|
||||
_boot_function(boot, name)
|
||||
for name in ("applyEmptyStateSuggestionPref", "applyEmptyStatePanelPref")
|
||||
)
|
||||
harness = f"""
|
||||
const vm=require('vm');
|
||||
const classes=new Set();
|
||||
const emptyState={{classList:{{toggle(name,enabled){{if(enabled)classes.add(name);else classes.delete(name);}}}}}};
|
||||
const sandbox={{window:{{_hideEmptyStateSuggestions:true,_hideEmptyStatePanel:true}},$:(id)=>id==='emptyState'?emptyState:null}};
|
||||
vm.createContext(sandbox);
|
||||
vm.runInContext({json.dumps(functions)},sandbox);
|
||||
sandbox.applyEmptyStateSuggestionPref();
|
||||
sandbox.applyEmptyStatePanelPref();
|
||||
if(!classes.has('no-suggestions')||!classes.has('no-welcome')) throw new Error('combined state was not applied');
|
||||
sandbox.window._hideEmptyStatePanel=false;
|
||||
sandbox.applyEmptyStatePanelPref();
|
||||
if(classes.has('no-welcome')) throw new Error('panel was not restored');
|
||||
if(!classes.has('no-suggestions')) throw new Error('restoring panel lost the suggestions preference');
|
||||
"""
|
||||
subprocess.run([node, "-e", harness], check=True, capture_output=True, text=True)
|
||||
|
||||
|
||||
def test_panels_round_trip_and_hot_apply_hide_welcome_panel():
|
||||
js = PANELS.read_text(encoding="utf-8")
|
||||
assert "payload.hide_empty_state_panel=hideEmptyStatePanelCb.checked;" in js
|
||||
assert "hideEmptyStatePanelCb.checked=settings.hide_empty_state_panel===true;" in js
|
||||
assert "window._hideEmptyStatePanel=hideEmptyStatePanelCb.checked;" in js
|
||||
assert "if(typeof applyEmptyStatePanelPref==='function') applyEmptyStatePanelPref();" in js
|
||||
|
||||
|
||||
def test_hide_welcome_panel_copy_covers_every_locale():
|
||||
js = I18N.read_text(encoding="utf-8")
|
||||
assert js.count("settings_label_hide_empty_state_panel:") == 15
|
||||
assert js.count("settings_desc_hide_empty_state_panel:") == 15
|
||||
assert "settings_label_hide_empty_state_panel: 'Ukryj panel powitalny nowej konwersacji'" in js
|
||||
Reference in new issue
Block a user