Compare commits
4 Commits
795f9730f8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| bfab0579a7 | |||
| 35cabb37b2 | |||
| 9dae003b93 | |||
| f68b4f7c6f |
@@ -17,3 +17,4 @@ android/.gradle/
|
||||
android/local.properties
|
||||
android/app/build/
|
||||
android/build/
|
||||
dist/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
细粒度个人日程 + AI 自然语言排程 + 自部署多设备同步。
|
||||
|
||||
当前进度:**阶段 0–4 + 搜索 / 重复日程 / Windows 安装包 / 界面动画 + 桌面日程提醒 + Android 同步客户端 v1**。
|
||||
当前进度:**阶段 0–4 + 搜索 / 重复日程 / 长期项目 / 完成汇总 / Windows 安装包 / Linux AppImage / 界面动画 + 桌面日程提醒 + Android 同步客户端 v1**。
|
||||
本地模型 50 条指令回归已完成:完整 49/50(98%),失败项 #42 单独复测通过。
|
||||
详细计划见 [`docs/PLAN.md`](docs/PLAN.md),验证记录见 [`docs/validation/`](docs/validation/)。
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
- **系统托盘**:关闭紧凑窗口时最小化到托盘;托盘可显示主窗口、新建日程、退出。
|
||||
- **智能增强**:今日任务面板显示主动建议;日视图绘制幽灵时间;提供每日复盘对话框。
|
||||
- **搜索与重复**:详细日程支持标题/说明搜索(`Ctrl+F`);新建日程可设置每天/每周/每月重复。
|
||||
- **长期项目**:跨多天的模糊截止目标独立显示,可手工创建,也可由 AI 从自然语言中识别创建。
|
||||
- **轻量动画**:窗口淡入、视图切换淡入、任务列表刷新与 Diff 卡片淡入。
|
||||
- **设置**:主题(跟随系统/浅色/深色)、ElaMica 云母效果、AI 接口地址/模型/API Key、日程提前提醒分钟数、同步服务地址/开关。
|
||||
|
||||
@@ -82,11 +83,31 @@
|
||||
|
||||
限制:应用必须仍在运行(可最小化到托盘);没有开机自启;轮询不是精确闹钟;同一时间块提醒状态只保存在内存中,重启后可能再次提醒。
|
||||
|
||||
## 长期项目
|
||||
|
||||
长期项目是独立于细碎时间块的高层目标,例如「一个月内完成飞行控制器项目」。
|
||||
|
||||
- 新建日程区域旁的文件夹按钮可手工创建项目:标题、说明、模糊截止日期。
|
||||
- 今日任务面板顶部显示「长期项目」区,展示剩余天数/逾期状态;点击编辑,菜单可标记完成或删除。
|
||||
- AI 会把跨多天、数周或数月的目标识别为 `project`,在 Diff 卡片中显示为「长期项目」,接受后写入项目表,不会占用某一天的时间块。
|
||||
- 长期项目通过同步变更流同步到其他桌面端;Android 当前只展示,不提供创建/编辑。
|
||||
- 项目截止日期是日期级模糊值,不参与精力曲线、幽灵时间或自动排程。
|
||||
|
||||
## 已完成汇总
|
||||
|
||||
今日任务面板标题旁的奖牌按钮打开「已完成汇总」:
|
||||
|
||||
- 可选择本周 / 本月 / 全部范围。
|
||||
- 统计已完成短期任务数、累计专注时长、已完成长期项目数、连续完成天数。
|
||||
- 分别列出已完成的短期任务和长期项目,带完成时间和截止日期。
|
||||
- Android 菜单也提供「已完成汇总」,展示同类统计和最近完成记录。
|
||||
|
||||
## 同步冲突行为
|
||||
|
||||
同步是后台无感进行的:不弹冲突对话框,失败自动重试,状态只显示在顶部标签。
|
||||
|
||||
- **同一任务/时间块在不同设备同时编辑**:按 `updated_at` 做 LWW,时间戳更新的版本获胜;删除墓碑在等时间戳时优先。
|
||||
- **完成状态**:只要有设备把时间块标记为 done,其他设备会接受该完成状态,即使远端时间戳较旧(避免手机/PC 时钟偏差导致完成状态不同步);取消完成仍按 LWW。
|
||||
- **不同日程被安排在同一时间**:它们是两个独立实体,都会保留,日视图以重叠列展示;系统不会自动移动或删除任何一方。
|
||||
- **重复日程**:物化后的时间块按普通日程同步;重复规则本身不参与变更流。
|
||||
- **服务端**只保存有序变更流,不做语义合并;最终一致性由客户端 LWW 保证。
|
||||
@@ -150,7 +171,8 @@ Windows/macOS 使用 Qt 原生输入法支持,不需要该插件。
|
||||
|
||||
- 今日日程列表、完成状态、编辑、长按删除、新建。
|
||||
- SQLite outbox、LWW、WebSocket + 15 秒轮询、设备注册。
|
||||
- 日程结束本地通知;WorkManager 每 15 分钟后台同步;开机重建任务。
|
||||
- 开始/提前 N 分钟/结束未完成本地通知;WorkManager 每 15 分钟后台同步;开机重建任务。
|
||||
- 桌面创建的长期项目会同步到 Android 并只读展示。
|
||||
- 暂不含 AI 对话/附件、精力曲线、复盘。
|
||||
|
||||
```bash
|
||||
@@ -241,6 +263,22 @@ cmake --build --preset linux-gcc
|
||||
|
||||
安装包包含开始菜单项与桌面快捷方式,卸载信息写入 Windows 应用列表。
|
||||
|
||||
### Linux AppImage
|
||||
|
||||
可生成免安装的 AppImage:
|
||||
|
||||
```bash
|
||||
./scripts/package-linux-appimage.sh
|
||||
chmod +x dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
```
|
||||
|
||||
- 产物:`dist/AI-Schedule-0.1.0-x86_64.AppImage`(约 34 MB)。
|
||||
- 已打包 Qt 库、xcb/Wayland 平台插件、SQLite 驱动、TLS 和 fcitx5 输入法插件。
|
||||
- 无 FUSE 环境使用:`./dist/AI-Schedule-0.1.0-x86_64.AppImage --appimage-extract-and-run`。
|
||||
- 可用 `QT_ROOT` 覆盖 Qt 路径,`TOOLS_DIR` 指定已下载的 linuxdeploy/appimagetool。
|
||||
- 详细验证见 [`docs/validation/phase-4-3.md`](docs/validation/phase-4-3.md)。
|
||||
|
||||
### Windows 多设备联调
|
||||
|
||||
1. 在服务端机器启动 `go run ./cmd/server`(或 Docker),设置随机 `SYNC_TOKEN_PEPPER`。
|
||||
@@ -264,7 +302,7 @@ ctest --preset linux-gcc
|
||||
精力档案 / 幽灵时间 / 每日复盘、搜索 / 重复日程、AI 编排(15 个用例:流式、修复、更新/删除、涟漪、拆分、冲突保护、多轮历史、文件、删除兜底、无 diff 重试)、
|
||||
OpenAI 兼容 Provider(本地假 SSE 服务,含无 API Key 的本地模型)、AI 对话到接受落库的 UI 全链路、Go 服务端单元/接口/并发测试、双客户端同步集成(含离线重连)。
|
||||
|
||||
Android:`cd android && ./gradlew :app:testDebugUnitTest`,当前 LWW / 时间工具共 6 个 JVM 测试通过;APK 构建见 [`android/README.md`](android/README.md)。
|
||||
Android:`cd android && ./gradlew :app:testDebugUnitTest`,当前 LWW / 时间工具 / 完成合并共 8 个 JVM 测试通过;APK 构建见 [`android/README.md`](android/README.md)。
|
||||
|
||||
本地模型回归(50 条真实中文指令):
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
- 今日日程列表:按日期前后切换、完成状态、编辑、长按删除。
|
||||
- 本地 SQLite:task / timeblock / outbox / sync_state。
|
||||
- 同步:设备注册、outbox 推送、增量拉取、LWW、WebSocket 通知、定时轮询。
|
||||
- 提醒:日程结束后对未完成项发本地通知;通知点击回到对应日期。
|
||||
- 长期项目:接收桌面端项目,在今日列表上方只读展示标题和截止倒计时。
|
||||
- 已完成汇总:右上角菜单查看短期任务数、专注时长、长期项目数和最近完成记录。
|
||||
- 提醒:日程开始、提前 N 分钟、结束后未完成都会发本地通知;通知点击回到对应日期。
|
||||
- 后台:WorkManager 每 15 分钟同步一次;开机接收 `BOOT_COMPLETED` 重新登记任务。
|
||||
- 设置:同步服务地址与启用开关;不支持 AI 对话和附件提取(桌面端功能)。
|
||||
|
||||
@@ -50,9 +52,10 @@ adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
## 通知与后台同步
|
||||
|
||||
- 提醒使用 Android 本地通知,不依赖服务端推送/FCM。
|
||||
- 通知在工作线程中检查过去 24 小时内已结束、仍未完成的日程;同一时间块只提醒一次。
|
||||
- 通知类型:日程开始、提前 N 分钟(0/5/10/15/30/60)、结束后未完成。
|
||||
- 设置页可选择提前分钟数;默认提前 10 分钟。
|
||||
- Android 13+ 首次启动会请求通知权限;拒绝后提醒不显示,但同步不受影响。
|
||||
- WorkManager 周期最小为 15 分钟;省电模式/Doze 或厂商后台限制可能进一步延迟。
|
||||
- WorkManager 周期最小为 15 分钟;提醒可能延迟,开始提醒只覆盖开始后 20 分钟内。
|
||||
- 开机广播会重新安排提醒与同步任务;不会自动打开 App 界面。
|
||||
- 如需即时后台推送,需要后续接入 FCM 或常驻前台服务(会增加耗电/复杂度)。
|
||||
|
||||
@@ -61,6 +64,7 @@ adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
## 当前限制
|
||||
|
||||
- 无 AI 对话 / 文件附件 / 精力曲线 / 重复日程创建 / 每日复盘;这些仍由桌面端提供。
|
||||
- 提醒不是精确闹钟:周期任务可能延迟,且没有“提前 N 分钟”提醒。
|
||||
- 长期项目目前只读展示,移动端暂不支持创建/编辑/完成操作。
|
||||
- 提醒不是精确闹钟:WorkManager 周期任务可能延迟。
|
||||
- 无 FCM 推送;App 被强制停止后,Android 不会执行周期任务,直到下次手动打开。
|
||||
- 未在真机或模拟器上做交互验证;当前验证到 APK 构建、JVM 单元测试和 Manifest 检查。
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ScrollView
|
||||
import android.widget.TextView
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
@@ -26,6 +27,7 @@ import com.misaki.schedule.background.BackgroundScheduler
|
||||
import com.misaki.schedule.background.NotificationHelper
|
||||
import com.misaki.schedule.data.TimeUtils
|
||||
import com.misaki.schedule.sync.SyncManager
|
||||
import com.misaki.schedule.ui.ProjectAdapter
|
||||
import com.misaki.schedule.ui.ScheduleAdapter
|
||||
import com.misaki.schedule.ui.ScheduleDialog
|
||||
import com.misaki.schedule.ui.SettingsDialog
|
||||
@@ -39,7 +41,10 @@ class MainActivity : AppCompatActivity() {
|
||||
private lateinit var prefs: Prefs
|
||||
private lateinit var syncManager: SyncManager
|
||||
private lateinit var adapter: ScheduleAdapter
|
||||
private lateinit var projectAdapter: ProjectAdapter
|
||||
private lateinit var list: RecyclerView
|
||||
private lateinit var projectList: RecyclerView
|
||||
private lateinit var projectHeader: TextView
|
||||
private lateinit var emptyText: TextView
|
||||
private lateinit var dateText: TextView
|
||||
private lateinit var syncStatus: TextView
|
||||
@@ -69,6 +74,8 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
list = findViewById(R.id.scheduleList)
|
||||
projectList = findViewById(R.id.projectList)
|
||||
projectHeader = findViewById(R.id.projectHeader)
|
||||
emptyText = findViewById(R.id.emptyText)
|
||||
dateText = findViewById(R.id.dateText)
|
||||
syncStatus = findViewById(R.id.syncStatus)
|
||||
@@ -84,6 +91,9 @@ class MainActivity : AppCompatActivity() {
|
||||
)
|
||||
list.layoutManager = LinearLayoutManager(this)
|
||||
list.adapter = adapter
|
||||
projectAdapter = ProjectAdapter()
|
||||
projectList.layoutManager = LinearLayoutManager(this)
|
||||
projectList.adapter = projectAdapter
|
||||
|
||||
findViewById<FloatingActionButton>(R.id.addButton).setOnClickListener {
|
||||
val start = TimeUtils.defaultStart(selectedDate)
|
||||
@@ -105,6 +115,10 @@ class MainActivity : AppCompatActivity() {
|
||||
val toolbar = findViewById<MaterialToolbar>(R.id.toolbar)
|
||||
toolbar.setOnMenuItemClickListener { item ->
|
||||
when (item.itemId) {
|
||||
R.id.action_completed -> {
|
||||
showCompletedSummary()
|
||||
true
|
||||
}
|
||||
R.id.action_sync -> {
|
||||
syncManager.reload()
|
||||
true
|
||||
@@ -163,11 +177,56 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun showCompletedSummary() {
|
||||
val items = repository.completedItems()
|
||||
val projects = repository.completedProjects()
|
||||
val focusedMinutes = items.sumOf {
|
||||
val start = TimeUtils.parse(it.block.startAt)
|
||||
val end = TimeUtils.parse(it.block.endAt)
|
||||
if (start != null && end != null) {
|
||||
maxOf(0, java.time.Duration.between(start, end).toMinutes().toInt())
|
||||
} else 0
|
||||
}
|
||||
val summaryText = buildString {
|
||||
append("短期任务 ${items.size} · 长期项目 ${projects.size}\n")
|
||||
append("累计专注 ${focusedMinutes / 60} 小时 ${focusedMinutes % 60} 分钟\n\n")
|
||||
if (items.isNotEmpty()) {
|
||||
append("短期任务\n")
|
||||
items.take(50).forEach {
|
||||
append("· ${it.task.title} ${TimeUtils.formatDate(it.block.doneAt ?: it.block.endAt)}\n")
|
||||
}
|
||||
append("\n")
|
||||
}
|
||||
if (projects.isNotEmpty()) {
|
||||
append("长期项目\n")
|
||||
projects.forEach { append("· ${it.title} ${TimeUtils.formatDate(it.updatedAt)}\n") }
|
||||
}
|
||||
if (items.isEmpty() && projects.isEmpty()) {
|
||||
append("还没有已完成记录。")
|
||||
}
|
||||
}
|
||||
val content = TextView(this).apply {
|
||||
text = summaryText
|
||||
textSize = 14f
|
||||
setPadding(48, 24, 48, 24)
|
||||
}
|
||||
val scroll = ScrollView(this).apply { addView(content) }
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.completed_summary)
|
||||
.setView(scroll)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
}
|
||||
|
||||
private fun refresh() {
|
||||
dateText.text = selectedDate.format(dateFormatter)
|
||||
val items = repository.itemsForDate(selectedDate)
|
||||
adapter.submit(items)
|
||||
emptyText.visibility = if (items.isEmpty()) View.VISIBLE else View.GONE
|
||||
val projects = repository.projects()
|
||||
projectAdapter.submit(projects)
|
||||
projectHeader.visibility = if (projects.isEmpty()) View.GONE else View.VISIBLE
|
||||
projectList.visibility = if (projects.isEmpty()) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
private fun showScheduleDialog(item: ScheduleItem?, fallbackStart: java.time.LocalDateTime? = null) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.ExistingWorkPolicy
|
||||
import androidx.work.NetworkType
|
||||
import androidx.work.OneTimeWorkRequestBuilder
|
||||
import androidx.work.OutOfQuotaPolicy
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkManager
|
||||
import com.misaki.schedule.data.Prefs
|
||||
@@ -55,6 +56,7 @@ object BackgroundScheduler {
|
||||
.build()
|
||||
val request = OneTimeWorkRequestBuilder<SyncWorker>()
|
||||
.setConstraints(constraints)
|
||||
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
|
||||
.build()
|
||||
WorkManager.getInstance(context).enqueueUniqueWork(
|
||||
SYNC_NOW_WORK,
|
||||
|
||||
@@ -43,6 +43,35 @@ object NotificationHelper {
|
||||
}
|
||||
|
||||
fun notifyReminder(context: Context, item: ScheduleItem): Boolean {
|
||||
val range = TimeUtils.formatRange(item.block.startAt, item.block.endAt)
|
||||
return notify(
|
||||
context,
|
||||
item,
|
||||
context.getString(R.string.reminder_title),
|
||||
context.getString(R.string.reminder_text, item.task.title, range),
|
||||
)
|
||||
}
|
||||
|
||||
fun notifyLead(context: Context, item: ScheduleItem, minutesBefore: Int): Boolean {
|
||||
val text = context.getString(
|
||||
R.string.reminder_lead_text,
|
||||
item.task.title,
|
||||
minutesBefore,
|
||||
TimeUtils.formatTime(item.block.startAt),
|
||||
)
|
||||
return notify(context, item, context.getString(R.string.reminder_lead_title), text)
|
||||
}
|
||||
|
||||
fun notifyStart(context: Context, item: ScheduleItem): Boolean {
|
||||
val text = context.getString(
|
||||
R.string.reminder_start_text,
|
||||
item.task.title,
|
||||
TimeUtils.formatRange(item.block.startAt, item.block.endAt),
|
||||
)
|
||||
return notify(context, item, context.getString(R.string.reminder_start_title), text)
|
||||
}
|
||||
|
||||
private fun notify(context: Context, item: ScheduleItem, title: String, text: String): Boolean {
|
||||
if (!canNotify(context)) return false
|
||||
ensureChannel(context)
|
||||
val intent = Intent(context, MainActivity::class.java).apply {
|
||||
@@ -55,11 +84,9 @@ object NotificationHelper {
|
||||
intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||
)
|
||||
val range = TimeUtils.formatRange(item.block.startAt, item.block.endAt)
|
||||
val text = context.getString(R.string.reminder_text, item.task.title, range)
|
||||
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setContentTitle(context.getString(R.string.reminder_title))
|
||||
.setContentTitle(title)
|
||||
.setContentText(text)
|
||||
.setStyle(NotificationCompat.BigTextStyle().bigText(text))
|
||||
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.misaki.schedule.background
|
||||
import android.content.Context
|
||||
import androidx.work.CoroutineWorker
|
||||
import androidx.work.WorkerParameters
|
||||
import com.misaki.schedule.data.Prefs
|
||||
import com.misaki.schedule.data.ScheduleRepository
|
||||
import com.misaki.schedule.data.TimeUtils
|
||||
|
||||
@@ -14,6 +15,7 @@ class ReminderWorker(appContext: Context, params: WorkerParameters) : CoroutineW
|
||||
return Result.success()
|
||||
}
|
||||
val repository = ScheduleRepository(applicationContext)
|
||||
val prefs = Prefs(applicationContext)
|
||||
val now = TimeUtils.nowIso()
|
||||
val since = TimeUtils.hoursAgo(24)
|
||||
val pending = repository.pendingReminders(now, since)
|
||||
@@ -22,6 +24,33 @@ class ReminderWorker(appContext: Context, params: WorkerParameters) : CoroutineW
|
||||
repository.markReminderSent(key, item.block.id, now)
|
||||
}
|
||||
}
|
||||
|
||||
val leadMinutes = prefs.reminderLeadMinutes
|
||||
val nowInstant = java.time.Instant.now()
|
||||
val horizon = TimeUtils.iso(nowInstant.plusSeconds(maxOf(leadMinutes, 20) * 60L))
|
||||
val active = repository.upcomingReminderCandidates(now, horizon)
|
||||
for (item in active) {
|
||||
val start = TimeUtils.parse(item.block.startAt) ?: continue
|
||||
val end = TimeUtils.parse(item.block.endAt) ?: continue
|
||||
val startKey = "${item.block.id}@${item.block.startAt}@start"
|
||||
val leadKey = "${item.block.id}@${item.block.startAt}@lead@${leadMinutes}"
|
||||
if (leadMinutes > 0 &&
|
||||
!nowInstant.isBefore(start.minusSeconds(leadMinutes * 60L)) &&
|
||||
nowInstant.isBefore(start) &&
|
||||
!repository.isReminderSent(leadKey) &&
|
||||
NotificationHelper.notifyLead(applicationContext, item, leadMinutes)
|
||||
) {
|
||||
repository.markReminderSent(leadKey, item.block.id, now)
|
||||
}
|
||||
if (!nowInstant.isBefore(start) &&
|
||||
nowInstant.isBefore(end) &&
|
||||
nowInstant.isBefore(start.plusSeconds(20 * 60L)) &&
|
||||
!repository.isReminderSent(startKey) &&
|
||||
NotificationHelper.notifyStart(applicationContext, item)
|
||||
) {
|
||||
repository.markReminderSent(startKey, item.block.id, now)
|
||||
}
|
||||
}
|
||||
Result.success()
|
||||
} catch (_: Exception) {
|
||||
Result.retry()
|
||||
|
||||
@@ -27,6 +27,10 @@ class Prefs(context: Context) {
|
||||
get() = prefs.getString("token", "").orEmpty()
|
||||
set(value) = prefs.edit().putString("token", value).apply()
|
||||
|
||||
var reminderLeadMinutes: Int
|
||||
get() = prefs.getInt("reminder_lead_minutes", 10).coerceIn(0, 24 * 60)
|
||||
set(value) = prefs.edit().putInt("reminder_lead_minutes", value.coerceIn(0, 24 * 60)).apply()
|
||||
|
||||
val deviceId: String
|
||||
get() = generatedDeviceId
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.database.sqlite.SQLiteOpenHelper
|
||||
|
||||
class ScheduleDb(context: Context) : SQLiteOpenHelper(context, "schedule.db", null, 2) {
|
||||
class ScheduleDb(context: Context) : SQLiteOpenHelper(context, "schedule.db", null, 3) {
|
||||
override fun onConfigure(db: SQLiteDatabase) {
|
||||
super.onConfigure(db)
|
||||
db.setForeignKeyConstraintsEnabled(true)
|
||||
@@ -66,6 +66,7 @@ class ScheduleDb(context: Context) : SQLiteOpenHelper(context, "schedule.db", nu
|
||||
db.execSQL(
|
||||
"CREATE TABLE reminder_sent(key TEXT PRIMARY KEY, block_id TEXT NOT NULL, sent_at TEXT NOT NULL)"
|
||||
)
|
||||
createProjectTable(db)
|
||||
db.execSQL("CREATE INDEX idx_timeblock_start ON timeblock(start_at)")
|
||||
db.execSQL("CREATE INDEX idx_timeblock_task ON timeblock(task_id)")
|
||||
db.execSQL("CREATE INDEX idx_outbox_entity ON outbox(entity_type, entity_id)")
|
||||
@@ -77,5 +78,30 @@ class ScheduleDb(context: Context) : SQLiteOpenHelper(context, "schedule.db", nu
|
||||
"CREATE TABLE IF NOT EXISTS reminder_sent(key TEXT PRIMARY KEY, block_id TEXT NOT NULL, sent_at TEXT NOT NULL)"
|
||||
)
|
||||
}
|
||||
if (oldVersion < 3) {
|
||||
createProjectTable(db)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createProjectTable(db: SQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS project(
|
||||
id TEXT PRIMARY KEY,
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
source TEXT,
|
||||
source_ref TEXT,
|
||||
deadline TEXT,
|
||||
priority INTEGER DEFAULT 1,
|
||||
status TEXT DEFAULT 'active',
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL,
|
||||
version INTEGER DEFAULT 0,
|
||||
device_id TEXT NOT NULL
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS idx_project_deadline ON project(status, deadline)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,21 @@ data class TimeBlock(
|
||||
val deviceId: String,
|
||||
)
|
||||
|
||||
data class Project(
|
||||
val id: String,
|
||||
val title: String,
|
||||
val description: String?,
|
||||
val source: String,
|
||||
val sourceRef: String?,
|
||||
val deadline: String?,
|
||||
val priority: Int,
|
||||
val status: String,
|
||||
val createdAt: String,
|
||||
val updatedAt: String,
|
||||
val version: Int,
|
||||
val deviceId: String,
|
||||
)
|
||||
|
||||
data class ScheduleItem(val task: Task, val block: TimeBlock) {
|
||||
fun isActive(): Boolean = block.status == "scheduled" || block.status == "in_progress"
|
||||
fun isDone(): Boolean = block.status == "done"
|
||||
@@ -53,6 +68,8 @@ object TimeUtils {
|
||||
|
||||
fun nowIso(): String = isoFormatter.format(Instant.now().truncatedTo(ChronoUnit.MILLIS))
|
||||
|
||||
fun iso(value: Instant): String = isoFormatter.format(value.truncatedTo(ChronoUnit.MILLIS))
|
||||
|
||||
fun toIso(local: LocalDateTime): String =
|
||||
isoFormatter.format(local.atZone(ZoneId.systemDefault()).toInstant().truncatedTo(ChronoUnit.MILLIS))
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.ContentValues
|
||||
import android.content.Context
|
||||
import android.database.Cursor
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import com.misaki.schedule.sync.CompletionMerge
|
||||
import com.misaki.schedule.sync.JsonCodec
|
||||
import com.misaki.schedule.sync.Lww
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -45,6 +46,92 @@ class ScheduleRepository(context: Context) {
|
||||
return result
|
||||
}
|
||||
|
||||
fun projects(): List<Project> {
|
||||
val result = mutableListOf<Project>()
|
||||
db.rawQuery(
|
||||
"""
|
||||
SELECT id, title, description, source, source_ref, deadline, priority, status,
|
||||
created_at, updated_at, version, device_id
|
||||
FROM project
|
||||
WHERE status = 'active'
|
||||
ORDER BY CASE WHEN deadline IS NULL THEN 1 ELSE 0 END, deadline ASC, priority DESC
|
||||
""".trimIndent(),
|
||||
emptyArray()
|
||||
).use { cursor ->
|
||||
while (cursor.moveToNext()) {
|
||||
result.add(
|
||||
Project(
|
||||
id = cursor.getString(0),
|
||||
title = cursor.getString(1),
|
||||
description = cursor.stringOrNull(2),
|
||||
source = cursor.getString(3) ?: "android",
|
||||
sourceRef = cursor.stringOrNull(4),
|
||||
deadline = cursor.stringOrNull(5),
|
||||
priority = cursor.getInt(6),
|
||||
status = cursor.getString(7) ?: "active",
|
||||
createdAt = cursor.getString(8),
|
||||
updatedAt = cursor.getString(9),
|
||||
version = cursor.getInt(10),
|
||||
deviceId = cursor.getString(11),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun completedItems(): List<ScheduleItem> {
|
||||
val result = mutableListOf<ScheduleItem>()
|
||||
db.rawQuery(
|
||||
"""
|
||||
SELECT t.id, t.title, t.description, t.source, t.source_ref, t.estimated_min,
|
||||
t.energy_req, t.deadline, t.priority, t.status, t.created_at, t.updated_at,
|
||||
t.version, t.device_id,
|
||||
b.id, b.task_id, b.start_at, b.end_at, b.granularity, b.splittable,
|
||||
b.breakable, b.status, b.done_at, b.created_at, b.updated_at, b.version, b.device_id
|
||||
FROM timeblock b JOIN task t ON t.id = b.task_id
|
||||
WHERE b.status = 'done'
|
||||
ORDER BY COALESCE(b.done_at, b.end_at) DESC
|
||||
LIMIT 200
|
||||
""".trimIndent(),
|
||||
emptyArray()
|
||||
).use { cursor ->
|
||||
while (cursor.moveToNext()) result.add(readItem(cursor))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun completedProjects(): List<Project> {
|
||||
val result = mutableListOf<Project>()
|
||||
db.rawQuery(
|
||||
"""
|
||||
SELECT id, title, description, source, source_ref, deadline, priority, status,
|
||||
created_at, updated_at, version, device_id
|
||||
FROM project WHERE status = 'done'
|
||||
ORDER BY updated_at DESC
|
||||
""".trimIndent(),
|
||||
emptyArray()
|
||||
).use { cursor ->
|
||||
while (cursor.moveToNext()) {
|
||||
result.add(Project(
|
||||
id = cursor.getString(0),
|
||||
title = cursor.getString(1),
|
||||
description = cursor.stringOrNull(2),
|
||||
source = cursor.getString(3) ?: "android",
|
||||
sourceRef = cursor.stringOrNull(4),
|
||||
deadline = cursor.stringOrNull(5),
|
||||
priority = cursor.getInt(6),
|
||||
status = cursor.getString(7) ?: "done",
|
||||
createdAt = cursor.getString(8),
|
||||
updatedAt = cursor.getString(9),
|
||||
version = cursor.getInt(10),
|
||||
deviceId = cursor.getString(11),
|
||||
))
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun create(title: String, start: LocalDateTime, end: LocalDateTime, deviceId: String): String {
|
||||
val now = TimeUtils.nowIso()
|
||||
val taskId = UUID.randomUUID().toString()
|
||||
@@ -210,6 +297,36 @@ class ScheduleRepository(context: Context) {
|
||||
return result
|
||||
}
|
||||
|
||||
fun upcomingReminderCandidates(nowIso: String, horizonIso: String): List<ScheduleItem> {
|
||||
val result = mutableListOf<ScheduleItem>()
|
||||
db.rawQuery(
|
||||
"""
|
||||
SELECT t.id, t.title, t.description, t.source, t.source_ref, t.estimated_min,
|
||||
t.energy_req, t.deadline, t.priority, t.status, t.created_at, t.updated_at,
|
||||
t.version, t.device_id,
|
||||
b.id, b.task_id, b.start_at, b.end_at, b.granularity, b.splittable,
|
||||
b.breakable, b.status, b.done_at, b.created_at, b.updated_at, b.version, b.device_id
|
||||
FROM timeblock b JOIN task t ON t.id = b.task_id
|
||||
WHERE b.status IN ('scheduled', 'in_progress')
|
||||
AND b.start_at <= ? AND b.end_at > ?
|
||||
ORDER BY b.start_at ASC
|
||||
LIMIT 50
|
||||
""".trimIndent(),
|
||||
arrayOf(horizonIso, nowIso)
|
||||
).use { cursor ->
|
||||
while (cursor.moveToNext()) {
|
||||
result.add(readItem(cursor))
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun isReminderSent(key: String): Boolean {
|
||||
db.rawQuery("SELECT 1 FROM reminder_sent WHERE key = ?", arrayOf(key)).use { cursor ->
|
||||
return cursor.moveToFirst()
|
||||
}
|
||||
}
|
||||
|
||||
fun markReminderSent(key: String, blockId: String, sentAt: String) {
|
||||
val values = ContentValues().apply {
|
||||
put("key", key)
|
||||
@@ -235,17 +352,25 @@ class ScheduleRepository(context: Context) {
|
||||
val entityId = change.optString("entity_id")
|
||||
val op = change.optString("op")
|
||||
val remoteUpdated = change.optString("updated_at")
|
||||
val payload = change.optJSONObject("payload")
|
||||
val localUpdated = localUpdatedAt(database, entityType, entityId)
|
||||
val equalWins = op == "delete"
|
||||
if (!Lww.shouldApply(localUpdated, remoteUpdated, equalWins)) continue
|
||||
val forceCompletion = CompletionMerge.remoteCompletionWins(
|
||||
entityType,
|
||||
op,
|
||||
localBlockStatus(database, entityId),
|
||||
payload?.optString("status"),
|
||||
)
|
||||
if (!forceCompletion && !Lww.shouldApply(localUpdated, remoteUpdated, equalWins)) continue
|
||||
if (op == "delete") {
|
||||
when (entityType) {
|
||||
"task" -> database.delete("task", "id = ?", arrayOf(entityId))
|
||||
"timeblock" -> database.delete("timeblock", "id = ?", arrayOf(entityId))
|
||||
"project" -> database.delete("project", "id = ?", arrayOf(entityId))
|
||||
}
|
||||
applied++
|
||||
} else if (op == "upsert") {
|
||||
val payload = change.optJSONObject("payload") ?: continue
|
||||
if (payload == null) continue
|
||||
when (entityType) {
|
||||
"task" -> {
|
||||
payload.put("updated_at", remoteUpdated)
|
||||
@@ -263,6 +388,13 @@ class ScheduleRepository(context: Context) {
|
||||
applied++
|
||||
}
|
||||
}
|
||||
"project" -> {
|
||||
payload.put("updated_at", remoteUpdated)
|
||||
payload.put("version", change.optInt("version", 0))
|
||||
payload.put("device_id", change.optString("device_id"))
|
||||
database.insertWithOnConflict("project", null, projectValues(payload), SQLiteDatabase.CONFLICT_REPLACE)
|
||||
applied++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,6 +464,7 @@ class ScheduleRepository(context: Context) {
|
||||
val table = when (entityType) {
|
||||
"task" -> "task"
|
||||
"timeblock" -> "timeblock"
|
||||
"project" -> "project"
|
||||
else -> return null
|
||||
}
|
||||
database.rawQuery("SELECT updated_at FROM $table WHERE id = ?", arrayOf(entityId)).use { cursor ->
|
||||
@@ -339,6 +472,12 @@ class ScheduleRepository(context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun localBlockStatus(database: SQLiteDatabase, blockId: String): String? {
|
||||
database.rawQuery("SELECT status FROM timeblock WHERE id = ?", arrayOf(blockId)).use { cursor ->
|
||||
return if (cursor.moveToFirst()) cursor.getString(0) else null
|
||||
}
|
||||
}
|
||||
|
||||
private fun taskExists(database: SQLiteDatabase, taskId: String): Boolean {
|
||||
database.rawQuery("SELECT 1 FROM task WHERE id = ?", arrayOf(taskId)).use { cursor ->
|
||||
return cursor.moveToFirst()
|
||||
@@ -413,6 +552,21 @@ class ScheduleRepository(context: Context) {
|
||||
put("device_id", block.deviceId)
|
||||
}
|
||||
|
||||
private fun projectValues(payload: JSONObject): ContentValues = ContentValues().apply {
|
||||
put("id", payload.optString("id"))
|
||||
put("title", payload.optString("title", "未命名项目"))
|
||||
put("description", payload.stringOrNull("description"))
|
||||
put("source", payload.optString("source", "android"))
|
||||
put("source_ref", payload.stringOrNull("source_ref"))
|
||||
put("deadline", payload.stringOrNull("deadline"))
|
||||
put("priority", payload.optInt("priority", 1))
|
||||
put("status", payload.optString("status", "active"))
|
||||
put("created_at", payload.optString("created_at", TimeUtils.nowIso()))
|
||||
put("updated_at", payload.optString("updated_at", TimeUtils.nowIso()))
|
||||
put("version", payload.optInt("version", 0))
|
||||
put("device_id", payload.optString("device_id"))
|
||||
}
|
||||
|
||||
private fun blockValues(payload: JSONObject): ContentValues = ContentValues().apply {
|
||||
put("id", payload.optString("id"))
|
||||
put("task_id", payload.optString("task_id"))
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.misaki.schedule.sync
|
||||
|
||||
object CompletionMerge {
|
||||
fun remoteCompletionWins(
|
||||
entityType: String,
|
||||
op: String,
|
||||
localStatus: String?,
|
||||
remoteStatus: String?,
|
||||
): Boolean =
|
||||
entityType == "timeblock" &&
|
||||
op == "upsert" &&
|
||||
remoteStatus == "done" &&
|
||||
(localStatus == "scheduled" || localStatus == "in_progress")
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.misaki.schedule.ui
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.misaki.schedule.R
|
||||
import com.misaki.schedule.data.Project
|
||||
import java.time.LocalDate
|
||||
import java.time.temporal.ChronoUnit
|
||||
|
||||
class ProjectAdapter : RecyclerView.Adapter<ProjectAdapter.ViewHolder>() {
|
||||
private var items: List<Project> = emptyList()
|
||||
|
||||
fun submit(projects: List<Project>) {
|
||||
items = projects
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_project, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = items.size
|
||||
|
||||
class ViewHolder(itemView: android.view.View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val title: TextView = itemView.findViewById(R.id.projectTitle)
|
||||
private val deadline: TextView = itemView.findViewById(R.id.projectDeadline)
|
||||
|
||||
fun bind(project: Project) {
|
||||
title.text = project.title
|
||||
deadline.text = deadlineLabel(project)
|
||||
}
|
||||
|
||||
private fun deadlineLabel(project: Project): String {
|
||||
val date = runCatching { LocalDate.parse(project.deadline) }.getOrNull()
|
||||
?: return "无截止日期"
|
||||
val days = ChronoUnit.DAYS.between(LocalDate.now(), date).toInt()
|
||||
return when {
|
||||
days < 0 -> "截止 ${date} · 已逾期 ${-days} 天"
|
||||
days == 0 -> "截止 今天"
|
||||
else -> "截止 ${date} · 剩余 ${days} 天"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.misaki.schedule.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Spinner
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.materialswitch.MaterialSwitch
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
@@ -15,6 +17,11 @@ object SettingsDialog {
|
||||
val view = LayoutInflater.from(context).inflate(R.layout.dialog_settings, null)
|
||||
val url = view.findViewById<TextInputEditText>(R.id.serverUrlInput)
|
||||
val enabled = view.findViewById<MaterialSwitch>(R.id.syncSwitch)
|
||||
val lead = view.findViewById<Spinner>(R.id.leadSpinner)
|
||||
val leadValues = intArrayOf(0, 5, 10, 15, 30, 60)
|
||||
val leadLabels = leadValues.map { if (it == 0) "仅开始时" else "提前 $it 分钟" }
|
||||
lead.adapter = ArrayAdapter(context, android.R.layout.simple_spinner_dropdown_item, leadLabels)
|
||||
lead.setSelection(leadValues.indexOf(prefs.reminderLeadMinutes).takeIf { it >= 0 } ?: 2)
|
||||
url.setText(prefs.serverUrl)
|
||||
enabled.isChecked = prefs.enabled
|
||||
|
||||
@@ -25,6 +32,7 @@ object SettingsDialog {
|
||||
.setPositiveButton(R.string.save) { _, _ ->
|
||||
prefs.serverUrl = url.text?.toString().orEmpty()
|
||||
prefs.enabled = enabled.isChecked
|
||||
prefs.reminderLeadMinutes = leadValues[lead.selectedItemPosition.coerceIn(0, leadValues.lastIndex)]
|
||||
BackgroundScheduler.update(context, prefs)
|
||||
syncManager.reload()
|
||||
}
|
||||
|
||||
@@ -73,6 +73,25 @@
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/projectHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/long_term_projects"
|
||||
android:textStyle="bold"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/projectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="4dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
@@ -27,6 +27,18 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/enable_sync" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:text="@string/reminder_lead"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/leadSpinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="14dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/projectTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/projectDeadline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="3dp"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/action_completed"
|
||||
android:title="@string/completed_summary"
|
||||
android:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_sync"
|
||||
android:title="@string/sync_now"
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<string name="previous_day">前一天</string>
|
||||
<string name="next_day">后一天</string>
|
||||
<string name="add_schedule">新建日程</string>
|
||||
<string name="long_term_projects">长期项目</string>
|
||||
<string name="completed_summary">已完成汇总</string>
|
||||
<string name="empty_schedule">今天还没有安排</string>
|
||||
<string name="sync_local">本地</string>
|
||||
<string name="sync_not_configured">未配置同步服务</string>
|
||||
@@ -33,5 +35,10 @@
|
||||
<string name="reminder_channel_description">日程结束时提醒未完成事项</string>
|
||||
<string name="reminder_title">日程已结束</string>
|
||||
<string name="reminder_text">「%1$s」原定 %2 尚未完成,点击处理。</string>
|
||||
<string name="notification_permission_hint">开启通知权限后,日程结束时会收到提醒。</string>
|
||||
<string name="notification_permission_hint">开启通知权限后,日程开始/结束时会收到提醒。</string>
|
||||
<string name="reminder_lead">提前提醒</string>
|
||||
<string name="reminder_lead_title">日程即将开始</string>
|
||||
<string name="reminder_lead_text">「%1$s」将在 %2 分钟后开始(%3)。</string>
|
||||
<string name="reminder_start_title">日程开始</string>
|
||||
<string name="reminder_start_text">「%1$s」现在开始(%2)。</string>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.misaki.schedule
|
||||
|
||||
import com.misaki.schedule.sync.CompletionMerge
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class CompletionMergeTest {
|
||||
@Test
|
||||
fun doneWinsOverLocalScheduledOrInProgress() {
|
||||
assertTrue(CompletionMerge.remoteCompletionWins("timeblock", "upsert", "scheduled", "done"))
|
||||
assertTrue(CompletionMerge.remoteCompletionWins("timeblock", "upsert", "in_progress", "done"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun doesNotOverrideDroppedOrUnrelatedChanges() {
|
||||
assertFalse(CompletionMerge.remoteCompletionWins("timeblock", "upsert", "dropped", "done"))
|
||||
assertFalse(CompletionMerge.remoteCompletionWins("task", "upsert", "active", "done"))
|
||||
assertFalse(CompletionMerge.remoteCompletionWins("timeblock", "delete", "scheduled", "done"))
|
||||
assertFalse(CompletionMerge.remoteCompletionWins("timeblock", "upsert", "scheduled", "scheduled"))
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
用户精力高峰(用于安排高精力任务):{ENERGY_PROFILE}
|
||||
用户现有日程(每行开头的 [bN] 是引用编号,只能用于 update/delete):
|
||||
{EXISTING_SCHEDULE}
|
||||
用户现有长期项目(避免重复创建):
|
||||
{EXISTING_PROJECTS}
|
||||
|
||||
工作规则:
|
||||
1. 先用 1–3 句简洁回复,说明你理解的需求和准备怎么安排。
|
||||
@@ -14,7 +16,8 @@
|
||||
{"operations":[
|
||||
{"type":"create","title":"任务标题","description":"可选说明","duration_min":60,"deadline":"YYYY-MM-DDTHH:MM:SS","priority":1,"energy_req":1,"splittable":false,"preferred_start":"YYYY-MM-DDTHH:MM:SS","preferred_end":"YYYY-MM-DDTHH:MM:SS"},
|
||||
{"type":"update","target_ref":"b1","title":"可选的新标题","duration_min":60,"preferred_start":"YYYY-MM-DDTHH:MM:SS","preferred_end":"YYYY-MM-DDTHH:MM:SS"},
|
||||
{"type":"delete","target_ref":"b2"}
|
||||
{"type":"delete","target_ref":"b2"},
|
||||
{"type":"project","title":"跨月项目","description":"可选说明","deadline":"YYYY-MM-DD","priority":2}
|
||||
]}
|
||||
4. 时间使用用户本地时间,不带时区;不确定的字段填 null。
|
||||
5. duration_min 必须在 15–480 之间;无法确定时用 60。
|
||||
@@ -31,6 +34,9 @@
|
||||
16. 示例:现有 [b2] 团队同步(会议)、[b4] 项目会议(会议)。用户说“删除明天所有会议”时,输出 {"operations":[{"type":"delete","target_ref":"b2"},{"type":"delete","target_ref":"b4"}]}。
|
||||
17. 示例:用户说“明天之前找时间做两小时长任务,可以拆开”,输出 create 并设置 "splittable":true;不要拆成两个独立任务。
|
||||
18. energy_req 取值:0=低精力杂务,1=一般沟通/会议,2=高专注深度工作、学习或创作;不确定时填 1。高精力任务应优先放在用户的精力高峰时段。
|
||||
19. 长期项目:当用户描述的是跨多天、数周或数月完成的目标(例如“一个月内完成飞行控制器项目”),且没有要求现在就拆成具体日程块时,使用 {"type":"project","title":"项目标题","description":"可选说明","deadline":"YYYY-MM-DD","priority":2}。不要用 create 把它塞进某一天。
|
||||
20. 只有用户明确要求“今天/明天/几点做多久”或明确要求把项目拆成执行块时,才使用 create 创建具体时间块。
|
||||
21. 长期项目的 deadline 使用日期而不是具体时间;如果用户说“这个月底/下个月/一个月内”,结合当前日期推算出合理日期。
|
||||
|
||||
补充信息:
|
||||
{EXTRA_CONTEXT}
|
||||
|
||||
@@ -4,7 +4,8 @@ JSON 格式:
|
||||
{"operations":[
|
||||
{"type":"create","title":"任务标题","description":"可选说明","duration_min":60,"deadline":"YYYY-MM-DDTHH:MM:SS","priority":1,"energy_req":1,"splittable":false,"preferred_start":"YYYY-MM-DDTHH:MM:SS","preferred_end":"YYYY-MM-DDTHH:MM:SS"},
|
||||
{"type":"update","target_ref":"b1","title":"可选的新标题","duration_min":60,"preferred_start":"YYYY-MM-DDTHH:MM:SS","preferred_end":"YYYY-MM-DDTHH:MM:SS"},
|
||||
{"type":"delete","target_ref":"b2"}
|
||||
{"type":"delete","target_ref":"b2"},
|
||||
{"type":"project","title":"长期项目标题","description":"可选说明","deadline":"YYYY-MM-DD","priority":2}
|
||||
]}
|
||||
|
||||
规则:
|
||||
@@ -14,4 +15,5 @@ JSON 格式:
|
||||
- 如果只是闲聊或没有日程变更,operations 输出空数组。
|
||||
- 用户明确要求新增/修改/删除时,必须给出 operations;冲突、时长不足或过去时间交给本地排程器处理。
|
||||
- 可拆分请求优先设置 splittable=true。
|
||||
- 跨多天/数周/数月的目标使用 type=project;只有具体执行块才使用 create。
|
||||
- 现有日程摘要中的(会议)标记用于识别会议类;删除“所有会议”时删除全部带标记项。
|
||||
|
||||
@@ -5,6 +5,7 @@ add_library(schedule_core STATIC
|
||||
core/DailyInsights.h
|
||||
core/EnergyProfile.cpp
|
||||
core/EnergyProfile.h
|
||||
core/Project.h
|
||||
core/ProposedDiff.h
|
||||
core/Recurrence.h
|
||||
core/SchedulerEngine.cpp
|
||||
@@ -82,8 +83,12 @@ add_library(schedule_ui STATIC
|
||||
ui/MainWindow.h
|
||||
ui/dialogs/BlockEditDialog.cpp
|
||||
ui/dialogs/BlockEditDialog.h
|
||||
ui/dialogs/CompletedSummaryDialog.cpp
|
||||
ui/dialogs/CompletedSummaryDialog.h
|
||||
ui/dialogs/DailyReviewDialog.cpp
|
||||
ui/dialogs/DailyReviewDialog.h
|
||||
ui/dialogs/ProjectDialog.cpp
|
||||
ui/dialogs/ProjectDialog.h
|
||||
ui/dialogs/SearchDialog.cpp
|
||||
ui/dialogs/SearchDialog.h
|
||||
ui/dialogs/SettingsDialog.cpp
|
||||
@@ -92,6 +97,8 @@ add_library(schedule_ui STATIC
|
||||
ui/panels/ChatPanel.h
|
||||
ui/panels/DiffPreviewCard.cpp
|
||||
ui/panels/DiffPreviewCard.h
|
||||
ui/panels/ProjectCard.cpp
|
||||
ui/panels/ProjectCard.h
|
||||
ui/panels/TodayItemCard.cpp
|
||||
ui/panels/TodayItemCard.h
|
||||
ui/panels/TodayPanel.cpp
|
||||
|
||||
@@ -479,6 +479,7 @@ QString AIService::buildSystemPrompt()
|
||||
prompt.replace(QStringLiteral("{ENERGY_PROFILE}"),
|
||||
m_scheduleService.dailyReview(now.date()).energySummary);
|
||||
prompt.replace(QStringLiteral("{EXISTING_SCHEDULE}"), scheduleSummary());
|
||||
prompt.replace(QStringLiteral("{EXISTING_PROJECTS}"), projectSummary());
|
||||
prompt.replace(QStringLiteral("{EXTRA_CONTEXT}"),
|
||||
m_filePaths.isEmpty()
|
||||
? QStringLiteral("无")
|
||||
@@ -544,6 +545,31 @@ QString AIService::scheduleSummary()
|
||||
return m_contextSummary;
|
||||
}
|
||||
|
||||
QString AIService::projectSummary()
|
||||
{
|
||||
const QVector<Project> projects = m_scheduleService.projects();
|
||||
if (projects.isEmpty())
|
||||
{
|
||||
return QStringLiteral("(暂无长期项目)");
|
||||
}
|
||||
QString summary;
|
||||
int count = 0;
|
||||
for (const Project& project : projects)
|
||||
{
|
||||
summary += QStringLiteral("- %1").arg(project.title);
|
||||
if (project.deadline.has_value())
|
||||
{
|
||||
summary += QStringLiteral("(截止 %1)").arg(project.deadline->toString(QStringLiteral("yyyy-MM-dd")));
|
||||
}
|
||||
summary += QLatin1Char('\n');
|
||||
if (++count >= 50)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return summary.trimmed();
|
||||
}
|
||||
|
||||
QJsonValue AIService::buildUserContent() const
|
||||
{
|
||||
QString text = m_userText;
|
||||
@@ -614,6 +640,9 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
bool forceSplit = false;
|
||||
};
|
||||
|
||||
QJsonArray projectCreates;
|
||||
QVector<ProposedProjectEntry> projectEntries;
|
||||
|
||||
auto findContext = [this](const QString& raw) -> const ContextItem* {
|
||||
QString key = raw.trimmed();
|
||||
if (key.startsWith(QLatin1Char('[')) && key.endsWith(QLatin1Char(']')))
|
||||
@@ -824,6 +853,39 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
{
|
||||
type = QStringLiteral("create");
|
||||
}
|
||||
if (type == QStringLiteral("project"))
|
||||
{
|
||||
const QString title = object.value(QStringLiteral("title")).toString().trimmed();
|
||||
const QString deadlineText = object.value(QStringLiteral("deadline")).toString().trimmed();
|
||||
const QDate deadline =
|
||||
QDate::fromString(deadlineText.left(10), Qt::ISODate);
|
||||
if (title.isEmpty() || !deadline.isValid())
|
||||
{
|
||||
Q_EMIT notice(QStringLiteral("AI 返回的长期项目缺少标题或截止日期,已跳过"));
|
||||
continue;
|
||||
}
|
||||
const QString tempId = QStringLiteral("p%1").arg(projectCreates.size() + 1);
|
||||
QJsonObject project;
|
||||
project.insert(QStringLiteral("temp_id"), tempId);
|
||||
project.insert(QStringLiteral("title"), title.left(200));
|
||||
project.insert(QStringLiteral("description"),
|
||||
object.value(QStringLiteral("description")).toString().left(2000));
|
||||
project.insert(QStringLiteral("deadline"), deadline.toString(Qt::ISODate));
|
||||
project.insert(QStringLiteral("priority"),
|
||||
std::clamp(object.value(QStringLiteral("priority")).toInt(2), 1, 5));
|
||||
project.insert(QStringLiteral("source_ref"), m_userText.left(500));
|
||||
projectCreates.append(project);
|
||||
|
||||
ProposedProjectEntry entry;
|
||||
entry.tempId = tempId;
|
||||
entry.operation = ProposedOperation::Create;
|
||||
entry.title = title;
|
||||
entry.description = project.value(QStringLiteral("description")).toString();
|
||||
entry.deadline = deadline;
|
||||
entry.priority = project.value(QStringLiteral("priority")).toInt();
|
||||
projectEntries.append(entry);
|
||||
continue;
|
||||
}
|
||||
if (type == QStringLiteral("create"))
|
||||
{
|
||||
bool changed = false;
|
||||
@@ -900,7 +962,7 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
}
|
||||
}
|
||||
|
||||
if (specs.isEmpty())
|
||||
if (specs.isEmpty() && projectCreates.isEmpty())
|
||||
{
|
||||
if (tryLocalDeleteAllMeetings())
|
||||
{
|
||||
@@ -1543,7 +1605,7 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
}
|
||||
}
|
||||
|
||||
if (creates.isEmpty() && updates.isEmpty() && deletes.isEmpty())
|
||||
if (creates.isEmpty() && updates.isEmpty() && deletes.isEmpty() && projectCreates.isEmpty())
|
||||
{
|
||||
appendHistory(m_visibleText);
|
||||
finishRequest();
|
||||
@@ -1558,8 +1620,8 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
QString explanation = visibleReply.trimmed();
|
||||
if (explanation.isEmpty())
|
||||
{
|
||||
explanation = QStringLiteral("我整理了 %1 项日程调整建议。")
|
||||
.arg(creates.size() + updates.size() + deletes.size());
|
||||
explanation = QStringLiteral("我整理了 %1 项日程/长期项目建议。")
|
||||
.arg(creates.size() + updates.size() + deletes.size() + projectCreates.size());
|
||||
Q_EMIT streamDelta(explanation);
|
||||
}
|
||||
|
||||
@@ -1572,6 +1634,7 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
{QStringLiteral("creates"), creates},
|
||||
{QStringLiteral("updates"), updates},
|
||||
{QStringLiteral("deletes"), deletes},
|
||||
{QStringLiteral("projects"), projectCreates},
|
||||
};
|
||||
if (!m_store.insertProposedDiff(diff))
|
||||
{
|
||||
@@ -1582,6 +1645,7 @@ void AIService::buildProposalFromOperations(const QJsonArray& operations, const
|
||||
m_pendingDiffs.insert(diff.id, diff);
|
||||
proposal.diffId = diff.id;
|
||||
proposal.explanation = explanation;
|
||||
proposal.projects = projectEntries;
|
||||
appendHistory(explanation);
|
||||
Q_EMIT proposalReady(proposal);
|
||||
finishRequest();
|
||||
|
||||
@@ -79,6 +79,7 @@ private:
|
||||
|
||||
QString buildSystemPrompt();
|
||||
QString scheduleSummary();
|
||||
QString projectSummary();
|
||||
QJsonValue buildUserContent() const;
|
||||
void buildProposalFromOperations(const QJsonArray& operations, const QString& visibleReply);
|
||||
bool tryLocalDeleteAllMeetings();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDate>
|
||||
#include <QDateTime>
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
@@ -43,6 +44,19 @@ struct ProposedScheduleEntry
|
||||
int energyRequired = -1;
|
||||
};
|
||||
|
||||
struct ProposedProjectEntry
|
||||
{
|
||||
QString tempId;
|
||||
ProposedOperation operation = ProposedOperation::Create;
|
||||
QString projectId;
|
||||
QString title;
|
||||
QString oldTitle;
|
||||
QString description;
|
||||
std::optional<QDate> deadline;
|
||||
std::optional<QDate> oldDeadline;
|
||||
int priority = 1;
|
||||
};
|
||||
|
||||
/*
|
||||
* 类名: ScheduleProposal
|
||||
* 功能: AI 生成并已落库的待确认日程建议,供 UI 展示与选择性接受
|
||||
@@ -53,6 +67,7 @@ struct ScheduleProposal
|
||||
QString diffId;
|
||||
QString explanation;
|
||||
QVector<ProposedScheduleEntry> entries;
|
||||
QVector<ProposedProjectEntry> projects;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ScheduleProposal)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDate>
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#include <optional>
|
||||
|
||||
/*
|
||||
* 类名: Project
|
||||
* 功能: 跨多天的长期项目/目标,只持有模糊截止日期,不占用细粒度时间块
|
||||
* 线程安全: 否(值类型)
|
||||
*/
|
||||
struct Project
|
||||
{
|
||||
QString id;
|
||||
QString title;
|
||||
QString description;
|
||||
QString source = QStringLiteral("manual");
|
||||
QString sourceRef;
|
||||
std::optional<QDate> deadline;
|
||||
int priority = 1;
|
||||
QString status = QStringLiteral("active");
|
||||
QDateTime createdAt;
|
||||
QDateTime updatedAt;
|
||||
int version = 0;
|
||||
QString deviceId;
|
||||
};
|
||||
@@ -202,9 +202,11 @@ Result schedule(const std::vector<TaskInput>& tasks,
|
||||
{
|
||||
const int clampedMinutes = std::clamp(task.durationMinutes, 5, 24 * 60);
|
||||
const std::chrono::seconds duration{clampedMinutes * 60};
|
||||
const std::optional<SysTime> deadline =
|
||||
task.deadline.has_value() ? std::optional<SysTime>(std::min(*task.deadline, rangeEnd))
|
||||
: std::nullopt;
|
||||
std::optional<SysTime> deadline;
|
||||
if (task.deadline.has_value())
|
||||
{
|
||||
deadline = std::min(*task.deadline, rangeEnd);
|
||||
}
|
||||
if (deadline && *deadline <= rangeStart)
|
||||
{
|
||||
result.failures.push_back({task.id, "截止时间已经过去"});
|
||||
|
||||
@@ -52,8 +52,8 @@ private:
|
||||
QAction* m_statusAction = nullptr;
|
||||
int m_overdueCount = 0;
|
||||
QString m_pendingBlockId;
|
||||
QHash<uint, QString> m_dbusTargets;
|
||||
#ifdef Q_OS_LINUX
|
||||
class QDBusInterface* m_notifications = nullptr;
|
||||
QHash<uint, QString> m_dbusTargets;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -396,6 +396,166 @@ bool ScheduleService::createRecurringBlock(const QString& title,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScheduleService::createProject(const QString& title,
|
||||
const QString& description,
|
||||
const QDate& deadline,
|
||||
QString* error)
|
||||
{
|
||||
if (title.trimmed().isEmpty())
|
||||
{
|
||||
m_lastError = QStringLiteral("项目标题不能为空");
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!deadline.isValid())
|
||||
{
|
||||
m_lastError = QStringLiteral("长期项目需要截止日期");
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const QDateTime now = QDateTime::currentDateTime();
|
||||
Project project;
|
||||
project.id = newId();
|
||||
project.title = title.trimmed().left(200);
|
||||
project.description = description.trimmed().left(2000);
|
||||
project.source = QStringLiteral("manual");
|
||||
project.deadline = deadline;
|
||||
project.priority = 1;
|
||||
project.status = QStringLiteral("active");
|
||||
project.createdAt = now;
|
||||
project.updatedAt = now;
|
||||
project.version = 0;
|
||||
project.deviceId = m_deviceId;
|
||||
if (!m_store.insertProject(project))
|
||||
{
|
||||
m_lastError = m_store.lastError();
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
m_lastError.clear();
|
||||
Q_EMIT dataChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScheduleService::updateProject(const QString& projectId,
|
||||
const QString& title,
|
||||
const QString& description,
|
||||
const QDate& deadline,
|
||||
QString* error)
|
||||
{
|
||||
auto project = m_store.projectById(projectId);
|
||||
if (!project.has_value())
|
||||
{
|
||||
m_lastError = QStringLiteral("长期项目不存在: %1").arg(projectId);
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (title.trimmed().isEmpty() || !deadline.isValid())
|
||||
{
|
||||
m_lastError = QStringLiteral("长期项目标题或截止日期无效");
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
project->title = title.trimmed().left(200);
|
||||
project->description = description.trimmed().left(2000);
|
||||
project->deadline = deadline;
|
||||
project->updatedAt = QDateTime::currentDateTime();
|
||||
project->version += 1;
|
||||
project->deviceId = m_deviceId;
|
||||
if (!m_store.updateProject(*project))
|
||||
{
|
||||
m_lastError = m_store.lastError();
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
m_lastError.clear();
|
||||
Q_EMIT dataChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScheduleService::setProjectStatus(const QString& projectId, const QString& status, QString* error)
|
||||
{
|
||||
if (status != QStringLiteral("active") && status != QStringLiteral("done"))
|
||||
{
|
||||
m_lastError = QStringLiteral("非法长期项目状态: %1").arg(status);
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
auto project = m_store.projectById(projectId);
|
||||
if (!project.has_value())
|
||||
{
|
||||
m_lastError = QStringLiteral("长期项目不存在: %1").arg(projectId);
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
project->status = status;
|
||||
project->updatedAt = QDateTime::currentDateTime();
|
||||
project->version += 1;
|
||||
project->deviceId = m_deviceId;
|
||||
if (!m_store.updateProject(*project))
|
||||
{
|
||||
m_lastError = m_store.lastError();
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
m_lastError.clear();
|
||||
Q_EMIT dataChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScheduleService::deleteProject(const QString& projectId, QString* error)
|
||||
{
|
||||
if (!m_store.deleteProject(projectId))
|
||||
{
|
||||
m_lastError = m_store.lastError();
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
m_lastError.clear();
|
||||
Q_EMIT dataChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<Project> ScheduleService::projects() const
|
||||
{
|
||||
return m_store.projects(false);
|
||||
}
|
||||
|
||||
std::optional<Project> ScheduleService::projectById(const QString& projectId) const
|
||||
{
|
||||
return m_store.projectById(projectId);
|
||||
}
|
||||
|
||||
bool ScheduleService::updateBlock(const QString& blockId,
|
||||
const QString& title,
|
||||
const QDateTime& start,
|
||||
@@ -688,10 +848,15 @@ bool ScheduleService::applyProposedDiff(const ProposedDiff& diff,
|
||||
QString blockId;
|
||||
QString taskId;
|
||||
};
|
||||
struct PendingProject
|
||||
{
|
||||
Project project;
|
||||
};
|
||||
|
||||
QVector<PendingCreate> creates;
|
||||
QVector<PendingUpdate> updates;
|
||||
QVector<PendingDelete> deletes;
|
||||
QVector<PendingProject> projects;
|
||||
QSet<QString> updatedBlockIds;
|
||||
QSet<QString> deletedBlockIds;
|
||||
const QDateTime now = QDateTime::currentDateTime();
|
||||
@@ -933,7 +1098,44 @@ bool ScheduleService::applyProposedDiff(const ProposedDiff& diff,
|
||||
deletedBlockIds.insert(blockId);
|
||||
}
|
||||
|
||||
if (creates.isEmpty() && updates.isEmpty() && deletes.isEmpty())
|
||||
const QJsonArray projectArray = diff.payload.value(QStringLiteral("projects")).toArray();
|
||||
for (const QJsonValue& value : projectArray)
|
||||
{
|
||||
const QJsonObject object = value.toObject();
|
||||
const QString tempId = object.value(QStringLiteral("temp_id")).toString();
|
||||
if (!accepted.contains(tempId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const QString title = object.value(QStringLiteral("title")).toString().trimmed();
|
||||
const QString deadlineText = object.value(QStringLiteral("deadline")).toString().trimmed();
|
||||
const QDate deadline = QDate::fromString(deadlineText.left(10), Qt::ISODate);
|
||||
if (title.isEmpty() || !deadline.isValid())
|
||||
{
|
||||
m_lastError = QStringLiteral("AI 提议中的长期项目数据无效: %1").arg(tempId);
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Project project;
|
||||
project.id = newId();
|
||||
project.title = title.left(200);
|
||||
project.description = object.value(QStringLiteral("description")).toString().left(2000);
|
||||
project.source = QStringLiteral("ai_chat");
|
||||
project.sourceRef = object.value(QStringLiteral("source_ref")).toString();
|
||||
project.deadline = deadline;
|
||||
project.priority = qBound(1, object.value(QStringLiteral("priority")).toInt(2), 5);
|
||||
project.status = QStringLiteral("active");
|
||||
project.createdAt = now;
|
||||
project.updatedAt = now;
|
||||
project.version = 0;
|
||||
project.deviceId = m_deviceId;
|
||||
projects.append({project});
|
||||
}
|
||||
|
||||
if (creates.isEmpty() && updates.isEmpty() && deletes.isEmpty() && projects.isEmpty())
|
||||
{
|
||||
m_lastError = QStringLiteral("AI 提议中没有选中的有效操作");
|
||||
if (error)
|
||||
@@ -1121,6 +1323,20 @@ bool ScheduleService::applyProposedDiff(const ProposedDiff& diff,
|
||||
}
|
||||
}
|
||||
|
||||
for (const PendingProject& entry : projects)
|
||||
{
|
||||
if (!m_store.insertProject(entry.project))
|
||||
{
|
||||
m_store.rollback();
|
||||
m_lastError = m_store.lastError();
|
||||
if (error)
|
||||
{
|
||||
*error = m_lastError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_store.commit())
|
||||
{
|
||||
m_store.rollback();
|
||||
@@ -1206,6 +1422,41 @@ QVector<ScheduleItem> ScheduleService::search(const QString& query, int limit) c
|
||||
return m_store.search(query, limit);
|
||||
}
|
||||
|
||||
QVector<ScheduleItem> ScheduleService::completedItems(const QDate& from, const QDate& to) const
|
||||
{
|
||||
if (!from.isValid() || !to.isValid() || from > to)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
return m_store.completedBlocks(DateTimeUtils::localDayStartUtc(from),
|
||||
DateTimeUtils::localDayEndUtc(to));
|
||||
}
|
||||
|
||||
QVector<Project> ScheduleService::completedProjects(const QDate& from, const QDate& to) const
|
||||
{
|
||||
if (!from.isValid() || !to.isValid() || from > to)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
QVector<Project> result;
|
||||
for (const Project& project : m_store.projects(true))
|
||||
{
|
||||
if (project.status != QStringLiteral("done"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const QDate completed = project.updatedAt.date();
|
||||
if (completed >= from && completed <= to)
|
||||
{
|
||||
result.append(project);
|
||||
}
|
||||
}
|
||||
std::sort(result.begin(), result.end(), [](const Project& a, const Project& b) {
|
||||
return a.updatedAt > b.updatedAt;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
QString ScheduleService::lastError() const
|
||||
{
|
||||
return m_lastError;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "core/DailyInsights.h"
|
||||
#include "core/EnergyProfile.h"
|
||||
#include "core/Project.h"
|
||||
#include "core/ProposedDiff.h"
|
||||
#include "core/Recurrence.h"
|
||||
#include "core/ScheduleItem.h"
|
||||
@@ -29,6 +30,19 @@ public:
|
||||
const QDateTime& start,
|
||||
const QDateTime& end,
|
||||
QString* error = nullptr);
|
||||
bool createProject(const QString& title,
|
||||
const QString& description,
|
||||
const QDate& deadline,
|
||||
QString* error = nullptr);
|
||||
bool updateProject(const QString& projectId,
|
||||
const QString& title,
|
||||
const QString& description,
|
||||
const QDate& deadline,
|
||||
QString* error = nullptr);
|
||||
bool setProjectStatus(const QString& projectId, const QString& status, QString* error = nullptr);
|
||||
bool deleteProject(const QString& projectId, QString* error = nullptr);
|
||||
QVector<Project> projects() const;
|
||||
std::optional<Project> projectById(const QString& projectId) const;
|
||||
bool createRecurringBlock(const QString& title,
|
||||
const QDateTime& start,
|
||||
const QDateTime& end,
|
||||
@@ -63,6 +77,8 @@ public:
|
||||
QVector<ScheduleItem> itemsForRange(const QDate& from, const QDate& to) const;
|
||||
QVector<ScheduleItem> overdueItems(const QDateTime& now = QDateTime::currentDateTime()) const;
|
||||
QVector<ScheduleItem> search(const QString& query, int limit = 100) const;
|
||||
QVector<ScheduleItem> completedItems(const QDate& from, const QDate& to) const;
|
||||
QVector<Project> completedProjects(const QDate& from, const QDate& to) const;
|
||||
QString lastError() const;
|
||||
|
||||
const EnergyProfile& energyProfile() const;
|
||||
|
||||
@@ -180,7 +180,52 @@ QVector<Migration> all()
|
||||
" VALUES('timeblock', OLD.id, 'delete', %1, %2); END")
|
||||
.arg(blockDeletePayload, nowExpression),
|
||||
};
|
||||
migrations.append(v3);
|
||||
|
||||
Migration v4;
|
||||
v4.version = 4;
|
||||
v4.name = QStringLiteral("long_term_projects");
|
||||
const QString projectJson = QStringLiteral(
|
||||
"json_object('id',%1.id,'title',%1.title,'description',%1.description,'source',%1.source,"
|
||||
"'source_ref',%1.source_ref,'deadline',%1.deadline,'priority',%1.priority,'status',%1.status,"
|
||||
"'created_at',%1.created_at,'updated_at',%1.updated_at,'version',%1.version,'device_id',%1.device_id)");
|
||||
const QString projectNow = QStringLiteral("strftime('%Y-%m-%dT%H:%M:%fZ','now')");
|
||||
v4.statements = {
|
||||
QStringLiteral(
|
||||
"CREATE TABLE IF NOT EXISTS project ("
|
||||
" id TEXT PRIMARY KEY,"
|
||||
" title TEXT NOT NULL,"
|
||||
" description TEXT,"
|
||||
" source TEXT,"
|
||||
" source_ref TEXT,"
|
||||
" deadline TEXT,"
|
||||
" priority INTEGER DEFAULT 1,"
|
||||
" status TEXT DEFAULT 'active',"
|
||||
" created_at TEXT NOT NULL,"
|
||||
" updated_at TEXT NOT NULL,"
|
||||
" version INTEGER DEFAULT 0,"
|
||||
" device_id TEXT NOT NULL"
|
||||
")"),
|
||||
QStringLiteral("CREATE INDEX IF NOT EXISTS idx_project_deadline ON project(status, deadline)"),
|
||||
QStringLiteral(
|
||||
"CREATE TRIGGER IF NOT EXISTS trg_project_outbox_insert AFTER INSERT ON project "
|
||||
"WHEN NOT EXISTS (SELECT 1 FROM sync_remote_apply) BEGIN "
|
||||
" INSERT INTO sync_outbox(entity_type, entity_id, op, payload, created_at) "
|
||||
" VALUES('project', NEW.id, 'upsert', %1, NEW.updated_at); END")
|
||||
.arg(projectJson.arg("NEW")),
|
||||
QStringLiteral(
|
||||
"CREATE TRIGGER IF NOT EXISTS trg_project_outbox_update AFTER UPDATE ON project "
|
||||
"WHEN NOT EXISTS (SELECT 1 FROM sync_remote_apply) BEGIN "
|
||||
" INSERT INTO sync_outbox(entity_type, entity_id, op, payload, created_at) "
|
||||
" VALUES('project', NEW.id, 'upsert', %1, NEW.updated_at); END")
|
||||
.arg(projectJson.arg("NEW")),
|
||||
QStringLiteral(
|
||||
"CREATE TRIGGER IF NOT EXISTS trg_project_outbox_delete AFTER DELETE ON project "
|
||||
"WHEN NOT EXISTS (SELECT 1 FROM sync_remote_apply) BEGIN "
|
||||
" INSERT INTO sync_outbox(entity_type, entity_id, op, payload, created_at) "
|
||||
" VALUES('project', OLD.id, 'delete', json_set(%1, '$.updated_at', %2), %2); END")
|
||||
.arg(projectJson.arg("OLD"), projectNow),
|
||||
};
|
||||
migrations.append(v4);
|
||||
|
||||
return migrations;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,36 @@ TimeBlock mapTimeBlock(const QSqlQuery& query, int offset)
|
||||
return block;
|
||||
}
|
||||
|
||||
Project mapProject(const QSqlQuery& query, int offset = 0)
|
||||
{
|
||||
Project project;
|
||||
project.id = query.value(offset + 0).toString();
|
||||
project.title = query.value(offset + 1).toString();
|
||||
project.description = query.value(offset + 2).toString();
|
||||
project.source = query.value(offset + 3).toString();
|
||||
project.sourceRef = query.value(offset + 4).toString();
|
||||
const QVariant deadline = query.value(offset + 5);
|
||||
if (!deadline.isNull())
|
||||
{
|
||||
const QDate date = QDate::fromString(deadline.toString(), Qt::ISODate);
|
||||
if (date.isValid())
|
||||
{
|
||||
project.deadline = date;
|
||||
}
|
||||
}
|
||||
project.priority = query.value(offset + 6).toInt();
|
||||
project.status = query.value(offset + 7).toString();
|
||||
project.createdAt = DateTimeUtils::fromDb(query.value(offset + 8).toString());
|
||||
project.updatedAt = DateTimeUtils::fromDb(query.value(offset + 9).toString());
|
||||
project.version = query.value(offset + 10).toInt();
|
||||
project.deviceId = query.value(offset + 11).toString();
|
||||
return project;
|
||||
}
|
||||
|
||||
constexpr const char* kProjectColumns =
|
||||
"p.id, p.title, p.description, p.source, p.source_ref, p.deadline, p.priority, p.status, "
|
||||
"p.created_at, p.updated_at, p.version, p.device_id";
|
||||
|
||||
constexpr const char* kTaskColumns =
|
||||
"t.id, t.title, t.description, t.source, t.source_ref, t.estimated_min, t.energy_req, "
|
||||
"t.deadline, t.priority, t.status, t.created_at, t.updated_at, t.version, t.device_id";
|
||||
@@ -502,6 +532,141 @@ bool SqliteStore::hasBlocksForTask(const QString& taskId)
|
||||
return query.next();
|
||||
}
|
||||
|
||||
bool SqliteStore::insertProject(const Project& project)
|
||||
{
|
||||
m_lastError.clear();
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
return setError(QStringLiteral("数据库未打开"));
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
query.prepare(QStringLiteral(
|
||||
"INSERT INTO project (id, title, description, source, source_ref, deadline, priority, "
|
||||
"status, created_at, updated_at, version, device_id) "
|
||||
"VALUES (:id, :title, :description, :source, :source_ref, :deadline, :priority, "
|
||||
":status, :created_at, :updated_at, :version, :device_id)"));
|
||||
query.bindValue(QStringLiteral(":id"), project.id);
|
||||
query.bindValue(QStringLiteral(":title"), project.title);
|
||||
query.bindValue(QStringLiteral(":description"), project.description);
|
||||
query.bindValue(QStringLiteral(":source"), project.source);
|
||||
query.bindValue(QStringLiteral(":source_ref"), project.sourceRef);
|
||||
query.bindValue(QStringLiteral(":deadline"),
|
||||
project.deadline.has_value() ? QVariant(project.deadline->toString(Qt::ISODate))
|
||||
: QVariant());
|
||||
query.bindValue(QStringLiteral(":priority"), project.priority);
|
||||
query.bindValue(QStringLiteral(":status"), project.status);
|
||||
query.bindValue(QStringLiteral(":created_at"), DateTimeUtils::toDb(project.createdAt));
|
||||
query.bindValue(QStringLiteral(":updated_at"), DateTimeUtils::toDb(project.updatedAt));
|
||||
query.bindValue(QStringLiteral(":version"), project.version);
|
||||
query.bindValue(QStringLiteral(":device_id"), project.deviceId);
|
||||
if (!query.exec())
|
||||
{
|
||||
return setError(QStringLiteral("插入长期项目失败: %1").arg(query.lastError().text()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SqliteStore::updateProject(const Project& project)
|
||||
{
|
||||
m_lastError.clear();
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
return setError(QStringLiteral("数据库未打开"));
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
query.prepare(QStringLiteral(
|
||||
"UPDATE project SET title = :title, description = :description, source = :source, "
|
||||
"source_ref = :source_ref, deadline = :deadline, priority = :priority, status = :status, "
|
||||
"updated_at = :updated_at, version = :version, device_id = :device_id WHERE id = :id"));
|
||||
query.bindValue(QStringLiteral(":title"), project.title);
|
||||
query.bindValue(QStringLiteral(":description"), project.description);
|
||||
query.bindValue(QStringLiteral(":source"), project.source);
|
||||
query.bindValue(QStringLiteral(":source_ref"), project.sourceRef);
|
||||
query.bindValue(QStringLiteral(":deadline"),
|
||||
project.deadline.has_value() ? QVariant(project.deadline->toString(Qt::ISODate))
|
||||
: QVariant());
|
||||
query.bindValue(QStringLiteral(":priority"), project.priority);
|
||||
query.bindValue(QStringLiteral(":status"), project.status);
|
||||
query.bindValue(QStringLiteral(":updated_at"), DateTimeUtils::toDb(project.updatedAt));
|
||||
query.bindValue(QStringLiteral(":version"), project.version);
|
||||
query.bindValue(QStringLiteral(":device_id"), project.deviceId);
|
||||
query.bindValue(QStringLiteral(":id"), project.id);
|
||||
if (!query.exec())
|
||||
{
|
||||
return setError(QStringLiteral("更新长期项目失败: %1").arg(query.lastError().text()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SqliteStore::deleteProject(const QString& id)
|
||||
{
|
||||
m_lastError.clear();
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
return setError(QStringLiteral("数据库未打开"));
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
query.prepare(QStringLiteral("DELETE FROM project WHERE id = :id"));
|
||||
query.bindValue(QStringLiteral(":id"), id);
|
||||
if (!query.exec())
|
||||
{
|
||||
return setError(QStringLiteral("删除长期项目失败: %1").arg(query.lastError().text()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::optional<Project> SqliteStore::projectById(const QString& id) const
|
||||
{
|
||||
m_lastError.clear();
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
setError(QStringLiteral("数据库未打开"));
|
||||
return std::nullopt;
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
query.prepare(QStringLiteral("SELECT %1 FROM project p WHERE p.id = :id")
|
||||
.arg(QString::fromLatin1(kProjectColumns)));
|
||||
query.bindValue(QStringLiteral(":id"), id);
|
||||
if (!query.exec())
|
||||
{
|
||||
setError(QStringLiteral("查询长期项目失败: %1").arg(query.lastError().text()));
|
||||
return std::nullopt;
|
||||
}
|
||||
if (!query.next())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return mapProject(query);
|
||||
}
|
||||
|
||||
QVector<Project> SqliteStore::projects(bool includeDone) const
|
||||
{
|
||||
m_lastError.clear();
|
||||
QVector<Project> result;
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
setError(QStringLiteral("数据库未打开"));
|
||||
return result;
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
const QString sql = QStringLiteral(
|
||||
"SELECT %1 FROM project p %2 "
|
||||
"ORDER BY CASE WHEN p.deadline IS NULL THEN 1 ELSE 0 END, "
|
||||
"p.deadline ASC, p.priority DESC, p.title ASC")
|
||||
.arg(QString::fromLatin1(kProjectColumns),
|
||||
includeDone ? QString() : QStringLiteral("WHERE p.status = 'active'"));
|
||||
if (!query.exec(sql))
|
||||
{
|
||||
setError(QStringLiteral("查询长期项目失败: %1").arg(query.lastError().text()));
|
||||
return result;
|
||||
}
|
||||
while (query.next())
|
||||
{
|
||||
result.append(mapProject(query));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SqliteStore::insertTimeBlock(const TimeBlock& block)
|
||||
{
|
||||
m_lastError.clear();
|
||||
@@ -916,7 +1081,9 @@ bool SqliteStore::applyRemoteChange(const RemoteChange& change, QString* error)
|
||||
{
|
||||
return setError(QStringLiteral("数据库未打开"));
|
||||
}
|
||||
if (change.entityType != QStringLiteral("task") && change.entityType != QStringLiteral("timeblock"))
|
||||
if (change.entityType != QStringLiteral("task") &&
|
||||
change.entityType != QStringLiteral("timeblock") &&
|
||||
change.entityType != QStringLiteral("project"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -931,7 +1098,8 @@ bool SqliteStore::applyRemoteChange(const RemoteChange& change, QString* error)
|
||||
QSqlQuery current(m_database);
|
||||
const QString table = change.entityType == QStringLiteral("task")
|
||||
? QStringLiteral("task")
|
||||
: QStringLiteral("timeblock");
|
||||
: (change.entityType == QStringLiteral("project") ? QStringLiteral("project")
|
||||
: QStringLiteral("timeblock"));
|
||||
current.prepare(QStringLiteral("SELECT updated_at FROM %1 WHERE id = :id").arg(table));
|
||||
current.bindValue(QStringLiteral(":id"), change.entityId);
|
||||
if (!current.exec())
|
||||
@@ -959,7 +1127,8 @@ bool SqliteStore::applyRemoteChange(const RemoteChange& change, QString* error)
|
||||
|
||||
const QString table = change.entityType == QStringLiteral("task")
|
||||
? QStringLiteral("task")
|
||||
: QStringLiteral("timeblock");
|
||||
: (change.entityType == QStringLiteral("project") ? QStringLiteral("project")
|
||||
: QStringLiteral("timeblock"));
|
||||
QSqlQuery current(m_database);
|
||||
current.prepare(QStringLiteral("SELECT updated_at FROM %1 WHERE id = :id").arg(table));
|
||||
current.bindValue(QStringLiteral(":id"), change.entityId);
|
||||
@@ -967,7 +1136,26 @@ bool SqliteStore::applyRemoteChange(const RemoteChange& change, QString* error)
|
||||
{
|
||||
return setError(QStringLiteral("查询远程 upsert 目标失败: %1").arg(current.lastError().text()));
|
||||
}
|
||||
if (current.next() && !remoteWins(current.value(0).toString(), remoteTime, false))
|
||||
bool hasLocal = current.next();
|
||||
const QString localUpdated = hasLocal ? current.value(0).toString() : QString();
|
||||
bool forceCompletion = false;
|
||||
if (change.entityType == QStringLiteral("timeblock"))
|
||||
{
|
||||
const QString remoteStatus = jsonString(change.payload, "status").toString();
|
||||
if (remoteStatus == QStringLiteral("done"))
|
||||
{
|
||||
QSqlQuery statusQuery(m_database);
|
||||
statusQuery.prepare(QStringLiteral("SELECT status FROM timeblock WHERE id = :id"));
|
||||
statusQuery.bindValue(QStringLiteral(":id"), change.entityId);
|
||||
if (statusQuery.exec() && statusQuery.next())
|
||||
{
|
||||
const QString localStatus = statusQuery.value(0).toString();
|
||||
forceCompletion = localStatus == QStringLiteral("scheduled") ||
|
||||
localStatus == QStringLiteral("in_progress");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasLocal && !forceCompletion && !remoteWins(localUpdated, remoteTime, false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1009,6 +1197,40 @@ bool SqliteStore::applyRemoteChange(const RemoteChange& change, QString* error)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (change.entityType == QStringLiteral("project"))
|
||||
{
|
||||
const QJsonObject object = change.payload;
|
||||
QSqlQuery upsert(m_database);
|
||||
upsert.prepare(QStringLiteral(
|
||||
"INSERT INTO project (id, title, description, source, source_ref, deadline, priority, "
|
||||
"status, created_at, updated_at, version, device_id) "
|
||||
"VALUES (:id, :title, :description, :source, :source_ref, :deadline, :priority, "
|
||||
":status, :created_at, :updated_at, :version, :device_id) "
|
||||
"ON CONFLICT(id) DO UPDATE SET title=excluded.title, description=excluded.description, "
|
||||
"source=excluded.source, source_ref=excluded.source_ref, deadline=excluded.deadline, "
|
||||
"priority=excluded.priority, status=excluded.status, updated_at=excluded.updated_at, "
|
||||
"version=excluded.version, device_id=excluded.device_id"));
|
||||
upsert.bindValue(QStringLiteral(":id"), change.entityId);
|
||||
upsert.bindValue(QStringLiteral(":title"),
|
||||
jsonString(object, "title").isValid() ? jsonString(object, "title")
|
||||
: QVariant(QStringLiteral("未命名项目")));
|
||||
upsert.bindValue(QStringLiteral(":description"), jsonString(object, "description"));
|
||||
upsert.bindValue(QStringLiteral(":source"), jsonString(object, "source"));
|
||||
upsert.bindValue(QStringLiteral(":source_ref"), jsonString(object, "source_ref"));
|
||||
upsert.bindValue(QStringLiteral(":deadline"), jsonString(object, "deadline"));
|
||||
upsert.bindValue(QStringLiteral(":priority"), jsonInt(object, "priority"));
|
||||
upsert.bindValue(QStringLiteral(":status"), jsonString(object, "status"));
|
||||
upsert.bindValue(QStringLiteral(":created_at"), jsonString(object, "created_at"));
|
||||
upsert.bindValue(QStringLiteral(":updated_at"), remoteTime);
|
||||
upsert.bindValue(QStringLiteral(":version"), change.version);
|
||||
upsert.bindValue(QStringLiteral(":device_id"), change.deviceId);
|
||||
if (!upsert.exec())
|
||||
{
|
||||
return setError(QStringLiteral("应用远程长期项目失败: %1").arg(upsert.lastError().text()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// timeblock
|
||||
const QJsonObject object = change.payload;
|
||||
const QString taskId = object.value(QStringLiteral("task_id")).toString();
|
||||
@@ -1110,6 +1332,41 @@ std::optional<Recurrence> SqliteStore::recurrenceForTask(const QString& taskId)
|
||||
return recurrence;
|
||||
}
|
||||
|
||||
QVector<ScheduleItem> SqliteStore::completedBlocks(const QDateTime& fromUtc,
|
||||
const QDateTime& toUtc) const
|
||||
{
|
||||
m_lastError.clear();
|
||||
QVector<ScheduleItem> items;
|
||||
if (!isOpenInternal())
|
||||
{
|
||||
setError(QStringLiteral("数据库未打开"));
|
||||
return items;
|
||||
}
|
||||
QSqlQuery query(m_database);
|
||||
query.prepare(QStringLiteral(
|
||||
"SELECT %1, %2 FROM timeblock b JOIN task t ON t.id = b.task_id "
|
||||
"WHERE b.status = 'done' "
|
||||
"AND COALESCE(b.done_at, b.end_at) >= :from "
|
||||
"AND COALESCE(b.done_at, b.end_at) < :to "
|
||||
"ORDER BY COALESCE(b.done_at, b.end_at) DESC")
|
||||
.arg(QString::fromLatin1(kBlockColumns), QString::fromLatin1(kTaskColumns)));
|
||||
query.bindValue(QStringLiteral(":from"), DateTimeUtils::toDb(fromUtc));
|
||||
query.bindValue(QStringLiteral(":to"), DateTimeUtils::toDb(toUtc));
|
||||
if (!query.exec())
|
||||
{
|
||||
setError(QStringLiteral("查询已完成日程失败: %1").arg(query.lastError().text()));
|
||||
return items;
|
||||
}
|
||||
while (query.next())
|
||||
{
|
||||
ScheduleItem item;
|
||||
item.block = mapTimeBlock(query, 0);
|
||||
item.task = mapTask(query, 13);
|
||||
items.append(item);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
QVector<ScheduleItem> SqliteStore::search(const QString& query, int limit) const
|
||||
{
|
||||
m_lastError.clear();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "core/EnergyProfile.h"
|
||||
#include "core/Project.h"
|
||||
#include "core/ProposedDiff.h"
|
||||
#include "core/Recurrence.h"
|
||||
#include "core/SyncTypes.h"
|
||||
@@ -46,6 +47,12 @@ public:
|
||||
bool insertRecurrence(const Recurrence& recurrence);
|
||||
std::optional<Recurrence> recurrenceForTask(const QString& taskId) const;
|
||||
|
||||
bool insertProject(const Project& project);
|
||||
bool updateProject(const Project& project);
|
||||
bool deleteProject(const QString& id);
|
||||
std::optional<Project> projectById(const QString& id) const;
|
||||
QVector<Project> projects(bool includeDone = false) const;
|
||||
|
||||
bool insertTimeBlock(const TimeBlock& block);
|
||||
bool updateTimeBlock(const TimeBlock& block);
|
||||
std::optional<TimeBlock> timeBlockById(const QString& id);
|
||||
@@ -60,6 +67,7 @@ public:
|
||||
// 已结束但仍未完成、且结束时间在最近 windowDays 内的块。
|
||||
QVector<ScheduleItem> overdueBefore(const QDateTime& nowUtc, int windowDays = 30) const;
|
||||
QVector<ScheduleItem> search(const QString& query, int limit = 100) const;
|
||||
QVector<ScheduleItem> completedBlocks(const QDateTime& fromUtc, const QDateTime& toUtc) const;
|
||||
|
||||
QVector<SyncOutboxItem> outboxBatch(int limit, QString* error = nullptr) const;
|
||||
int outboxCount(QString* error = nullptr) const;
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
#include "sync/SyncService.h"
|
||||
#include "ui/MainWindow.h"
|
||||
#include "ui/dialogs/BlockEditDialog.h"
|
||||
#include "ui/dialogs/CompletedSummaryDialog.h"
|
||||
#include "ui/dialogs/DailyReviewDialog.h"
|
||||
#include "ui/dialogs/ProjectDialog.h"
|
||||
#include "ui/dialogs/SettingsDialog.h"
|
||||
#include "ui/panels/ChatPanel.h"
|
||||
#include "ui/panels/TodayPanel.h"
|
||||
@@ -266,6 +268,23 @@ void CompactWindow::connectSignals()
|
||||
}
|
||||
});
|
||||
connect(m_todayPanel, &TodayPanel::reviewRequested, this, &CompactWindow::openDailyReview);
|
||||
connect(m_todayPanel, &TodayPanel::achievementsRequested, this, &CompactWindow::openCompletedSummary);
|
||||
connect(m_todayPanel, &TodayPanel::newProjectRequested, this, &CompactWindow::openNewProject);
|
||||
connect(m_todayPanel, &TodayPanel::editProjectRequested, this, &CompactWindow::openEditProject);
|
||||
connect(m_todayPanel, &TodayPanel::projectStatusRequested, this, [this](const QString& id, const QString& status) {
|
||||
QString error;
|
||||
if (!m_scheduleService.setProjectStatus(id, status, &error))
|
||||
{
|
||||
showError(QStringLiteral("更新长期项目失败"), error);
|
||||
}
|
||||
});
|
||||
connect(m_todayPanel, &TodayPanel::deleteProjectRequested, this, [this](const QString& id) {
|
||||
QString error;
|
||||
if (!m_scheduleService.deleteProject(id, &error))
|
||||
{
|
||||
showError(QStringLiteral("删除长期项目失败"), error);
|
||||
}
|
||||
});
|
||||
|
||||
connect(&m_notificationService,
|
||||
&NotificationService::overdueListChanged,
|
||||
@@ -377,6 +396,7 @@ void CompactWindow::reloadToday()
|
||||
const QDateTime now = QDateTime::currentDateTime();
|
||||
m_todayPanel->setDate(today);
|
||||
m_todayPanel->setItems(m_todayItems, now);
|
||||
m_todayPanel->setProjects(m_scheduleService.projects());
|
||||
const QVector<Suggestion> suggestions = m_scheduleService.suggestions(now);
|
||||
m_todayPanel->setInsightText(
|
||||
suggestions.isEmpty() ? QString()
|
||||
@@ -420,6 +440,57 @@ void CompactWindow::openDailyReview()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void CompactWindow::openCompletedSummary()
|
||||
{
|
||||
CompletedSummaryDialog dialog(m_scheduleService, m_tokens, this);
|
||||
dialog.moveToCenter();
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void CompactWindow::openNewProject()
|
||||
{
|
||||
ProjectDialog dialog(m_tokens, this);
|
||||
dialog.moveToCenter();
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
QString error;
|
||||
if (!m_scheduleService.createProject(dialog.titleValue(),
|
||||
dialog.descriptionValue(),
|
||||
dialog.deadlineValue(),
|
||||
&error))
|
||||
{
|
||||
showError(QStringLiteral("创建长期项目失败"), error);
|
||||
}
|
||||
}
|
||||
|
||||
void CompactWindow::openEditProject(const QString& projectId)
|
||||
{
|
||||
const auto project = m_scheduleService.projectById(projectId);
|
||||
if (!project.has_value())
|
||||
{
|
||||
showError(QStringLiteral("编辑长期项目失败"), QStringLiteral("找不到该项目"));
|
||||
return;
|
||||
}
|
||||
ProjectDialog dialog(m_tokens, this);
|
||||
dialog.setValues(project->title, project->description, project->deadline.value_or(QDate()));
|
||||
dialog.moveToCenter();
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
QString error;
|
||||
if (!m_scheduleService.updateProject(projectId,
|
||||
dialog.titleValue(),
|
||||
dialog.descriptionValue(),
|
||||
dialog.deadlineValue(),
|
||||
&error))
|
||||
{
|
||||
showError(QStringLiteral("保存长期项目失败"), error);
|
||||
}
|
||||
}
|
||||
|
||||
void CompactWindow::updateSyncStatus(const QString& status)
|
||||
{
|
||||
if (!m_syncLabel)
|
||||
|
||||
@@ -65,6 +65,9 @@ private:
|
||||
void openSchedule();
|
||||
void openSettings();
|
||||
void openDailyReview();
|
||||
void openCompletedSummary();
|
||||
void openNewProject();
|
||||
void openEditProject(const QString& projectId);
|
||||
void openEditDialog(const QString& blockId);
|
||||
void showError(const QString& title, const QString& message);
|
||||
void updateSyncStatus(const QString& status);
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
#include "services/ScheduleService.h"
|
||||
#include "sync/SyncService.h"
|
||||
#include "ui/dialogs/BlockEditDialog.h"
|
||||
#include "ui/dialogs/CompletedSummaryDialog.h"
|
||||
#include "ui/dialogs/DailyReviewDialog.h"
|
||||
#include "ui/dialogs/ProjectDialog.h"
|
||||
#include "ui/dialogs/SearchDialog.h"
|
||||
#include "ui/dialogs/SettingsDialog.h"
|
||||
#include "ui/panels/TodayPanel.h"
|
||||
@@ -423,6 +425,23 @@ void MainWindow::connectSignals()
|
||||
m_grid->setFocus(Qt::OtherFocusReason);
|
||||
});
|
||||
connect(m_todayPanel, &TodayPanel::reviewRequested, this, &MainWindow::openDailyReview);
|
||||
connect(m_todayPanel, &TodayPanel::achievementsRequested, this, &MainWindow::openCompletedSummary);
|
||||
connect(m_todayPanel, &TodayPanel::newProjectRequested, this, &MainWindow::openNewProject);
|
||||
connect(m_todayPanel, &TodayPanel::editProjectRequested, this, &MainWindow::openEditProject);
|
||||
connect(m_todayPanel, &TodayPanel::projectStatusRequested, this, [this](const QString& id, const QString& status) {
|
||||
QString error;
|
||||
if (!m_scheduleService.setProjectStatus(id, status, &error))
|
||||
{
|
||||
showError(QStringLiteral("更新长期项目失败"), error);
|
||||
}
|
||||
});
|
||||
connect(m_todayPanel, &TodayPanel::deleteProjectRequested, this, [this](const QString& id) {
|
||||
QString error;
|
||||
if (!m_scheduleService.deleteProject(id, &error))
|
||||
{
|
||||
showError(QStringLiteral("删除长期项目失败"), error);
|
||||
}
|
||||
});
|
||||
|
||||
connect(&m_notificationService,
|
||||
&NotificationService::overdueListChanged,
|
||||
@@ -626,6 +645,7 @@ void MainWindow::reloadCurrentView()
|
||||
|
||||
m_todayPanel->setDate(m_currentDate);
|
||||
m_todayPanel->setItems(agendaItems, now);
|
||||
m_todayPanel->setProjects(m_scheduleService.projects());
|
||||
if (m_currentDate == QDate::currentDate())
|
||||
{
|
||||
const QVector<Suggestion> suggestions = m_scheduleService.suggestions(now);
|
||||
@@ -882,6 +902,57 @@ void MainWindow::openDailyReview()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::openCompletedSummary()
|
||||
{
|
||||
CompletedSummaryDialog dialog(m_scheduleService, m_tokens, this);
|
||||
dialog.moveToCenter();
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::openNewProject()
|
||||
{
|
||||
ProjectDialog dialog(m_tokens, this);
|
||||
dialog.moveToCenter();
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
QString error;
|
||||
if (!m_scheduleService.createProject(dialog.titleValue(),
|
||||
dialog.descriptionValue(),
|
||||
dialog.deadlineValue(),
|
||||
&error))
|
||||
{
|
||||
showError(QStringLiteral("创建长期项目失败"), error);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openEditProject(const QString& projectId)
|
||||
{
|
||||
const auto project = m_scheduleService.projectById(projectId);
|
||||
if (!project.has_value())
|
||||
{
|
||||
showError(QStringLiteral("编辑长期项目失败"), QStringLiteral("找不到该项目"));
|
||||
return;
|
||||
}
|
||||
ProjectDialog dialog(m_tokens, this);
|
||||
dialog.setValues(project->title, project->description, project->deadline.value_or(QDate()));
|
||||
dialog.moveToCenter();
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
QString error;
|
||||
if (!m_scheduleService.updateProject(projectId,
|
||||
dialog.titleValue(),
|
||||
dialog.descriptionValue(),
|
||||
dialog.deadlineValue(),
|
||||
&error))
|
||||
{
|
||||
showError(QStringLiteral("保存长期项目失败"), error);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openSearch()
|
||||
{
|
||||
SearchDialog dialog(m_scheduleService,
|
||||
|
||||
@@ -91,6 +91,9 @@ private:
|
||||
void openEditDialog(const QString& blockId);
|
||||
void openSettings();
|
||||
void openDailyReview();
|
||||
void openCompletedSummary();
|
||||
void openNewProject();
|
||||
void openEditProject(const QString& projectId);
|
||||
void updateOverdueBanner(const QVector<ScheduleItem>& items);
|
||||
void showError(const QString& title, const QString& message);
|
||||
void updateSyncStatus(const QString& status);
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
#include "CompletedSummaryDialog.h"
|
||||
|
||||
#include <QDate>
|
||||
#include <QFrame>
|
||||
#include <QLayoutItem>
|
||||
#include <QSet>
|
||||
#include <QTimer>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "ElaComboBox.h"
|
||||
#include "ElaPushButton.h"
|
||||
#include "ElaScrollArea.h"
|
||||
#include "ElaText.h"
|
||||
#include "core/DateTimeUtils.h"
|
||||
#include "services/ScheduleService.h"
|
||||
#include "storage/SqliteStore.h"
|
||||
#include "ui/theme/AnimationUtils.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
QString formatMinutes(int minutes)
|
||||
{
|
||||
if (minutes <= 0)
|
||||
{
|
||||
return QStringLiteral("0 分钟");
|
||||
}
|
||||
return DateTimeUtils::formatDuration(minutes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
CompletedSummaryDialog::CompletedSummaryDialog(ScheduleService& scheduleService,
|
||||
const ThemeTokens& tokens,
|
||||
QWidget* parent)
|
||||
: ElaDialog(parent)
|
||||
, m_scheduleService(scheduleService)
|
||||
, m_tokens(tokens)
|
||||
{
|
||||
setWindowTitle(QStringLiteral("已完成汇总"));
|
||||
setWindowButtonFlags(ElaAppBarType::CloseButtonHint);
|
||||
resize(640, 680);
|
||||
setMinimumWidth(560);
|
||||
|
||||
auto* root = new QVBoxLayout(this);
|
||||
root->setContentsMargins(24, 8, 24, 18);
|
||||
root->setSpacing(10);
|
||||
|
||||
auto* title = new ElaText(QStringLiteral("已完成汇总"), 18, this);
|
||||
QFont titleFont = title->font();
|
||||
titleFont.setWeight(QFont::DemiBold);
|
||||
title->setFont(titleFont);
|
||||
root->addWidget(title);
|
||||
|
||||
auto* subtitle = new ElaText(QStringLiteral("把完成的事情放在一起,看看你已经走了多远。"), 11, this);
|
||||
subtitle->setTextStyle(ElaTextType::Caption);
|
||||
root->addWidget(subtitle);
|
||||
|
||||
auto* rangeRow = new QHBoxLayout();
|
||||
rangeRow->setSpacing(10);
|
||||
auto* rangeLabel = new ElaText(QStringLiteral("范围"), 12, this);
|
||||
m_rangeCombo = new ElaComboBox(this);
|
||||
m_rangeCombo->addItems({QStringLiteral("本周"),
|
||||
QStringLiteral("本月"),
|
||||
QStringLiteral("全部")});
|
||||
m_rangeCombo->setCurrentIndex(2);
|
||||
m_rangeCombo->setFixedSize(130, 32);
|
||||
rangeRow->addWidget(rangeLabel, 0, Qt::AlignVCenter);
|
||||
rangeRow->addWidget(m_rangeCombo, 0, Qt::AlignVCenter);
|
||||
rangeRow->addStretch(1);
|
||||
root->addLayout(rangeRow);
|
||||
|
||||
auto* stats = new QHBoxLayout();
|
||||
stats->setSpacing(28);
|
||||
const auto addStat = [this, stats](const QString& label, ElaText** valueOut) {
|
||||
auto* column = new QVBoxLayout();
|
||||
column->setSpacing(2);
|
||||
auto* title = new ElaText(label, 11, this);
|
||||
title->setTextStyle(ElaTextType::Caption);
|
||||
auto* value = new ElaText(QStringLiteral("0"), 19, this);
|
||||
QFont font = value->font();
|
||||
font.setWeight(QFont::DemiBold);
|
||||
value->setFont(font);
|
||||
column->addWidget(title);
|
||||
column->addWidget(value);
|
||||
stats->addLayout(column);
|
||||
*valueOut = value;
|
||||
};
|
||||
addStat(QStringLiteral("短期任务"), &m_taskStat);
|
||||
addStat(QStringLiteral("专注时长"), &m_focusStat);
|
||||
addStat(QStringLiteral("长期项目"), &m_projectStat);
|
||||
addStat(QStringLiteral("连续完成"), &m_streakStat);
|
||||
root->addLayout(stats);
|
||||
|
||||
auto* divider = new QFrame(this);
|
||||
divider->setFrameShape(QFrame::HLine);
|
||||
divider->setFrameShadow(QFrame::Plain);
|
||||
root->addWidget(divider);
|
||||
|
||||
m_scrollArea = new ElaScrollArea(this);
|
||||
m_scrollArea->setWidgetResizable(true);
|
||||
m_scrollArea->setFrameShape(QFrame::NoFrame);
|
||||
m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
m_scrollArea->setStyleSheet(QStringLiteral("QScrollArea{background:transparent;border:none;}"));
|
||||
m_scrollArea->viewport()->setAutoFillBackground(false);
|
||||
m_scrollArea->viewport()->setStyleSheet(QStringLiteral("background:transparent;"));
|
||||
|
||||
m_listWidget = new QWidget(m_scrollArea);
|
||||
m_listWidget->setAutoFillBackground(false);
|
||||
m_listWidget->setStyleSheet(QStringLiteral("background:transparent;"));
|
||||
m_listLayout = new QVBoxLayout(m_listWidget);
|
||||
m_listLayout->setContentsMargins(0, 0, 4, 0);
|
||||
m_listLayout->setSpacing(6);
|
||||
m_listLayout->addStretch(1);
|
||||
m_scrollArea->setWidget(m_listWidget);
|
||||
root->addWidget(m_scrollArea, 1);
|
||||
|
||||
auto* closeRow = new QHBoxLayout();
|
||||
closeRow->addStretch(1);
|
||||
auto* close = new ElaPushButton(QStringLiteral("完成"), this);
|
||||
close->setFixedSize(88, 34);
|
||||
close->setDefault(true);
|
||||
closeRow->addWidget(close);
|
||||
root->addLayout(closeRow);
|
||||
|
||||
connect(close, &ElaPushButton::clicked, this, &CompletedSummaryDialog::accept);
|
||||
connect(m_rangeCombo, &ElaComboBox::currentIndexChanged, this, [this](int) { rebuild(); });
|
||||
rebuild();
|
||||
QTimer::singleShot(0, this, [this]() { AnimationUtils::fadeWindow(this); });
|
||||
}
|
||||
|
||||
void CompletedSummaryDialog::clearLayout(QVBoxLayout* layout)
|
||||
{
|
||||
while (QLayoutItem* item = layout->takeAt(0))
|
||||
{
|
||||
if (QWidget* widget = item->widget())
|
||||
{
|
||||
widget->hide();
|
||||
widget->deleteLater();
|
||||
}
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
QString CompletedSummaryDialog::shortRangeStart() const
|
||||
{
|
||||
const QDate today = QDate::currentDate();
|
||||
switch (m_rangeCombo->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
return today.addDays(1 - today.dayOfWeek()).toString(Qt::ISODate);
|
||||
case 1:
|
||||
return QDate(today.year(), today.month(), 1).toString(Qt::ISODate);
|
||||
default:
|
||||
return QDate(2000, 1, 1).toString(Qt::ISODate);
|
||||
}
|
||||
}
|
||||
|
||||
void CompletedSummaryDialog::rebuild()
|
||||
{
|
||||
if (!m_listLayout)
|
||||
{
|
||||
return;
|
||||
}
|
||||
clearLayout(m_listLayout);
|
||||
const QDate today = QDate::currentDate();
|
||||
const QDate start = QDate::fromString(shortRangeStart(), Qt::ISODate);
|
||||
const auto items = m_scheduleService.completedItems(start, today);
|
||||
const auto projects = m_scheduleService.completedProjects(start, today);
|
||||
|
||||
int focusedMinutes = 0;
|
||||
QSet<QDate> completionDays;
|
||||
for (const ScheduleItem& item : items)
|
||||
{
|
||||
focusedMinutes += qMax(0, DateTimeUtils::minutesBetween(item.block.startAt, item.block.endAt));
|
||||
completionDays.insert(item.block.doneAt.has_value() ? item.block.doneAt->date()
|
||||
: item.block.endAt.date());
|
||||
}
|
||||
for (const Project& project : projects)
|
||||
{
|
||||
completionDays.insert(project.updatedAt.date());
|
||||
}
|
||||
|
||||
int streak = 0;
|
||||
QDate cursor = completionDays.contains(today) ? today : today.addDays(-1);
|
||||
while (completionDays.contains(cursor))
|
||||
{
|
||||
++streak;
|
||||
cursor = cursor.addDays(-1);
|
||||
}
|
||||
|
||||
m_taskStat->setText(QString::number(items.size()));
|
||||
m_focusStat->setText(formatMinutes(focusedMinutes));
|
||||
m_projectStat->setText(QString::number(projects.size()));
|
||||
m_streakStat->setText(QStringLiteral("%1 天").arg(streak));
|
||||
|
||||
const auto addSection = [this](const QString& text) {
|
||||
auto* label = new ElaText(text, 13, m_listWidget);
|
||||
QFont font = label->font();
|
||||
font.setWeight(QFont::DemiBold);
|
||||
label->setFont(font);
|
||||
label->setContentsMargins(2, 8, 0, 2);
|
||||
m_listLayout->addWidget(label);
|
||||
};
|
||||
const auto addEmpty = [this](const QString& text) {
|
||||
auto* label = new ElaText(text, 12, m_listWidget);
|
||||
label->setTextStyle(ElaTextType::Caption);
|
||||
label->setContentsMargins(2, 2, 0, 2);
|
||||
m_listLayout->addWidget(label);
|
||||
};
|
||||
if (items.isEmpty() && projects.isEmpty())
|
||||
{
|
||||
addEmpty(QStringLiteral("这个范围内还没有已完成记录。"));
|
||||
m_listLayout->addStretch(1);
|
||||
return;
|
||||
}
|
||||
|
||||
addSection(QStringLiteral("短期任务 · %1").arg(items.size()));
|
||||
if (items.isEmpty())
|
||||
{
|
||||
addEmpty(QStringLiteral("暂无已完成短期任务。"));
|
||||
}
|
||||
int shown = 0;
|
||||
for (const ScheduleItem& item : items)
|
||||
{
|
||||
if (shown++ >= 80)
|
||||
{
|
||||
break;
|
||||
}
|
||||
auto* card = new QFrame(m_listWidget);
|
||||
card->setStyleSheet(
|
||||
QStringLiteral("QFrame{background:%1;border:1px solid %2;border-radius:8px;}")
|
||||
.arg(m_tokens.cardBackground.name(), m_tokens.cardBorder.name()));
|
||||
auto* layout = new QVBoxLayout(card);
|
||||
layout->setContentsMargins(10, 7, 10, 7);
|
||||
layout->setSpacing(2);
|
||||
auto* name = new QLabel(item.task.title, card);
|
||||
name->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:12px;font-weight:600;")
|
||||
.arg(m_tokens.textPrimary.name()));
|
||||
const QDateTime doneAt = item.block.doneAt.value_or(item.block.endAt);
|
||||
auto* detail = new QLabel(
|
||||
QStringLiteral("完成于 %1 · %2–%3")
|
||||
.arg(doneAt.toString(QStringLiteral("MM-dd HH:mm")),
|
||||
item.block.startAt.toString(QStringLiteral("HH:mm")),
|
||||
item.block.endAt.toString(QStringLiteral("HH:mm"))),
|
||||
card);
|
||||
detail->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:11px;")
|
||||
.arg(m_tokens.textMuted.name()));
|
||||
layout->addWidget(name);
|
||||
layout->addWidget(detail);
|
||||
m_listLayout->addWidget(card);
|
||||
}
|
||||
|
||||
addSection(QStringLiteral("长期项目 · %1").arg(projects.size()));
|
||||
if (projects.isEmpty())
|
||||
{
|
||||
addEmpty(QStringLiteral("暂无已完成长期项目。"));
|
||||
}
|
||||
for (const Project& project : projects)
|
||||
{
|
||||
auto* card = new QFrame(m_listWidget);
|
||||
card->setStyleSheet(
|
||||
QStringLiteral("QFrame{background:%1;border:1px solid %2;border-left:3px solid %3;border-radius:8px;}")
|
||||
.arg(m_tokens.cardBackground.name(),
|
||||
m_tokens.cardBorder.name(),
|
||||
m_tokens.success.name()));
|
||||
auto* layout = new QVBoxLayout(card);
|
||||
layout->setContentsMargins(10, 7, 10, 7);
|
||||
layout->setSpacing(2);
|
||||
auto* name = new QLabel(project.title, card);
|
||||
name->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:12px;font-weight:600;")
|
||||
.arg(m_tokens.textPrimary.name()));
|
||||
auto* detail = new QLabel(
|
||||
QStringLiteral("完成于 %1%2")
|
||||
.arg(project.updatedAt.toString(QStringLiteral("MM-dd HH:mm")),
|
||||
project.deadline.has_value()
|
||||
? QStringLiteral(" · 截止 %1").arg(project.deadline->toString(QStringLiteral("yyyy-MM-dd")))
|
||||
: QString()),
|
||||
card);
|
||||
detail->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:11px;")
|
||||
.arg(m_tokens.textMuted.name()));
|
||||
layout->addWidget(name);
|
||||
layout->addWidget(detail);
|
||||
m_listLayout->addWidget(card);
|
||||
}
|
||||
m_listLayout->addStretch(1);
|
||||
AnimationUtils::fadeIn(m_listWidget, 150);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "ElaDialog.h"
|
||||
#include "ui/theme/ThemeTokens.h"
|
||||
|
||||
class ElaComboBox;
|
||||
class ElaScrollArea;
|
||||
class ElaText;
|
||||
class QVBoxLayout;
|
||||
class ScheduleService;
|
||||
|
||||
/*
|
||||
* 类名: CompletedSummaryDialog
|
||||
* 功能: 汇总已完成的短期任务与长期项目,展示统计、连续天数和完成记录
|
||||
* 线程安全: 否;UI 线程
|
||||
*/
|
||||
class CompletedSummaryDialog : public ElaDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CompletedSummaryDialog(ScheduleService& scheduleService,
|
||||
const ThemeTokens& tokens,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
private:
|
||||
void rebuild();
|
||||
static void clearLayout(QVBoxLayout* layout);
|
||||
QString shortRangeStart() const;
|
||||
|
||||
ScheduleService& m_scheduleService;
|
||||
ThemeTokens m_tokens;
|
||||
ElaComboBox* m_rangeCombo = nullptr;
|
||||
ElaText* m_taskStat = nullptr;
|
||||
ElaText* m_focusStat = nullptr;
|
||||
ElaText* m_projectStat = nullptr;
|
||||
ElaText* m_streakStat = nullptr;
|
||||
ElaScrollArea* m_scrollArea = nullptr;
|
||||
QWidget* m_listWidget = nullptr;
|
||||
QVBoxLayout* m_listLayout = nullptr;
|
||||
};
|
||||
@@ -0,0 +1,123 @@
|
||||
#include "ProjectDialog.h"
|
||||
|
||||
#include <QDateEdit>
|
||||
#include <QFormLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "ElaLineEdit.h"
|
||||
#include "ElaPlainTextEdit.h"
|
||||
#include "ElaPushButton.h"
|
||||
#include "ElaText.h"
|
||||
|
||||
ProjectDialog::ProjectDialog(const ThemeTokens& tokens, QWidget* parent)
|
||||
: ElaDialog(parent)
|
||||
, m_errorColor(tokens.blockOverdueBorder.name())
|
||||
{
|
||||
setWindowTitle(QStringLiteral("新建长期项目"));
|
||||
setWindowButtonFlags(ElaAppBarType::CloseButtonHint);
|
||||
setMinimumWidth(460);
|
||||
resize(460, 390);
|
||||
|
||||
auto* root = new QVBoxLayout(this);
|
||||
root->setContentsMargins(22, 8, 22, 18);
|
||||
root->setSpacing(12);
|
||||
|
||||
auto* form = new QFormLayout();
|
||||
form->setLabelAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
form->setHorizontalSpacing(14);
|
||||
form->setVerticalSpacing(12);
|
||||
|
||||
auto* titleLabel = new ElaText(QStringLiteral("项目标题"), 13, this);
|
||||
m_titleEdit = new ElaLineEdit(this);
|
||||
m_titleEdit->setPlaceholderText(QStringLiteral("例如:完成飞行控制器项目"));
|
||||
m_titleEdit->setClearButtonEnabled(true);
|
||||
m_titleEdit->setMinimumHeight(34);
|
||||
|
||||
auto* descriptionLabel = new ElaText(QStringLiteral("说明"), 13, this);
|
||||
m_descriptionEdit = new ElaPlainTextEdit(this);
|
||||
m_descriptionEdit->setPlaceholderText(QStringLiteral("目标、范围或验收标准(可选)"));
|
||||
m_descriptionEdit->setMinimumHeight(130);
|
||||
|
||||
auto* deadlineLabel = new ElaText(QStringLiteral("模糊截止"), 13, this);
|
||||
m_deadlineEdit = new QDateEdit(this);
|
||||
m_deadlineEdit->setCalendarPopup(true);
|
||||
m_deadlineEdit->setDisplayFormat(QStringLiteral("yyyy-MM-dd"));
|
||||
m_deadlineEdit->setDate(QDate::currentDate().addMonths(1));
|
||||
m_deadlineEdit->setMinimumHeight(34);
|
||||
|
||||
form->addRow(titleLabel, m_titleEdit);
|
||||
form->addRow(descriptionLabel, m_descriptionEdit);
|
||||
form->addRow(deadlineLabel, m_deadlineEdit);
|
||||
root->addLayout(form);
|
||||
|
||||
m_errorLabel = new ElaText(this);
|
||||
m_errorLabel->setTextPixelSize(12);
|
||||
m_errorLabel->setStyleSheet(QStringLiteral("color:%1;").arg(m_errorColor));
|
||||
m_errorLabel->setMinimumHeight(18);
|
||||
root->addWidget(m_errorLabel);
|
||||
root->addStretch(1);
|
||||
|
||||
auto* buttonRow = new QHBoxLayout();
|
||||
buttonRow->addStretch(1);
|
||||
auto* cancel = new ElaPushButton(QStringLiteral("取消"), this);
|
||||
auto* save = new ElaPushButton(QStringLiteral("保存"), this);
|
||||
cancel->setFixedSize(88, 34);
|
||||
save->setFixedSize(88, 34);
|
||||
save->setDefault(true);
|
||||
buttonRow->addWidget(cancel);
|
||||
buttonRow->addWidget(save);
|
||||
root->addLayout(buttonRow);
|
||||
|
||||
connect(cancel, &ElaPushButton::clicked, this, &ProjectDialog::reject);
|
||||
connect(save, &ElaPushButton::clicked, this, &ProjectDialog::accept);
|
||||
}
|
||||
|
||||
void ProjectDialog::setValues(const QString& title, const QString& description, const QDate& deadline)
|
||||
{
|
||||
m_titleEdit->setText(title);
|
||||
m_descriptionEdit->setPlainText(description);
|
||||
if (deadline.isValid())
|
||||
{
|
||||
m_deadlineEdit->setDate(deadline);
|
||||
}
|
||||
m_titleEdit->setFocus();
|
||||
m_titleEdit->selectAll();
|
||||
}
|
||||
|
||||
QString ProjectDialog::titleValue() const
|
||||
{
|
||||
return m_titleEdit->text().trimmed();
|
||||
}
|
||||
|
||||
QString ProjectDialog::descriptionValue() const
|
||||
{
|
||||
return m_descriptionEdit->toPlainText().trimmed();
|
||||
}
|
||||
|
||||
QDate ProjectDialog::deadlineValue() const
|
||||
{
|
||||
return m_deadlineEdit->date();
|
||||
}
|
||||
|
||||
void ProjectDialog::updateError(const QString& message)
|
||||
{
|
||||
m_errorLabel->setText(message);
|
||||
}
|
||||
|
||||
void ProjectDialog::accept()
|
||||
{
|
||||
const QString title = titleValue();
|
||||
if (title.isEmpty())
|
||||
{
|
||||
updateError(QStringLiteral("请输入项目标题"));
|
||||
return;
|
||||
}
|
||||
if (!deadlineValue().isValid())
|
||||
{
|
||||
updateError(QStringLiteral("请选择截止日期"));
|
||||
return;
|
||||
}
|
||||
updateError(QString());
|
||||
QDialog::accept();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDate>
|
||||
#include <QString>
|
||||
|
||||
#include "ElaDialog.h"
|
||||
#include "ui/theme/ThemeTokens.h"
|
||||
|
||||
class ElaLineEdit;
|
||||
class ElaPlainTextEdit;
|
||||
class ElaText;
|
||||
class QDateEdit;
|
||||
|
||||
/*
|
||||
* 类名: ProjectDialog
|
||||
* 功能: 手工创建/编辑长期项目(标题、说明、模糊截止日期)
|
||||
* 线程安全: 否;UI 线程
|
||||
*/
|
||||
class ProjectDialog : public ElaDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ProjectDialog(const ThemeTokens& tokens, QWidget* parent = nullptr);
|
||||
|
||||
void setValues(const QString& title, const QString& description, const QDate& deadline);
|
||||
QString titleValue() const;
|
||||
QString descriptionValue() const;
|
||||
QDate deadlineValue() const;
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
|
||||
private:
|
||||
void updateError(const QString& message);
|
||||
|
||||
ElaLineEdit* m_titleEdit = nullptr;
|
||||
ElaPlainTextEdit* m_descriptionEdit = nullptr;
|
||||
QDateEdit* m_deadlineEdit = nullptr;
|
||||
ElaText* m_errorLabel = nullptr;
|
||||
QString m_errorColor;
|
||||
};
|
||||
@@ -105,6 +105,7 @@ DiffPreviewCard::DiffPreviewCard(const ScheduleProposal& proposal,
|
||||
break;
|
||||
}
|
||||
}
|
||||
const int projectCount = proposal.projects.size();
|
||||
QStringList parts;
|
||||
if (creates > 0)
|
||||
{
|
||||
@@ -118,10 +119,14 @@ DiffPreviewCard::DiffPreviewCard(const ScheduleProposal& proposal,
|
||||
{
|
||||
parts.append(QStringLiteral("删除 %1").arg(deletes));
|
||||
}
|
||||
if (projectCount > 0)
|
||||
{
|
||||
parts.append(QStringLiteral("长期项目 %1").arg(projectCount));
|
||||
}
|
||||
|
||||
auto* header = new QHBoxLayout();
|
||||
header->setSpacing(8);
|
||||
auto* title = new QLabel(QStringLiteral("AI 日程建议"), this);
|
||||
auto* title = new QLabel(QStringLiteral("AI 计划建议"), this);
|
||||
title->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:13px;font-weight:600;")
|
||||
.arg(m_tokens.textPrimary.name()));
|
||||
auto* count = new QLabel(parts.join(QStringLiteral(" · ")), this);
|
||||
@@ -140,6 +145,7 @@ DiffPreviewCard::DiffPreviewCard(const ScheduleProposal& proposal,
|
||||
check->setChecked(state == State::Pending);
|
||||
check->setEnabled(state == State::Pending);
|
||||
m_checks.append(check);
|
||||
m_tempIds.append(entry.tempId);
|
||||
|
||||
auto* textLayout = new QVBoxLayout();
|
||||
textLayout->setSpacing(1);
|
||||
@@ -232,6 +238,59 @@ DiffPreviewCard::DiffPreviewCard(const ScheduleProposal& proposal,
|
||||
connect(check, &ElaCheckBox::toggled, this, &DiffPreviewCard::updateAcceptEnabled);
|
||||
}
|
||||
|
||||
for (const ProposedProjectEntry& project : proposal.projects)
|
||||
{
|
||||
auto* row = new QHBoxLayout();
|
||||
row->setSpacing(8);
|
||||
auto* check = new ElaCheckBox(this);
|
||||
check->setChecked(state == State::Pending);
|
||||
check->setEnabled(state == State::Pending);
|
||||
m_checks.append(check);
|
||||
m_tempIds.append(project.tempId);
|
||||
|
||||
auto* textLayout = new QVBoxLayout();
|
||||
textLayout->setSpacing(1);
|
||||
auto* titleRow = new QHBoxLayout();
|
||||
titleRow->setSpacing(6);
|
||||
auto* opLabel = new QLabel(QStringLiteral("长期项目"), this);
|
||||
opLabel->setStyleSheet(
|
||||
QStringLiteral("background:transparent;border:none;color:%1;font-size:10px;font-weight:600;")
|
||||
.arg(m_tokens.diffAdd.name()));
|
||||
auto* titleLabel = new QLabel(project.title, this);
|
||||
titleLabel->setWordWrap(true);
|
||||
titleLabel->setStyleSheet(
|
||||
QStringLiteral("background:transparent;border:none;color:%1;font-size:12px;font-weight:600;")
|
||||
.arg(m_tokens.textPrimary.name()));
|
||||
titleRow->addWidget(opLabel, 0, Qt::AlignTop);
|
||||
titleRow->addWidget(titleLabel, 1);
|
||||
textLayout->addLayout(titleRow);
|
||||
if (project.deadline.has_value())
|
||||
{
|
||||
auto* deadline = new QLabel(
|
||||
QStringLiteral("截止 %1(剩余 %2 天)")
|
||||
.arg(project.deadline->toString(QStringLiteral("yyyy-MM-dd")))
|
||||
.arg(QDate::currentDate().daysTo(*project.deadline)),
|
||||
this);
|
||||
deadline->setStyleSheet(
|
||||
QStringLiteral("background:transparent;border:none;color:%1;font-size:11px;")
|
||||
.arg(m_tokens.textSecondary.name()));
|
||||
textLayout->addWidget(deadline);
|
||||
}
|
||||
if (!project.description.isEmpty())
|
||||
{
|
||||
auto* description = new QLabel(project.description, this);
|
||||
description->setWordWrap(true);
|
||||
description->setStyleSheet(
|
||||
QStringLiteral("background:transparent;border:none;color:%1;font-size:11px;")
|
||||
.arg(m_tokens.textMuted.name()));
|
||||
textLayout->addWidget(description);
|
||||
}
|
||||
row->addWidget(check, 0, Qt::AlignTop);
|
||||
row->addLayout(textLayout, 1);
|
||||
root->addLayout(row);
|
||||
connect(check, &ElaCheckBox::toggled, this, &DiffPreviewCard::updateAcceptEnabled);
|
||||
}
|
||||
|
||||
auto* buttonRow = new QHBoxLayout();
|
||||
buttonRow->setSpacing(8);
|
||||
buttonRow->addStretch(1);
|
||||
@@ -257,9 +316,9 @@ DiffPreviewCard::DiffPreviewCard(const ScheduleProposal& proposal,
|
||||
QStringList tempIds;
|
||||
for (int i = 0; i < m_checks.size(); ++i)
|
||||
{
|
||||
if (m_checks.at(i)->isChecked() && i < m_proposal.entries.size())
|
||||
if (m_checks.at(i)->isChecked() && i < m_tempIds.size())
|
||||
{
|
||||
tempIds.append(m_proposal.entries.at(i).tempId);
|
||||
tempIds.append(m_tempIds.at(i));
|
||||
}
|
||||
}
|
||||
setResolved(State::Applied);
|
||||
|
||||
@@ -45,6 +45,7 @@ private:
|
||||
ThemeTokens m_tokens;
|
||||
State m_state;
|
||||
QVector<ElaCheckBox*> m_checks;
|
||||
QStringList m_tempIds;
|
||||
ElaPushButton* m_acceptButton = nullptr;
|
||||
ElaPushButton* m_rejectButton = nullptr;
|
||||
QLabel* m_statusLabel = nullptr;
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#include "ProjectCard.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "ElaMenu.h"
|
||||
#include "ElaToolButton.h"
|
||||
|
||||
ProjectCard::ProjectCard(const Project& project, const ThemeTokens& tokens, QWidget* parent)
|
||||
: QFrame(parent)
|
||||
, m_project(project)
|
||||
, m_tokens(tokens)
|
||||
{
|
||||
setObjectName(QStringLiteral("ProjectCard"));
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
setStyleSheet(QStringLiteral(
|
||||
"QFrame#ProjectCard{background:%1;border:1px solid %2;border-left:3px solid %3;"
|
||||
"border-radius:9px;}"
|
||||
"QFrame#ProjectCard:hover{background:%4;}")
|
||||
.arg(m_tokens.cardBackground.name(),
|
||||
m_tokens.cardBorder.name(),
|
||||
m_tokens.accent.name(),
|
||||
m_tokens.cardHoverBackground.name()));
|
||||
|
||||
auto* row = new QHBoxLayout(this);
|
||||
row->setContentsMargins(10, 7, 6, 7);
|
||||
row->setSpacing(4);
|
||||
auto* textLayout = new QVBoxLayout();
|
||||
textLayout->setSpacing(2);
|
||||
|
||||
auto* title = new QLabel(m_project.title, this);
|
||||
title->setWordWrap(true);
|
||||
title->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:12px;font-weight:600;")
|
||||
.arg(m_tokens.textPrimary.name()));
|
||||
auto* deadline = new QLabel(deadlineText(), this);
|
||||
const bool overdue = m_project.deadline.has_value() &&
|
||||
m_project.deadline->isValid() &&
|
||||
QDate::currentDate().daysTo(*m_project.deadline) < 0;
|
||||
deadline->setStyleSheet(QStringLiteral("background:transparent;border:none;color:%1;font-size:11px;")
|
||||
.arg(overdue ? m_tokens.blockOverdueBorder.name() : m_tokens.textMuted.name()));
|
||||
textLayout->addWidget(title);
|
||||
textLayout->addWidget(deadline);
|
||||
row->addLayout(textLayout, 1);
|
||||
|
||||
m_menuButton = new ElaToolButton(this);
|
||||
m_menuButton->setIsTransparent(true);
|
||||
m_menuButton->setFixedSize(26, 26);
|
||||
m_menuButton->setElaIcon(ElaIconType::EllipsisVertical);
|
||||
m_menuButton->setToolTip(QStringLiteral("项目操作"));
|
||||
auto* menu = new ElaMenu(this);
|
||||
QAction* edit = menu->addAction(QStringLiteral("编辑"));
|
||||
connect(edit, &QAction::triggered, this, [this]() { Q_EMIT editRequested(m_project.id); });
|
||||
QAction* done = menu->addAction(QStringLiteral("标记完成"));
|
||||
connect(done, &QAction::triggered, this, [this]() { Q_EMIT statusChangeRequested(m_project.id, QStringLiteral("done")); });
|
||||
menu->addSeparator();
|
||||
QAction* remove = menu->addAction(QStringLiteral("删除"));
|
||||
connect(remove, &QAction::triggered, this, [this]() { Q_EMIT deleteRequested(m_project.id); });
|
||||
m_menuButton->setMenu(menu);
|
||||
m_menuButton->setPopupMode(QToolButton::InstantPopup);
|
||||
row->addWidget(m_menuButton, 0, Qt::AlignTop);
|
||||
}
|
||||
|
||||
QString ProjectCard::deadlineText() const
|
||||
{
|
||||
if (!m_project.deadline.has_value() || !m_project.deadline->isValid())
|
||||
{
|
||||
return QStringLiteral("无截止日期");
|
||||
}
|
||||
const int days = QDate::currentDate().daysTo(*m_project.deadline);
|
||||
if (days < 0)
|
||||
{
|
||||
return QStringLiteral("截止 %1 · 已逾期 %2 天")
|
||||
.arg(m_project.deadline->toString(QStringLiteral("M月d日")))
|
||||
.arg(-days);
|
||||
}
|
||||
if (days == 0)
|
||||
{
|
||||
return QStringLiteral("截止 今天");
|
||||
}
|
||||
return QStringLiteral("截止 %1 · 剩余 %2 天")
|
||||
.arg(m_project.deadline->toString(QStringLiteral("M月d日")))
|
||||
.arg(days);
|
||||
}
|
||||
|
||||
void ProjectCard::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton && rect().contains(event->position().toPoint()))
|
||||
{
|
||||
Q_EMIT editRequested(m_project.id);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
QFrame::mouseReleaseEvent(event);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
#include "core/Project.h"
|
||||
#include "ui/theme/ThemeTokens.h"
|
||||
|
||||
class ElaToolButton;
|
||||
|
||||
/*
|
||||
* 类名: ProjectCard
|
||||
* 功能: 长期项目卡片;显示模糊截止日期与剩余天数
|
||||
* 线程安全: 否;UI 线程
|
||||
*/
|
||||
class ProjectCard : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProjectCard(const Project& project, const ThemeTokens& tokens, QWidget* parent = nullptr);
|
||||
|
||||
signals:
|
||||
void editRequested(const QString& projectId);
|
||||
void statusChangeRequested(const QString& projectId, const QString& status);
|
||||
void deleteRequested(const QString& projectId);
|
||||
|
||||
protected:
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
|
||||
private:
|
||||
QString deadlineText() const;
|
||||
|
||||
Project m_project;
|
||||
ThemeTokens m_tokens;
|
||||
ElaToolButton* m_menuButton = nullptr;
|
||||
};
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "ElaScrollArea.h"
|
||||
#include "ElaText.h"
|
||||
#include "ElaToolButton.h"
|
||||
#include "ProjectCard.h"
|
||||
#include "TodayItemCard.h"
|
||||
#include "ui/theme/AnimationUtils.h"
|
||||
|
||||
@@ -40,9 +41,25 @@ TodayPanel::TodayPanel(QWidget* parent)
|
||||
m_reviewButton->setToolTip(QStringLiteral("今日复盘 (Ctrl+R)"));
|
||||
connect(m_reviewButton, &ElaToolButton::clicked, this, &TodayPanel::reviewRequested);
|
||||
|
||||
m_achievementsButton = new ElaToolButton(this);
|
||||
m_achievementsButton->setIsTransparent(true);
|
||||
m_achievementsButton->setElaIcon(ElaIconType::Medal);
|
||||
m_achievementsButton->setFixedSize(26, 26);
|
||||
m_achievementsButton->setToolTip(QStringLiteral("已完成汇总"));
|
||||
connect(m_achievementsButton, &ElaToolButton::clicked, this, &TodayPanel::achievementsRequested);
|
||||
|
||||
m_newProjectButton = new ElaToolButton(this);
|
||||
m_newProjectButton->setIsTransparent(true);
|
||||
m_newProjectButton->setElaIcon(ElaIconType::FolderPlus);
|
||||
m_newProjectButton->setFixedSize(26, 26);
|
||||
m_newProjectButton->setToolTip(QStringLiteral("新建长期项目"));
|
||||
connect(m_newProjectButton, &ElaToolButton::clicked, this, &TodayPanel::newProjectRequested);
|
||||
|
||||
header->addWidget(m_titleLabel);
|
||||
header->addStretch(1);
|
||||
header->addWidget(m_countLabel, 0, Qt::AlignVCenter);
|
||||
header->addWidget(m_achievementsButton, 0, Qt::AlignVCenter);
|
||||
header->addWidget(m_newProjectButton, 0, Qt::AlignVCenter);
|
||||
header->addWidget(m_reviewButton, 0, Qt::AlignVCenter);
|
||||
root->addLayout(header);
|
||||
|
||||
@@ -114,6 +131,12 @@ void TodayPanel::setItems(const QVector<ScheduleItem>& items, const QDateTime& n
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void TodayPanel::setProjects(const QVector<Project>& projects)
|
||||
{
|
||||
m_projects = projects;
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void TodayPanel::clearLayout(QVBoxLayout* layout)
|
||||
{
|
||||
while (QLayoutItem* item = layout->takeAt(0))
|
||||
@@ -199,20 +222,32 @@ void TodayPanel::rebuild()
|
||||
return a.block.id < b.block.id;
|
||||
});
|
||||
|
||||
if (!m_projects.isEmpty())
|
||||
{
|
||||
auto* section = new ElaText(QStringLiteral("长期项目 · %1").arg(m_projects.size()), 13, m_listWidget);
|
||||
QFont sectionFont = section->font();
|
||||
sectionFont.setWeight(QFont::DemiBold);
|
||||
section->setFont(sectionFont);
|
||||
section->setContentsMargins(2, 8, 0, 2);
|
||||
m_listLayout->addWidget(section);
|
||||
for (const Project& project : m_projects)
|
||||
{
|
||||
auto* card = new ProjectCard(project, m_tokens, m_listWidget);
|
||||
connect(card, &ProjectCard::editRequested, this, &TodayPanel::editProjectRequested);
|
||||
connect(card, &ProjectCard::statusChangeRequested, this, &TodayPanel::projectStatusRequested);
|
||||
connect(card, &ProjectCard::deleteRequested, this, &TodayPanel::deleteProjectRequested);
|
||||
m_listLayout->addWidget(card);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sorted.isEmpty())
|
||||
{
|
||||
auto* empty = new ElaText(QStringLiteral("今天还没有安排\n双击时间网格即可新建"), 13, m_listWidget);
|
||||
empty->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
empty->setMinimumHeight(120);
|
||||
empty->setMinimumHeight(90);
|
||||
empty->setTextStyle(ElaTextType::Caption);
|
||||
m_listLayout->addWidget(empty);
|
||||
m_listLayout->addStretch(1);
|
||||
if (m_renderedCount != 0)
|
||||
{
|
||||
m_renderedCount = 0;
|
||||
AnimationUtils::fadeIn(m_listWidget, 150);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (const ScheduleItem& item : sorted)
|
||||
@@ -225,10 +260,12 @@ void TodayPanel::rebuild()
|
||||
connect(card, &TodayItemCard::deleteRequested, this, &TodayPanel::deleteRequested);
|
||||
m_listLayout->addWidget(card);
|
||||
}
|
||||
|
||||
m_listLayout->addStretch(1);
|
||||
if (m_renderedCount != sorted.size())
|
||||
const int renderedCount = sorted.size() + m_projects.size();
|
||||
if (m_renderedCount != renderedCount)
|
||||
{
|
||||
m_renderedCount = sorted.size();
|
||||
m_renderedCount = renderedCount;
|
||||
AnimationUtils::fadeIn(m_listWidget, 150);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "core/Project.h"
|
||||
#include "core/ScheduleItem.h"
|
||||
#include "ui/theme/ThemeTokens.h"
|
||||
|
||||
@@ -27,6 +28,7 @@ public:
|
||||
void setTokens(const ThemeTokens& tokens);
|
||||
void setDate(const QDate& date);
|
||||
void setItems(const QVector<ScheduleItem>& items, const QDateTime& now);
|
||||
void setProjects(const QVector<Project>& projects);
|
||||
void setInsightText(const QString& text);
|
||||
|
||||
signals:
|
||||
@@ -36,6 +38,11 @@ signals:
|
||||
void deleteRequested(const QString& blockId);
|
||||
void focusRequested(const QString& blockId);
|
||||
void reviewRequested();
|
||||
void achievementsRequested();
|
||||
void newProjectRequested();
|
||||
void editProjectRequested(const QString& projectId);
|
||||
void projectStatusRequested(const QString& projectId, const QString& status);
|
||||
void deleteProjectRequested(const QString& projectId);
|
||||
|
||||
private:
|
||||
void rebuild();
|
||||
@@ -43,12 +50,15 @@ private:
|
||||
|
||||
ThemeTokens m_tokens;
|
||||
QVector<ScheduleItem> m_items;
|
||||
QVector<Project> m_projects;
|
||||
QDateTime m_now;
|
||||
|
||||
ElaText* m_titleLabel = nullptr;
|
||||
ElaText* m_countLabel = nullptr;
|
||||
ElaText* m_insightLabel = nullptr;
|
||||
ElaToolButton* m_reviewButton = nullptr;
|
||||
ElaToolButton* m_newProjectButton = nullptr;
|
||||
ElaToolButton* m_achievementsButton = nullptr;
|
||||
ElaScrollArea* m_scrollArea = nullptr;
|
||||
QWidget* m_listWidget = nullptr;
|
||||
QVBoxLayout* m_listLayout = nullptr;
|
||||
|
||||
@@ -82,6 +82,7 @@ private slots:
|
||||
void forcesSplitWhenUserAllowsIt();
|
||||
void localDeleteAllMeetingsFallback();
|
||||
void retriesNoDiffActionableRequest();
|
||||
void createsLongTermProjectFromOperation();
|
||||
};
|
||||
|
||||
namespace
|
||||
@@ -742,5 +743,41 @@ void TestAI::retriesNoDiffActionableRequest()
|
||||
QVERIFY(proposal.entries.first().title == QStringLiteral("深度工作"));
|
||||
}
|
||||
|
||||
void TestAI::createsLongTermProjectFromOperation()
|
||||
{
|
||||
Context context;
|
||||
QVERIFY(context.initialize());
|
||||
|
||||
const QDate deadline = QDate::currentDate().addDays(30);
|
||||
context.mock->responses = {
|
||||
diffResponse(
|
||||
QStringLiteral("这是一个跨月目标,我会把它作为长期项目管理。"),
|
||||
QStringLiteral(
|
||||
"{\"operations\":[{\"type\":\"project\",\"title\":\"飞行控制器项目\","
|
||||
"\"description\":\"完成固件、测试与文档\",\"deadline\":\"%1\",\"priority\":2}]}")
|
||||
.arg(deadline.toString(QStringLiteral("yyyy-MM-dd"))))};
|
||||
|
||||
QSignalSpy proposalSpy(context.ai.get(), &AIService::proposalReady);
|
||||
QSignalSpy failedSpy(context.ai.get(), &AIService::requestFailed);
|
||||
QSignalSpy appliedSpy(context.ai.get(), &AIService::diffApplied);
|
||||
context.ai->request(QStringLiteral("一个月内完成飞行控制器项目,先不用安排具体时间"));
|
||||
|
||||
QCOMPARE(failedSpy.count(), 0);
|
||||
QCOMPARE(proposalSpy.count(), 1);
|
||||
const ScheduleProposal proposal = proposalSpy.first().at(0).value<ScheduleProposal>();
|
||||
QCOMPARE(proposal.entries.size(), 0);
|
||||
QCOMPARE(proposal.projects.size(), 1);
|
||||
QCOMPARE(proposal.projects.first().title, QStringLiteral("飞行控制器项目"));
|
||||
QCOMPARE(proposal.projects.first().deadline.value(), deadline);
|
||||
|
||||
context.ai->applyDiff(proposal.diffId, {proposal.projects.first().tempId});
|
||||
QCOMPARE(appliedSpy.count(), 1);
|
||||
const QVector<Project> projects = context.service->projects();
|
||||
QCOMPARE(projects.size(), 1);
|
||||
QCOMPARE(projects.first().title, QStringLiteral("飞行控制器项目"));
|
||||
QCOMPARE(projects.first().deadline.value(), deadline);
|
||||
QCOMPARE(projects.first().source, QStringLiteral("ai_chat"));
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(TestAI)
|
||||
#include "test_ai.moc"
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#include "ui/CompactWindow.h"
|
||||
#include "ui/MainWindow.h"
|
||||
#include "ui/dialogs/BlockEditDialog.h"
|
||||
#include "ui/dialogs/CompletedSummaryDialog.h"
|
||||
#include "ui/dialogs/DailyReviewDialog.h"
|
||||
#include "ui/dialogs/ProjectDialog.h"
|
||||
#include "ui/dialogs/SearchDialog.h"
|
||||
#include "ui/dialogs/SettingsDialog.h"
|
||||
#include "ui/panels/DiffPreviewCard.h"
|
||||
@@ -68,6 +70,8 @@ private slots:
|
||||
void opensDailyReview();
|
||||
void searchDialogFindsSchedules();
|
||||
void repeatDialogShowsOptions();
|
||||
void projectDialogShowsFields();
|
||||
void completedSummaryShowsStats();
|
||||
void aiChatShowsDiffAndAccepts();
|
||||
void aiChatShowsMultiOperationDiff();
|
||||
|
||||
@@ -123,6 +127,25 @@ void TestCompactWindow::createSampleData(ScheduleService& service, const QDate&
|
||||
QVERIFY(create(QStringLiteral("写周报"),
|
||||
QDateTime(today, QTime(9, 0), Qt::LocalTime),
|
||||
QDateTime(today, QTime(10, 30), Qt::LocalTime)));
|
||||
QString projectError;
|
||||
QVERIFY2(service.createProject(QStringLiteral("飞行控制器项目"),
|
||||
QStringLiteral("完成固件、测试与文档"),
|
||||
today.addDays(30),
|
||||
&projectError),
|
||||
qPrintable(projectError));
|
||||
QVERIFY2(service.createProject(QStringLiteral("已完成旧项目"),
|
||||
QStringLiteral("历史项目"),
|
||||
today.addDays(-10),
|
||||
&projectError),
|
||||
qPrintable(projectError));
|
||||
for (const Project& project : service.projects())
|
||||
{
|
||||
if (project.title == QStringLiteral("已完成旧项目"))
|
||||
{
|
||||
service.setProjectStatus(project.id, QStringLiteral("done"), &projectError);
|
||||
break;
|
||||
}
|
||||
}
|
||||
QVERIFY(create(QStringLiteral("团队同步"),
|
||||
QDateTime(today, QTime(10, 0), Qt::LocalTime),
|
||||
QDateTime(today, QTime(11, 0), Qt::LocalTime)));
|
||||
@@ -379,6 +402,45 @@ void TestCompactWindow::repeatDialogShowsOptions()
|
||||
QCOMPARE(dialog.recurrenceUntil(), start.date().addMonths(3));
|
||||
}
|
||||
|
||||
void TestCompactWindow::projectDialogShowsFields()
|
||||
{
|
||||
ThemeManager theme(*m_settings);
|
||||
theme.initialize();
|
||||
ProjectDialog dialog(theme.tokens());
|
||||
const QDate deadline = QDate::currentDate().addDays(30);
|
||||
dialog.setValues(QStringLiteral("飞行控制器项目"),
|
||||
QStringLiteral("完成固件、测试与文档"),
|
||||
deadline);
|
||||
dialog.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&dialog));
|
||||
QTest::qWait(300);
|
||||
saveWindow(&dialog, QStringLiteral("project-dialog.png"));
|
||||
QCOMPARE(dialog.titleValue(), QStringLiteral("飞行控制器项目"));
|
||||
QCOMPARE(dialog.deadlineValue(), deadline);
|
||||
dialog.accept();
|
||||
}
|
||||
|
||||
void TestCompactWindow::completedSummaryShowsStats()
|
||||
{
|
||||
QTemporaryDir databaseDir;
|
||||
QVERIFY(databaseDir.isValid());
|
||||
SqliteStore store(databaseDir.filePath(QStringLiteral("schedule.db")));
|
||||
QString error;
|
||||
QVERIFY2(store.open(&error), qPrintable(error));
|
||||
|
||||
ThemeManager theme(*m_settings);
|
||||
theme.initialize();
|
||||
ScheduleService service(store, QStringLiteral("summary-test"));
|
||||
createSampleData(service, QDate::currentDate());
|
||||
|
||||
CompletedSummaryDialog dialog(service, theme.tokens());
|
||||
dialog.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&dialog));
|
||||
QTest::qWait(300);
|
||||
saveWindow(&dialog, QStringLiteral("completed-summary.png"));
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
void TestCompactWindow::aiChatShowsDiffAndAccepts()
|
||||
{
|
||||
QTemporaryDir databaseDir;
|
||||
|
||||
@@ -29,6 +29,8 @@ private slots:
|
||||
void searchFindsSchedules();
|
||||
void createsRecurringSchedules();
|
||||
void startAndLeadReminders();
|
||||
void projectCrudAndPersistence();
|
||||
void completedSummaryQueries();
|
||||
};
|
||||
|
||||
namespace
|
||||
@@ -474,5 +476,76 @@ void TestServices::startAndLeadReminders()
|
||||
QCOMPARE(leadSpy.count(), 1);
|
||||
}
|
||||
|
||||
void TestServices::projectCrudAndPersistence()
|
||||
{
|
||||
Context context;
|
||||
QVERIFY(context.open());
|
||||
|
||||
const QDate deadline = QDate::currentDate().addMonths(1);
|
||||
QString error;
|
||||
QVERIFY2(context.service->createProject(QStringLiteral("飞行控制器项目"),
|
||||
QStringLiteral("完成飞控板固件与测试"),
|
||||
deadline,
|
||||
&error),
|
||||
qPrintable(error));
|
||||
QVector<Project> projects = context.service->projects();
|
||||
QCOMPARE(projects.size(), 1);
|
||||
QCOMPARE(projects.first().title, QStringLiteral("飞行控制器项目"));
|
||||
QCOMPARE(projects.first().deadline.value(), deadline);
|
||||
const QString id = projects.first().id;
|
||||
|
||||
QVERIFY2(context.service->updateProject(id,
|
||||
QStringLiteral("飞行控制器项目 v2"),
|
||||
QStringLiteral("完成固件、测试与文档"),
|
||||
deadline.addDays(7),
|
||||
&error),
|
||||
qPrintable(error));
|
||||
auto updated = context.service->projectById(id);
|
||||
QVERIFY(updated.has_value());
|
||||
QCOMPARE(updated->title, QStringLiteral("飞行控制器项目 v2"));
|
||||
QCOMPARE(updated->deadline.value(), deadline.addDays(7));
|
||||
|
||||
ScheduleService reloaded(*context.store, QStringLiteral("test-device"));
|
||||
QCOMPARE(reloaded.projects().size(), 1);
|
||||
|
||||
QVERIFY2(context.service->setProjectStatus(id, QStringLiteral("done"), &error), qPrintable(error));
|
||||
QVERIFY(context.service->projects().isEmpty());
|
||||
QCOMPARE(context.store->outboxCount() > 0, true);
|
||||
|
||||
QVERIFY2(context.service->deleteProject(id, &error), qPrintable(error));
|
||||
QVERIFY(!context.service->projectById(id).has_value());
|
||||
}
|
||||
|
||||
void TestServices::completedSummaryQueries()
|
||||
{
|
||||
Context context;
|
||||
QVERIFY(context.open());
|
||||
|
||||
const QDate today = QDate::currentDate();
|
||||
const QDateTime start(today, QTime(9, 0), Qt::LocalTime);
|
||||
QString error;
|
||||
QVERIFY(context.service->createBlock(QStringLiteral("已完成短期任务"),
|
||||
start,
|
||||
start.addSecs(90 * 60),
|
||||
&error));
|
||||
const QString blockId = context.service->itemsForDay(today).first().block.id;
|
||||
QVERIFY2(context.service->setBlockStatus(blockId, QStringLiteral("done"), &error), qPrintable(error));
|
||||
|
||||
QVERIFY(context.service->createProject(QStringLiteral("已完成长期项目"),
|
||||
QStringLiteral("项目说明"),
|
||||
today.addDays(10),
|
||||
&error));
|
||||
const QString projectId = context.service->projects().first().id;
|
||||
QVERIFY2(context.service->setProjectStatus(projectId, QStringLiteral("done"), &error), qPrintable(error));
|
||||
|
||||
const QVector<ScheduleItem> completed = context.service->completedItems(today, today);
|
||||
QCOMPARE(completed.size(), 1);
|
||||
QCOMPARE(completed.first().task.title, QStringLiteral("已完成短期任务"));
|
||||
const QVector<Project> projects = context.service->completedProjects(today, today);
|
||||
QCOMPARE(projects.size(), 1);
|
||||
QCOMPARE(projects.first().title, QStringLiteral("已完成长期项目"));
|
||||
QCOMPARE(context.service->completedItems(today.addDays(1), today.addDays(2)).size(), 0);
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(TestServices)
|
||||
#include "test_services.moc"
|
||||
|
||||
@@ -17,6 +17,7 @@ private slots:
|
||||
void proposedDiffRoundTrip();
|
||||
void outboxCapturesLocalChanges();
|
||||
void remoteApplySuppressesOutboxAndUsesLww();
|
||||
void remoteCompletionWinsOverOlderTimestamp();
|
||||
};
|
||||
|
||||
void TestStorage::migrationCreatesSchema()
|
||||
@@ -26,10 +27,10 @@ void TestStorage::migrationCreatesSchema()
|
||||
SqliteStore store(dir.filePath(QStringLiteral("schedule.db")));
|
||||
QString error;
|
||||
QVERIFY2(store.open(&error), qPrintable(error));
|
||||
QCOMPARE(store.schemaVersion(), 3);
|
||||
QCOMPARE(store.schemaVersion(), 4);
|
||||
store.close();
|
||||
QVERIFY2(store.open(&error), qPrintable(error));
|
||||
QCOMPARE(store.schemaVersion(), 3);
|
||||
QCOMPARE(store.schemaVersion(), 4);
|
||||
}
|
||||
|
||||
void TestStorage::taskAndBlockRoundTrip()
|
||||
@@ -260,5 +261,67 @@ void TestStorage::remoteApplySuppressesOutboxAndUsesLww()
|
||||
QCOMPARE(store.outboxCount(), 0);
|
||||
}
|
||||
|
||||
void TestStorage::remoteCompletionWinsOverOlderTimestamp()
|
||||
{
|
||||
QTemporaryDir dir;
|
||||
QVERIFY(dir.isValid());
|
||||
SqliteStore store(dir.filePath(QStringLiteral("schedule.db")));
|
||||
QString error;
|
||||
QVERIFY2(store.open(&error), qPrintable(error));
|
||||
|
||||
const QDateTime now = QDateTime::currentDateTime();
|
||||
Task task;
|
||||
task.id = QStringLiteral("completion-task");
|
||||
task.title = QStringLiteral("完成同步");
|
||||
task.createdAt = now;
|
||||
task.updatedAt = now;
|
||||
task.deviceId = QStringLiteral("device-a");
|
||||
QVERIFY(store.insertTask(task));
|
||||
|
||||
TimeBlock block;
|
||||
block.id = QStringLiteral("completion-block");
|
||||
block.taskId = task.id;
|
||||
block.startAt = now.addSecs(3600);
|
||||
block.endAt = now.addSecs(7200);
|
||||
block.createdAt = now;
|
||||
block.updatedAt = now;
|
||||
block.deviceId = QStringLiteral("device-a");
|
||||
QVERIFY(store.insertTimeBlock(block));
|
||||
|
||||
RemoteChange change;
|
||||
change.seq = 2;
|
||||
change.deviceId = QStringLiteral("device-b");
|
||||
change.entityType = QStringLiteral("timeblock");
|
||||
change.entityId = block.id;
|
||||
change.op = QStringLiteral("upsert");
|
||||
change.version = 1;
|
||||
change.updatedAt = DateTimeUtils::toDb(now.addSecs(-60));
|
||||
change.payload = QJsonObject{
|
||||
{QStringLiteral("id"), block.id},
|
||||
{QStringLiteral("task_id"), task.id},
|
||||
{QStringLiteral("start_at"), DateTimeUtils::toDb(block.startAt)},
|
||||
{QStringLiteral("end_at"), DateTimeUtils::toDb(block.endAt)},
|
||||
{QStringLiteral("granularity"), 15},
|
||||
{QStringLiteral("splittable"), 1},
|
||||
{QStringLiteral("breakable"), 1},
|
||||
{QStringLiteral("status"), QStringLiteral("done")},
|
||||
{QStringLiteral("done_at"), DateTimeUtils::toDb(now.addSecs(-60))},
|
||||
{QStringLiteral("created_at"), DateTimeUtils::toDb(block.createdAt)},
|
||||
{QStringLiteral("updated_at"), DateTimeUtils::toDb(now.addSecs(-60))},
|
||||
{QStringLiteral("version"), 1},
|
||||
{QStringLiteral("device_id"), QStringLiteral("device-b")},
|
||||
};
|
||||
|
||||
QVERIFY(store.beginTransaction());
|
||||
QVERIFY(store.setRemoteApplySuppressed(true));
|
||||
QVERIFY(store.applyRemoteChange(change));
|
||||
QVERIFY(store.setRemoteApplySuppressed(false));
|
||||
QVERIFY(store.commit());
|
||||
const auto updated = store.timeBlockById(block.id);
|
||||
QVERIFY(updated.has_value());
|
||||
QCOMPARE(updated->status, QStringLiteral("done"));
|
||||
QVERIFY(updated->doneAt.has_value());
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(TestStorage)
|
||||
#include "test_storage.moc"
|
||||
|
||||
@@ -115,6 +115,19 @@ void TestSyncIntegration::twoClientsConverge()
|
||||
QTRY_VERIFY_WITH_TIMEOUT(serviceB.itemsForDay(tomorrow).size() == 1, 20000);
|
||||
QCOMPARE(serviceB.itemsForDay(tomorrow).first().task.title, QStringLiteral("跨设备任务"));
|
||||
|
||||
const QString sharedBlockId = serviceA.itemsForDay(tomorrow).first().block.id;
|
||||
QVERIFY2(serviceA.setBlockStatus(sharedBlockId, QStringLiteral("done"), &error), qPrintable(error));
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!serviceB.itemsForDay(tomorrow).isEmpty() &&
|
||||
serviceB.itemsForDay(tomorrow).first().block.status ==
|
||||
QStringLiteral("done"),
|
||||
20000);
|
||||
QVERIFY2(serviceB.setBlockStatus(sharedBlockId, QStringLiteral("scheduled"), &error),
|
||||
qPrintable(error));
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!serviceA.itemsForDay(tomorrow).isEmpty() &&
|
||||
serviceA.itemsForDay(tomorrow).first().block.status ==
|
||||
QStringLiteral("scheduled"),
|
||||
20000);
|
||||
|
||||
QVERIFY2(serviceA.updateBlock(serviceA.itemsForDay(tomorrow).first().block.id,
|
||||
QStringLiteral("跨设备任务 v2"),
|
||||
start.addSecs(3600),
|
||||
@@ -176,6 +189,26 @@ void TestSyncIntegration::twoClientsConverge()
|
||||
}
|
||||
QVERIFY(sawOffline);
|
||||
|
||||
const QDate projectDeadline = QDate::currentDate().addMonths(1);
|
||||
QVERIFY2(serviceA.createProject(QStringLiteral("长期项目"),
|
||||
QStringLiteral("跨月目标"),
|
||||
projectDeadline,
|
||||
&error),
|
||||
qPrintable(error));
|
||||
QTRY_VERIFY_WITH_TIMEOUT(serviceB.projects().size() == 1, 20000);
|
||||
QCOMPARE(serviceB.projects().first().title, QStringLiteral("长期项目"));
|
||||
QVERIFY2(serviceB.updateProject(serviceB.projects().first().id,
|
||||
QStringLiteral("长期项目 v2"),
|
||||
QStringLiteral("跨月目标 v2"),
|
||||
projectDeadline.addDays(14),
|
||||
&error),
|
||||
qPrintable(error));
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!serviceA.projects().isEmpty() &&
|
||||
serviceA.projects().first().title == QStringLiteral("长期项目 v2"),
|
||||
20000);
|
||||
QVERIFY2(serviceA.deleteProject(serviceA.projects().first().id, &error), qPrintable(error));
|
||||
QTRY_VERIFY_WITH_TIMEOUT(serviceB.projects().isEmpty(), 20000);
|
||||
|
||||
syncA.stop();
|
||||
syncB.stop();
|
||||
serverProcess.terminate();
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
> 阶段 4(精力曲线 / 幽灵时间 / 每日复盘 / 主动建议)已验证:[`validation/phase-4.md`](validation/phase-4.md)。
|
||||
> 阶段 4.1(搜索 / 重复日程 / Windows 安装包 / 动画)已验证:[`validation/phase-4-1.md`](validation/phase-4-1.md)。
|
||||
> 阶段 4.2(桌面开始提醒 / 原生通知 / 点击定位)已验证:[`validation/phase-4-2.md`](validation/phase-4-2.md)。
|
||||
> 阶段 4.3(Linux AppImage)已验证:[`validation/phase-4-3.md`](validation/phase-4-3.md)。
|
||||
> 阶段 4.4(长期项目 / AI 识别 / 跨端展示)已验证:[`validation/phase-4-4.md`](validation/phase-4-4.md)。
|
||||
> 阶段 4.5(已完成任务/项目汇总)已验证:[`validation/phase-4-5.md`](validation/phase-4-5.md)。
|
||||
> 阶段 5.0(Android 同步客户端)已构建验证:[`validation/phase-5.md`](validation/phase-5.md)。
|
||||
> 阶段 5.1(移动提醒 / 完成同步修复 / MinGW 修复)已验证:[`validation/phase-5-1.md`](validation/phase-5-1.md)。
|
||||
|
||||
## 0. 当前环境
|
||||
|
||||
@@ -153,6 +157,29 @@ Schedule/
|
||||
- [x] 设置页提前提醒选项、TOML `[reminders] lead_minutes`
|
||||
- 验收:`ctest --preset linux-gcc` 12/12;见 [`validation/phase-4-2.md`](validation/phase-4-2.md)
|
||||
|
||||
### 阶段 4.3:Linux AppImage(已完成)
|
||||
- [x] linuxdeploy/appimagetool 打包脚本
|
||||
- [x] Qt 库、平台插件、SQLite、TLS、fcitx5 插件打包
|
||||
- [x] 桌面图标、.desktop 与 AppStream 元数据
|
||||
- [x] Xvfb/X11 与 offscreen 启动验证;产物约 34 MB
|
||||
- 验收:见 [`validation/phase-4-3.md`](validation/phase-4-3.md)
|
||||
|
||||
### 阶段 4.4:长期项目(已完成)
|
||||
- [x] Project 模型 + SQLite schema v4 + 同步触发器
|
||||
- [x] 长期项目面板、截止日倒计时、手工新建/编辑/完成/删除
|
||||
- [x] AI `project` 操作、Diff 卡片勾选、项目上下文注入
|
||||
- [x] 服务端接受 `project` 变更;桌面双端同步集成测试
|
||||
- [x] Android 接收/只读展示长期项目
|
||||
- 验收:`ctest 12/12`;Android 8/8;见 [`validation/phase-4-4.md`](validation/phase-4-4.md)
|
||||
|
||||
### 阶段 4.5:已完成汇总(已完成)
|
||||
- [x] 已完成短期任务查询与完成时间排序
|
||||
- [x] 已完成长期项目查询
|
||||
- [x] 本周/本月/全部范围、完成数/专注时长/项目数/连续天数
|
||||
- [x] 桌面汇总对话框与今日面板奖牌入口
|
||||
- [x] Android 菜单「已完成汇总」统计与最近记录
|
||||
- 验收:`ctest 12/12`;Android 8/8;见 [`validation/phase-4-5.md`](validation/phase-4-5.md)
|
||||
|
||||
### 阶段 5.0:Android 同步客户端(已完成 v1)
|
||||
- [x] 独立 Kotlin/Android 工程,不依赖 Qt
|
||||
- [x] SQLite task/timeblock/outbox/sync_state、LWW、删除墓碑
|
||||
@@ -166,6 +193,13 @@ Schedule/
|
||||
- [ ] FCM 即时推送、精确提醒、Keystore、发布签名
|
||||
- 验收:`assembleDebug` + `testDebugUnitTest`;见 [`validation/phase-5.md`](validation/phase-5.md)
|
||||
|
||||
### 阶段 5.1:移动提醒与完成同步修复(已完成)
|
||||
- [x] Android 开始提醒 / 提前 N 分钟提醒 / 超时提醒
|
||||
- [x] Windows MinGW 编译修复(SystemTray DBus 成员条件编译)
|
||||
- [x] 完成状态同步:远端 done 覆盖本地 scheduled/in_progress,避免时钟偏差导致丢完成
|
||||
- [x] Android 本地变更使用 expedited WorkManager 尽快同步
|
||||
- 验收:`ctest 12/12`;Android 8/8 JVM 测试;见 [`validation/phase-5-1.md`](validation/phase-5-1.md)
|
||||
|
||||
## 3. 质量门槛(每阶段)
|
||||
|
||||
1. `cmake --preset linux-gcc && cmake --build --preset linux-gcc` 零警告(`-Werror`)。
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
Daemon will be stopped at the end of the build
|
||||
> Task :app:preBuild UP-TO-DATE
|
||||
> Task :app:preDebugBuild UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
|
||||
> Task :app:checkKotlinGradlePluginConfigurationErrors
|
||||
> Task :app:checkDebugAarMetadata UP-TO-DATE
|
||||
> Task :app:generateDebugResValues UP-TO-DATE
|
||||
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
|
||||
> Task :app:generateDebugResources UP-TO-DATE
|
||||
> Task :app:mergeDebugResources UP-TO-DATE
|
||||
> Task :app:packageDebugResources UP-TO-DATE
|
||||
> Task :app:parseDebugLocalResources UP-TO-DATE
|
||||
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
|
||||
> Task :app:extractDeepLinksDebug UP-TO-DATE
|
||||
> Task :app:processDebugMainManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifestForPackage UP-TO-DATE
|
||||
> Task :app:processDebugResources UP-TO-DATE
|
||||
> Task :app:compileDebugKotlin UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebug UP-TO-DATE
|
||||
> Task :app:compileDebugJavaWithJavac NO-SOURCE
|
||||
> Task :app:mergeDebugShaders UP-TO-DATE
|
||||
> Task :app:compileDebugShaders NO-SOURCE
|
||||
> Task :app:generateDebugAssets UP-TO-DATE
|
||||
> Task :app:mergeDebugAssets UP-TO-DATE
|
||||
> Task :app:compressDebugAssets UP-TO-DATE
|
||||
> Task :app:desugarDebugFileDependencies UP-TO-DATE
|
||||
> Task :app:dexBuilderDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugGlobalSynthetics UP-TO-DATE
|
||||
> Task :app:processDebugJavaRes UP-TO-DATE
|
||||
> Task :app:mergeDebugJavaResource UP-TO-DATE
|
||||
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
|
||||
> Task :app:mergeDebugStartupProfile UP-TO-DATE
|
||||
> Task :app:mergeExtDexDebug UP-TO-DATE
|
||||
> Task :app:mergeLibDexDebug UP-TO-DATE
|
||||
> Task :app:mergeProjectDexDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeLibs NO-SOURCE
|
||||
> Task :app:stripDebugDebugSymbols NO-SOURCE
|
||||
> Task :app:validateSigningDebug UP-TO-DATE
|
||||
> Task :app:writeDebugAppMetadata UP-TO-DATE
|
||||
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
|
||||
> Task :app:packageDebug UP-TO-DATE
|
||||
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
|
||||
> Task :app:assembleDebug UP-TO-DATE
|
||||
> Task :app:bundleDebugClassesToRuntimeJar UP-TO-DATE
|
||||
> Task :app:bundleDebugClassesToCompileJar UP-TO-DATE
|
||||
> Task :app:compileDebugUnitTestKotlin UP-TO-DATE
|
||||
> Task :app:preDebugUnitTestBuild UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebugUnitTest UP-TO-DATE
|
||||
> Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE
|
||||
> Task :app:processDebugUnitTestJavaRes UP-TO-DATE
|
||||
> Task :app:testDebugUnitTest UP-TO-DATE
|
||||
|
||||
BUILD SUCCESSFUL in 9s
|
||||
41 actionable tasks: 1 executed, 40 up-to-date
|
||||
|
||||
APK: android/app/build/outputs/apk/debug/app-debug.apk (6.6 MB)
|
||||
JVM unit tests: LwwTest 3, TimeUtilsTest 3, CompletionMergeTest 2; 8 passed, 0 failed.
|
||||
@@ -0,0 +1,60 @@
|
||||
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
Daemon will be stopped at the end of the build
|
||||
> Task :app:preBuild UP-TO-DATE
|
||||
> Task :app:preDebugBuild UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
|
||||
> Task :app:checkKotlinGradlePluginConfigurationErrors
|
||||
> Task :app:checkDebugAarMetadata UP-TO-DATE
|
||||
> Task :app:generateDebugResValues UP-TO-DATE
|
||||
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
|
||||
> Task :app:generateDebugResources UP-TO-DATE
|
||||
> Task :app:mergeDebugResources UP-TO-DATE
|
||||
> Task :app:packageDebugResources UP-TO-DATE
|
||||
> Task :app:parseDebugLocalResources UP-TO-DATE
|
||||
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
|
||||
> Task :app:extractDeepLinksDebug UP-TO-DATE
|
||||
> Task :app:processDebugMainManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifestForPackage UP-TO-DATE
|
||||
> Task :app:processDebugResources UP-TO-DATE
|
||||
> Task :app:compileDebugKotlin UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebug UP-TO-DATE
|
||||
> Task :app:compileDebugJavaWithJavac NO-SOURCE
|
||||
> Task :app:mergeDebugShaders UP-TO-DATE
|
||||
> Task :app:compileDebugShaders NO-SOURCE
|
||||
> Task :app:generateDebugAssets UP-TO-DATE
|
||||
> Task :app:mergeDebugAssets UP-TO-DATE
|
||||
> Task :app:compressDebugAssets UP-TO-DATE
|
||||
> Task :app:desugarDebugFileDependencies UP-TO-DATE
|
||||
> Task :app:dexBuilderDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugGlobalSynthetics UP-TO-DATE
|
||||
> Task :app:processDebugJavaRes UP-TO-DATE
|
||||
> Task :app:mergeDebugJavaResource UP-TO-DATE
|
||||
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
|
||||
> Task :app:mergeDebugStartupProfile UP-TO-DATE
|
||||
> Task :app:mergeExtDexDebug UP-TO-DATE
|
||||
> Task :app:mergeLibDexDebug UP-TO-DATE
|
||||
> Task :app:mergeProjectDexDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeLibs NO-SOURCE
|
||||
> Task :app:stripDebugDebugSymbols NO-SOURCE
|
||||
> Task :app:validateSigningDebug UP-TO-DATE
|
||||
> Task :app:writeDebugAppMetadata UP-TO-DATE
|
||||
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
|
||||
> Task :app:packageDebug UP-TO-DATE
|
||||
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
|
||||
> Task :app:assembleDebug UP-TO-DATE
|
||||
> Task :app:bundleDebugClassesToRuntimeJar UP-TO-DATE
|
||||
> Task :app:bundleDebugClassesToCompileJar UP-TO-DATE
|
||||
> Task :app:compileDebugUnitTestKotlin UP-TO-DATE
|
||||
> Task :app:preDebugUnitTestBuild UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebugUnitTest UP-TO-DATE
|
||||
> Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE
|
||||
> Task :app:processDebugUnitTestJavaRes UP-TO-DATE
|
||||
> Task :app:testDebugUnitTest UP-TO-DATE
|
||||
|
||||
BUILD SUCCESSFUL in 8s
|
||||
41 actionable tasks: 1 executed, 40 up-to-date
|
||||
|
||||
APK: android/app/build/outputs/apk/debug/app-debug.apk (6.6 MB)
|
||||
JVM unit tests: LwwTest 3, TimeUtilsTest 3, CompletionMergeTest 2; 8 passed, 0 failed.
|
||||
@@ -0,0 +1,61 @@
|
||||
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
Daemon will be stopped at the end of the build
|
||||
> Task :app:preBuild UP-TO-DATE
|
||||
> Task :app:preDebugBuild UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
|
||||
> Task :app:checkKotlinGradlePluginConfigurationErrors
|
||||
> Task :app:checkDebugAarMetadata UP-TO-DATE
|
||||
> Task :app:generateDebugResValues UP-TO-DATE
|
||||
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
|
||||
> Task :app:generateDebugResources UP-TO-DATE
|
||||
> Task :app:mergeDebugResources UP-TO-DATE
|
||||
> Task :app:packageDebugResources UP-TO-DATE
|
||||
> Task :app:parseDebugLocalResources UP-TO-DATE
|
||||
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
|
||||
> Task :app:extractDeepLinksDebug UP-TO-DATE
|
||||
> Task :app:processDebugMainManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifest UP-TO-DATE
|
||||
> Task :app:processDebugManifestForPackage UP-TO-DATE
|
||||
> Task :app:processDebugResources UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugShaders UP-TO-DATE
|
||||
> Task :app:compileDebugShaders NO-SOURCE
|
||||
> Task :app:generateDebugAssets UP-TO-DATE
|
||||
> Task :app:mergeDebugAssets UP-TO-DATE
|
||||
> Task :app:compressDebugAssets UP-TO-DATE
|
||||
> Task :app:desugarDebugFileDependencies UP-TO-DATE
|
||||
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
|
||||
> Task :app:mergeDebugStartupProfile UP-TO-DATE
|
||||
> Task :app:mergeExtDexDebug UP-TO-DATE
|
||||
> Task :app:mergeLibDexDebug UP-TO-DATE
|
||||
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
|
||||
> Task :app:mergeDebugNativeLibs NO-SOURCE
|
||||
> Task :app:stripDebugDebugSymbols NO-SOURCE
|
||||
> Task :app:validateSigningDebug UP-TO-DATE
|
||||
> Task :app:writeDebugAppMetadata UP-TO-DATE
|
||||
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
|
||||
> Task :app:preDebugUnitTestBuild UP-TO-DATE
|
||||
> Task :app:javaPreCompileDebugUnitTest UP-TO-DATE
|
||||
> Task :app:compileDebugKotlin
|
||||
> Task :app:compileDebugJavaWithJavac NO-SOURCE
|
||||
> Task :app:dexBuilderDebug
|
||||
> Task :app:mergeDebugGlobalSynthetics UP-TO-DATE
|
||||
> Task :app:processDebugJavaRes UP-TO-DATE
|
||||
> Task :app:mergeDebugJavaResource UP-TO-DATE
|
||||
> Task :app:bundleDebugClassesToRuntimeJar
|
||||
> Task :app:bundleDebugClassesToCompileJar
|
||||
> Task :app:mergeProjectDexDebug
|
||||
> Task :app:compileDebugUnitTestKotlin UP-TO-DATE
|
||||
> Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE
|
||||
> Task :app:processDebugUnitTestJavaRes UP-TO-DATE
|
||||
> Task :app:testDebugUnitTest
|
||||
> Task :app:packageDebug
|
||||
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
|
||||
> Task :app:assembleDebug
|
||||
|
||||
BUILD SUCCESSFUL in 13s
|
||||
41 actionable tasks: 8 executed, 33 up-to-date
|
||||
|
||||
|
||||
APK: android/app/build/outputs/apk/debug/app-debug.apk (6.5 MB)
|
||||
JVM unit tests: LwwTest 3, TimeUtilsTest 3, CompletionMergeTest 2; 8 passed, 0 failed.
|
||||
@@ -0,0 +1,504 @@
|
||||
$ ./scripts/package-linux-appimage.sh
|
||||
|
||||
Configuring release build...
|
||||
Preset CMake variables:
|
||||
|
||||
CMAKE_EXPORT_COMPILE_COMMANDS="ON"
|
||||
CMAKE_PREFIX_PATH="/home/misaki/Qt6.3/6.6.3/gcc_64"
|
||||
SCHEDULE_WARNINGS_AS_ERRORS="ON"
|
||||
|
||||
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
|
||||
-- Configuring done (0.2s)
|
||||
-- Generating done (0.1s)
|
||||
-- Build files have been written to: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release
|
||||
[1/61] Automatic MOC and UIC for target schedule_core
|
||||
[2/60] Building Go sync server
|
||||
[3/60] Building CXX object client/src/CMakeFiles/schedule_core.dir/storage/SqliteStore.cpp.o
|
||||
[4/60] Linking CXX static library client/src/libschedule_core.a
|
||||
[5/60] Linking CXX executable client/tests/test_scheduler
|
||||
[6/60] Linking CXX executable client/tests/test_energy
|
||||
[7/60] Automatic MOC and UIC for target schedule_services
|
||||
[8/60] Automatic MOC and UIC for target test_storage
|
||||
[9/59] Building CXX object client/src/CMakeFiles/schedule_services.dir/schedule_services_autogen/mocs_compilation.cpp.o
|
||||
[10/59] Building CXX object client/src/CMakeFiles/schedule_services.dir/services/NotificationService.cpp.o
|
||||
[11/59] Building CXX object client/tests/CMakeFiles/test_storage.dir/test_storage.cpp.o
|
||||
[12/59] Linking CXX executable client/tests/test_storage
|
||||
[13/59] Building CXX object client/src/CMakeFiles/schedule_services.dir/services/ScheduleService.cpp.o
|
||||
[14/59] Linking CXX static library client/src/libschedule_services.a
|
||||
[15/59] Automatic MOC and UIC for target schedule_sync
|
||||
[16/58] Automatic MOC and UIC for target schedule_ai
|
||||
[17/57] Linking CXX executable client/tests/test_config
|
||||
[18/57] Automatic MOC and UIC for target test_services
|
||||
[19/56] Building CXX object client/src/CMakeFiles/schedule_sync.dir/sync/SyncService.cpp.o
|
||||
[20/56] Linking CXX static library client/src/libschedule_sync.a
|
||||
[21/56] Automatic MOC and UIC for target test_sync_integration
|
||||
[22/55] Building CXX object client/tests/CMakeFiles/test_services.dir/test_services.cpp.o
|
||||
[23/55] Linking CXX executable client/tests/test_services
|
||||
[24/55] Building CXX object client/tests/CMakeFiles/test_sync_integration.dir/test_sync_integration.cpp.o
|
||||
[25/55] Linking CXX executable client/tests/test_sync_integration
|
||||
[26/55] Building CXX object client/src/CMakeFiles/schedule_ai.dir/ai/AIService.cpp.o
|
||||
[27/55] Linking CXX static library client/src/libschedule_ai.a
|
||||
[28/55] Linking CXX executable client/tests/test_openai_provider
|
||||
[29/55] Automatic MOC and UIC for target schedule_ui
|
||||
[30/55] Automatic MOC and UIC for target test_ai
|
||||
[31/54] Building CXX object client/tools/CMakeFiles/ai_regression.dir/ai_regression.cpp.o
|
||||
[32/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/ui/dialogs/SearchDialog.cpp.o
|
||||
[33/54] Linking CXX executable bin/ai_regression
|
||||
[34/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/ui/dialogs/CompletedSummaryDialog.cpp.o
|
||||
[35/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/schedule_ui_autogen/mocs_compilation.cpp.o
|
||||
[36/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/ui/CompactWindow.cpp.o
|
||||
[37/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/ui/panels/TodayPanel.cpp.o
|
||||
[38/54] Building CXX object client/src/CMakeFiles/schedule_ui.dir/ui/MainWindow.cpp.o
|
||||
[39/54] Linking CXX static library client/src/libschedule_ui.a
|
||||
[40/54] Automatic MOC and UIC for target Schedule
|
||||
[41/53] Automatic MOC and UIC for target test_mainwindow
|
||||
[42/52] Linking CXX executable client/tests/test_grid
|
||||
[43/52] Automatic MOC and UIC for target test_compactwindow
|
||||
[44/51] Building CXX object client/tests/CMakeFiles/test_ai.dir/test_ai.cpp.o
|
||||
[45/51] Linking CXX executable client/tests/test_ai
|
||||
[46/51] Building CXX object client/src/CMakeFiles/Schedule.dir/main.cpp.o
|
||||
[47/51] Linking CXX executable bin/Schedule
|
||||
[48/51] Building CXX object client/tests/CMakeFiles/test_mainwindow.dir/test_mainwindow.cpp.o
|
||||
[49/51] Linking CXX executable client/tests/test_mainwindow
|
||||
[50/51] Building CXX object client/tests/CMakeFiles/test_compactwindow.dir/test_compactwindow.cpp.o
|
||||
[51/51] Linking CXX executable client/tests/test_compactwindow
|
||||
Installing application files...
|
||||
-- Install configuration: "Release"
|
||||
-- Installing: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/./Schedule
|
||||
-- Set non-toolchain portion of runtime path of "/home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/./Schedule" to "$ORIGIN:$ORIGIN/../lib"
|
||||
-- Installing: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/./README.md
|
||||
-- Installing: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/licenses/ElaWidgetTools-LICENSE
|
||||
-- Installing: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/licenses/tomlplusplus-LICENSE
|
||||
Copying required Qt plugins...
|
||||
Deploying shared library dependencies...
|
||||
linuxdeploy version 1-alpha (git commit ID d2557d6), GitHub actions build 328 built on 2025-10-01 02:03:18 UTC
|
||||
|
||||
-- Creating basic AppDir structure --
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/pixmaps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/16x16/apps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/32x32/apps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/64x64/apps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/128x128/apps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/256x256/apps/
|
||||
Creating directory /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/scalable/apps/
|
||||
|
||||
-- Deploying dependencies for existing files in AppDir --
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WebSockets.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WebSockets.so.6 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Sql.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Sql.so.6 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Network.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Network.so.6 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Widgets.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Widgets.so.6 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Gui.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Gui.so.6 using dpkg-query
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libGLX.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libOpenGL.so.0
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6DBus.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6DBus.so.6 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Core.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Core.so.6 using dpkg-query
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libstdc++.so.6
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libm.so.6
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libgcc_s.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libc.so.6
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libpthread.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libzstd.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libzstd.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libgssapi_krb5.so.2
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libgssapi_krb5.so.2
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libz.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libresolv.so.2
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libGL.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxkbcommon.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxkbcommon.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libEGL.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libfontconfig.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libX11.so.6
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libdl.so.2
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libfreetype.so.6
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libgthread-2.0.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libgthread-2.0.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libGLdispatch.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libdbus-1.so.3
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libdbus-1.so.3
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicui18n.so.56
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicui18n.so.56 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicuuc.so.56
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicuuc.so.56 using dpkg-query
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicudata.so.56
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicudata.so.56 using dpkg-query
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/librt.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libkrb5.so.3
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libkrb5.so.3
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libk5crypto.so.3
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libk5crypto.so.3
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libcom_err.so.2
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libkrb5support.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libkrb5support.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libexpat.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libxcb.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libbz2.so.1.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libbz2.so.1.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libpng16.so.16
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libpng16.so.16
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libbrotlidec.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libbrotlidec.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libsystemd.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libsystemd.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libkeyutils.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libkeyutils.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libXau.so.6
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libXau.so.6
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libXdmcp.so.6
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libXdmcp.so.6
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libbrotlicommon.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libbrotlicommon.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libcap.so.2
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libcap.so.2
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libgcrypt.so.20
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libgcrypt.so.20
|
||||
Deploying shared library /lib/x86_64-linux-gnu/liblz4.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/liblz4.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/liblzma.so.5
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/liblzma.so.5
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libbsd.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libbsd.so.0
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libgpg-error.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libmd.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libmd.so.0
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandClient.so.6.6.3
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libwayland-client.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libwayland-cursor.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libwayland-cursor.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libffi.so.8
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libffi.so.8
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WlShellIntegration.so.6.6.3
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WaylandClient.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WaylandClient.so.6 using dpkg-query
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6OpenGL.so.6.6.3
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandEglClientHwIntegration.so.6.6.3
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libwayland-egl.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libwayland-egl.so.1
|
||||
Deploying shared library /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6OpenGL.so.6
|
||||
WARNING: Could not find copyright files for file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6OpenGL.so.6 using dpkg-query
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6XcbQpa.so.6.6.3
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-cursor.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-cursor.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-icccm.so.4
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-icccm.so.4
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-image.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-image.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-keysyms.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-keysyms.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-randr.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-randr.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-render.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-render.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-render-util.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-render-util.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-shape.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-shape.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-shm.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-shm.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-sync.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-sync.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-xfixes.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-xfixes.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-xkb.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-xkb.so.1
|
||||
Skipping deployment of blacklisted library /lib/x86_64-linux-gnu/libX11-xcb.so.1
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0
|
||||
Deploying shared library /lib/x86_64-linux-gnu/libxcb-util.so.1
|
||||
Deploying copyright files for file /lib/x86_64-linux-gnu/libxcb-util.so.1
|
||||
|
||||
-- Deploying executables --
|
||||
Deploying executable /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule
|
||||
WARNING: Could not find copyright files for file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule using dpkg-query
|
||||
Deploying dependencies for ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule
|
||||
|
||||
-- Copying files into AppDir --
|
||||
Copying file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Core.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Core.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6DBus.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6DBus.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Gui.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Gui.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Network.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Network.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6OpenGL.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6OpenGL.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Sql.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Sql.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WaylandClient.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandClient.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6WebSockets.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WebSockets.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libQt6Widgets.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Widgets.so.6
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicudata.so.56 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicudata.so.56
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicui18n.so.56 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicui18n.so.56
|
||||
Copying file /home/misaki/Qt6.3/6.6.3/gcc_64/lib/libicuuc.so.56 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicuuc.so.56
|
||||
Copying file /lib/x86_64-linux-gnu/libXau.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXau.so.6
|
||||
Copying file /lib/x86_64-linux-gnu/libXdmcp.so.6 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXdmcp.so.6
|
||||
Copying file /lib/x86_64-linux-gnu/libbrotlicommon.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlicommon.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libbrotlidec.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlidec.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libbsd.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbsd.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libbz2.so.1.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbz2.so.1.0
|
||||
Copying file /lib/x86_64-linux-gnu/libcap.so.2 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libcap.so.2
|
||||
Copying file /lib/x86_64-linux-gnu/libdbus-1.so.3 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libdbus-1.so.3
|
||||
Copying file /lib/x86_64-linux-gnu/libffi.so.8 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libffi.so.8
|
||||
Copying file /lib/x86_64-linux-gnu/libgcrypt.so.20 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgcrypt.so.20
|
||||
Copying file /lib/x86_64-linux-gnu/libglib-2.0.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libglib-2.0.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgssapi_krb5.so.2
|
||||
Copying file /lib/x86_64-linux-gnu/libgthread-2.0.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgthread-2.0.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libk5crypto.so.3 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libk5crypto.so.3
|
||||
Copying file /lib/x86_64-linux-gnu/libkeyutils.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkeyutils.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libkrb5.so.3 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5.so.3
|
||||
Copying file /lib/x86_64-linux-gnu/libkrb5support.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5support.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/liblz4.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblz4.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/liblzma.so.5 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblzma.so.5
|
||||
Copying file /lib/x86_64-linux-gnu/libmd.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libmd.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libpcre2-8.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpcre2-8.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libpng16.so.16 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpng16.so.16
|
||||
Copying file /lib/x86_64-linux-gnu/libsystemd.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libsystemd.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libwayland-cursor.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-cursor.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libwayland-egl.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-egl.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-cursor.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-cursor.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-icccm.so.4 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-icccm.so.4
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-image.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-image.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-keysyms.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-randr.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-randr.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-render-util.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render-util.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-render.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-shape.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shape.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-shm.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shm.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-sync.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-sync.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-util.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-util.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xfixes.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxcb-xkb.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xkb.so.1
|
||||
Copying file /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon-x11.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libxkbcommon.so.0 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon.so.0
|
||||
Copying file /lib/x86_64-linux-gnu/libzstd.so.1 to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libzstd.so.1
|
||||
Copying file /usr/share/doc/libbrotli1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libbrotli1/copyright
|
||||
Copying file /usr/share/doc/libbsd0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libbsd0/copyright
|
||||
Copying file /usr/share/doc/libbz2-1.0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libbz2-1.0/copyright
|
||||
Copying file /usr/share/doc/libcap2/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libcap2/copyright
|
||||
Copying file /usr/share/doc/libdbus-1-3/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libdbus-1-3/copyright
|
||||
Copying file /usr/share/doc/libffi8/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libffi8/copyright
|
||||
Copying file /usr/share/doc/libgcrypt20/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libgcrypt20/copyright
|
||||
Copying file /usr/share/doc/libglib2.0-0t64/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libglib2.0-0t64/copyright
|
||||
Copying file /usr/share/doc/libgssapi-krb5-2/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libgssapi-krb5-2/copyright
|
||||
Copying file /usr/share/doc/libk5crypto3/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libk5crypto3/copyright
|
||||
Copying file /usr/share/doc/libkeyutils1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libkeyutils1/copyright
|
||||
Copying file /usr/share/doc/libkrb5-3/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libkrb5-3/copyright
|
||||
Copying file /usr/share/doc/libkrb5support0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libkrb5support0/copyright
|
||||
Copying file /usr/share/doc/liblz4-1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/liblz4-1/copyright
|
||||
Copying file /usr/share/doc/liblzma5/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/liblzma5/copyright
|
||||
Copying file /usr/share/doc/libmd0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libmd0/copyright
|
||||
Copying file /usr/share/doc/libpcre2-8-0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libpcre2-8-0/copyright
|
||||
Copying file /usr/share/doc/libpng16-16t64/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libpng16-16t64/copyright
|
||||
Copying file /usr/share/doc/libsystemd0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libsystemd0/copyright
|
||||
Copying file /usr/share/doc/libwayland-cursor0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libwayland-cursor0/copyright
|
||||
Copying file /usr/share/doc/libwayland-egl1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libwayland-egl1/copyright
|
||||
Copying file /usr/share/doc/libxau6/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxau6/copyright
|
||||
Copying file /usr/share/doc/libxcb-cursor0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-cursor0/copyright
|
||||
Copying file /usr/share/doc/libxcb-icccm4/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-icccm4/copyright
|
||||
Copying file /usr/share/doc/libxcb-image0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-image0/copyright
|
||||
Copying file /usr/share/doc/libxcb-keysyms1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-keysyms1/copyright
|
||||
Copying file /usr/share/doc/libxcb-randr0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-randr0/copyright
|
||||
Copying file /usr/share/doc/libxcb-render-util0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-render-util0/copyright
|
||||
Copying file /usr/share/doc/libxcb-render0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-render0/copyright
|
||||
Copying file /usr/share/doc/libxcb-shape0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-shape0/copyright
|
||||
Copying file /usr/share/doc/libxcb-shm0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-shm0/copyright
|
||||
Copying file /usr/share/doc/libxcb-sync1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-sync1/copyright
|
||||
Copying file /usr/share/doc/libxcb-util1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-util1/copyright
|
||||
Copying file /usr/share/doc/libxcb-xfixes0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-xfixes0/copyright
|
||||
Copying file /usr/share/doc/libxcb-xkb1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxcb-xkb1/copyright
|
||||
Copying file /usr/share/doc/libxdmcp6/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxdmcp6/copyright
|
||||
Copying file /usr/share/doc/libxkbcommon-x11-0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxkbcommon-x11-0/copyright
|
||||
Copying file /usr/share/doc/libxkbcommon0/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libxkbcommon0/copyright
|
||||
Copying file /usr/share/doc/libzstd1/copyright to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/doc/libzstd1/copyright
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Core.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6DBus.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Gui.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Network.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6OpenGL.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Sql.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandClient.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WebSockets.so.6: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Widgets.so.6: rpath starts with $
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXau.so.6
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXdmcp.so.6
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlicommon.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlidec.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbsd.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbz2.so.1.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libcap.so.2
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libdbus-1.so.3
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libffi.so.8
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgcrypt.so.20
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libglib-2.0.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgssapi_krb5.so.2
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgthread-2.0.so.0
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicudata.so.56: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicui18n.so.56: rpath starts with $
|
||||
WARNING: Not calling strip on binary /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicuuc.so.56: rpath starts with $
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libk5crypto.so.3
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkeyutils.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5.so.3
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5support.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblz4.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblzma.so.5
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libmd.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpcre2-8.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpng16.so.16
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libsystemd.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-cursor.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-egl.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-cursor.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-icccm.so.4
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-image.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-keysyms.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-randr.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render-util.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shape.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shm.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-sync.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-util.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xfixes.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xkb.so.1
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon-x11.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon.so.0
|
||||
Calling strip on library /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libzstd.so.1
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule to $ORIGIN/../lib
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Core.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6DBus.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Gui.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Network.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6OpenGL.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6OpenGL.so.6.6.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Sql.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandClient.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandClient.so.6.6.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WaylandEglClientHwIntegration.so.6.6.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WebSockets.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6Widgets.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6WlShellIntegration.so.6.6.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libQt6XcbQpa.so.6.6.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXau.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libXdmcp.so.6 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlicommon.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbrotlidec.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbsd.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libbz2.so.1.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libcap.so.2 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libdbus-1.so.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libffi.so.8 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgcrypt.so.20 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libglib-2.0.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgssapi_krb5.so.2 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libgthread-2.0.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicudata.so.56 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicui18n.so.56 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libicuuc.so.56 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libk5crypto.so.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkeyutils.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5.so.3 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libkrb5support.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblz4.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/liblzma.so.5 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libmd.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpcre2-8.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libpng16.so.16 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libsystemd.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-cursor.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libwayland-egl.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-cursor.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-icccm.so.4 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-image.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-keysyms.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-randr.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render-util.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-render.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shape.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-shm.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-sync.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-util.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xfixes.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxcb-xkb.so.1 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon-x11.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libxkbcommon.so.0 to $ORIGIN
|
||||
Setting rpath in ELF file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/lib/libzstd.so.1 to $ORIGIN
|
||||
|
||||
-- Deploying icons --
|
||||
Deploying icon /home/misaki/MisakiCodes/Schedule/packaging/linux/schedule.png
|
||||
WARNING: Could not find copyright files for file /home/misaki/MisakiCodes/Schedule/packaging/linux/schedule.png using dpkg-query
|
||||
|
||||
-- Deploying desktop files --
|
||||
Deploying desktop file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop
|
||||
|
||||
-- Copying files into AppDir --
|
||||
Copying file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop
|
||||
Copying file /home/misaki/MisakiCodes/Schedule/packaging/linux/schedule.png to /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/256x256/apps/schedule.png
|
||||
|
||||
-- Deploying files into AppDir root directory --
|
||||
Deploying files to AppDir root using desktop file: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop
|
||||
Deploying desktop file to AppDir root: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop
|
||||
Creating symlink for file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/applications/Schedule.desktop in/as /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir
|
||||
Deploying icon to AppDir root: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/scalable/apps/schedule.svg
|
||||
Creating symlink for file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/share/icons/hicolor/scalable/apps/schedule.svg in/as /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir
|
||||
Deploying AppRun symlink for executable in AppDir root: /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule
|
||||
Creating symlink for file /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/usr/bin/Schedule in/as /home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir/AppRun
|
||||
Creating /home/misaki/MisakiCodes/Schedule/dist/AI-Schedule-0.1.0-x86_64.AppImage...
|
||||
appimagetool, continuous build (commit 5735cc5), build <local dev build> built on 2023-03-08 22:52:04 UTC
|
||||
Using architecture x86_64
|
||||
WARNING: AppStream upstream metadata is missing, please consider creating it
|
||||
in usr/share/metainfo/Schedule.appdata.xml
|
||||
Please see https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps
|
||||
for more information or use the generator at http://output.jsbin.com/qoqukof.
|
||||
Generating squashfs...
|
||||
Parallel mksquashfs: Using 12 processors
|
||||
Creating 4.0 filesystem on /home/misaki/MisakiCodes/Schedule/dist/AI-Schedule-0.1.0-x86_64.AppImage, block size 131072.
|
||||
|
||||
[===============================================================/] 747/747 100%
|
||||
|
||||
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
|
||||
compressed data, compressed metadata, compressed fragments,
|
||||
compressed xattrs, compressed ids
|
||||
duplicates are removed
|
||||
Filesystem size 34417.91 Kbytes (33.61 Mbytes)
|
||||
41.70% of uncompressed filesystem size (82531.28 Kbytes)
|
||||
Inode table size 4272 bytes (4.17 Kbytes)
|
||||
41.78% of uncompressed inode table size (10224 bytes)
|
||||
Directory table size 2462 bytes (2.40 Kbytes)
|
||||
41.81% of uncompressed directory table size (5888 bytes)
|
||||
Number of duplicate files found 13
|
||||
Number of inodes 232
|
||||
Number of files 147
|
||||
Number of fragments 30
|
||||
Number of symbolic links 11
|
||||
Number of device nodes 0
|
||||
Number of fifo nodes 0
|
||||
Number of socket nodes 0
|
||||
Number of directories 74
|
||||
Number of ids (unique uids + gids) 1
|
||||
Number of uids 1
|
||||
root (0)
|
||||
Number of gids 1
|
||||
root (0)
|
||||
Embedding ELF...
|
||||
Marking the AppImage as executable...
|
||||
Embedding MD5 digest
|
||||
Success
|
||||
|
||||
Please consider submitting your AppImage to AppImageHub, the crowd-sourced
|
||||
central directory of available AppImages, by opening a pull request
|
||||
at https://github.com/AppImage/appimage.github.io
|
||||
/home/misaki/MisakiCodes/Schedule/build/linux-gcc-release/AppDir should be packaged as /home/misaki/MisakiCodes/Schedule/dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
AppImage created: /home/misaki/MisakiCodes/Schedule/dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
@@ -0,0 +1 @@
|
||||
49efebebbec76ce36dedf7e14fe33ee476909a122a5f0d022afd3c8e4ae87538 dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 39 KiB |
@@ -0,0 +1,29 @@
|
||||
Test project /home/misaki/MisakiCodes/Schedule/build/linux-gcc
|
||||
Start 1: go_server_tests
|
||||
1/12 Test #1: go_server_tests .................. Passed 0.21 sec
|
||||
Start 2: storage
|
||||
2/12 Test #2: storage .......................... Passed 0.02 sec
|
||||
Start 3: services
|
||||
3/12 Test #3: services ......................... Passed 0.05 sec
|
||||
Start 4: grid
|
||||
4/12 Test #4: grid ............................. Passed 0.40 sec
|
||||
Start 5: mainwindow
|
||||
5/12 Test #5: mainwindow ....................... Passed 1.28 sec
|
||||
Start 6: compactwindow
|
||||
6/12 Test #6: compactwindow .................... Passed 4.33 sec
|
||||
Start 7: config
|
||||
7/12 Test #7: config ........................... Passed 0.02 sec
|
||||
Start 8: scheduler
|
||||
8/12 Test #8: scheduler ........................ Passed 0.01 sec
|
||||
Start 9: energy
|
||||
9/12 Test #9: energy ........................... Passed 0.00 sec
|
||||
Start 10: ai
|
||||
10/12 Test #10: ai ............................... Passed 0.12 sec
|
||||
Start 11: openai_provider
|
||||
11/12 Test #11: openai_provider .................. Passed 0.21 sec
|
||||
Start 12: sync_integration
|
||||
12/12 Test #12: sync_integration ................. Passed 9.12 sec
|
||||
|
||||
100% tests passed, 0 tests failed out of 12
|
||||
|
||||
Total Test time (real) = 15.76 sec
|
||||
@@ -0,0 +1,29 @@
|
||||
Test project /home/misaki/MisakiCodes/Schedule/build/linux-gcc
|
||||
Start 1: go_server_tests
|
||||
1/12 Test #1: go_server_tests .................. Passed 0.12 sec
|
||||
Start 2: storage
|
||||
2/12 Test #2: storage .......................... Passed 0.02 sec
|
||||
Start 3: services
|
||||
3/12 Test #3: services ......................... Passed 0.05 sec
|
||||
Start 4: grid
|
||||
4/12 Test #4: grid ............................. Passed 0.39 sec
|
||||
Start 5: mainwindow
|
||||
5/12 Test #5: mainwindow ....................... Passed 1.26 sec
|
||||
Start 6: compactwindow
|
||||
6/12 Test #6: compactwindow .................... Passed 4.66 sec
|
||||
Start 7: config
|
||||
7/12 Test #7: config ........................... Passed 0.02 sec
|
||||
Start 8: scheduler
|
||||
8/12 Test #8: scheduler ........................ Passed 0.01 sec
|
||||
Start 9: energy
|
||||
9/12 Test #9: energy ........................... Passed 0.00 sec
|
||||
Start 10: ai
|
||||
10/12 Test #10: ai ............................... Passed 0.12 sec
|
||||
Start 11: openai_provider
|
||||
11/12 Test #11: openai_provider .................. Passed 0.21 sec
|
||||
Start 12: sync_integration
|
||||
12/12 Test #12: sync_integration ................. Passed 11.41 sec
|
||||
|
||||
100% tests passed, 0 tests failed out of 12
|
||||
|
||||
Total Test time (real) = 18.29 sec
|
||||
@@ -0,0 +1,29 @@
|
||||
Test project /home/misaki/MisakiCodes/Schedule/build/linux-gcc
|
||||
Start 1: go_server_tests
|
||||
1/12 Test #1: go_server_tests .................. Passed 16.80 sec
|
||||
Start 2: storage
|
||||
2/12 Test #2: storage .......................... Passed 0.03 sec
|
||||
Start 3: services
|
||||
3/12 Test #3: services ......................... Passed 0.06 sec
|
||||
Start 4: grid
|
||||
4/12 Test #4: grid ............................. Passed 0.38 sec
|
||||
Start 5: mainwindow
|
||||
5/12 Test #5: mainwindow ....................... Passed 1.25 sec
|
||||
Start 6: compactwindow
|
||||
6/12 Test #6: compactwindow .................... Passed 4.96 sec
|
||||
Start 7: config
|
||||
7/12 Test #7: config ........................... Passed 0.02 sec
|
||||
Start 8: scheduler
|
||||
8/12 Test #8: scheduler ........................ Passed 0.00 sec
|
||||
Start 9: energy
|
||||
9/12 Test #9: energy ........................... Passed 0.00 sec
|
||||
Start 10: ai
|
||||
10/12 Test #10: ai ............................... Passed 0.13 sec
|
||||
Start 11: openai_provider
|
||||
11/12 Test #11: openai_provider .................. Passed 0.21 sec
|
||||
Start 12: sync_integration
|
||||
12/12 Test #12: sync_integration ................. Passed 11.59 sec
|
||||
|
||||
100% tests passed, 0 tests failed out of 12
|
||||
|
||||
Total Test time (real) = 35.43 sec
|
||||
@@ -0,0 +1,29 @@
|
||||
Test project /home/misaki/MisakiCodes/Schedule/build/linux-gcc
|
||||
Start 1: go_server_tests
|
||||
1/12 Test #1: go_server_tests .................. Passed 0.28 sec
|
||||
Start 2: storage
|
||||
2/12 Test #2: storage .......................... Passed 0.03 sec
|
||||
Start 3: services
|
||||
3/12 Test #3: services ......................... Passed 0.05 sec
|
||||
Start 4: grid
|
||||
4/12 Test #4: grid ............................. Passed 0.45 sec
|
||||
Start 5: mainwindow
|
||||
5/12 Test #5: mainwindow ....................... Passed 1.28 sec
|
||||
Start 6: compactwindow
|
||||
6/12 Test #6: compactwindow .................... Passed 4.31 sec
|
||||
Start 7: config
|
||||
7/12 Test #7: config ........................... Passed 0.02 sec
|
||||
Start 8: scheduler
|
||||
8/12 Test #8: scheduler ........................ Passed 0.00 sec
|
||||
Start 9: energy
|
||||
9/12 Test #9: energy ........................... Passed 0.00 sec
|
||||
Start 10: ai
|
||||
10/12 Test #10: ai ............................... Passed 0.12 sec
|
||||
Start 11: openai_provider
|
||||
11/12 Test #11: openai_provider .................. Passed 0.21 sec
|
||||
Start 12: sync_integration
|
||||
12/12 Test #12: sync_integration ................. Passed 9.57 sec
|
||||
|
||||
100% tests passed, 0 tests failed out of 12
|
||||
|
||||
Total Test time (real) = 16.33 sec
|
||||
@@ -0,0 +1,7 @@
|
||||
? github.com/misaki/Schedule/server/cmd/server [no test files]
|
||||
ok github.com/misaki/Schedule/server/internal/api (cached)
|
||||
? github.com/misaki/Schedule/server/internal/auth [no test files]
|
||||
? github.com/misaki/Schedule/server/internal/config [no test files]
|
||||
? github.com/misaki/Schedule/server/internal/model [no test files]
|
||||
ok github.com/misaki/Schedule/server/internal/service (cached)
|
||||
ok github.com/misaki/Schedule/server/internal/store (cached)
|
||||
@@ -0,0 +1,7 @@
|
||||
? github.com/misaki/Schedule/server/cmd/server [no test files]
|
||||
ok github.com/misaki/Schedule/server/internal/api (cached)
|
||||
? github.com/misaki/Schedule/server/internal/auth [no test files]
|
||||
? github.com/misaki/Schedule/server/internal/config [no test files]
|
||||
? github.com/misaki/Schedule/server/internal/model [no test files]
|
||||
ok github.com/misaki/Schedule/server/internal/service (cached)
|
||||
ok github.com/misaki/Schedule/server/internal/store (cached)
|
||||
@@ -0,0 +1,73 @@
|
||||
# 阶段 4.3 验证报告:Linux AppImage 打包
|
||||
|
||||
> 日期:2026-10-26
|
||||
> 环境:Ubuntu 24.04 / Qt 6.6.3 / linuxdeploy 2025-10 / appimagetool 2023
|
||||
|
||||
## 1. 本次交付
|
||||
|
||||
新增 Linux AppImage 打包:
|
||||
|
||||
- `scripts/package-linux-appimage.sh`
|
||||
- `packaging/linux/Schedule.desktop`
|
||||
- `packaging/linux/schedule.svg` + `schedule.png`
|
||||
- `packaging/linux/com.misaki.Schedule.appdata.xml`
|
||||
|
||||
产物:
|
||||
|
||||
```text
|
||||
dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
大小:约 34 MB
|
||||
SHA-256:49efebebbec76ce36dedf7e14fe33ee476909a122a5f0d022afd3c8e4ae87538
|
||||
```
|
||||
|
||||
脚本会:
|
||||
|
||||
1. 使用 `linux-gcc-release` preset,并强制 `CMAKE_BUILD_TYPE=Release`;
|
||||
2. 安装到临时 AppDir;
|
||||
3. 部署 Qt 库、平台插件、SQLite 驱动、TLS、图标主题和 fcitx5 输入法插件;
|
||||
4. 打包 Qt6XcbQpa / Qt6OpenGL / Wayland 客户端等平台插件依赖;
|
||||
5. 使用 `linuxdeploy` 收集系统依赖,`appimagetool` 生成 AppImage;
|
||||
6. 首次运行时自动下载 linuxdeploy/appimagetool 到用户缓存,也可用 `TOOLS_DIR` 指定现成工具目录。
|
||||
|
||||
## 2. 验证
|
||||
|
||||
```bash
|
||||
./scripts/package-linux-appimage.sh
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage --appimage-version
|
||||
```
|
||||
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| AppImage 构建 | 成功,约 34 MB |
|
||||
| `--appimage-version` | 正常输出 |
|
||||
| Xvfb/X11 启动 | 成功运行至超时退出(exit 124),无缺失库/插件错误 |
|
||||
| offscreen 启动 | 成功创建临时配置与 SQLite 数据库 |
|
||||
| 内置 Qt | WebSockets / DBus / SQL / Widgets 等已部署 |
|
||||
| 内置插件 | platforms(xcb/wayland/offscreen)、imageformats、sqldrivers(sqlite)、platforminputcontexts(含 fcitx5) |
|
||||
|
||||
构建日志见 [`appimage-build-phase-4-3.txt`](appimage-build-phase-4-3.txt),校验值见 [`appimage-sha256.txt`](appimage-sha256.txt),桌面回归测试见 [`ctest-phase-4-3.txt`](ctest-phase-4-3.txt)。
|
||||
|
||||
## 3. 使用
|
||||
|
||||
```bash
|
||||
chmod +x dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
```
|
||||
|
||||
文件管理器通常可直接双击运行。
|
||||
|
||||
- 如果系统没有 FUSE:
|
||||
```bash
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage --appimage-extract-and-run
|
||||
```
|
||||
或 `APPIMAGE_EXTRACT_AND_RUN=1 ./...AppImage`
|
||||
- 配置与数据库仍保存在用户目录,不由 AppImage 内部保存;与普通安装版共享同一设备 ID/配置。
|
||||
- 通过 `QT_ROOT` 指定 Qt 安装路径;通过 `TOOLS_DIR` 复用已下载的 linuxdeploy/appimagetool。
|
||||
|
||||
## 4. 已知限制
|
||||
|
||||
1. AppImage 在 Ubuntu 24.04 上构建,较旧的发行版可能缺少更新的 glibc 而无法运行。
|
||||
2. 直接运行需要 FUSE;无 FUSE 环境使用 `--appimage-extract-and-run`。
|
||||
3. 首次打包需要联网下载 linuxdeploy/appimagetool;离线环境可预先放入 `TOOLS_DIR`。
|
||||
4. AppImage 未提交到 git(`dist/` 已忽略),当前产物在本地 `dist/` 目录。
|
||||
5. 未做代码签名/AppImage 更新元数据;系统级通知仍依赖桌面通知服务。
|
||||
@@ -0,0 +1,84 @@
|
||||
# 阶段 4.4 验证报告:长期项目 / AI 识别 / 跨端展示
|
||||
|
||||
> 日期:2026-10-31
|
||||
> 环境:Ubuntu 24.04 / Qt 6.6.3 / Android SDK 34 / Go 1.27.1
|
||||
|
||||
## 1. 本次交付
|
||||
|
||||
1. **Project 领域模型**:长期项目拥有标题、说明、模糊截止日期、优先级、状态;不创建 timeblock,不参与日常排程。
|
||||
2. **SQLite schema v4**:新增 `project` 表与 insert/update/delete outbox 触发器;`entity_type=project` 进入同步变更流。
|
||||
3. **桌面 UI**:
|
||||
- 今日任务面板顶部新增「长期项目」区,显示剩余天数/逾期状态。
|
||||
- 文件夹按钮手工新建长期项目;项目卡片可编辑、标记完成、删除。
|
||||
- 手工项目对话框包含标题、说明、截止日期。
|
||||
4. **AI 识别**:
|
||||
- Prompt 增加长期项目规则和 `type=project` 操作。
|
||||
- 跨多天/数周/数月的模糊目标生成长期项目 Diff,而不是塞进某一天。
|
||||
- Diff 卡片显示「长期项目」和截止日期,接受后写入项目表;AI 不直接写库。
|
||||
- AI 上下文包含已有长期项目,降低重复创建概率。
|
||||
5. **同步**:Go 服务端接受 `project` 变更;桌面双端项目创建/修改/删除集成测试通过。
|
||||
6. **Android**:接收并只读展示长期项目及截止倒计时(移动端暂不支持创建/编辑)。
|
||||
|
||||
## 2. 验证
|
||||
|
||||
```bash
|
||||
cmake --preset linux-gcc
|
||||
cmake --build --preset linux-gcc --clean-first -j$(nproc)
|
||||
ctest --preset linux-gcc
|
||||
|
||||
cd server && go test ./...
|
||||
cd android && ./gradlew :app:assembleDebug :app:testDebugUnitTest
|
||||
```
|
||||
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| 桌面全量构建 | 成功,0 警告 |
|
||||
| 桌面 `ctest` | **12/12 通过** |
|
||||
| 项目 CRUD/持久化 | 通过(`test_services::projectCrudAndPersistence`) |
|
||||
| AI 项目操作 | 通过(`test_ai::createsLongTermProjectFromOperation`) |
|
||||
| 双桌面同步 | 通过(`test_sync_integration`:创建/更新/删除项目) |
|
||||
| Go 服务端 | `go test ./...` 通过 |
|
||||
| Android APK | Debug 构建成功,约 6.6 MB |
|
||||
| Android JVM 测试 | 8/8 通过 |
|
||||
|
||||
输出:
|
||||
|
||||
- [`ctest-phase-4-4.txt`](ctest-phase-4-4.txt)
|
||||
- [`go-test-phase-4-4.txt`](go-test-phase-4-4.txt)
|
||||
- [`android-build-test-phase-4-4.txt`](android-build-test-phase-4-4.txt)
|
||||
|
||||
## 3. 界面截图
|
||||
|
||||
| 截图 | 说明 |
|
||||
|---|---|
|
||||
| [`project-dialog-dark.png`](project-dialog-dark.png) / [`project-dialog-light.png`](project-dialog-light.png) | 手工创建长期项目 |
|
||||
| [`compact-dark.png`](compact-dark.png) | 紧凑窗口中的长期项目 + 今日任务 |
|
||||
| [`schedule-day.png`](schedule-day.png) | 详细日程中的长期项目区 |
|
||||
|
||||
## 4. 行为说明
|
||||
|
||||
- 长期项目只保存截止日期,不指定具体小时,也不占用日程网格。
|
||||
- 项目列表按截止日期升序;没有截止日期的项目排在最后。
|
||||
- 项目完成(done)后会从活动列表隐藏;目前没有「已完成项目」历史视图。
|
||||
- AI 只负责创建项目;修改/完成/删除由人工操作。
|
||||
- AI 不会自动把项目拆成每日执行块;需要用户明确要求拆解时才会创建具体任务。
|
||||
- AI 创建的项目通过普通 `project` 同步变更同步到其他桌面端和 Android。
|
||||
- Android 当前只展示项目,不提供项目创建/编辑入口。
|
||||
|
||||
## 5. 已知限制
|
||||
|
||||
1. Android 项目为只读;需要在桌面端创建/编辑。
|
||||
2. AI 项目操作只支持 create,不支持项目 update/delete 的 Diff。
|
||||
3. 项目截止日期为日期级,不支持「月底前」「Q4」等自然语言时间段的独立结构化表示。
|
||||
4. 没有项目进度百分比、任务分解清单或里程碑。
|
||||
5. Prompt 增加长期项目规则后尚未重新跑完整 50 条真实模型回归。
|
||||
6. 旧客户端需升级到 schema v4(桌面)或 DB v3(Android)才能正确同步项目。
|
||||
|
||||
## 6. 人工验收建议
|
||||
|
||||
1. 点击今日任务面板的文件夹按钮,创建「飞行控制器项目」,确认顶部项目卡片和剩余天数。
|
||||
2. 编辑截止日期、标记完成、删除项目,确认列表与同步数据一致。
|
||||
3. 对 AI 说「一个月内完成飞行控制器项目,先不要排具体时间」,确认 Diff 卡片是「长期项目」而不是时间块。
|
||||
4. 接受后确认项目进入列表、日程网格没有新增时间块。
|
||||
5. 在另一台桌面端/Android 上确认项目同步出现,安卓端仅展示。
|
||||
6. 用已有长期项目再次提出相同目标,确认 AI 上下文能避免明显重复创建。
|
||||
@@ -0,0 +1,80 @@
|
||||
# 阶段 4.5 验证报告:已完成任务 / 长期项目汇总
|
||||
|
||||
> 日期:2026-10-31
|
||||
> 环境:Ubuntu 24.04 / Qt 6.6.3 / Android SDK 34
|
||||
|
||||
## 1. 本次交付
|
||||
|
||||
### 1.1 桌面端
|
||||
- 今日任务面板标题旁新增奖牌按钮,打开「已完成汇总」。
|
||||
- 支持范围切换:本周 / 本月 / 全部。
|
||||
- 统计:
|
||||
- 已完成短期任务数;
|
||||
- 累计专注时长;
|
||||
- 已完成长期项目数;
|
||||
- 连续完成天数。
|
||||
- 分别列出已完成的短期任务(完成时间、原时间段)和长期项目(完成时间、截止日期)。
|
||||
- 已完成长期项目从日常项目列表隐藏,但会出现在汇总中。
|
||||
- 新增存储查询:按完成时间查询已完成的 timeblock;按更新时间查询 done 项目。
|
||||
|
||||
### 1.2 Android
|
||||
- 右上角菜单新增「已完成汇总」。
|
||||
- 展示短期任务数、累计专注时长、长期项目数和最近完成记录。
|
||||
- 数据来自本地同步库,不额外请求服务器。
|
||||
|
||||
## 2. 验证
|
||||
|
||||
```bash
|
||||
cmake --preset linux-gcc
|
||||
cmake --build --preset linux-gcc --clean-first -j$(nproc)
|
||||
ctest --preset linux-gcc
|
||||
|
||||
cd server && go test ./...
|
||||
cd android && ./gradlew :app:assembleDebug :app:testDebugUnitTest
|
||||
```
|
||||
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| 桌面全量构建 | 成功,0 警告 |
|
||||
| 桌面 `ctest` | **12/12 通过** |
|
||||
| 已完成查询测试 | `test_services::completedSummaryQueries` 通过 |
|
||||
| Go 服务端 | `go test ./...` 通过 |
|
||||
| Android APK | Debug 构建成功,约 6.6 MB |
|
||||
| Android JVM 测试 | 8/8 通过 |
|
||||
|
||||
输出:
|
||||
|
||||
- [`ctest-phase-4-5.txt`](ctest-phase-4-5.txt)
|
||||
- [`go-test-phase-4-5.txt`](go-test-phase-4-5.txt)
|
||||
- [`android-build-test-phase-4-5.txt`](android-build-test-phase-4-5.txt)
|
||||
|
||||
## 3. 界面截图
|
||||
|
||||
| 截图 | 说明 |
|
||||
|---|---|
|
||||
| [`completed-summary-dark.png`](completed-summary-dark.png) | 已完成汇总 · 深色 |
|
||||
| [`completed-summary-light.png`](completed-summary-light.png) | 已完成汇总 · 浅色 |
|
||||
| [`compact-dark.png`](compact-dark.png) | 今日任务面板新增汇总入口 |
|
||||
|
||||
## 4. 行为说明
|
||||
|
||||
- 短期任务完成记录按 `done_at`(没有则使用结束时间)归档。
|
||||
- 长期项目完成记录按项目状态 done + `updated_at` 归档;项目截止日期仍显示。
|
||||
- 连续完成天数:从今天(今天未完成则从昨天)向前连续有完成记录的天数。
|
||||
- 汇总只读取本地 SQLite,不需要网络;多设备数据通过既有同步链路进入本地。
|
||||
|
||||
## 5. 已知限制
|
||||
|
||||
1. 短期任务统计按完成的时间块计数,同一任务多个块会显示为多条记录。
|
||||
2. 长期项目完成时间使用 `updated_at`,没有独立的 `completed_at` 字段。
|
||||
3. 暂无周/月趋势图、日历热力图或可分享的成就卡片。
|
||||
4. Android 汇总只有全部范围,桌面支持本周/本月/全部。
|
||||
5. Android 长期项目仍为只读。
|
||||
|
||||
## 6. 人工验收建议
|
||||
|
||||
1. 完成一条普通日程和一个长期项目。
|
||||
2. 点击今日任务面板的奖牌按钮,确认统计、连续天数和列表正确。
|
||||
3. 切换本周/本月/全部,确认筛选范围生效。
|
||||
4. 在 Android 菜单打开「已完成汇总」,确认能看到桌面完成的记录。
|
||||
5. 重启应用后再次打开汇总,确认数据来自本地 SQLite 且不丢失。
|
||||
@@ -0,0 +1,89 @@
|
||||
# 阶段 5.1 验证报告:移动提醒 / 完成同步修复 / MinGW 修复
|
||||
|
||||
> 日期:2026-10-26
|
||||
> 环境:Ubuntu 24.04(桌面 + Android 构建)/ Qt 6.6.3 / Android SDK 34 / Gradle 8.7
|
||||
|
||||
## 1. 修复内容
|
||||
|
||||
### 1.1 Windows MinGW 编译失败
|
||||
|
||||
`SystemTray::handleDbusAction` / `handleDbusClosed` 在所有平台都会编译,但 `m_dbusTargets` 之前只在 Linux 分支声明,导致 Windows 报 `m_dbusTargets was not declared`。
|
||||
|
||||
修复:将 `QHash<uint, QString> m_dbusTargets` 移到平台条件外;QDBus 接口对象仍只在 Linux 创建,Windows 不引入 Qt DBus。
|
||||
|
||||
### 1.2 完成状态不同步
|
||||
|
||||
原因之一是多设备时钟偏差:完成操作使用 `updated_at` LWW,手机/PC 时钟不一致时,一个较旧的完成时间戳可能被另一个设备忽略。
|
||||
|
||||
修复:完成状态采用“完成优先”合并:
|
||||
|
||||
- 远端 `status=done`,本地为 `scheduled` / `in_progress` → **接受远端完成**,即使远端时间戳较旧。
|
||||
- 本地已 `done` 时,普通更新仍按 LWW。
|
||||
- 取消完成(`scheduled`)仍按 LWW,不会无条件覆盖完成状态。
|
||||
- 桌面端在 `SqliteStore::applyRemoteChange` 中实现;Android 在 `CompletionMerge` + `ScheduleRepository.applyRemote` 中实现。
|
||||
|
||||
同时 Android 的本地变更同步改为 **expedited WorkManager**,减少“点击完成后手机切后台”导致的延迟。
|
||||
|
||||
### 1.3 移动端提醒
|
||||
|
||||
Android 现在与桌面提醒语义对齐:
|
||||
|
||||
- 日程开始本地通知。
|
||||
- 提前 N 分钟本地通知;设置页可选 0 / 5 / 10 / 15 / 30 / 60,默认 10。
|
||||
- 日程结束仍未完成仍会超时通知。
|
||||
- 通知点击打开对应日期。
|
||||
- WorkManager 15 分钟周期;Doze/厂商限制可能延迟。
|
||||
- 开始提醒只覆盖开始后 20 分钟内,避免后台任务延迟后补发过旧通知。
|
||||
|
||||
## 2. 验证
|
||||
|
||||
```bash
|
||||
# 桌面
|
||||
cmake --preset linux-gcc
|
||||
cmake --build --preset linux-gcc --clean-first -j$(nproc)
|
||||
ctest --preset linux-gcc
|
||||
|
||||
# Android
|
||||
cd android
|
||||
./gradlew :app:assembleDebug
|
||||
./gradlew :app:testDebugUnitTest
|
||||
```
|
||||
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| 桌面全量构建 | 成功,0 警告 |
|
||||
| 桌面 `ctest` | **12/12 通过** |
|
||||
| 完成状态集成测试 | A 完成 → B 完成;B 取消完成 → A 取消完成 |
|
||||
| 远端旧时间戳完成测试 | 旧时间戳 done 仍覆盖本地 scheduled |
|
||||
| Android APK | Debug APK 构建成功(约 6.5 MB) |
|
||||
| Android JVM 测试 | **8/8 通过**(LWW 3 + 时间 3 + 完成合并 2) |
|
||||
| MinGW | 已修复条件编译错误;需在 Windows 重新构建确认 |
|
||||
|
||||
完整输出:
|
||||
|
||||
- [`ctest-phase-5-1.txt`](ctest-phase-5-1.txt)
|
||||
- [`android-build-test-phase-5-1.txt`](android-build-test-phase-5-1.txt)
|
||||
|
||||
## 3. 提醒/同步行为
|
||||
|
||||
- **前台**:App 打开时 WebSocket + 15 秒轮询,PC 完成通常几秒内同步到手机。
|
||||
- **后台**:Android WorkManager 周期最小 15 分钟;PC 完成到手机可能需要等待下一个周期,或打开 App 立即同步。
|
||||
- **手机完成 → PC**:前台立即;切后台时 expedited one-time worker 会尽快执行,但仍受系统限制。
|
||||
- **完成合并**:完成优先;取消完成继续按 LWW,极端时钟偏差下取消完成仍可能延迟/被旧完成覆盖。
|
||||
- 没有 FCM,所以 PC → 后台手机的即时推送尚未实现(需要 FCM 或常驻前台服务)。
|
||||
|
||||
## 4. 已知限制
|
||||
|
||||
1. Android 提醒由 15 分钟周期任务触发,不是精确闹钟;开始提醒可能延迟,且只覆盖开始后 20 分钟。
|
||||
2. PC 后台 → 手机后台不是即时;15 分钟周期或打开 App。
|
||||
3. 完成优先规则可能让“取消完成”在极端时钟漂移时被旧的 done 状态覆盖。
|
||||
4. 没有 FCM、精确 AlarmManager、发布签名;真机交互仍需人工验证。
|
||||
5. Windows MinGW 修复未在本机实际运行 Windows 编译;按代码路径已消除该条件编译错误,请在 Windows 重新构建确认。
|
||||
|
||||
## 5. 人工验收建议
|
||||
|
||||
1. Windows 重新拉取代码,删除 `build/windows-mingw` 后重新 configure/build,确认 `SystemTray.cpp` 通过。
|
||||
2. PC 完成一条日程,手机前台打开,确认状态变为已完成;手机取消完成,确认 PC 跟随。
|
||||
3. 手机关后台/锁屏,PC 完成日程,等待后台周期或重新打开 App,确认最终状态收敛。
|
||||
4. Android 设置提前 5 分钟,创建 10 分钟后开始的日程,确认提前通知和开始通知。
|
||||
5. 点击通知,确认打开对应日期并定位日程。
|
||||
@@ -27,7 +27,7 @@ cd android
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| Debug APK | 构建成功:`android/app/build/outputs/apk/debug/app-debug.apk`(约 6.5 MB) |
|
||||
| JVM 单元测试 | 6/6 通过(LwwTest 3 + TimeUtilsTest 3) |
|
||||
| JVM 单元测试 | 6/6 通过(阶段 5.0;阶段 5.1 增至 8/8) |
|
||||
| `aapt dump badging` | package `com.misaki.schedule`,minSdk 26,targetSdk 34;包含通知/开机权限和 WorkManager 服务 |
|
||||
|
||||
完整构建/测试输出见 [`android-build-test-phase-5.txt`](android-build-test-phase-5.txt)。
|
||||
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 103 KiB |
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=AI 日程
|
||||
Comment=AI-driven personal schedule and calendar
|
||||
Exec=Schedule
|
||||
Icon=schedule
|
||||
Terminal=false
|
||||
Categories=Office;Calendar;
|
||||
StartupWMClass=Schedule
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>com.misaki.Schedule</id>
|
||||
<name>AI 日程</name>
|
||||
<summary>AI 驱动的个人日程与日历</summary>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<description>
|
||||
<p>AI 日程是一款本地优先的日程管理应用,支持自然语言排程、日/月/年视图、精力曲线、幽灵时间、每日复盘以及自部署多设备同步。</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">Schedule.desktop</launchable>
|
||||
<developer_name>Misaki</developer_name>
|
||||
<releases>
|
||||
<release version="0.1.0" date="2026-10-26"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
|
||||
<rect x="10" y="10" width="236" height="236" rx="56" fill="#3D6FE8"/>
|
||||
<rect x="57" y="72" width="142" height="120" rx="18" fill="none" stroke="#FFFFFF" stroke-width="14"/>
|
||||
<line x1="57" y1="107" x2="199" y2="107" stroke="#FFFFFF" stroke-width="14"/>
|
||||
<line x1="89" y1="54" x2="89" y2="82" stroke="#FFFFFF" stroke-width="16" stroke-linecap="round"/>
|
||||
<line x1="167" y1="54" x2="167" y2="82" stroke="#FFFFFF" stroke-width="16" stroke-linecap="round"/>
|
||||
<polyline points="95,146 118,169 164,121" fill="none" stroke="#FFFFFF" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 693 B |
@@ -0,0 +1,169 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
BUILD_DIR="${BUILD_DIR:-$ROOT/build/linux-gcc-release}"
|
||||
DIST_DIR="${DIST_DIR:-$ROOT/dist}"
|
||||
QT_ROOT="${QT_ROOT:-/home/misaki/Qt6.3/6.6.3/gcc_64}"
|
||||
VERSION="${VERSION:-0.1.0}"
|
||||
ARCH="${ARCH:-x86_64}"
|
||||
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/schedule-appimage-tools"
|
||||
|
||||
if [[ -n "${TOOLS_DIR:-}" ]]; then
|
||||
CACHE_DIR="$TOOLS_DIR"
|
||||
fi
|
||||
|
||||
mkdir -p "$CACHE_DIR" "$DIST_DIR"
|
||||
|
||||
download_tool() {
|
||||
local name="$1"
|
||||
local url="$2"
|
||||
local target="$CACHE_DIR/$name"
|
||||
if [[ ! -x "$target" ]]; then
|
||||
echo "Downloading $name..."
|
||||
curl -fL --retry 3 --max-time 300 -o "$target" "$url"
|
||||
chmod +x "$target"
|
||||
fi
|
||||
}
|
||||
|
||||
download_tool linuxdeploy-x86_64.AppImage \
|
||||
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
|
||||
download_tool appimagetool-x86_64.AppImage \
|
||||
"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||
|
||||
LINUXDEPLOY="$CACHE_DIR/linuxdeploy-x86_64.AppImage"
|
||||
APPIMAGETOOL="$CACHE_DIR/appimagetool-x86_64.AppImage"
|
||||
export PATH="$CACHE_DIR:$PATH"
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
export QMAKE="$QT_ROOT/bin/qmake"
|
||||
export LD_LIBRARY_PATH="$QT_ROOT/lib:${LD_LIBRARY_PATH:-}"
|
||||
export VERSION
|
||||
export ARCH
|
||||
|
||||
if [[ ! -x "$QT_ROOT/bin/qmake" ]]; then
|
||||
echo "Qt qmake not found: $QT_ROOT/bin/qmake" >&2
|
||||
echo "Set QT_ROOT to the Qt 6.6.3 gcc_64 directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Configuring release build..."
|
||||
cmake --preset linux-gcc-release -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build --preset linux-gcc-release -j"$(nproc)"
|
||||
|
||||
APPDIR="$BUILD_DIR/AppDir"
|
||||
rm -rf "$APPDIR"
|
||||
mkdir -p "$APPDIR"
|
||||
|
||||
echo "Installing application files..."
|
||||
DESTDIR="$APPDIR" cmake --install "$BUILD_DIR" --prefix /usr
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
if [[ -f "$APPDIR/usr/Schedule" ]]; then
|
||||
mv "$APPDIR/usr/Schedule" "$APPDIR/usr/bin/Schedule"
|
||||
fi
|
||||
if command -v strip >/dev/null 2>&1; then
|
||||
strip --strip-unneeded "$APPDIR/usr/bin/Schedule" || true
|
||||
fi
|
||||
|
||||
install -Dm644 "$ROOT/packaging/linux/Schedule.desktop" \
|
||||
"$APPDIR/usr/share/applications/Schedule.desktop"
|
||||
install -Dm644 "$ROOT/packaging/linux/schedule.png" \
|
||||
"$APPDIR/usr/share/icons/hicolor/256x256/apps/schedule.png"
|
||||
install -Dm644 "$ROOT/packaging/linux/schedule.svg" \
|
||||
"$APPDIR/usr/share/icons/hicolor/scalable/apps/schedule.svg"
|
||||
install -Dm644 "$ROOT/packaging/linux/com.misaki.Schedule.appdata.xml" \
|
||||
"$APPDIR/usr/share/metainfo/com.misaki.Schedule.appdata.xml"
|
||||
cp "$ROOT/packaging/linux/Schedule.desktop" "$APPDIR/Schedule.desktop"
|
||||
cp "$ROOT/packaging/linux/schedule.png" "$APPDIR/schedule.png"
|
||||
cp "$ROOT/packaging/linux/schedule.png" "$APPDIR/.DirIcon"
|
||||
|
||||
echo "Copying required Qt plugins..."
|
||||
copy_plugin_dir() {
|
||||
local name="$1"
|
||||
if [[ -d "$QT_ROOT/plugins/$name" ]]; then
|
||||
mkdir -p "$APPDIR/usr/plugins/$name"
|
||||
cp -a "$QT_ROOT/plugins/$name/." "$APPDIR/usr/plugins/$name/"
|
||||
fi
|
||||
}
|
||||
for plugin_dir in \
|
||||
platforms \
|
||||
platformthemes \
|
||||
platforminputcontexts \
|
||||
imageformats \
|
||||
iconengines \
|
||||
styles \
|
||||
tls \
|
||||
xcbglintegrations \
|
||||
wayland-shell-integration \
|
||||
wayland-decoration-client \
|
||||
accessible; do
|
||||
copy_plugin_dir "$plugin_dir"
|
||||
done
|
||||
mkdir -p "$APPDIR/usr/plugins/sqldrivers"
|
||||
if [[ -e "$QT_ROOT/plugins/sqldrivers/libqsqlite.so" ]]; then
|
||||
cp "$QT_ROOT/plugins/sqldrivers/libqsqlite.so" "$APPDIR/usr/plugins/sqldrivers/"
|
||||
fi
|
||||
find "$APPDIR/usr/plugins" -name '*.debug' -delete
|
||||
|
||||
# Copy Qt libraries required by the X11/Wayland platform plugins. The core
|
||||
# deployment handles the application's direct Qt dependencies, but not these
|
||||
# plugin-only modules.
|
||||
mkdir -p "$APPDIR/usr/lib"
|
||||
for lib in \
|
||||
libQt6XcbQpa \
|
||||
libQt6OpenGL \
|
||||
libQt6WaylandClient \
|
||||
libQt6WaylandEglClientHwIntegration \
|
||||
libQt6WlShellIntegration; do
|
||||
cp -a "$QT_ROOT/lib/$lib.so"* "$APPDIR/usr/lib/" 2>/dev/null || true
|
||||
done
|
||||
|
||||
echo "Deploying shared library dependencies..."
|
||||
"$LINUXDEPLOY" \
|
||||
--appdir "$APPDIR" \
|
||||
--executable "$APPDIR/usr/bin/Schedule" \
|
||||
--desktop-file "$APPDIR/usr/share/applications/Schedule.desktop" \
|
||||
--icon-file "$ROOT/packaging/linux/schedule.png"
|
||||
|
||||
cat > "$APPDIR/usr/bin/qt.conf" <<'QT_CONF'
|
||||
[Paths]
|
||||
Prefix=..
|
||||
Plugins=plugins
|
||||
Libraries=lib
|
||||
QT_CONF
|
||||
|
||||
# Bundle a few newer xcb helpers that are not guaranteed on older desktops.
|
||||
copy_system_library() {
|
||||
local soname="$1"
|
||||
local path
|
||||
path="$(ldconfig -p 2>/dev/null | awk -v name="$soname" '$1 == name { print $NF; exit }')"
|
||||
if [[ -n "$path" && -f "$path" ]]; then
|
||||
cp -L "$path" "$APPDIR/usr/lib/"
|
||||
fi
|
||||
}
|
||||
for lib in \
|
||||
libxcb-cursor.so.0 \
|
||||
libxcb-icccm.so.4 \
|
||||
libxcb-image.so.0 \
|
||||
libxcb-keysyms.so.1 \
|
||||
libxcb-render-util.so.0 \
|
||||
libxcb-xinerama.so.0 \
|
||||
libxcb-util.so.1 \
|
||||
libxkbcommon-x11.so.0; do
|
||||
copy_system_library "$lib"
|
||||
done
|
||||
|
||||
rm -f "$APPDIR/AppRun"
|
||||
cat > "$APPDIR/AppRun" <<'APPRUN'
|
||||
#!/bin/sh
|
||||
HERE="$(dirname "$(readlink -f "$0")")"
|
||||
export LD_LIBRARY_PATH="$HERE/usr/lib:${LD_LIBRARY_PATH:-}"
|
||||
export QT_PLUGIN_PATH="$HERE/usr/plugins"
|
||||
exec "$HERE/usr/bin/Schedule" "$@"
|
||||
APPRUN
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
OUTPUT="$DIST_DIR/AI-Schedule-${VERSION}-${ARCH}.AppImage"
|
||||
echo "Creating $OUTPUT..."
|
||||
ARCH="$ARCH" VERSION="$VERSION" "$APPIMAGETOOL" "$APPDIR" "$OUTPUT"
|
||||
chmod +x "$OUTPUT"
|
||||
echo "AppImage created: $OUTPUT"
|
||||
@@ -104,7 +104,7 @@ internal/model → 设备与变更模型
|
||||
internal/auth → token 随机生成与 SHA-256 哈希
|
||||
```
|
||||
|
||||
变更流只由服务端分配递增 `seq`;服务端不合并冲突、不解析日程语义。客户端负责 LWW 与最终一致性。
|
||||
变更流只由服务端分配递增 `seq`;`entity_type` 支持 `task`、`timeblock`、`project`。服务端不合并冲突、不解析日程语义;客户端负责 LWW 与最终一致性。
|
||||
|
||||
## 测试
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ func validateChange(change *model.ChangeInput) error {
|
||||
change.EntityID = strings.TrimSpace(change.EntityID)
|
||||
change.Op = strings.TrimSpace(change.Op)
|
||||
change.UpdatedAt = strings.TrimSpace(change.UpdatedAt)
|
||||
if change.EntityType != "task" && change.EntityType != "timeblock" {
|
||||
if change.EntityType != "task" && change.EntityType != "timeblock" && change.EntityType != "project" {
|
||||
return errors.New("unsupported entity_type")
|
||||
}
|
||||
if change.EntityID == "" || len(change.EntityID) > 128 {
|
||||
|
||||