Skip to content

Commit d0f549a

Browse files
PythonSmall-QCopilot
andcommitted
Version 1.0.0 of TimeLens! Hello, GitHub!
Co-authored-by: Copilot <copilot@github.com>
1 parent af71067 commit d0f549a

77 files changed

Lines changed: 17550 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
frontend:
11+
name: Frontend lint & typecheck
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Lint
26+
run: npm run lint
27+
28+
- name: Type-check
29+
run: npm run typecheck
30+
31+
rust:
32+
name: Rust check
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Install system dependencies
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y \
41+
libwebkit2gtk-4.1-dev \
42+
libgtk-3-dev \
43+
libayatana-appindicator3-dev \
44+
librsvg2-dev \
45+
pkg-config \
46+
libssl-dev
47+
48+
- name: Setup Rust toolchain
49+
uses: dtolnay/rust-toolchain@stable
50+
51+
- name: Cache Rust dependencies
52+
uses: Swatinem/rust-cache@v2
53+
with:
54+
workspaces: src-tauri
55+
56+
- name: Cargo check
57+
working-directory: src-tauri
58+
run: cargo check --all-targets

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: windows-latest
18+
args: ""
19+
- platform: macos-latest
20+
args: "--target universal-apple-darwin"
21+
22+
runs-on: ${{ matrix.platform }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
# ── macOS: universal binary needs both targets ──────────────────────────
28+
- name: Add macOS targets
29+
if: matrix.platform == 'macos-latest'
30+
run: |
31+
rustup target add aarch64-apple-darwin
32+
rustup target add x86_64-apple-darwin
33+
34+
# ── Node.js ─────────────────────────────────────────────────────────────
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
cache: npm
40+
41+
- name: Install frontend dependencies
42+
run: npm ci
43+
44+
# ── Rust ────────────────────────────────────────────────────────────────
45+
- name: Setup Rust toolchain
46+
uses: dtolnay/rust-toolchain@stable
47+
48+
- name: Cache Rust
49+
uses: Swatinem/rust-cache@v2
50+
with:
51+
workspaces: src-tauri
52+
53+
# ── Linux system libs (not used here but keep for potential future runs) ──
54+
55+
# ── Build & publish ──────────────────────────────────────────────────────
56+
- name: Build and release
57+
uses: tauri-apps/tauri-action@v0
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
tagName: ${{ github.ref_name }}
62+
releaseName: "TimeLens ${{ github.ref_name }}"
63+
releaseBody: |
64+
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
65+
releaseDraft: false
66+
prerelease: false
67+
args: ${{ matrix.args }}

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
9+
# Dependencies
10+
node_modules/
11+
12+
# Build output
13+
dist/
14+
dist-ssr/
15+
*.local
16+
17+
# Editor
18+
.vscode/
19+
!.vscode/extensions.json
20+
.idea/
21+
.DS_Store
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?
27+
28+
# Tauri
29+
src-tauri/target/
30+
src-tauri/gen/
31+
32+
# Icon generation scripts (dev utility only)
33+
generate-icons.mjs
34+
generate-ico-icns.mjs
35+
36+
# Test
37+
coverage/
38+
39+
# Environment
40+
.env
41+
.env.local
42+
.env.production

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 100,
7+
"bracketSpacing": true,
8+
"arrowParens": "always"
9+
}

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Changelog
2+
3+
All notable changes to TimeLens are documented here.
4+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5+
6+
---
7+
8+
## [0.1.0][0.1.0]
9+
10+
### Added
11+
12+
#### Screen Time Tracking
13+
14+
- Automatic foreground window monitoring (Windows via Win32 API; macOS via AppleScript)
15+
- Per-app daily usage totals stored in SQLite
16+
- Hourly distribution breakdown (0–23 h area chart)
17+
- 7-day usage trend
18+
- 500 ms debounce to suppress noise from rapid app switches
19+
- Pause / resume tracking from tray menu or Settings
20+
21+
#### Dashboard
22+
23+
- Today overview cards: total time, current app, most-used app
24+
- Top-8 apps horizontal bar chart (Recharts)
25+
- 24-hour area chart with current-hour highlight
26+
- Full ranked app list with progress bars
27+
- Date navigator (prev / next day)
28+
29+
#### Floating Widgets
30+
31+
- **Clock Widget** — digital (12/24 h toggle) and analog display; draggable; frameless transparent window
32+
- **Todo Widget** — quick-add input, checkbox toggle, @dnd-kit drag-reorder, per-item delete, clear completed
33+
- **Timer Widget** — Pomodoro (25 min work / 5 min break with auto-phase switch), custom countdown, stopwatch; animated SVG progress ring
34+
- Widget position/size persisted to DB; restored on next launch
35+
- Focus-based always-on-top: widget rises to front on focus, recedes on blur
36+
37+
#### App Infrastructure
38+
39+
- Tauri 2.x multi-window with capability manifests
40+
- System tray with Show, New Clock / Todo / Timer, Pause, Quit actions
41+
- Main window hides to tray on close (no accidental data loss)
42+
- Zustand stores with localStorage persistence for settings
43+
- i18next with `en` and `zh-CN` locale files; runtime language switching
44+
- GitHub Actions CI (lint + typecheck + `cargo check`) on push/PR
45+
- GitHub Actions release workflow: builds Windows `.msi`/`.exe` + macOS universal `.dmg` on `v*` tags
46+
47+
[0.1.0]: https://github.com/PythonSmall-Q/TimeLens/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contributing to TimeLens
2+
3+
Thank you for your interest in contributing! Please follow these guidelines to keep the project healthy.
4+
5+
---
6+
7+
## Development Setup
8+
9+
```bash
10+
# Prerequisites: Node.js ≥ 18, Rust ≥ 1.77, Tauri CLI 2.x
11+
12+
git clone https://github.com/PythonSmall-Q/TimeLens.git
13+
cd TimeLens
14+
npm install
15+
npm run tauri:dev
16+
```
17+
18+
Refer to [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for a full environment guide, debugging tips, and architecture notes.
19+
20+
---
21+
22+
## Pull Request Process
23+
24+
1. **Fork** the repository and create a feature branch from `dev`:
25+
```
26+
git checkout -b feat/your-feature dev
27+
```
28+
2. Make your changes. Keep commits focused and atomic.
29+
3. Run checks locally before pushing:
30+
```bash
31+
npm run lint
32+
npm run typecheck
33+
cd src-tauri && cargo check
34+
```
35+
4. Open a PR targeting the `dev` branch. Fill in the PR template.
36+
5. A maintainer will review and merge to `dev`; `dev``main` merges happen on scheduled releases.
37+
38+
---
39+
40+
## Code Style
41+
42+
| Scope | Rule |
43+
|-------|------|
44+
| TypeScript / React | ESLint + Prettier (config in repo root) |
45+
| Rust | `cargo fmt` + `cargo clippy` |
46+
| Commit messages | Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `refactor:`) |
47+
48+
Run `npm run format` to auto-format TypeScript/JSON files.
49+
50+
---
51+
52+
## Adding a Language
53+
54+
See [docs/ADD_LANGUAGE.md](docs/ADD_LANGUAGE.md).
55+
56+
---
57+
58+
## Reporting Bugs
59+
60+
Open an issue with:
61+
- TimeLens version
62+
- OS and version
63+
- Steps to reproduce
64+
- Expected vs actual behaviour
65+
- Logs from `Help → Open Log Directory` (if applicable)
66+
67+
---
68+
69+
## License
70+
71+
By contributing, you agree your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)