Skip to content

Commit 385d519

Browse files
committed
feat: added multiple functions.
## Added - **Widget SDK v2** — `manifest.json` now supports `manifest_version`, `sdk_version`, structured `capabilities`, and `csp`. Legacy v1 manifests are auto-normalized to v2. - **Widget `local_api_call` enforcement** — widgets can request `local-api:call`; the host issues scoped API tokens and the local API server enforces token scopes across all routes. - **Widget dev harness** — updated the local widget preview page to handle SDK v2 capabilities and permission simulation. - **Widget template & migration guide** — upgraded `examples/third-party-widget-template/` to SDK v2 with TypeScript types and `localApiCall` example; added `docs/WIDGET_SDK_v2_MIGRATION.md`. - **Settings UI for v2.0.0 platform features** — added sections/cards for migration rehearsal/integrity checks, passphrase-protected backups, archive scheduler and compression, profile management, and database encryption. - **CI quality gates** — added `npm test`, Rust `cargo test`, Tauri build smoke test, offline critical-journey tests, and migration-rehearsal job to `.github/workflows/ci.yml`. - **Dashboard Insights enhancements** — added saved views, distraction hotspot card, and Apps/Categories/Projects comparison tabs. - **Focus rule backend integration** — Focus Mode rules now persist in the backend `focus_rules` table with CRUD commands and backend-driven auto start/stop. - **Profile state isolation** — moved profile metadata and `current_profile_id` into a separate unencrypted `app_state.db` so profile switching remains reliable even when individual profile databases are encrypted. - **Full Japanese, Korean, French, German, and Spanish localization** — completed frontend translations across all desktop namespaces (`common`, `dashboard`, `widgets`, `settings`, `limits`, `categories`, `goals`, `focus`, `browserUsage`) for `ja`, `ko`, `fr`, `de`, and `es`. - **Frontend accessibility pass** — added "Skip to main content" link, global `:focus-visible` styles, ARIA live announcer for notifications, navigation landmark labels, `aria-current="page"`, icon-only button labels, dialog roles/modal attributes, and dynamic HTML `lang` updates. - **Local API server governance** — hardened all API server routes to enforce widget-scoped API token scopes and reject unscoped or revoked tokens. - **Offline test harness scripts** — added `scripts/offline-journey-tests.sh` and `scripts/migration-rehearsal.sh` for local critical-journey and migration validation. ### Changed - Consolidated roadmap governance into a single canonical local-first source at `docs/ROADMAP_v2.0.0.md`. - Archived the parallel roadmap track to avoid split planning ownership and version drift. - Normalized core desktop release metadata to `2.0.0` across npm, Tauri, and Windows MSIX manifest sources. - Added advanced Browser Usage date-range exploration with local saved views (custom range, save/apply/delete presets). - Added Dashboard "what changed" summary card for recent period comparison (top increase/decrease, new/stopped active apps, total delta). - Added Dashboard "Unified Insight Workspace" narrative panel (daily review, weekly reflection, goal health) powered by local suggestions and anomaly detection. - Added local notification automation controls in Tracking settings (quiet hours + reminder cooldown) and wired them into all in-app alert dispatches. - Added Dashboard "Unified Timeline" panel with cross-source feed (desktop focus sessions, browser sessions, interruption markers) and local source/search filters. - Moved "What Changed" summary, Unified Insight Workspace, and Unified Timeline into a dedicated Dashboard Insights page to reduce homepage density and improve analysis flow. - Added cross-module drill-down actions from Dashboard summaries/timeline into Categories, Browser Usage, and Focus Mode, with URL-parameter context handoff. - Fixed interruption marker detail drill-down target: `Open Detail` now routes to a dedicated interruption detail view with hour window, switch count, and fragment score context instead of Focus Mode landing. - Added a unified Privacy & Permission Center entry in Settings to aggregate local-only boundary, tracking state, API governance, backup, and data health with one-click deep links. - Added reusable async state cards (loading/empty/error) and applied them to core pages for consistent platform-level UX. - Expanded async state card adoption to Goals, Dashboard, and Widget Center to reduce duplicated state UI logic. - Added Focus Mode rule automation panel with local rule management, simulation, and one-click apply-to-start behavior. - Hardened third-party widget permission enforcement by mapping `settings:write` to runtime channel interception and fixing install-time permission dialog state reset / instance targeting. - Upgraded Widget permission matrix from read-only audit view to manageable controls with one-click permission revoke. - Added secondary confirmation and success/failure feedback for widget permission revoke actions to reduce accidental operations. - Added per-widget permission change timeline (grant/revoke actor + timestamp) for third-party widget governance audits. - Completed i18n coverage for newly added Widget permission matrix and Browser Usage/Dashboard incremental features across `en` / `zh-CN` / `zh-TW`. ### Fixed - **Profile switching reliability** — fixed a bug where switching profiles could result in a "connection refused" error or missing profiles because `current_profile_id` was stored inside the encrypted profile database. - **Widget permission dialog state** — fixed install-time permission dialog state reset and instance targeting so permission grants are correctly associated with the widget being installed. - **Database encryption shutdown corruption** — fixed a critical bug where shutdown re-encryption generated a fresh nonce/salt but did not update the stored metadata, causing the next startup to fail with "Failed to decrypt database". Re-encryption now writes updated metadata and uses atomic temp-file writes. - **Database encryption file-lock resilience** — encryption/decryption and plaintext wipe now retry on Windows file locks and fall back to a usable runtime plaintext database if the encrypted backup cannot be decrypted on startup. - **Database encryption disable flow** — fixed a bug where disabling encryption and restarting could corrupt or overwrite the latest plaintext with a stale encrypted backup. Disabling now preserves the current runtime plaintext and removes encrypted artifacts after verifying the plaintext is valid. - **Database open retry on restart** — added a short retry loop when opening the profile database during startup to avoid "localhost refused connection" / startup failures caused by Windows file-lock races after `app.restart()`.
1 parent 1220e12 commit 385d519

94 files changed

Lines changed: 8293 additions & 934 deletions

File tree

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: 120 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, dev]
5+
branches: [master, main, dev]
66
pull_request:
7-
branches: [main, dev]
7+
branches: [master, main, dev]
88
workflow_dispatch:
99

1010
jobs:
1111
frontend:
12-
name: Frontend lint & typecheck
12+
name: Frontend lint, typecheck & unit tests
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -29,8 +29,11 @@ jobs:
2929
- name: Type-check
3030
run: npm run typecheck
3131

32+
- name: Unit tests
33+
run: npm test
34+
3235
rust:
33-
name: Rust check
36+
name: Rust check & test
3437
runs-on: ubuntu-latest
3538
steps:
3639
- uses: actions/checkout@v4
@@ -58,3 +61,116 @@ jobs:
5861
- name: Cargo check
5962
working-directory: src-tauri
6063
run: cargo check --all-targets
64+
65+
- name: Cargo test
66+
working-directory: src-tauri
67+
run: cargo test --lib
68+
69+
tauri-build:
70+
name: Tauri build smoke test
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Setup Node.js
76+
uses: actions/setup-node@v4
77+
with:
78+
node-version: 20
79+
cache: npm
80+
81+
- name: Install dependencies
82+
run: npm ci
83+
84+
- name: Install system dependencies
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install -y \
88+
libwebkit2gtk-4.1-dev \
89+
libgtk-3-dev \
90+
libayatana-appindicator3-dev \
91+
librsvg2-dev \
92+
libglib2.0-dev \
93+
pkg-config \
94+
libssl-dev
95+
96+
- name: Setup Rust toolchain
97+
uses: dtolnay/rust-toolchain@stable
98+
99+
- name: Cache Rust dependencies
100+
uses: Swatinem/rust-cache@v2
101+
with:
102+
workspaces: src-tauri
103+
104+
- name: Build Tauri
105+
run: npm run tauri build -- --bundles deb
106+
env:
107+
CI: true
108+
109+
offline-critical-journeys:
110+
name: Offline critical journey tests
111+
runs-on: ubuntu-latest
112+
needs: [frontend, rust]
113+
steps:
114+
- uses: actions/checkout@v4
115+
116+
- name: Setup Node.js
117+
uses: actions/setup-node@v4
118+
with:
119+
node-version: 20
120+
cache: npm
121+
122+
- name: Install dependencies
123+
run: npm ci
124+
125+
- name: Install system dependencies
126+
run: |
127+
sudo apt-get update
128+
sudo apt-get install -y \
129+
libwebkit2gtk-4.1-dev \
130+
libgtk-3-dev \
131+
libayatana-appindicator3-dev \
132+
librsvg2-dev \
133+
libglib2.0-dev \
134+
pkg-config \
135+
libssl-dev
136+
137+
- name: Setup Rust toolchain
138+
uses: dtolnay/rust-toolchain@stable
139+
140+
- name: Cache Rust dependencies
141+
uses: Swatinem/rust-cache@v2
142+
with:
143+
workspaces: src-tauri
144+
145+
- name: Run offline journey tests
146+
run: bash scripts/offline-journey-tests.sh
147+
148+
migration-rehearsal:
149+
name: 1.x → 2.0 migration rehearsal
150+
runs-on: ubuntu-latest
151+
needs: [rust]
152+
steps:
153+
- uses: actions/checkout@v4
154+
155+
- name: Install system dependencies
156+
run: |
157+
sudo apt-get update
158+
sudo apt-get install -y \
159+
libwebkit2gtk-4.1-dev \
160+
libgtk-3-dev \
161+
libayatana-appindicator3-dev \
162+
librsvg2-dev \
163+
libglib2.0-dev \
164+
pkg-config \
165+
libssl-dev
166+
167+
- name: Setup Rust toolchain
168+
uses: dtolnay/rust-toolchain@stable
169+
170+
- name: Cache Rust dependencies
171+
uses: Swatinem/rust-cache@v2
172+
with:
173+
workspaces: src-tauri
174+
175+
- name: Run migration rehearsal
176+
run: bash scripts/migration-rehearsal.sh

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

66
---
77

8-
## [2.0.0] - 2026-06-06
8+
## [2.0.0] - 2026-06-12
99

1010
### Added
1111

@@ -30,6 +30,19 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
3030
- **Category and project comparison** — added `get_category_comparison_in_ranges` and `get_project_comparison_in_ranges` for period-over-period drill-down beyond apps.
3131
- **Goal risk notifications** — added `evaluate_goal_risks` and a background notifier that emits `goal-risk-alert` events and native notifications when goals are off track.
3232
- **Backend Focus rule automation** — moved Focus rules from frontend-only `localStorage` to the `focus_rules` table with CRUD commands and a background evaluator that auto starts/stops focus sessions.
33+
- **Widget SDK v2**`manifest.json` now supports `manifest_version`, `sdk_version`, structured `capabilities`, and `csp`. Legacy v1 manifests are auto-normalized to v2.
34+
- **Widget `local_api_call` enforcement** — widgets can request `local-api:call`; the host issues scoped API tokens and the local API server enforces token scopes across all routes.
35+
- **Widget dev harness** — updated the local widget preview page to handle SDK v2 capabilities and permission simulation.
36+
- **Widget template & migration guide** — upgraded `examples/third-party-widget-template/` to SDK v2 with TypeScript types and `localApiCall` example; added `docs/WIDGET_SDK_v2_MIGRATION.md`.
37+
- **Settings UI for v2.0.0 platform features** — added sections/cards for migration rehearsal/integrity checks, passphrase-protected backups, archive scheduler and compression, profile management, and database encryption.
38+
- **CI quality gates** — added `npm test`, Rust `cargo test`, Tauri build smoke test, offline critical-journey tests, and migration-rehearsal job to `.github/workflows/ci.yml`.
39+
- **Dashboard Insights enhancements** — added saved views, distraction hotspot card, and Apps/Categories/Projects comparison tabs.
40+
- **Focus rule backend integration** — Focus Mode rules now persist in the backend `focus_rules` table with CRUD commands and backend-driven auto start/stop.
41+
- **Profile state isolation** — moved profile metadata and `current_profile_id` into a separate unencrypted `app_state.db` so profile switching remains reliable even when individual profile databases are encrypted.
42+
- **Full Japanese, Korean, French, German, and Spanish localization** — completed frontend translations across all desktop namespaces (`common`, `dashboard`, `widgets`, `settings`, `limits`, `categories`, `goals`, `focus`, `browserUsage`) for `ja`, `ko`, `fr`, `de`, and `es`.
43+
- **Frontend accessibility pass** — added "Skip to main content" link, global `:focus-visible` styles, ARIA live announcer for notifications, navigation landmark labels, `aria-current="page"`, icon-only button labels, dialog roles/modal attributes, and dynamic HTML `lang` updates.
44+
- **Local API server governance** — hardened all API server routes to enforce widget-scoped API token scopes and reject unscoped or revoked tokens.
45+
- **Offline test harness scripts** — added `scripts/offline-journey-tests.sh` and `scripts/migration-rehearsal.sh` for local critical-journey and migration validation.
3346

3447
### Changed
3548

@@ -54,6 +67,15 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5467
- Added per-widget permission change timeline (grant/revoke actor + timestamp) for third-party widget governance audits.
5568
- Completed i18n coverage for newly added Widget permission matrix and Browser Usage/Dashboard incremental features across `en` / `zh-CN` / `zh-TW`.
5669

70+
### Fixed
71+
72+
- **Profile switching reliability** — fixed a bug where switching profiles could result in a "connection refused" error or missing profiles because `current_profile_id` was stored inside the encrypted profile database.
73+
- **Widget permission dialog state** — fixed install-time permission dialog state reset and instance targeting so permission grants are correctly associated with the widget being installed.
74+
- **Database encryption shutdown corruption** — fixed a critical bug where shutdown re-encryption generated a fresh nonce/salt but did not update the stored metadata, causing the next startup to fail with "Failed to decrypt database". Re-encryption now writes updated metadata and uses atomic temp-file writes.
75+
- **Database encryption file-lock resilience** — encryption/decryption and plaintext wipe now retry on Windows file locks and fall back to a usable runtime plaintext database if the encrypted backup cannot be decrypted on startup.
76+
- **Database encryption disable flow** — fixed a bug where disabling encryption and restarting could corrupt or overwrite the latest plaintext with a stale encrypted backup. Disabling now preserves the current runtime plaintext and removes encrypted artifacts after verifying the plaintext is valid.
77+
- **Database open retry on restart** — added a short retry loop when opening the profile database during startup to avoid "localhost refused connection" / startup failures caused by Windows file-lock races after `app.restart()`.
78+
5779
## [1.4.4] - 2026-06-06
5880

5981
### Added

docs/ROADMAP_v2.0.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TimeLens Roadmap to v2.0.0 (Local-First)
22

3-
Last updated: 2026-06-06
3+
Last updated: 2026-06-12
44

55
## Canonical Source
66

@@ -248,7 +248,7 @@ Target window: 2027 Q1
248248
- Full end-to-end offline scenario testing across dashboard, widgets, backup, restore, and extension integration.
249249
- Security checklist verification for local storage, permission boundaries, and API exposure.
250250
- Long-run stability tests (multi-day local logging workload).
251-
- Accessibility checks for keyboard navigation and screen reader critical flows.
251+
- Accessibility checks for keyboard navigation and screen reader critical flows. *(Basic pass completed: skip link, focus-visible styles, ARIA live announcer, dialog roles, dynamic `lang`, landmark labels.)*
252252

253253
### Release Gates (Must Pass)
254254

0 commit comments

Comments
 (0)