Skip to content

TimeLens v1.1.0

Choose a tag to compare

@github-actions github-actions released this 10 May 03:07

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
  • ExternalWidgetHost updated 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 data
    • POST /api/vscode/sessions — receive coding sessions with per-language durations
    • GET /api/vscode/stats/today / stats/range — coding time summaries
    • GET /api/vscode/languages/range — programming language usage ranking
    • GET /api/vscode/projects/range — project-level time breakdown
    • GET|POST /api/vscode/enabled — tracking toggle and level configuration
  • Database schema — new vscode_sessions and vscode_session_languages tables 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 /vscode route with Code2 icon 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 with localStorage persistence 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.md and docs/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 with manifest.json, index.js, and bilingual README

Backend

  • New productivity_cmd.rs module (src-tauri/src/commands/productivity_cmd.rs) — Rust commands for productivity score calculation and interruption detection metrics
    • get_productivity_score — single-day score from focus time, switch count, and usage patterns
    • get_productivity_score_range — daily scores across a date range for trend charts
    • get_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.rs expanded with additional aggregate query endpoints for range statistics and category insights
    • get_app_comparison_in_ranges — period-over-period usage comparison
    • get_category_totals_in_range / get_category_daily_totals_in_range — category-level aggregation
    • get_hourly_distribution_for_date / get_recent_daily_totals_range / get_app_category_map — widget channel data APIs

Internationalization

  • dashboard namespace significantly expanded — productivity score, interruption detection, dashboard customization, and app detail labels
  • widgets namespace expanded — permission dialog, signature verification, and third-party widget management labels
  • common namespace 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_info command — detects whether the app was installed via Microsoft Store or direct download, determining the appropriate update strategy

Fixed

  • Fixed WidgetRegistryLoadError error type not convertible to String (compilation failure)
  • Removed unused chrono::Local import


🚩 macOS 无签名运行说明

首次打开如遇“无法验证开发者”或“已损坏”提示,请右键 App → 打开,或在终端执行:

xattr -dr com.apple.quarantine /Applications/TimeLens.app

如仍无法运行,请在“系统设置 → 隐私与安全性”中允许此 App。