TimeLens v1.1.0
Added
Widget Permission System
- New third-party widget permission system — official and third-party widgets now have separate trust tiers
- WidgetPermissionDialog component (
src/pages/WidgetCenter/WidgetPermissionDialog.tsx) — modal for reviewing and granting individual data-access permissions before a third-party widget loads - Import local widget support in WidgetCenter — browse filesystem to load external widget packages
- Permission persistence and management backend (
src-tauri/src/commands/widget_permissions.rs) — stores granted permissions per widget in the database - Widget signature verification — SHA-256 hash validation of the manifest entry file to ensure package integrity
Widget Data Channels
- Expanded widget channel data interfaces — additional query endpoints exposed to widgets via IPC
- Fine-grained permission control — widgets must request explicit permission for each data category they access
ExternalWidgetHostupdated with permission filtering and expanded channel capabilities
VS Code Integration
- New VS Code Insights page (
src/pages/VsCodeInsights/index.tsx) — dedicated page for Visual Studio Code usage analytics- Total coding time, session count, and tracking toggle
- Three tracking levels: basic (time only), standard (+ language stats), detailed (+ project stats)
- VS Code API endpoints (
src-tauri/src/api_server/mod.rs) — REST API for the VS Code extension to push session dataPOST /api/vscode/sessions— receive coding sessions with per-language durationsGET /api/vscode/stats/today/stats/range— coding time summariesGET /api/vscode/languages/range— programming language usage rankingGET /api/vscode/projects/range— project-level time breakdownGET|POST /api/vscode/enabled— tracking toggle and level configuration
- Database schema — new
vscode_sessionsandvscode_session_languagestables with indexes for fast date/project/language queries - Dashboard TodayOverview — new VS Code card showing today's coding time, top language, and top project
- Dashboard customization — VS Code card visibility toggle in Home Customize
- Sidebar navigation — new
/vscoderoute withCode2icon in the main nav
Productivity Score
- New Productivity Score algorithm — calculates daily and date-range scores from focus time, app switch count, and usage patterns
- ProductivityScoreCard component — new dashboard card displaying the current period's productivity score
- ProductivityTrendChart component — line chart visualizing productivity score trends across days
Interruption Detection
- New interruption detection engine — identifies high-frequency app switching via a sliding window algorithm
- Dashboard fragmentation indicator — red dot badge on the dashboard header when frequent context switches are detected
Global Search
- New Global Search (
Ctrl+K) — system-wide quick search and navigation- Search scope covers pages, apps, categories, todos, and goals
- Grouped results with highlighted matches
- Full keyboard navigation (arrow keys to move, Enter to select)
- GlobalSearch component (
src/components/GlobalSearch.tsx) — overlay search panel with fuzzy matching and category grouping
Widget UX
- Widget auto-blur on mouse leave — floating widgets fade out 2 seconds after the mouse leaves, reducing visual distraction
- Widget idle state — widgets enter a low-attention mode when not actively interacted with
Dashboard Customization
- New Home Customize page (
src/pages/HomeCustomize/index.tsx) — manage visibility and reorder of individual dashboard cards; each card can be shown or hidden independently - Dashboard layout store (
src/stores/dashboardLayoutStore.ts) — Zustand store withlocalStoragepersistence for card visibility and ordering preferences - Dashboard index refactored with modular conditional card rendering based on layout configuration
App Detail Modal
- New AppDetailModal component (
src/components/AppDetailModal.tsx) — detailed usage view accessible by clicking any app in the dashboard ranking- Displays today's usage, 7-day total, and assigned category
- 7-day bar chart with daily breakdown
- Quick navigation to the Categories page for re-categorization
Developer Resources
- New Widget Development Guide (
docs/WIDGETS_DEV_GUIDE.mdanddocs/WIDGETS_DEV_GUIDE.zh-CN.md) — comprehensive documentation for building third-party widgets including manifest format, render contract, and permission system - New third-party widget template (
examples/third-party-widget-template/) — minimal starter template withmanifest.json,index.js, and bilingual README
Backend
- New
productivity_cmd.rsmodule (src-tauri/src/commands/productivity_cmd.rs) — Rust commands for productivity score calculation and interruption detection metricsget_productivity_score— single-day score from focus time, switch count, and usage patternsget_productivity_score_range— daily scores across a date range for trend chartsget_interruption_periods— per-hour fragment data (switch count + fragmentation score) for a given date
- Database schema expanded — new tables and indexes for productivity tracking, widget permissions, and signature verification storage
storage_cmd.rsexpanded with additional aggregate query endpoints for range statistics and category insightsget_app_comparison_in_ranges— period-over-period usage comparisonget_category_totals_in_range/get_category_daily_totals_in_range— category-level aggregationget_hourly_distribution_for_date/get_recent_daily_totals_range/get_app_category_map— widget channel data APIs
Internationalization
dashboardnamespace significantly expanded — productivity score, interruption detection, dashboard customization, and app detail labelswidgetsnamespace expanded — permission dialog, signature verification, and third-party widget management labelscommonnamespace expanded — global search and app detail action labels
Changed
- WidgetCenter page refactored — official and third-party widgets are now displayed in separate sections with distinct visual treatment
- Dashboard heavily refactored — modular card system with conditional rendering, AppDetailModal integration, and layout store support
- Dashboard enhanced — new productivity score card, productivity trend chart, and interruption fragmentation indicator added
- ExternalWidgetHost — updated with permission filtering and expanded data channel interfaces
- Code structure optimization — Rust and TypeScript types aligned, API surfaces unified
- Various bug fixes and stability improvements
App Infrastructure
get_install_channel_infocommand — detects whether the app was installed via Microsoft Store or direct download, determining the appropriate update strategy
Fixed
- Fixed
WidgetRegistryLoadErrorerror type not convertible toString(compilation failure) - Removed unused
chrono::Localimport
🚩 macOS 无签名运行说明
首次打开如遇“无法验证开发者”或“已损坏”提示,请右键 App → 打开,或在终端执行:
xattr -dr com.apple.quarantine /Applications/TimeLens.app
如仍无法运行,请在“系统设置 → 隐私与安全性”中允许此 App。