Skip to content

v0.8.6

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Feb 15:03
· 1 commit to main since this release

Changelog

[0.8.6] - 2026-02-10

Added

  • New Sick Leave position (--pos s)
  • Optional range support via --to (start date is the command DATE)
  • Automatic skipping of:
    • Weekends (Saturday/Sunday)
    • National holidays
    • Dates already containing events

Changed

  • Sick Leave is now stored as a non-working marker day (sentinel event at 00:00, similar to Holiday)
  • list rendering updated:
    • IN/OUT/TGT displayed as --:--
    • Sick Leave days do not contribute to ΔWORK totals
  • CLI validation improved:
    • --to is only allowed with --pos s
    • If --to is omitted, Sick Leave applies only to the specified DATE
  • recalc_pairs_for_date updated to accept &Connection
  • Refactored add flow to cleanly separate:
    • marker days
    • working days
    • range handling

Fixed

  • Prevented 00:00 IN time from being displayed for Sick Leave
  • Prevented incorrect surplus/deficit calculations for Sick Leave days
  • Improved argument validation consistency in add

v0.8.5 — 2026-01-13

Added

  • Enhanced add command to display the calculated target exit time (TGT)
    immediately after adding an IN event.

Changed

  • Unified IN and OUT event creation through a shared CLI helper.
  • Removed duplicated upsert logic in edit and insert modes.
  • Reused existing time formatting utilities for target time rendering.

Internal

  • Refactored add command logic to improve readability and maintainability
    without changing existing behavior.

v0.8.4 — 2026-01-09

Changed

  • Improved list command output for National Holiday days:
    • time placeholders (--:--) are no longer shown
    • the meta field is displayed instead, providing a meaningful holiday description
  • Made National Holiday row layout adaptive to table width:
    • meta column now expands dynamically based on the current table layout
    • works consistently across weekday display modes and --compact
  • Unified and hardened meta rendering:
    • meta values are filtered, concatenated, and truncated in a single helper
    • truncation is Unicode-safe (char-based, UTF-8 safe)
    • optional ellipsis () is applied when truncation occurs
  • Added focused unit tests for get_meta_string to validate:
    • filtering of empty metadata
    • correct concatenation
    • Unicode-safe truncation behavior

Internal

  • Refactored list rendering logic to reduce hardcoded column widths
  • Improved robustness of table layout against future column size changes

[0.8.3] – 2026-01-08

✨ New features

  • Import data from JSON and CSV files

    • New import command to insert events into the database from external sources.
    • Supported formats:
      • JSON (flexible structures: root array, { days: [...] }, { holidays: [...] })
      • CSV (with header row).
    • Supported options:
      • --file <path>: input file
      • --format <json|csv> (default: json)
      • --dry-run: simulate the import without modifying the database
      • --replace: overwrite existing conflicting data
      • --source: logical label describing the data origin
  • National holidays support

    • Added new position NationalHoliday.
    • National holidays:
      • do not affect the user vacation balance
      • are compatible with automatic/preventive imports (e.g. yearly calendars).
  • Preventive holiday import

    • Allows preparing JSON/CSV files with annual holidays and importing them in advance.
    • Reduces manual errors and forgotten entries.

🔧 Improvements

  • Enhanced data source tracking

    • The source field of imported events now automatically includes the input format
      (e.g. import (from json), import (from csv)).
  • meta field support for imported events

    • Descriptive data (e.g. holiday name) is stored in the meta field as JSON.
    • Example:
      { "name": "New Year" }
  • Refactor of Event::new() constructor

    • The constructor now explicitly supports:
      • meta
      • source
    • Clear separation between CLI-created events and imported events.
  • Database query refactor

    • Split db::queries into topic-based submodules.
    • Fixed module conflict between queries.rs and queries/mod.rs.
  • Shared utilities

    • Added helper functions in utils::formatting to standardize source generation.

🛠 Fixes

  • Improved validation of imported records:
    • invalid dates
    • unsupported positions
    • malformed rows
  • Improved import reporting:
    • total rows
    • imported rows
    • skipped rows
    • conflicts
    • invalid rows

🧪 Developer notes

  • All import logic is isolated in the src/import module.
  • Full dry-run support for safe testing on real databases.
  • Solid foundation for future integrations (ICS calendars, APIs, external sync).

[0.8.2] — 2026-01-08

✨ Added

  • Added a new day position National holiday (N) to represent public holidays that do not affect personal holiday
    allowance.
  • Introduced support for --pos n / --pos national in the add command to mark national holidays.
  • Added idempotent database migration to extend the events.position CHECK constraint with the new N value.

🧠 Changed

  • Updated daily and compact list views to properly display National holiday days with neutral time and ΔWORK values.
  • Improved semantic distinction between Holiday (personal leave) and National holiday (public holiday) in
    reports and summaries.

🐞 Fixes

  • Ensured database migrations safely no-op when the schema is already aligned.
  • Fixed SQL escaping issues in migration logging statements.

🧹 Internal

  • Extended Location enum and related parsing/formatting utilities.
  • Refined migration logging for better traceability and robustness.

[0.8.1] - 2026-01-07

✨ New

  • Added list --compact output mode for a concise, single-line daily overview.
  • Introduced unified date column format YYYY-MM-DD (WD) with configurable weekday length.
  • Improved visual hierarchy for list --details with highlighted DETAILS section header.
  • Added dynamic table width handling based on weekday display mode (None, Short, Medium, Long).

🔧 Improvements

  • Refactored list command rendering logic for better layout consistency and maintainability.
  • Harmonized table headers and footers across standard and compact list views.
  • Improved footer alignment using dynamic table width calculation.
  • Clarified labels:
    • Expected → Target end
    • Surplus → ΔWORK
  • Enhanced compact delta formatting (e.g. +02h04m).
  • Automatic re-print of table headers when switching month during period listing.
  • Improved holiday visualization:
    • All time fields shown as --:--
    • Greyed output
    • Neutral contribution to totals.

🐞 Fixes

  • Fixed incorrect handling of --pos h (Holiday) requiring --in/--out.
  • Fixed misleading error classification (InvalidTime → InvalidArgs) for invalid CLI combinations.
  • Fixed surplus calculation edge cases when work gaps are present.
  • Fixed weekday width/layout inconsistencies across different display modes.
  • Removed unused variables and eliminated compiler warnings in list.rs.

🧹 Internal

  • Introduced WeekdayMode enum for explicit weekday rendering control.
  • Centralized table width logic via utils::table constants.
  • Simplified footer formatting and alignment logic.
  • Improved separation between presentation logic and data computation.

[v0.8.0] - 2025-12-18

🚀 Stable release — Timeline & Work Gap engine

This release marks the first stable 0.8.x version and concludes the alpha/beta cycle with a fully consolidated
timeline engine, correct multi-pair handling, and a refined CLI experience.


✨ Highlights

  • Stable multi-pair daily model

    • Unlimited IN/OUT pairs per day
    • Persistent pair numbering
    • Fully deterministic timeline reconstruction
  • Working gap support (final)

    • Explicit --work-gap / --no-work-gap flags on OUT events
    • Gaps can be added, removed, or edited retroactively
    • Correct impact on worked time, expected exit, and surplus
    • Clear visual indicators (🔗 / ✂️)
  • Accurate time calculations

    • Worked time now correctly:
      • sums all pairs
      • subtracts non-working gaps
      • includes working gaps only when explicitly marked
    • Expected exit is consistently based on:
      • first IN of the day
      • configured minimum working time
      • lunch rules and windows
    • Surplus calculation is now fully reliable in all scenarios

🧠 Changed

  • OUT events without --pos now inherit the position of the corresponding IN
  • Day details view shows pair-level positions, not aggregated day position
  • Timeline, pairing, and gap logic fully unified across:
    • list
    • list --events
    • list --details
    • exports

🗄️ Database & Migration

  • New stable column events.work_gap
  • Safe, idempotent migrations with:
    • automatic schema alignment
    • backup before destructive changes
  • Automatic recalculation of pairs and daily summaries after edits

🖥️ CLI & UX

  • Unified message system across all commands:
    • ℹ️ info · ⚠️ warning · ❌ error · ✅ success
  • Clear, explicit confirmation messages for gap edits
  • Cleaner event listings:
    • no duplicated dates for multiple pairs
    • improved visual alignment

📦 Export system (stable)

  • Fully refactored export architecture
  • Supported formats:
    • CSV
    • JSON
    • XLSX
    • PDF (multipage, styled, dynamic titles)
  • Shared helpers and consistent overwrite handling

⚠️ Breaking changes

  • Legacy work_sessions table is no longer used
  • Timeline-based model is now the single source of truth
  • CLI behavior fully aligned with the new flag-based syntax introduced in 0.8.x

✅ Final notes

v0.8.0 represents a major architectural milestone.
The internal engine is now considered stable, correct, and extensible.

Future releases will focus on:

  • automated tests
  • performance refinements
  • advanced reporting and statistics

[v0.8.0-beta3] - 2025-12-15

✨ Added

  • 🔗 Working gap support between pairs via --work-gap flag on OUT events.
  • ✂️ Ability to remove a working gap using --no-work-gap in edit mode.
  • New work_gap boolean field stored in the events table.
  • Explicit confirmation messages when enabling or removing work gaps.

🧠 Changed

  • Expected / surplus calculation now correctly accounts for non-working gaps between pairs.
  • OUT events without --pos now inherit the position from the corresponding IN.
  • Day details view now shows the position of each pair, not the aggregated day position.
  • Improved visual output in list --events: repeated dates are no longer duplicated for multiple pairs.

🐞 Fixed

  • Incorrect surplus calculation when non-working gaps were present between pairs.
  • Wrong position assigned to OUT events when --pos was omitted.
  • Multiple inconsistencies in pair reconstruction and gap handling logic.

🗄️ Database

  • Migration added to introduce the work_gap column to the events table.
  • Automatic recalculation of pairs, expected time, and surplus after gap updates.

[0.8.0-beta2] - 2025-12-12

✨ Added

  • Nuovo sistema PDF multipagina con gestione automatica:

    • intestazione titolo per pagina
    • numeri di pagina
    • tabelle multilinea con header ripetuti
    • zebra striping
    • calcolo intelligente della larghezza colonne
  • Titolo PDF dinamico basato su --range, con supporto a:

    • anno (YYYY)
    • mese (YYYY-MM)
    • giorno (YYYY-MM-DD)
    • intervallo (YYYY:YYYY, YYYY-MM:YYYY-MM, ecc.)
  • Supporto ufficiale al nuovo enum ExportFormat (CSV, JSON, XLSX, PDF) con validazione in Clap.

  • Gestione uniforme dell’overwrite dei file con richiesta di conferma.

  • Helper condivisi in export/utils.rs:

    • build_pdf_title
    • path_str
    • to_io_app_error

🔧 Changed

  • Riscrittura completa del sistema di messaggistica a video (UI):
    • Tutti i messaggi CLI passano ora da ui/messages.rs
    • Stile uniforme per info, successi, warning ed errori
    • Emoji standardizzate:
      • ℹ️ info
      • ⚠️ warning
      • ❌ error
      • ✅ success
    • Prompt di conferma file riscritti usando la nuova UI
  • Refactor completo del modulo Export
    • Suddivisione in:
      • logic.rs
      • csv_export.rs
      • json_export.rs
      • xlsx_export.rs
      • pdf_export.rs
      • utils.rs
    • Rimossi duplicati, ridotto il codice di oltre il 40%
    • Migliorata la leggibilità e l’estendibilità del codice
  • XLSX export migliorato
    • gestione numeri, date e orari
    • riduzione della duplicazione di codice
    • stile coerente con il PDF
  • Migrazioni Config riviste
    • messaggi più chiari
    • log più leggibili
    • gestione errori unificata

🐛 Fixed

  • Risolto crash PDF: “duplicate indirect reference id” grazie alla nuova gestione interna degli ID.
  • Fix larghezza colonne in XLSX (ora corretto anche in caso di testi lunghi).
  • Fix del sistema export che utilizzava ancora versioni duplicate di events_to_table.
  • Fix comportamento --force in alcuni percorsi non assoluti.

🧹 Removed

  • Codice legacy del vecchio export (ora sostituito da export/).
  • Vecchio PdfManager monolitico (ora multipagina e completamente rifattorizzato).

🖥️ Unified console message system (dettaglio tecnico)

(Questa sezione compare solo nel CHANGELOG, non nel README)

La release introduce un nuovo sistema di messaggistica centralizzato, ora usato da tutti i comandi dell'app:

  • Output coerente e stilisticamente uniforme
  • Distinzione immediata delle tipologie di messaggi
  • Addio ai println! sparsi
  • Integrazione diretta nei flussi init, export, config, db, migrate, ecc.

Esempi:

ℹ️ Exporting to PDF: report.pdf
⚠️ The file already exists. Overwrite? [y/N]:
❌ Error: invalid date format
✅ Export completed: report.pdf

[0.8.0-beta1] – 2025-12-10

🚀 Major changes

✔ Full rewrite of the list command

  • The command is now fully based on the timeline model (events → timeline → pairs).
  • The legacy table work_sessions is officially removed.
  • Consistent layout for:
    • list
    • list --today
    • list --events
    • list --details
  • Automatic month separators when using --period spanning multiple months.
  • Intelligent ANSI-color output (green/red/gray) across all modes.
  • Daily surplus formula rewritten as:
    surplus = end_time – expected_exit.

✔ Correct handling of Expected Exit & Lunch

  • Implemented lunch_window–aware expected exit calculation, fixing incorrect results when lunch was not explicitly
    declared.
  • When the user records only --in (no --out yet), expected exit now correctly includes:
    • required minimum lunch duration
    • validation against lunch_window
  • Lunch computation is now unified and extracted from the timeline model.

🗄 Database updates

✔ New command db

Introduced:

  • rtimelogger db --info → show DB size, event count, date range, avg events/day
  • rtimelogger db --check → PRAGMA integrity_check
  • rtimelogger db --vacuum → compact and optimize DB
  • rtimelogger db --migrate → run schema migrations safely

✔ Safe migration to new schema ≥ 0.8.0-beta1

  • migrate.rs rewritten to support progressive migrations.
  • Removal of obsolete tables (work_sessions) only when upgrading from pre-0.8.0 versions.
  • Automatic backup before performing destructive schema changes.
  • Added and populated missing column pair when required.

✔ Recalculation of all event pairs

  • New utility: db_utils::rebuild_all_pairs()
    Ensures all IN/OUT events receive a correct, sequential pair number.

🗂 Configuration system upgrades

✔ Auto-heal of missing config fields

When loading rtimelogger.conf, if any field is missing, the system now:

  1. Adds the missing key
  2. Assigns default value
  3. Saves updated config back to disk

✔ Added new setting lunch_window

Used to compute expected exit when lunch is not explicitly set by the user.


💾 Backup improvements

  • backup --file <path> now asks for confirmation before overwriting an existing file.
  • Improved clarity of success/error output.
  • Compression logic unchanged, but now more robust.

🔧 Internal refactoring

  • Consolidated ANSI color helpers (gray, red, green, reset).
  • Unified naming/formatting in formatting.rs.
  • Replaced scattered logic with consistent timeline-derived computations.
  • Strong cleanup of unused or legacy code paths.
  • Better error reporting in many critical code points.

🧹 Fixes

  • Fixed wrong Expected Exit when lunch was defined only in one event of the pair.
  • Fixed day surplus double-counting or off-by-lunch errors.
  • Fixed visual misalignment in several output modes.
  • Fixed pair generation inconsistencies in newly inserted events.
  • Fixed config loading not saving newly introduced parameters.

[0.8.0-alpha2] - 2025-12-04

Changed

  • The add command has been fully redesigned to use a cleaner and more
    explicit flag-based syntax. Positional parameters have been removed,
    except for the required date argument.
  • The legacy positional fields (pos_pos, start_pos, lunch_pos,
    end_pos) have been removed from the CLI parser and internal API.
  • The new syntax is now:
    rtimelogger add <date> --pos <code> --in HH:MM --out HH:MM --lunch <min>

Examples:

  • rtimelogger add 2025-12-03 --pos r --in 08:50
  • rtimelogger add 2025-12-03 --in 09:00 --out 17:30 --lunch 45
  • rtimelogger add 2025-12-03 --edit --pair 1 --out 15:30

Added

  • The add command now supports explicit, optional flags for:
  • --pos (location)
  • --in
  • --out
  • --lunch
  • --pair
  • --edit

This makes the command behavior clearer, more consistent, and easier to
extend in future releases.

Improved

  • The handle() function for the add command has been simplified.
    It now processes only the new flag-based syntax and no longer merges
    legacy positional parameters.
  • The business logic AddLogic::apply() has been refactored to remove
    all references to positional parameter fallbacks.
  • Edit mode logic has been preserved and improved:
  • Explicit flags override only the fields passed by the user
  • IN-only, OUT-only, and lunch-only operations are now more predictable
  • Invalid combinations generate clearer error messages

Notes

This release marks the beginning of the new 0.8.x CLI design, which will
gradually replace the legacy positional-parameter architecture with a
cleaner, more maintainable, and future-proof flag-only approach.


[0.8.0-alpha1] - 2025-11-30

🚀 Major Refactor & Architecture Overhaul

  • Fully reworked internal architecture of event handling, pairing, timeline construction, work sessions,
    logging, and exporting.

  • Unifying logic across add, del, edit, backup, log, and export commands.

  • Significantly improved code organization and separation of concerns across modules:

    • core/add.rs, core/del.rs, core/backup.rs, core/export.rs
    • db/queries.rs rewritten and consolidated
    • models updated for correctness and consistency
    • utils updated for date/time parsing and improved formatting

➕ Add Command Improvements

  • Complete rewrite of AddLogic with cleaner separation between parsing, validation, and DB operations.

  • All parameters (except date) are now optional, with automatic inference based on context.

  • Improved handling of positional arguments and flags.

  • Correct handling of editing existing pairs using --edit and --pair.

  • Position (location) inference rules rewritten:

    • If no position is provided, fallback to last event of the day.
    • Default position remains O (Office).
  • Fix for lunch-only updates without requiring an OUT event.


🗑️ Del Command Improvements

  • Introduced interactive confirmation prompts for destructive operations:

    • Deleting a single pair now asks for confirmation.
    • Deleting an entire date also asks for confirmation.
  • Logic moved fully into core/del.rs.

  • Proper timeline recalculation after deletions.


📝 Full Logging Redesign

  • Internal log now uses a clean and structured format.

  • Timestamp standardized to %FT%T%:z.

  • Added ANSI color output:

    • init → orange
    • add → green
    • del → red
    • edit → yellow
    • migration_applied → purple
    • migrate_to_* → purple
    • backup → blue
    • fallback → white
  • Unified operation + target into one column with truncation to 60 chars.

  • Smart alignment of columns for a consistent table-like layout.


🗂️ Export System Rewrite

  • Entire export subsystem refactored into core/export.rs.

  • Added support for formats:

    • CSV
    • JSON
    • XLSX (with professional Excel styling: freeze panes, custom formats, banded rows)
    • PDF (via PdfManager)
  • Added --range support matching --period syntax:

    • YYYY, YYYY-MM, YYYY-MM-DD
    • YYYY:YYYY, YYYY-MM:YYYY-MM, YYYY-MM-DD:YYYY-MM-DD
  • Smart parsing of Excel date/time formats.

  • Added --force to bypass overwrite confirmation.

  • Enforced requirement for absolute file paths.


💾 Backup System Improvements

  • Backup logic rewritten into core/backup.rs.
  • Added ZIP compression using the zip crate.
  • Backup now logs its operation into the internal log.
  • Automatic cleanup of uncompressed files after successful compression.
  • Added error feedback for invalid paths and missing database file.

🧮 Pair Recalculation & Session Consistency

  • Pair recalculation fully rewritten.

  • Automatically updates pair values after:

    • additions
    • edits
    • deletions
  • Fix for events being stored with incorrect pair values.

  • Timeline logic improved for IN/OUT matching.


🗃️ Database Query Layer

  • Consolidated all DB read/write functions in db/queries.rs.
  • load_events_by_date now works with NaiveDate instead of string.
  • map_row improved with safe parsing and better error reporting.
  • Removed deprecated timestamp field usage.

🧱 Models & Utilities

  • Updated Event, EventType, and Location to reflect the new structure.
  • Location now has cleaner conversions: code, to_db_str, from_db_str, from_code.
  • Added time parsing helpers in utils/time.rs.
  • Improved date parsing with better validation.

🧹 Cleanup and Misc Improvements

  • Removed all deprecated functions and unused fields.
  • Ensured consistent error handling using AppError and AppResult.
  • Removed redundant arguments from handlers.
  • Fixed warnings across multiple modules.
  • Ensured database path resolution flows through config consistently.

⚙️ Migration Compatibility

  • Added detection and logging for migrations (e.g., migrate_to_*).
  • ANSI color mapping extended for migration operations.

✔️ Final Notes

This release marks a major architectural milestone, with more than 80% of the application redesigned for
maintainability, correctness, and future expansion.

The next phase will introduce:

  • unit tests
  • integration tests
  • timeline/export validation tests

rTimeLogger's internal engine is now finally stable and extensible.


[0.7.7] - 2025-12-01

Added

  • Introduced the new --period filter for the db --rebuild command.
    The rebuild process can now target a specific time interval instead of
    processing the entire database.
  • Supported formats:
    • all → rebuild all dates
    • YYYY → rebuild a full year
    • YYYY-MM → rebuild a specific month
    • YYYY-MM-DD → rebuild a single day
    • start:end → rebuild a date range (inclusive)

Improved

  • The rebuild function now parses the period string into a fully prepared
    SQL query, simplifying the internal logic and improving maintainability.
  • Enhanced clarity and robustness of event selection logic.
  • Reduced query duplication and unified result mapping via a single closure,
    fixing a previous type mismatch (E0308) at compile time.

Behaviour

  • The rebuild process still supports incomplete days (IN-only events), and
    will generate valid work_sessions entries with zero duration.
  • As in v0.7.6, a backup table is created before rebuilding and removed only
    after a successful commit.

Notes

This feature enables selective reconstruction of the work_sessions table,
which is particularly useful when dealing with large databases or correcting
a specific time window without touching the rest of the data.


[0.7.6] - 2025-12-01

Added

  • Introduced the new db --rebuild command to fully regenerate the work_sessions table from the raw events table.
  • Added automatic backup of the existing work_sessions table before rebuilding.
  • Added support for incomplete days (days containing only IN events), which now generate a valid work_sessions entry
    with an empty end_time and zero duration.
  • The rebuild function now returns the number of rows inserted, allowing for detailed logging and user feedback.

Improved

  • Daily position is now correctly computed based on all events of the day:
    • If all events share the same position → that position is used.
    • If mixed positions are present → the position is set to M.
  • Daily work duration is computed by summing the durations of all IN/OUT pairs and subtracting the total lunch break.
  • Improved safety of time parsing and error handling during event processing.

Fixed

  • Addressed an issue where missing or inconsistent data in work_sessions could cause the list command to falsely
    report “No recorded sessions found”.
  • Ensures full database integrity for legacy 0.7.x installations.

Notes

This fix is essential for restoring consistency in production databases.
The feature will be ported to the 0.8.0-alpha2 architecture.


[0.7.5] - 2025-11-21

Changed

  • Renamed the --now flag of the list command to --today for improved clarity and consistency.

[0.7.1] - 2025-11-18

Added

  • Official Debian (.deb) package generation using cargo-deb.
    A .deb package is now automatically built, signed, and included in every release.

Changed

  • Updated CI pipeline to integrate .deb production on Linux (ubuntu-latest).
  • Improved artifact handling and release asset organization across platforms.

Fixed

  • Ensured consistent SHA256 and GPG signature generation for all package formats.

[0.7.0] - 2025-11-18

Added

  • Extended period filtering for list
    The --period option now supports advanced date formats and custom ranges:

    • Single values:
      • YYYY → full year
      • YYYY-MM → full month
      • YYYY-MM-DD → specific day
    • Ranges (start:end) in matching formats:
      • YYYY:YYYY → year range
      • YYYY-MM:YYYY-MM → month range
      • YYYY-MM-DD:YYYY-MM-DD → day range
    • Example usage:
      • rtimelogger list --period 2025-06
      • rtimelogger list --period 2025-06-01:2025-06-10
      • rtimelogger list --period 2024:2025
  • New --period all (full archive mode)
    Added support for rtimelogger list --period all to display every stored session, with no date filtering applied. Works
    with all sub-filters (--pos, --events, --summary, --pairs, etc.).

  • New --range all for export
    rtimelogger export --range all now exports all available data from the database (sessions or events), matching the new
    list behaviour.

  • Default period for list
    Running rtimelogger list without any period or event filters now automatically shows the current month,
    improving usability for daily workflows.

  • Updated export --range option
    --range now supports the exact same date formats and ranges as --period, ensuring consistency between listing and
    exporting data.

Changed

  • Improved the help messages of --period and export --range with explicit descriptions and examples.

  • Refactored and extended internal filtering logic (build_filtered_query) to support:

    • year / month / day
    • ranges (start:end)
    • the new all keyword across both sessions and events.
  • Improved test execution by migrating all tests to the new, non-deprecated cargo_bin_cmd! macro from assert_cmd,
    replacing the deprecated Command::cargo_bin() API.

Fixed

  • Improved error handling for malformed add command input (Issue #22).
    When invalid input is detected (e.g., bad date format or missing positional arguments), the CLI now prints:
    • a clear validation error
    • a short usage guide
    • positional argument descriptions
    • concrete examples making the command easier to use without needing to run --help after every mistake.

Notes

v0.7.0 introduces a more powerful and unified date-range filtering system, a full-archive mode, improved help output,
and modernized test infrastructure. All previous CLI behaviours remain fully backwards-compatible.


[0.6.6] - 2025-10-13

Added

  • Embedded Windows application icon (res/rTimelogger.ico) directly into the executable.
    • Implemented using the winres build dependency.
    • The icon is now visible in Windows Explorer and taskbar.
  • New project resource directory res/ for graphical assets (SVG, PNG, ICO).

Changed

  • cli: rename top-level subcommand confconfig (and variant Commands::ConfCommands::Config) to harmonize
    CLI naming across projects.
    • Subcommands remain the same: --print, --edit, --editor.
    • Handler function renamed from handle_conf to handle_config and corresponding call sites updated.
    • Note: this is a breaking CLI name change (users must call rtimelogger config ...). Consider adding a
      backwards-compat shim in a follow-up if desired.

Changed

  • Build process updated to automatically compile and embed Windows resources during cargo build --release.
  • Improved project organization by moving graphical resources under res/.

Fixed / Misc

  • backup: when --compress is provided, the original uncompressed backup file (e.g. my_db.sqlite.bck) is now removed
    after successful compression (e.g. my_db.sqlite.zip or my_db.sqlite.tar.gz) to avoid leaving redundant files on
    disk; a
    non-fatal warning is emitted if removal fails.

Notes

  • The .res file generated during build is temporary and no longer stored in the repository.

[0.6.5] - 2025-10-10

Added

  • tests: tests/position_recompute_tests.rs with:
    • functional coverage for single-position recompute (ensures position and end_time are correct after deleting
      pairs),
    • robustness loop (multiple independent runs) to catch potential flakiness related to test harness/FS state.

Changed

  • perf(db): recompute work_sessions.position using a single SQLite query (COUNT(DISTINCT position), MIN(position)) in
    delete_events_by_ids_and_recompute_sessions instead of materializing positions in Rust.
    • Moves distinct/count work to SQLite, avoids extra allocations and sorting, and provides an early-exit cheap path
      for mixed positions.
    • Preserves existing semantics: update position only when exactly one distinct position remains; otherwise leave
      unchanged.

Fixed / Misc

  • chore(main): removed redundant closure in src/main.rs (unwrap_or_else(Config::load) ->
    unwrap_or_else(Config::load)).
  • All tests pass locally (cargo test ran successfully after changes).

[0.6.0] - 2025-10-09

Release highlights: brand-new PDF export support and a reworked XLSX export with improved readability.

Added

  • New PDF export feature:
    • Introduced PdfManager module using pdf-writer for report generation.
    • Supports tabular layout with bold headers and zebra stripes for readability.
    • Integrated in export.rs as an alternative export format alongside CSV and JSON.
  • New XLSX export feature:
    • Added XlsxManager module using rust_xlsxwriter for Excel-compatible exports.
    • Introduced tabular/graphical layout for better readability.
    • First row is now frozen as header.

Changed

  • Refactored time formatting utilities:
    • Updated mins2hhmm() to support both combined ("HH:MM") and split ("HH","MM") output via an optional parameter.
    • Added new helper functions mins2readable() for consistent human-readable duration formatting (e.g., 07h 45m).
    • Replaced duplicated inline conversion logic with unified helper calls.
  • Updated logic and unit tests to align with the new time formatting behavior.

Fixed

  • Corrected formatting of negative durations to display a single minus sign (e.g., -01h 25m instead of -00h -25m).
  • Resolved minor inconsistencies in duration calculation and string conversion.

[0.5.1] - 2025-10-09

Added

  • Comprehensive export test suite covering CSV/JSON outputs for --events and --sessions.
    Tests include range filtering (including brace day-range syntax), empty dataset behavior, overwrite/cancel flows,
    CSV structure checks and a performance smoke test.
  • Shared test helpers in tests/common.rs (setup_test_db, temp_out, init_db_with_data, populate_many_sessions)
    to
    reduce duplication across tests and simplify integration test setup.

Changed

  • Implemented --range handling for export (supports YYYY, YYYY-MM, and YYYY-MM-{dd..dd} brace syntax) and
    applied it to both events and work_sessions exports.
  • Refactored src/export.rs:
    • Extracted helper build_query_with_range to build SQL + owned parameters.
    • Pass owned date parameters to stmt.query_map(...) to ensure correct binding and lifetimes.
  • Moved test helpers out of the library (src/test_common.rs) into tests/common.rs and updated tests to use the
    shared helpers.

Fixed

  • Fixed an export bug where SQL range parameters were not passed to query_map (caused incorrect/ignored ranges and
    lifetime errors E0597). Exports now correctly filter by date when --range is provided.
  • Resolved Clippy warnings across the codebase; added a small allow for dead_code in test helpers where appropriate.

Notes

  • The --range option is now implemented and exercised by tests; removed the previous note stating it was a stub.
  • Consider adding CSV headers in a follow-up if explicit headings are desired for exported CSV files.

[0.5.0] - 2025-10-08

Added

  • New configuration option show_weekday to control weekday display in list command (None, Short, Medium,
    Long).
  • Display weekday next to date in list command output.
  • New backup command with --file option to create a copy of the database.
  • Added --compress flag for backup:
    • On Windows creates a .zip archive.
    • On Linux/macOS creates a .tar.gz archive.
  • Backup operations are logged in the database via ttlog.

Changed

  • Moved CLI definition (Cli and Commands) from main.rs into a dedicated cli.rs module.
    This improves project structure by keeping main.rs focused on the entrypoint logic.
  • Improved del command output: now shows a clear warning when no events or sessions are found for a date.
  • Updated tests to reflect new del command behavior.

Fixed

  • Corrected calculation of expected end time considering min_duration_lunch_break and max_duration_lunch_break.
  • Fixed insertion of lunch break duration in events table.
  • Fixed test alignment for delete of non-existent sessions.
  • Deduplicated migration code (removed repeated SQL blocks).

[0.4.5] - 2025-10-06

Changed

  • Project renamed from rtimelog to rtimelogger.
  • No functional changes: this release only updates the crate name, repository links, badges, and documentation
    references.

[0.4.2] - 2025-10-03

Added

  • del enhancements:
    • del <date> removes all events and legacy work_session rows for the given date (with interactive confirmation).
    • del --pair <pair> <date> removes only the events belonging to the specified pair for that date (with interactive
      confirmation); if no events remain for the date the legacy work_sessions row(s) are removed as well.
  • Database helper functions to delete events by date/ids and sessions by date.
  • del now records concise audit entries into the internal log table (visible with rtimelog log --print).

Changed

  • Introduced position value M (Mixed) to indicate days with multiple working positions; updated describe_position to
    display a friendly label for M.
  • Extracted create_missing_event into src/events.rs and added a unit test to improve testability and reduce
    duplicate code in commands.rs.
  • list --events --summary now displays Dur in a human-friendly "XH YYM" format; JSON output remains in minutes (
    duration_minutes).
  • Updated README to document the above behavior and examples.

Fixed

  • Added a migration to extend position CHECKs to include 'M' and to update existing tables where necessary.
  • Fixed a Clippy warning in db::delete_events_by_ids (removed an unnecessary map_identity) so
    cargo clippy -D warnings passes.
  • Updated integration tests to verify deletion-by-date and deletion-by-pair behavior.

[0.4.1] - 2025-10-03

Added

  • Unit test(s) targeting the creation of missing events (exposed for unit testing).

Changed

  • Refactored event helper logic:
    • Extracted create_missing_event helper into a reusable function and moved it to src/events.rs for better
      testability and separation of concerns.
    • Removed duplicated code in commands.rs and consolidated the helper usage.
  • Presentation improvement: in list --events --summary the Duration field is now displayed in a human-friendly "Xh Ym"
    format instead of raw minutes (display-only change).

Fixed

  • Resolved compilation issues caused by duplicate definitions in commands.rs.

[0.4.0] - 2025-10-02

Added

  • Event pair aggregation features:
    • Derived Pair column when listing events (sequential pairing of in with next out per date, FIFO).
    • --pairs <id> filter to show only events (or summaries) for a specific pair id (per date).
    • --summary mode (only with --events) to display one aggregated row per pair (start, end, lunch, net duration,
      unmatched flag).
    • Enriched JSON output (--events --json and --events --summary --json) including fields: pair, unmatched,
      lunch_minutes, duration_minutes (summary mode).
  • Unmatched event handling: lone in or out events are marked with an asterisk (*) after the pair id and
    "unmatched": true in JSON.
  • Case‑insensitive normalization for --pos filter when listing events/sessions (r / R behave the same).
  • Automatic dual-write: add --in/--out now (still) logs legacy session data and inserts punch events used by the new
    reporting features.
  • New integration tests covering:
    • Pair calculation and filtering
    • Summary (basic, filtered, JSON, unmatched)
    • Enriched JSON schema
    • Case-insensitive position filter for events

Changed

  • Refactored event printing logic into helper functions (compute_event_pairs, compute_event_summaries,
    summary/table
    printers).
  • Improved output alignment for event and summary tables.
  • Internal minor cleanups (pattern matching adjustments for 2024 edition, separator printing, warning removal).

Fixed

  • Proper representation of unmatched events; they no longer appear merged with unrelated pairs.
  • Prevented spurious formatting warnings in summary table output.

Notes

  • No breaking schema changes: all new capabilities are additive and backward‑compatible with existing databases.
  • Legacy session listing (list) remains unchanged; new functionality is activated only with --events.

[0.3.6] - 2025-09-30

Added

  • New log subcommand with the --print option to display rows from the internal log table (date, function,
    message). Useful for diagnostics and auditing internal operations.
  • Application now records an entry into the internal log table on key user actions:
    • init: logs when a database/config is initialized (message: "Database initialized at " or "Test DB
      initialized at ").
    • add: logs a concise summary of changes applied for the given date (message format:
      date=YYYY-MM-DD | key=val, key=val, ..., e.g. date=2025-09-30 | start=09:00, lunch=30).
    • del: logs deletions (message: Deleted session id <id>).

These log entries include a timestamp (ISO 8601) generated at insertion time and are intended for troubleshooting and
audit.


[0.3.5] - 2025-09-30

Added / Optimized

  • Performance: use cached prepared statements (Connection::prepare_cached) for repeated queries and upserts (
    db::list_sessions, db::get_session, db::upsert_*, db::ttlog) to reduce SQL compilation overhead and speed up
    repeated CLI invocations.
  • Migration to add new configuration parameter separator_char to the config file if missing; allows customizing the
    character used for month-end separators in list output.
  • Integration test test_separator_after_month_end validating that a separator is printed after the month's last day.

Changed

  • Internal refactor and performance optimizations; bumped version to v0.3.5.
  • Documentation updated: README.md now documents the separator_char configuration option and how to override it.

Fixed

  • Fixed a bug in the configuration migration (migrate_to_033_rel) where a variable was referenced out of scope,
    causing a compilation error in some environments; the migration now correctly serializes the updated configuration and
    writes it back.

[0.3.4] - 2025-09-30

Added

  • Print the record inserted or updated when invoking the add command (the command now displays only the affected
    record).
  • Configuration files for GitHub Copilot: copilot-custom.json (machine-readable) and copilot-custom.md (
    human-readable documentation).
  • Bump project version to v0.3.4 and update dependencies as required.

Changed

  • Updated dependencies and version metadata for the v0.3.4 release.

[0.3.3] - 2025-09-18

Added

  • New internal DB versioning system to handle schema evolution.
  • New table schema_migrations to record each migration applied.
  • Automatic check and execution of pending migrations every time a command is run.
  • Automatic configuration file migration:
    • Adds missing parameters min_duration_lunch_break (default 30)
    • and max_duration_lunch_break (default 90)

Changed

  • The logic for expected exit time now uses configurable lunch break limits from the configuration file instead of
    hardcoded values.
  • Improved conf --edit command:
    • If the requested editor does not exist, the application now falls back to the default editor ($EDITOR/nano on
      Linux/macOS, notepad on Windows) instead of panicking.

[0.3.2] - 2025-09-17

Added

  • New command del to delete a work session by id from the work_sessions table.
  • New working position C = On-Site (Client).
  • Utility function to map working positions (O, R, C, H) into descriptive, colorized labels.
  • Unit test for the new utility function.
  • Integration tests for:
    • del command (successful and unsuccessful cases).
    • describe_position function.

Changed

  • Output of the list command updated:
  • Supports the new working position C=On-Site (Client).
  • Displays colorized working positions for better readability.
  • Reformatted integration test outputs for consistency.
  • Updated SQL in init command to support the new position C.
  • Introduced migration function for release 0.3.2.

[0.3.1] - 2025-09-17

Added

  • New global option --pos in the list command to filter sessions by working position:
    • O = Office
    • R = Remote
    • H = Holiday
  • A function make_separator and print_separator in utils.rs to generate aligned separators with custom character,
    width, and alignment.
  • Unit tests for make_separator.
  • Integration test for the new --pos option of list command.
  • Display of the total surplus (sum of daily surpluses) at the end of the list output.

Changed

  • Improved the output formatting of the list command, including:
    • aligned Lunch time using HH:MM or padded -
    • cleaner separator handling with the new utility functions.

[0.3.0] - 2025-09-16

Added

  • New parameter working_time in application configuration file to define the daily working duration.
  • Support for new position H (Holiday) in work sessions, with purple highlighted visualization in list command.
  • Database migration mechanism to automatically upgrade schema when needed.
  • Utility snippets in Rust to convert NaiveDate and NaiveDateTime to/from ISO 8601 text strings for SQLite
    compatibility.

Changed

  • Updated all calculation logic for expected exit time to use the configurable working_time parameter.
  • Changed the visualization of lunchtime from number of minutes to HH:MM notation.
  • Updated integration tests to validate:
    • usage of the new working_time parameter
    • new position H (Holiday)
    • DB migration functionality

[0.2.5] - 2025-09-16

Added

  • New conf command to handle the configuration file
  • --print option for conf to print the current configuration file
  • --edit option for conf to edit the configuration file
  • --editor option for conf, to be used with --edit, to specify which editor to use (supports vim, nano, or any
    custom path)
  • Help messages for the new conf command and its options

Changed

  • Separated command implementations from main.rs into a new commands.rs source file

Fixed

  • Removed a stray debug print line

[0.2.1] - 2025-09-15

Added

  • Support in init command for initializing a new database in:
    • an absolute path
    • directories containing spaces in their names

Changed

  • Updated list command: now shows the expected end time even when only the start time is provided for a given date
  • Updated integration tests for the new version v0.2.1

Fixed

  • Prevented production config (rtimelog.conf) from being overwritten during integration tests by introducing --test
    global flag
  • Ensured consistent DB path resolution when using --db together with --test

[0.2.0] - 2025-09-14

Added

  • Creation of a configuration file in the user home (depending on platform) with:
    • DB filename
    • Default working position (O)
  • New column position in SQLite DB to identify the working position of the day:
    • O = Office
    • R = Remote
  • New options for add command:
    • --pos add the working position of the day, O = Office, R = Remote
    • --in add the start hour of work
    • --lunch add the duration of lunch
    • --out add the end hour of work
  • Added global option --db to specify:
    • a DB name (created under rTimelog config directory)
    • or an absolute DB path
  • Added a message when the DB is empty (⚠️ No recorded sessions found)

Changed

  • Reorganized the output of the list command
  • Updated integration tests for new DB column position
  • Updated the logic for opening the connection to the DB file
  • Updated integration tests to use --db option

Notes

  • Previous intermediate changes introduced --name and config file handling,
    but they have been replaced by the new global --db approach for consistency.

[v0.1.2] - 2025-09-12

Added

  • Added functionality to search records by year (yyyy) or year-month (yyyy-mm) using option --period.
  • Added explicit + sign for positive surplus minutes.

Changed

  • Updated integration tests to cover new functionalities.

[0.1.1] - 2025-09-12

Added

  • New workflow: release.yml for automated releases
  • New workflow: ci.yml for multi-platform build and test (Linux, Windows, macOS Intel & ARM)
  • Added Unit Test for Logic and Integration between DB and Logic

Changed

  • Updated README.md with badges and new documentation
  • Fixed formatting issues detected by cargo fmt

Removed

  • Deleted obsolete workflow .github/workflows/rust.yml

[0.1.0] - 2025-09-12

Added

  • Create CHANGELOG.md
  • Create LICENSE
  • Create rust.yml
  • Create README.md
  • Set origin language in English
  • If the date parameter is empty, assume the current date
  • Initial version of the project