Skip to content

feat: add option to reverse the timer dial direction - #519

Open
MaximilianLoose wants to merge 3 commits into
Splode:mainfrom
MaximilianLoose:feat/change-dial-direction
Open

MaximilianLoose wants to merge 3 commits into
Splode:mainfrom
MaximilianLoose:feat/change-dial-direction

Conversation

@MaximilianLoose

@MaximilianLoose MaximilianLoose commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

Adds a setting to reverse the direction in which the timer dial moves.
The option is in Settings → Timer and is off by default, so existing
behavior is unchanged.

Changes

  • TimerDial.svelte: new dial_direction prop. When true, the SVG is
    mirrored horizontally (scaleX(-1)), which reverses the arc's direction.
    The start point stays at the top. Works in elapsed and countdown mode;
    progress calculation and tween animation are unchanged.
  • Settings: new boolean setting with a default value and DB mapping
    (settings/defaults.rs, settings/mod.rs), types.ts and settings.ts
    updated to match.
  • TimerSection.svelte: new toggle in the settings UI.
  • Tray icon (tray.rs, commands.rs, lib.rs): new reverse_direction
    field in TrayState. When set, the progress arc is mirrored around the
    vertical axis (the start point at 12 o'clock stays in place). The icon is
    re-rendered immediately when the setting changes and the value is reset
    with "Reset to defaults". Includes a unit test.
  • Translations: English and German strings added.
  • Separate commit: replaces CStr::from_bytes_with_nul_unchecked(b"...\0")
    with a c"..." literal to satisfy clippy::manual_c_str_literals on
    macOS.

Screenshots

Setting (Settings → Timer):

Reverse Dial Direction setting
Default Reversed
Elapsed
Countdown

Notes

  • Only en and de translations are included; other languages need the
    new keys.

Checklist

  • npm run format
  • npm run check
  • cargo test --manifest-path src-tauri/Cargo.toml
  • cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings

@MaximilianLoose
MaximilianLoose force-pushed the feat/change-dial-direction branch from be8301c to 6a09a86 Compare October 29, 2026 12:41
@MaximilianLoose
MaximilianLoose force-pushed the feat/change-dial-direction branch from 6a09a86 to f9af9a1 Compare October 29, 2026 12:44
The tray icon always drew its progress arc clockwise, so it moved
against the dial when "Reverse Dial Direction" was enabled. Mirror
the arc around the vertical axis when the setting is on, and
re-render the icon when the setting changes or is reset to defaults.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant