feat(feedback): несколько шаблонов промпта у пользователя

user_settings.feedback_prompts: JSON {active, items:[{id,name,text}]}, до 20
шаблонов, валидация normalizePromptTemplates(). Активный шаблон зеркалируется
в feedback_prompt на стороне сервера, поэтому resolveFeedbackPrompt() воркера
не меняется. UI — селект, имя и кнопки «Новый/Удалить» над #fbPromptText,
старый единственный промпт превращается в первый шаблон при первом открытии.
This commit is contained in:
dev
2026-10-08 16:25:41 +03:00
parent 355feb234b
commit 2b60a69bd4
4 changed files with 149 additions and 9 deletions
+11
View File
@@ -28,6 +28,11 @@
.fb-keys-details[open] summary { border-bottom:1px solid var(--border); }
.fb-keys-details .fb-keys-body { display:flex; flex-direction:column; gap:10px; padding:12px 14px; }
#fbPromptText { min-height:48vh; resize:vertical; }
.fb-tpl-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.fb-tpl-row #fbPromptTpl { flex:1 1 220px; min-width:180px; }
.fb-tpl-row #fbPromptTplName { flex:1 1 180px; min-width:150px; }
.fb-tpl-row button { flex:none; }
.fb-tpl-row button:disabled { opacity:.5; cursor:default; }
#fbPromptModal { overflow:auto; align-items:flex-start; padding:4vh 16px; }
#fbPromptModal > .edit-modal { margin:auto; }
.feedback-item { position:relative; }
@@ -209,6 +214,12 @@
</div>
<div class="settings-field">
<label>Шаблон промпта</label>
<div class="fb-tpl-row">
<select id="fbPromptTpl" class="settings-input"></select>
<input type="text" id="fbPromptTplName" class="settings-input" maxlength="100" placeholder="Название шаблона">
<button type="button" class="btn-primary ghost" id="fbPromptTplAdd">+ Новый шаблон</button>
<button type="button" class="btn-primary ghost" id="fbPromptTplDel">Удалить</button>
</div>
<textarea id="fbPromptText" class="settings-input" rows="24" maxlength="15000" placeholder="Загрузка…"></textarea>
<div class="hint"><span id="fbPromptCount">0 / 15000</span> · Пусто — используется системный шаблон</div>
</div>