fix: 优化字数更改设置

This commit is contained in:
Daniel
2026-04-21 13:41:35 +08:00
parent d76c7fa25a
commit 1bbabc2a78
3 changed files with 60 additions and 17 deletions

View File

@@ -63,11 +63,11 @@ SYSTEM_PROMPT_TEMPLATE = """
REWRITE_SCHEMA_HINT_TEMPLATE = """
请输出 JSON勿包在 ``` 里),例如:
{
{{
"title": "短标题,点明主题",
"summary": "一句话到两句话摘要",
"body_markdown": "第一段内容…\\n\\n第二段…\\n\\n第三段…\\n\\n第四段…\\n\\n第五段…"
}
}}
body_markdown 写法:
- 使用 **4~6 段**:每段若干完整句子,段之间 **\\n\\n**(空一行);

View File

@@ -327,17 +327,34 @@ label {
margin-top: 4px;
}
.target-chars-inline {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.target-chars-inline #targetBodyChars {
width: 110px;
flex: 0 0 110px;
}
.target-chars-quick {
display: flex;
gap: 8px;
margin-top: 8px;
flex-wrap: wrap;
gap: 6px;
margin-top: 0;
flex-wrap: nowrap;
max-width: 100%;
min-width: 0;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
}
.target-char-chip {
width: auto;
margin-top: 0;
padding: 4px 10px;
padding: 4px 8px;
border-radius: 999px;
border: 1px solid #cbd5e1;
background: #fff;
@@ -345,6 +362,7 @@ label {
font-size: 12px;
font-weight: 700;
line-height: 1.5;
flex: 0 0 auto;
}
.target-char-chip:hover {
@@ -357,6 +375,10 @@ label {
color: var(--accent-2);
}
.target-chars-block {
width: 100%;
}
.meta {
color: var(--muted);
font-size: 12px;
@@ -428,6 +450,24 @@ button:disabled {
opacity: 0.65;
}
/* 覆盖全局 button 宽度,确保快捷字数按钮始终横向紧凑排列 */
.target-chars-quick {
display: flex;
flex-wrap: nowrap;
align-items: center;
}
.target-chars-quick .target-char-chip,
button.target-char-chip {
width: auto;
min-width: 56px;
margin-top: 0;
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
}
.actions {
display: grid;
grid-template-columns: 1fr 1fr;

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ app_name }}</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=20260406a" />
<link rel="stylesheet" href="/static/style.css?v=20260410d" />
<link rel="stylesheet" href="/static/style.css?v=20260421a" />
</head>
<body>
<header class="topbar">
@@ -91,18 +91,21 @@
</div>
</div>
<label>必须保留观点</label>
<input id="keepPoints" type="text" placeholder="逗号分隔" />
<div class="grid2">
<div>
<label>必须保留观点</label>
<input id="keepPoints" type="text" placeholder="逗号分隔" />
</div>
<div class="target-chars-block">
<label>改写目标字数</label>
<input id="targetBodyChars" type="number" min="180" max="2200" step="10" value="500" placeholder="如500" />
<div class="target-chars-quick" aria-label="快捷字数">
<button type="button" class="target-char-chip" data-target-chars="300">300</button>
<button type="button" class="target-char-chip is-active" data-target-chars="500">500</button>
<button type="button" class="target-char-chip" data-target-chars="800">800</button>
<button type="button" class="target-char-chip" data-target-chars="1200">1200</button>
<div class="target-chars-inline">
<input id="targetBodyChars" type="number" min="180" max="2200" step="10" value="500" placeholder="如500" />
<div class="target-chars-quick" aria-label="快捷字数">
<button type="button" class="target-char-chip" data-target-chars="300">300</button>
<button type="button" class="target-char-chip is-active" data-target-chars="500">500</button>
<button type="button" class="target-char-chip" data-target-chars="800">800</button>
<button type="button" class="target-char-chip" data-target-chars="1200">1200</button>
</div>
</div>
</div>
</div>
@@ -156,6 +159,6 @@
</main>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="/static/app.js?v=20260410d"></script>
<script src="/static/app.js?v=20260421a"></script>
</body>
</html>