fix(island,classisland,server,desktop,plugin): 灵动岛去掉整窗背景材质(修卡片外圈白底面板)+ 左右边距只在左/右停靠生效 + 镜像课表补课间

- 灵动岛:移除 win.setBackgroundMaterial() 与 applyBackgroundMaterial/getBackgroundMaterial。它把系统材质刷在整个窗口矩形上(岛是"固定大包围盒窗口",卡片外还有留白),且明暗跟随应用的浅色主题 → 卡片周围出现一圈浅色面板;更糟的是调用过一次(含 none)后窗口就回不到逐像素透明,从 glass 切到 black/tinted 会永久留一圈纯白。glass 因此改为纯 CSS 半透明深色卡(WinIsland 拿不到 host backdrop 时的降级色 rgba(32,32,36,.804))
- 回归用例:新增「个性设置:卡片外圈透出桌面(三种风格都没有白底面板)」——整屏截图取样,并在岛底下垫一块已知颜色底板,让"环 = 底板色"可被精确断言(webContents.capturePage() 拍不到窗口之后的材质,是当初漏掉这个 bug 的原因)
- 边距:左右边距只在"左/右停靠"时生效(默认顶部居中时水平锚点就是屏幕中线),设置页把该滑块置灰并说明,避免被当成"调了不生效"
- 课间:镜像回 ClassIsland 的课表改为每两节之间补一段课间、最后一节之后不补(放学);服务端 synthesizeTimeLayout 同口径,不再依赖导入的时间表里有没有课间点
- 文档:README / AGENTS.md / docs/winisland-design-tokens.md / 插件 README 同步

门禁:pnpm lint 0 error、pnpm typecheck 四包通过。未跑:verify:desktop(需先 build:desktop)、verify:e2e / verify:classisland(需后端启动)。
This commit is contained in:
LoveChengke committed 2026-09-27 18:08:51 +08:00
1 parent 7536abfc95
commit 5c27586af9
12 files changed
+678 -141

No files matched your search

@@ -662,7 +662,12 @@ function parseStoredTimeLayout(raw: string): { startTime: string; endTime: strin
}
}
/** 没有导入节次时间表时,用当天课表里出现过的起止时间合成一份(去重并按时间排序) */
/**
* 没有导入节次时间表时,用课表里出现过的起止时间合成一份(去重、按时间排序)。
*
* **每节课之间补一个课间**(timeType=1:上一节下课 → 下一节上课),最后一节之后不补(放学)。
* 班级小助手这边的节次时间表与 ClassIsland 档案保持同一口径,镜像过去才不会缺课间。
*/
function synthesizeTimeLayout(
schedules: { startTime: string; endTime: string }[],
): { startTime: string; endTime: string; timeType: number }[] {
@@ -670,9 +675,22 @@ function synthesizeTimeLayout(
for (const item of schedules) {
if (!seen.has(item.startTime)) seen.set(item.startTime, item.endTime);
}
return [...seen.entries()]
const classPoints = [...seen.entries()]
.sort((a, b) => a[0].localeCompare(b[0]))
.map(([startTime, endTime]) => ({ startTime, endTime, timeType: 0 }));
const items: { startTime: string; endTime: string; timeType: number }[] = [];
for (let index = 0; index < classPoints.length; index += 1) {
const point = classPoints[index]!;
items.push(point);
const next = classPoints[index + 1];
if (!next) continue; // 最后一节之后是放学,不插课间
if (next.startTime > point.endTime) {
items.push({ startTime: point.endTime, endTime: next.startTime, timeType: 1 });
}
}
return items;
}
/* ------------------------------------------------------------------ 供仪表盘/统计使用 */