Files
ClassIsland Prompt Kit 22c1784bab feat: ClassIsland / ClassHelper 灵动岛提示词套件
- 重构版主提示词(14 parts,面向 ClassHelper 灵动岛重构)
- ClassIsland 全量规格提示词(20 parts,含分卷与逐章版本)
- 投喂指南、分卷、逐节文件
- 调研记录、一致性基线、生成与质检脚本
2026-11-12 21:59:58 +08:00

21 lines
2.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { readFileSync, writeFileSync } from 'node:fs';
const p = 'parts-r/07-island-components.md';
let t = readFileSync(p, 'utf8');
const oldS = `- 窗口几何(固定包围盒,开合时不动):
- 宽 = 行内容自然宽 + 2 × 12(行内边距)+ 2 × \`ISLAND_SHADOW_PAD\`(=10,\`packages/shared/src/constants.ts:351\`);
- **高恒为 40 + 2 × \`ISLAND_SHADOW_PAD\`**(无消息 / 有消息都一样;气泡在行内,不改变窗口高度);
- 只在"行宽跨档"、显示器/DPI 变化或"窗口不可见"时 \`setBounds\`(沿用 \`applyWindowLayout\` 的比较逻辑,\`main/island.ts:1598-1612\`)。
- 行宽/内容宽必须由渲染层测量后上报:\`reportSize({ width, height })\`(\`CustomIslandRuntime.vue:255\`)+ \`setHitRect\`(\`IslandApp.vue:421-454\`),主进程**不得**自行猜内容尺寸。
- 气泡宽度上限 **720**【推断:按 1080p 下 ClassIsland 岛常用宽度取整】;超宽时课程表按 \`settings.count\` 截断(7.4.5),气泡正文最多 2 行(7.2.8)。`;
const newS = `- 窗口几何(**预置固定包围盒**,开合/消息变化时都不改窗口尺寸):
- **宽 = min(目标显示器工作区宽, 960) DIP**(960 为本实现的岛内容上限;行内容在窗口内按停靠位对齐、超出截断);**不得**按"行内容自然宽"逐次扩缩窗口;
- **高 = 40 + 2 × 20 = 80 DIP**(20 = ClassIsland Fluent 安全区/阴影余量;行高 40 恒不变,气泡、正文 2 行、进度条都在 40 行内完成);
- **只在显示器/DPI 变化、停靠/偏移设置变化、窗口不可见时**重算 \`setBounds\`;行内容变化(课程名、秒数、消息出现/收起)**禁止**改窗口尺寸(\`main/island.ts:1598-1612\` 的比较逻辑仅用于上述设置变化);
- 可见行背景宽度 = 行内容自然宽(≤ 窗口宽),水平对齐按停靠位:左/中/右;行背景之外是透明余量,用户不可见。
- 行宽/内容宽仍必须由渲染层测量后上报(\`reportSize\`/\`setHitRect\`,\`CustomIslandRuntime.vue:255\`、\`IslandApp.vue:421-454\`),用于**行背景宽度、截断与命中矩形**,不用于改窗口尺寸。
- 气泡宽度上限 **720**【推断:按 1080p 下 ClassIsland 岛常用宽度取整】;超宽时课程表按 \`settings.count\` 截断(7.4.5),气泡正文最多 2 行(7.2.8)。`;
if (!t.includes(oldS)) throw new Error('未找到 7.1.2 fixed 窗口几何段');
t = t.replace(oldS, newS);
writeFileSync(p, t, 'utf8');
console.log('07 fixed geometry patched');