Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/web/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4126,10 +4126,13 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " +
const baseSel = document.createElement("select");
baseSel.id = "pack-base-sel";
baseSel.className = "field-input";
[["", "cfg.q_pack_base_blank"], ["default", "cfg.q_pack_base_default"], ["chat", "cfg.q_pack_base_chat"], ["lean", "cfg.q_pack_base_lean"]].forEach((pair) => {
// #5345 follow-up: keep labels as literal t("…") calls — the #1024
// dead-key guard only counts string-literal arguments, so the old
// array + variable-lookup shape hid all four keys (CI red on master).
[["", t("cfg.q_pack_base_blank")], ["default", t("cfg.q_pack_base_default")], ["chat", t("cfg.q_pack_base_chat")], ["lean", t("cfg.q_pack_base_lean")]].forEach(([value, label]) => {
const opt = document.createElement("option");
opt.value = pair[0];
opt.textContent = t(pair[1]);
opt.value = value;
opt.textContent = label;
baseSel.appendChild(opt);
});
const btnBaseLoad = document.createElement("button");
Expand All @@ -4148,14 +4151,14 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " +
descIn.placeholder = t("cfg.q_pack_desc_ph");
descIn.style.cssText = "width:100%;box-sizing:border-box";
descWrap.append(descLab, descIn);
function packSectionField(labelKey, helpKey, rows) {
function packSectionField(label, helpText, rows) {
const wrap = document.createElement("div");
wrap.style.cssText = "margin:8px 0";
const lab = document.createElement("div");
lab.textContent = t(labelKey);
lab.textContent = label;
lab.style.cssText = "font-size:13px;font-weight:600;margin-bottom:2px";
const help = document.createElement("div");
help.textContent = t(helpKey);
help.textContent = helpText;
help.style.cssText = "font-size:12px;color:#57606a;margin-bottom:4px";
const ta = document.createElement("textarea");
ta.className = "field-input mono";
Expand All @@ -4165,8 +4168,8 @@ if (d.keepalive) kv(parts, t("det.keepalive"), d.keepalive.tierLabel + " · " +
wrap.append(lab, help, ta);
return { wrap, ta };
}
const phF = packSectionField("cfg.q_pack_phil", "cfg.q_pack_phil_help", 5);
const hcF = packSectionField("cfg.q_pack_hc", "cfg.q_pack_hc_help", 8);
const phF = packSectionField(t("cfg.q_pack_phil"), t("cfg.q_pack_phil_help"), 5);
const hcF = packSectionField(t("cfg.q_pack_hc"), t("cfg.q_pack_hc_help"), 8);
const taPh = phF.ta;
const taHc = hcF.ta;
const formHint = document.createElement("div");
Expand Down
2 changes: 1 addition & 1 deletion src/web/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ export const MESSAGES: Record<Locale, Record<string, string>> = {
"cfg.q_pack_ai_apply_ok": "Parsed and filled into the form; the full JSON is synced to the Advanced (JSON) tab",
"cfg.q_pack_ai_extra": "The model also returned advanced fields: {names} — kept in the Advanced (JSON) tab and saved with the pack",
"cfg.q_pack_json_obj": "the pasted content must be a single JSON object",
"cfg.q_pack_ai_p1": "You are helping me customize a compression prompt pack for billion-context. My scenario and requirements:",
"cfg.q_pack_ai_p1": "You are helping me customize a compression prompt pack for billion-context. My scenario and requirements are as follows: {need}",
"cfg.q_pack_ai_p2": "Write the JSON in bili-pack.json shape. Top-level object may contain: name (optional; lowercase letters/digits and ._- ; omit if unwanted), description (optional; one plain-sentence purpose), promptSections (object; at least one of): philosophy — the stance summaries take, what to keep first, what must never be lost; howToCompress — concrete summary-writing rules: structure, granularity, timeline requirements.",
"cfg.q_pack_ai_p3": "Rules: 1. Content must fit my concrete scenario — no generic filler; 2. The readers of both sections are the AI model itself — clear imperative bullet-style sentences; 3. If a section adds no value for my scenario, OMIT that key entirely (omitted = system defaults stay) instead of writing an empty string; 4. Output ONLY one JSON object — no markdown fences, no comments, no prose.",
"cfg.q_pck": "prompt_cache_key self-stamping (promptCache.routing)",
Expand Down
Loading