fix(promptlib): v1.12.1 变量标签列定宽 6 字,输入框左边缘对齐
validate / validate (push) Canceled after 0s

用户截图:三个变量名「风格 / 女生 / 价格与利益点」长短不一,标签列 flex:0 0 auto
跟着文字宽度走 ⇒ 每行 textarea 左边缘不齐,看着散。

- .iwb-plp-nk 改 flex:0 0 76px + width/max-width 76px(12px 字号 × 6 字 + 4px 余量),
  定宽后四行输入框左边缘实测同为 508.66px;6 字名称完整显示,超 6 字省略号截断,
  完整名称仍在 title 里
- 名称框 placeholder 改为「变量名称(节点上最多显示 6 字)」,说明为什么长名会被省略
- harness 61 项(新增 2 项:定宽不被改回 auto、提示文案在位)
This commit is contained in:
qiqi committed 2026-11-24 18:11:16 +08:00
1 parent 4092eb5437
commit 48d86f3e0f
4 files changed
+18 -9

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@iwb-plugin/promptlib",
"private": true,
"version": "1.12.0",
"version": "1.12.1",
"description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供",
"ibwPlugin": {
"id": "promptlib",
+2 -2
View File
@@ -1191,7 +1191,7 @@
if (longVarKey(v.key)) {
item.appendChild(el('div', { class: 'iwb-plp-vtip', text: '这个变量的占位符是正文里的一整句,已把原句放进「内容」;建议把「占位符」改成短名(如 变量1),正文会同步替换。' }))
}
var nameIn = el('input', { class: 'iwb-input iwb-plp-vname', placeholder: '变量名称(如:顶部金色边)' })
var nameIn = el('input', { class: 'iwb-input iwb-plp-vname', placeholder: '变量名称(节点上最多显示 6 字)' })
nameIn.value = v.label || ''
nameIn.addEventListener('input', function () { v.label = nameIn.value })
item.appendChild(field('名称', nameIn))
@@ -2117,7 +2117,7 @@
global.IWBPluginHost.register({
id: 'promptlib',
name: '提示词库',
version: '1.12.0',
version: '1.12.1',
apiVersion: 1,
capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite'],
data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 },
+5 -2
View File
@@ -147,9 +147,12 @@
.iwb-plp-ntitle{font-weight:600;font-size: 13px;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.iwb-plp-nvars{display:flex;flex-direction:column;gap:4px}
/* v1.12.0:变量行从固定 26px 单行改为「上限 5 行自适应」—— 标签贴首行顶部对齐,
输入框换 textarea 后由 autoGrowArea() 写 height,这里只兜底最小高度。 */
输入框换 textarea 后由 autoGrowArea() 写 height,这里只兜底最小高度。
v1.12.1:标签列定宽 76px(12px 字号 × 6 字 + 4px 余量)。此前是 flex:0 0 auto,
宽度跟着名称长短变 ⇒ 每个变量输入框左边缘错位(用户截图指出不美观)。
超过 6 字的名称省略号截断,完整名称在 title 里。 */
.iwb-plp-nrow{display:flex;align-items:flex-start;gap:6px;min-height:26px}
.iwb-plp-nk{flex:0 0 auto;max-width:96px;padding-top:4px;color:var(--iwb-text2,#5b6472);font-size: 12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-nk{flex:0 0 76px;width:76px;max-width:76px;padding-top:4px;color:var(--iwb-text2,#5b6472);font-size: 12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-nin{flex:1 1 auto;min-width:0;height:auto;min-height:24px;padding:2px 8px;line-height:1.5;font-size: 12px;resize:none;overflow-y:hidden}
.iwb-plp-nref{display:flex;align-items:center;gap:6px;font-size: 12px;color:var(--iwb-text2,#5b6472);border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px}
.iwb-plp-nref em{font-style:normal;color:var(--iwb-text2,#8b929c)}
+10 -4
View File
@@ -20,9 +20,9 @@ const ok = (name, cond) => {
}
// ---- 1) 版本 / manifest ----
ok("manifest.version = 1.12.0", /version:\s*'1\.12\.0'/.test(src))
ok('package.json version = 1.12.0',
JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8')).version === '1.12.0')
ok("manifest.version = 1.12.1", /version:\s*'1\.12\.1'/.test(src))
ok('package.json version = 1.12.1',
JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8')).version === '1.12.1')
ok('manifest 已移除「分享时附带封面图片」开关声明',
!/shareWithCover:\s*\{\s*type:\s*'boolean'/.test(src))
ok('源码不再定义/读取 shareWithCover 设置',
@@ -163,7 +163,7 @@ ok('长句插入不再当占位符(旧实现 slice(0,24) 已移除)',
ok('长句插入把原文交给内容框 + 展开并聚焦名称',
src.includes('varEd.preset(name, { def: picked })') && src.includes("open[key] = true"))
ok('编辑器四个字段齐全(名称/内容/说明/占位符)',
src.includes("'变量名称(如:顶部金色边)'") &&
src.includes("'变量名称(节点上最多显示 6 字)'") &&
src.includes("class: 'iwb-input iwb-plp-vdef', rows: '1'") &&
src.includes('说明(会作为节点输入框的占位提示)') &&
src.includes("class: 'iwb-input iwb-plp-vkey'"))
@@ -185,5 +185,11 @@ ok('样式:收起态摘要与三角已定义',
ok('样式:内容多行框自适应(overflow 由 JS 控制)',
css.includes('.iwb-plp-vdef{height:auto;min-height:30px'))
ok('v1.12.1 节点变量标签列定宽 6 字(76px),输入框左边缘才对齐',
css.includes('.iwb-plp-nk{flex:0 0 76px;width:76px;max-width:76px') &&
!css.includes('.iwb-plp-nk{flex:0 0 auto'))
ok('v1.12.1 名称框提示说明「节点上最多显示 6 字」',
src.includes("'变量名称(节点上最多显示 6 字)'"))
console.log(failed ? ('✗ ' + failed + ' 项失败') : '✓ 全部通过')
if (failed) process.exitCode = 1