feat: 完善 AI 对话、每日作息与课件目录体验

新增持久化对话、追问卡片和轮次导航;支持每日子时间表、切换保留课程与自动课间;完善课件逐层目录、学期周次同步及两端自适应。同步迁移、文档和回归截图。

验证:后端 262/262、AI 55 项、Web 81/81、桌面 71/71、授权 23 项;构建、类型、Lint 与文档检查通过。
This commit is contained in:
LoveChengke committed 2026-11-08 09:07:10 +08:00
1 parent cdb64c5499
commit 9351203deb
59 files changed
+1277 -149

No files matched your search

@@ -83,6 +83,59 @@ export async function runQuickSmoke(win: BrowserWindow): Promise<void> {
return result.detail;
});
}
await check('主窗口最小与常规尺寸、深浅主题及关怀字号无页面横向溢出', async () => {
const bounds = win.getContentBounds();
const appearance = await win.webContents.executeJavaScript(
`({className:document.documentElement.className,style:document.documentElement.getAttribute('style')})`,
);
const shots = path.resolve(app.getAppPath(), '../../docs/screenshots/desktop-responsive');
fs.mkdirSync(shots, { recursive: true });
await win.webContents.executeJavaScript('window.__classhelperSmoke__.islandEditorSmoke(true)');
try {
for (const [width, height] of [
[1000, 540],
[1242, 582],
[1920, 1080],
])
for (const theme of ['light', 'dark']) {
win.setContentSize(width!, height!);
await win.webContents.executeJavaScript(
`document.documentElement.classList.toggle('dark',${theme === 'dark'});document.documentElement.classList.toggle('care-mode',${theme === 'dark'});document.documentElement.style.setProperty('--ch-font-scale',${JSON.stringify(theme === 'dark' ? '1.5' : '1')})`,
);
for (const route of [
'/schedule',
'/homeworks',
'/notifications',
'/grades',
'/courseware',
'/settings/general',
'/settings/appearance',
'/settings/island',
'/settings/island/editor',
'/settings/reminder',
'/settings/account',
'/settings/about',
]) {
await win.webContents.executeJavaScript(`location.hash=${JSON.stringify('#' + route)}`);
await new Promise((resolve) => setTimeout(resolve, 150));
if (
!(await win.webContents.executeJavaScript('document.documentElement.scrollWidth<=innerWidth+1'))
)
throw new Error(`${route} ${width} ${theme} 页面溢出`);
}
fs.writeFileSync(
path.join(shots, `main-${width}-${theme}.png`),
(await win.webContents.capturePage()).toPNG(),
);
}
} finally {
await win.webContents.executeJavaScript(
`document.documentElement.className=${JSON.stringify(appearance.className)};document.documentElement.setAttribute('style',${JSON.stringify(appearance.style || '')});window.__classhelperSmoke__.islandEditorSmoke(false)`,
);
win.setContentSize(bounds.width, bounds.height);
}
return '1000×540、1242×582、1920×1080,截图保存在 docs/screenshots/desktop-responsive';
});
await verifyAgentSmoke(check);
await verifyLayoutSmoke(check);
await verifyCoursewareSmoke(check);
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { countDates } from '@classhelper/ui';
import { countDates, CoursewareFolders } from '@classhelper/ui';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { ElMessage } from 'element-plus';
import {
@@ -24,11 +24,16 @@ async function refreshLocal() {
// 两个来源的教师与目录不通用,切换时清空,避免看到空列表却找不到原因。
watch(library, () => {
teacher.value = '';
folderPath.value = '';
folderOwner.value = '';
});
const items = ref<CoursewareDto[]>([]),
loading = ref(false),
offline = ref(false),
error = ref('');
const folderPath = ref(''),
folderOwner = ref(''),
grouping = ref('folder');
const query = ref(''),
category = ref(''),
date = ref(''),
@@ -38,6 +43,11 @@ const dateSource = computed(() =>
source.value.filter(
(item) =>
(!query.value || `${item.name} ${item.teacher.name}`.includes(query.value)) &&
(grouping.value !== 'folder' ||
((item.folderPath || '') === folderPath.value &&
(folderOwner.value
? item.teacher.id === folderOwner.value
: new Set(items.value.map((i) => i.teacher.id)).size <= 1))) &&
(!category.value || item.category === category.value) &&
(!teacher.value || item.teacher.name === teacher.value),
),
@@ -112,6 +122,16 @@ onUnmounted(() => {
</script>
<template>
<div class="page courseware-page">
<el-radio-group v-model="grouping">
<el-radio-button value="folder">文件夹</el-radio-button>
<el-radio-button value="date">日期归档</el-radio-button>
</el-radio-group>
<CoursewareFolders
v-if="grouping === 'folder'"
v-model:path="folderPath"
v-model:owner="folderOwner"
:items="source"
/>
<header class="page-header">
<div>
<h2 class="page-title">课件</h2>
@@ -219,7 +219,7 @@ onMounted(async () => {
}
.about-extra {
margin-left: auto;
margin-left: 12px;
margin-right: 12px;
font-size: 12px;
font-weight: 400;