Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ release
.vscode/*
!.vscode/extensions.json
.idea
.claude/
.codex/
.DS_Store
*.suo
*.ntvs*
Expand Down
54 changes: 54 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Timetable.OS Agent Notes

## Source And Runtime

- Source of truth: `D:\software\时间管理窗`.
- Local runtime target: `D:\software\Timetable_latest_standalone_20260425233036\win-unpacked`.
- User data lives outside source at `%APPDATA%\Timetable\app-data.json`.
- User data archives live under `D:\software\Timetable_data_archive`.

## Hard Rules

- Make product changes in source (`src`, `public`, `scripts`, `docs`) and rebuild.
- Do not manually patch `win-unpacked\resources\app.asar` except for emergency repair; migrate any emergency patch back into source before the next normal build.
- Do not copy private user data into `src`, `docs`, defaults, tests, or git-tracked fixtures.
- Keep generated artifacts (`out`, `release`, `coverage`, logs) out of hand-authored documentation except as command outputs or deployment targets.

## Standard Verification

Run from `D:\software\时间管理窗` after code changes:

```bash
npm.cmd run typecheck
npm.cmd run lint
npm.cmd test
npm.cmd run build
```

For packaged behavior changes, also run:

```bash
npm.cmd run pack:win
npm.cmd run deploy:local
```

For main-process or renderer bundle changes, syntax-check generated bundles:

```bash
node --check out/main/index.js
node --check out/renderer/assets/index-*.js
```

## Local EXE Policy

Windows Application Control can block newly generated `Timetable.exe` files on this machine. If a new deployed executable is blocked, keep or restore a previously allowed `Timetable.exe` shell and use it with the current deployed `resources/app.asar`. Verify the `app.asar` contains expected source strings before reporting success.

## Current Ritual Behavior

- Entry animation is controlled by `ritualIntroEnabled` and is not limited to once per day.
- Exit animation is triggered by the dedicated `archive` window action, surfaced as `结束今日`.
- Entry modes: `door`, `curtain`, `meteor`, `sunrise`.
- Work ritual modes: `workbench`, `stamp`, `focus`. They are separate from startup entry and are triggered through `window.timeable.startWorkRitual()` / IPC `ritual:work`.
- Exit modes: `door`, `curtain`, `moon`.
- Ritual music is generated locally with Web Audio; do not add copied melodies or external audio assets.
- Countdown day-based helpers default to Beijing time; keep that behavior out of private user-data defaults.
116 changes: 69 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,97 @@
# Timetable
# Timetable.OS

Timetable 是一个本地优先的 Windows 桌面规划工具,用来管理课程表、每日任务、长期目标、备忘录、倒计时、道理卡片、桌面挂件和时间统计。
Timetable.OS is a local-first Windows desktop planner for courses, daily tasks, long-term goals, memos, countdowns, principle cards, desktop widgets, time statistics, and ritualized day start/end flows.

## 直接下载
## Current Local Version

[点击下载 Windows 安装包 setup.exe](https://github.com/Evander764/Timetable/releases/download/v0.3.3/Timetable-0.3.3-x64-setup.exe)
- App version: `0.3.8`
- Source of truth: `D:\software\时间管理窗`
- Local runtime target: `D:\software\Timetable_latest_standalone_20260425233036\win-unpacked`
- User data: `%APPDATA%\Timetable\app-data.json`
- User data archive root: `D:\software\Timetable_data_archive`

不想安装时,也可以下载解压版:
This repository does not store private user data. Runtime data and backups stay outside the source tree.

[下载 win-unpacked 压缩包](https://github.com/Evander764/Timetable/releases/download/v0.3.3/Timetable-win-unpacked-v0.3.3.zip)
## Features

## 运行提示
- Course ledger: term start date, total weeks, odd/even week courses, and custom timetable slots.
- Today calibration: vertical daily workflow with the main question, next node, execution queue, and archive action.
- Daily tasks: recurring tasks, completion tracking, priority, and desktop task widgets.
- Long-term goals: staged goals, subtasks, progress, and status tracking.
- Memo archive: active/ended memos and optional desktop display.
- Countdown events: countdown card and event list, with day-based timing aligned to Beijing time by default.
- Principle cards: multiple cards, standalone/embedded display, rotation, and desktop widget support.
- Desktop widgets: main panel, task widget, memo widget, countdown widget, and principle widget.
- Time audit: day-level browser and AI usage tracking.
- Rituals: configurable entry, work-start, and exit animation modes with local Web Audio synthesis.

- 当前版本支持 Windows x64。
- 安装包是普通用户安装,不需要管理员权限。
- 当前安装包没有数字签名,Windows 可能显示“未知发布者”或 SmartScreen 提示。
- 如果你信任这个仓库,可以在提示中点击“更多信息”,然后选择“仍要运行”。
- Release 附带 `SHA256SUMS.txt`,可用于校验下载文件。
## Ritual Modes

## 主要功能
Entry modes:

- 课程表:支持学期开始日期、总周数、单/双周课程、自定义课表时间。
- 今日行动中心:自动判断正在上课、下一节课、今日课程结束或今日无课。
- 道理卡片:支持多张卡片、手动切换、自动轮换和翻页动画。
- 桌面挂件:支持主面板、倒计时、备忘录、任务卡片和道理卡片。
- 时间统计:按天统计前台网页和 AI 应用使用时间,AdsPower 不会被计入 Claude。
- 托盘退出:可设置右上角关闭按钮是退出程序还是隐藏到托盘,也可开启“仅托盘退出”。
- 数据备份:支持自动备份、手动备份、备份恢复和恢复前保护备份。
- `开门光缝`
- `升起帷幕`
- `流星破晓`
- `日出破晓`

## 数据与隐私
Exit modes:

- 这个仓库不包含任何个人应用数据。
- 应用运行数据保存在 Electron 的 `userData/app-data.json`。
- 备份文件保存在 `userData/backups`。
- 更新应用包不会覆盖原来的 JSON 数据。
- 导出的备份、本地构建产物和运行日志不会提交到 Git。
- `关门归档`
- `降下帷幕`
- `月升归档`

## 自动更新
Work ritual modes:

打包后的应用启动时会检查 GitHub 最新 Release:
- `工作台点亮`
- `印章落定`
- `晨光聚焦`

```text
https://github.com/Evander764/Timetable/releases/latest
```
Entry playback is controlled by the `每日入场仪式` setting and is no longer limited to once per day. Work rituals are launched manually from `今日校准台` or previewed in settings; they are not startup animations. Exit playback is triggered by the dedicated `结束今日` archive action.

发现新版本后,应用会显示版本说明和确认按钮。用户确认后,程序会先备份当前用户数据,再下载 Release 中的 `app.asar`,校验 `SHA256SUMS.txt`,替换资源包并自动重启。用户数据仍然保留在本机 `userData` 目录,新版本会继续使用原来的数据。
## Local Development

## 本地开发
Install dependencies:

```bash
npm install
```

Run during development:

```bash
npm run dev
```

常用命令:
Checks:

```bash
npm.cmd run typecheck
npm.cmd run lint
npm.cmd test
npm.cmd run build
```

Package and deploy to the local runtime target:

```bash
npm run lint
npm test
npm run build
npm run pack:win
npm run dist:win
npm run dist:portable
npm run release:win
npm.cmd run pack:win
npm.cmd run deploy:local
```

## 发布新版本
After building, syntax-check the generated bundles when changing main-process or renderer behavior:

```bash
node --check out/main/index.js
node --check out/renderer/assets/index-*.js
```

## Local Deployment Note

On this machine, newly generated `Timetable.exe` files can be blocked by Windows Application Control policy. If the deployed executable is blocked but an earlier `Timetable.exe` is allowed, keep the allowed executable shell and deploy the current `resources/app.asar`. The product code still comes from source and the current packaged resource bundle.

1. 提高 `package.json` 和 `package-lock.json` 的版本号。
2. 执行 `npm run release:win`。
3. 上传 `app.asar`、`setup.exe`、便携版、win-unpacked zip 和 `SHA256SUMS.txt`。
4. 创建 GitHub Release,例如 `v0.3.3`。
## Data And Privacy

当前最新公开版本是 `v0.3.3`。
- The source tree must not include `%APPDATA%\Timetable\app-data.json`.
- Use `npm.cmd run archive:user-data` when a manual data snapshot is needed.
- Application package updates must not overwrite user JSON data.
- Generated release folders, runtime logs, coverage output, and local archives are build artifacts, not source facts.
Binary file added buildResources/icon.ico
Binary file not shown.
73 changes: 73 additions & 0 deletions docs/migration-ledger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Timetable.OS Selective Source Migration Ledger

## Reference

- Source of truth: `D:\software\时间管理窗`
- Runtime target: `D:\software\Timetable_latest_standalone_20260425233036`
- Read-only package reference: `D:\software\Timetable_win-unpacked_backup_20260508121936_source_first`
- User data archive root: `D:\software\Timetable_data_archive`

## Migrated Into Source

- TIMETABLE.OS black, white, gray, and orange visual language is implemented in source CSS instead of as a bundled CSS patch.
- Main navigation is renamed to the ledger system: 今日校准, 时间审计, 桌面浮窗, 课程账本, 执行队列, 目标档案, 备忘档案, 倒计时, 原则卡, 系统设置, 数据中枢.
- The overview screen is rebuilt as an immersive vertical 今日校准台 chapter flow: 开场问题, 下一节点, 执行队列, 今日归档.
- The main screen uses native vertical scrolling with section index navigation and task completion preserved; horizontal film-strip navigation is no longer the current interaction model.
- Desktop floating widgets use the archive style and remove the gray border that showed between the white desktop and black widget body.
- Entry and exit rituals are source-owned through `src/main/ritualWindows.ts`.
- Entry and exit ritual HTML is generated by pure functions in `src/main/ritualHtml.ts`, including original Web Audio synthesis when enabled.
- Ritual audio settings are source-owned: `ritualMusicEnabled` and `ritualMusicVolume` are normalized for legacy user data.
- Data archival is repeatable through `npm.cmd run archive:user-data`; private data remains outside the source tree.

## Intentionally Not Migrated

- No minified renderer bundle is copied into source.
- No `hoper_v7.html` text, mojibake content, Google Fonts, custom cursor behavior, hidden easter eggs, or specific melody sequence is copied.
- No temporary `.timetable-os-work` or app.asar extraction directory is stored in the application directory.
- No private `app-data.json` or backup content is committed into `src` or `docs`.
- No old package bug is treated as canonical when it conflicts with source structure or current user feedback.

## 2026-05-09 Reference Pass

- Read-only reference: user-provided local `hoper_v7.html` design sample.
- Adopted intent: chapter progress, stamp-like completion feedback, restrained dark/light scene switching, and low-volume synthetic atmosphere.
- Rewritten in source: 今日校准台 vertical layout, task stamp state, archive action entry, responsive panel constraints, overlay border removal, and Web Audio ritual pads/bells/noise.
- Not adopted: any original copy, large-site presentation structure, cursor hiding, hidden interactions, external font loading, or copyrighted audio material.

## 2026-05-09 Interaction Guardrails

- Toggle controls are now source-owned through a dedicated `.toggle-switch` class instead of broad `button[aria-pressed]` overrides, preventing unrelated buttons from being resized.
- Window title controls and tray menu labels are normalized in source; `结束今日` remains a separate `archive` action and does not reuse ordinary close.
- App, tray, favicon, and packaged Windows icons now point to the same black original knot mark generated in `public` and `buildResources`.
- Main shell and floating menus have explicit `min-width`, `overflow-x`, and viewport-width constraints to reduce hidden right-side content and menu clipping.

## 2026-05-09 Ritual Mode Expansion

- Added source-owned entry modes: `开门光缝`, `升起帷幕`, and `流星破晓`.
- Added source-owned exit modes: `关门归档`, `降下帷幕`, and `月升归档`.
- Each mode uses an original local Web Audio synthesis branch; no external audio files, copied melodies, or reference HTML code are embedded.
- Settings now expose separate entry and exit animation mode selectors while preserving the existing configurable ritual text and music volume controls.

## 2026-05-09 Cinematic Ritual Upgrade

- Rebuilt `流星破晓` with layered stars, a bright meteor core, dynamic meteor trail, shock wave, dawn wash, and a stronger original sweep/impact sound.
- Added a dedicated `日出破晓` entry mode with rising sun, atmospheric rays, horizon silhouette, haze, and warm pad/bell audio.
- Upgraded `开启灿烂的一天` typography and placement so it appears as a centered cinematic title after the reveal, not as a low utility label.
- Reworked all exit modes with richer scene dimming, continuous closing light, seal/curtain/moon details, and slower archive copy reveal.
- Replaced the harsh striped exit curtain with a softer stage-curtain material, and moved the moon exit visual to the upper-right with no crater marks so it does not collide with archive copy.
- Corrected `流星破晓` so the meteor falls from upper-right to lower-left with the impact glow on the lower-left, and replaced the entry curtain's hard stripe texture with a softer black velvet lift.

## 2026-05-10 Work Ritual And Meteor Cleanup

- Split `工作台点亮`, `印章落定`, and `晨光聚焦` out of startup entry modes into the independent `workRitualMode` setting.
- Added a manual `开始工作` launch path on `今日校准台` plus settings preview buttons; both call `window.timeable.startWorkRitual()` through IPC `ritual:work`.
- Work rituals render as full-screen ritual windows with `data-ritual-kind="work"` and still use original local Web Audio synthesis.
- Rebuilt `流星破晓` as a meteor shower with a white-blue meteor head and warm-orange tail. The main meteor still falls from upper-right to lower-left.
- Removed the folded/jagged tear trajectory from `流星破晓`; the sky reveal is now a cleaner diagonal light cut instead of a zigzag rift.
- Countdown day-based calculations now default to Beijing time for user-facing remaining-day countdowns.

## Current Data Snapshot

Recorded source-first manual snapshot for this migration:

`D:\software\Timetable_data_archive\20260509-090903`
42 changes: 42 additions & 0 deletions docs/source-first-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Timetable.OS Source-First Workflow

`D:\software\时间管理窗` is the source of truth for Timetable.OS development.

## Rules

- Make formal product changes in `src`, `public`, or `scripts`.
- Do not patch `D:\software\Timetable_latest_standalone_20260425233036\win-unpacked\resources\app.asar` directly except for emergency repair.
- Keep user data outside the source tree. Use `npm.cmd run archive:user-data` to copy runtime data to `D:\software\Timetable_data_archive`.
- After source changes, run checks from this source directory:
- `npm.cmd run typecheck`
- `npm.cmd run lint`
- `npm.cmd test`
- `npm.cmd run build`
- For main-process or renderer bundle changes, also run:
- `node --check out/main/index.js`
- `node --check out/renderer/assets/index-*.js`
- Package with `npm.cmd run pack:win`.
- Deploy the packaged `win-unpacked` with `npm.cmd run deploy:local`.

## Runtime Target

The default local runtime target is:

`D:\software\Timetable_latest_standalone_20260425233036`

`deploy:local` stops Timetable processes from that target, backs up the current `win-unpacked` folder beside it, then copies the packaged `win-unpacked` output into place.

## Windows Application Control Workaround

On this machine, newly generated `Timetable.exe` files can be blocked by Windows Application Control policy. If that happens:

1. Preserve a previously allowed `Timetable.exe` from the runtime target or a known-good backup.
2. Run `npm.cmd run pack:win` and `npm.cmd run deploy:local` normally so the current `resources/app.asar` is deployed.
3. Copy the allowed executable shell back over `D:\software\Timetable_latest_standalone_20260425233036\win-unpacked\Timetable.exe`.
4. Start the app from the runtime target and verify the deployed `app.asar` contains the expected source strings.

This is a local execution workaround only. Do not treat it as permission to hand-edit `app.asar`; source remains authoritative.

## Emergency Patch Tool

The packaged-ASAR patch tool in `%APPDATA%\TimetableOSPatchTools` is retained only as a fallback. If it is used, migrate the same behavior back into this source project before the next normal build.
1 change: 1 addition & 0 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
win: {
executableName: "Timetable",
icon: "buildResources/icon.ico",
signAndEditExecutable: false
},
nsis: {
Expand Down
6 changes: 6 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'

const packageJson = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8')) as { version: string }

export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
Expand All @@ -26,6 +29,9 @@ export default defineConfig({
root: resolve(__dirname, 'src/renderer'),
publicDir: resolve(__dirname, 'public'),
plugins: [react(), tailwindcss()],
define: {
__APP_VERSION__: JSON.stringify(packageJson.version),
},
resolve: {
alias: {
'@renderer': resolve(__dirname, 'src/renderer'),
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"name": "timetable",
"productName": "Timetable",
"private": false,
"version": "0.3.3",
"version": "0.3.8",
"description": "A local Windows desktop planner for courses, tasks, goals, memos, countdowns, and desktop widgets.",
"author": "Timetable Local Builder",
"main": "out/main/index.js",
"type": "module",
"scripts": {
"dev": "electron-vite dev",
"build": "npm run typecheck && electron-vite build",
"build": "node scripts/clean-output.mjs && npm run typecheck && electron-vite build",
"typecheck": "tsc --noEmit -p tsconfig.app.json && tsc --noEmit -p tsconfig.node.json",
"lint": "eslint .",
"test": "vitest run --coverage",
"archive:user-data": "node scripts/archive-user-data.mjs",
"preview": "electron-vite preview",
"pack:win": "node scripts/run-electron-builder-win.mjs --dir",
"deploy:local": "node scripts/deploy-local.mjs",
"dist:win": "node scripts/run-electron-builder-win.mjs nsis",
"dist:portable": "node scripts/run-electron-builder-win.mjs portable",
"release:win": "node scripts/run-electron-builder-win.mjs nsis portable"
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading