mirror of
https://github.com/ricolandia/TriliumNext-Toolkit.git
synced 2026-05-17 10:55:40 -04:00
refactor(pomodoro): convert floating button to native widget panel
This commit is contained in:
parent
2d1c7fe347
commit
e72aa0f2c8
3 changed files with 16 additions and 2 deletions
Binary file not shown.
|
|
@ -1,33 +1,47 @@
|
|||
# Minimalist Pomodoro + Time Tracker
|
||||
|
||||
A monochromatic Pomodoro timer widget with per-note time tracking and automated report generation. Built with zero external dependencies in ~130 lines of code.
|
||||
A monochromatic Pomodoro timer widget with per-note time tracking and automated report generation. Built with zero external dependencies.
|
||||
|
||||
## Features
|
||||
|
||||
* **Pomodoro Timer:** Standard 25min focus / 5min break cycles.
|
||||
* **Per-Note Tracking:** Automatically logs how much time you spend on each note while the timer is running.
|
||||
* **Monochromatic UI:** Uses the active theme's CSS variables for a distraction-free experience.
|
||||
|
||||
## 🚀 What's New (Latest Updates)
|
||||
|
||||
**v4 - Native Widget Panel**
|
||||
|
||||
* **Right-pane widget:** Replaced the absolutely-positioned floating button with a proper `RightPanelWidget`, rendering the timer as a native collapsible section in the right panel.
|
||||
* **No more overlap:** Removed `_autoposition()` and all manual coordinate logic — the widget now follows Trilium's layout system naturally.
|
||||
* **Cleaner UI:** Timer display enlarged to 32px; controls expand to full width.
|
||||
|
||||
**v3 - Core Bug Fixes & Stability**
|
||||
|
||||
* **Wall-clock time tracking:** The timer no longer stops or loses time when the Trilium window is minimized or loses focus (bypassing `setInterval` throttling).
|
||||
* **Pause fix:** Fixed a bug where time wasn't accounted for correctly after unpausing a session (`lastTick` reset issue).
|
||||
|
||||
**v2 - Workflow & Persistence**
|
||||
|
||||
* **Seamless Transitions:** Automatically chains sessions (Focus → Break → Focus) without stopping.
|
||||
* **Safe Persistence:** Saves progress to `localStorage` on pauses or app closures. The timer automatically restores pending data if you reopen the app.
|
||||
* **Auto-Reports:** Generates a formatted note on stop, detailing completed cycles (and if they were chained), total time, and time spent per note.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Create a `JS Frontend` note.
|
||||
2. Paste the script code or import the `.zip`.
|
||||
3. Add the label: `#widget`. Reload Trilium.
|
||||
|
||||
> To place the widget in the **left pane** instead, change `get parentWidget()` to `'left-pane'` and the base class to `api.NoteContextAwareWidget` with `doRender()`.
|
||||
|
||||
## Original link
|
||||
|
||||
[https://github.com/orgs/TriliumNext/discussions/9710](https://github.com/orgs/TriliumNext/discussions/9710)
|
||||
|
||||
### Images
|
||||
### Images
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
|
|
|||
BIN
Minimalist-Pomodoro/imagens/pomodoro-4-.webp
Normal file
BIN
Minimalist-Pomodoro/imagens/pomodoro-4-.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Loading…
Add table
Reference in a new issue