Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Bump patch version and version_code
run: |
Expand Down
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@ _ide_helper.php
Homestead.json
Homestead.yaml
Thumbs.db
/nativephp

/database/database.sqlite
/app-release-signed.apk*
/my-release-key*

# Credential files (keystores, private keys, etc.)
/credentials/

/* AI */
.agents
.mcp.json
CLAUDE.md
AGENTS.md
GEMINI.md
.claude
.junie
.gemini
9 changes: 8 additions & 1 deletion app/Livewire/ProgramEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ public function formattedDuration(): string

public function totalDuration(): int
{
return array_reduce(
if (empty($this->phases)) {
return 0;
}

$total = array_reduce(
$this->phases,
static function (int $carry, array $p): int {
$repTime = $p['duration'] * $p['repetitions'];
Expand All @@ -226,6 +230,9 @@ static function (int $carry, array $p): int {
},
0,
);

// The last phase's cooldown is never executed (timer goes straight to Complete).
return $total - (int) ($this->phases[array_key_last($this->phases)]['cooldown'] ?? 0);
}

/**
Expand Down
42 changes: 29 additions & 13 deletions app/Livewire/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
class Settings extends Component
{
public BeepLeadIn $defaultBeepLeadIn = BeepLeadIn::Three;

public string $defaultEndSound = 'triple';

public string $soundMode = 'beep';

public float $volume = 0.8;

public bool $keepScreenOn = true;

public bool $saved = false;
Expand All @@ -29,10 +33,10 @@ public function mount(): void
$settings = Setting::current();

$this->defaultBeepLeadIn = $settings->default_beep_lead_in;
$this->defaultEndSound = $settings->default_end_sound;
$this->soundMode = $settings->sound_mode;
$this->volume = $settings->volume;
$this->keepScreenOn = $settings->keep_screen_on;
$this->defaultEndSound = $settings->default_end_sound;
$this->soundMode = $settings->sound_mode;
$this->volume = $settings->volume;
$this->keepScreenOn = $settings->keep_screen_on;
}

public function render(): View
Expand All @@ -44,24 +48,36 @@ public function save(): void
{
$this->validate([
'defaultBeepLeadIn' => ['required', new Enum(BeepLeadIn::class)],
'defaultEndSound' => 'required|in:triple,chime',
'soundMode' => 'required|in:beep,voice',
'volume' => 'required|numeric|min:0|max:1',
'keepScreenOn' => 'boolean',
'defaultEndSound' => 'required|in:triple,chime',
'soundMode' => 'required|in:beep,voice',
'volume' => 'required|numeric|min:0|max:1',
'keepScreenOn' => 'boolean',
]);

$settings = Setting::current();

$settings->default_beep_lead_in = $this->defaultBeepLeadIn;
$settings->default_end_sound = $this->defaultEndSound;
$settings->sound_mode = $this->soundMode;
$settings->volume = round((float) $this->volume, 2);
$settings->keep_screen_on = $this->keepScreenOn;
$settings->default_end_sound = $this->defaultEndSound;
$settings->sound_mode = $this->soundMode;
$settings->volume = round((float)$this->volume, 2);
$settings->keep_screen_on = $this->keepScreenOn;

$settings->save();

$this->dispatch('settingsLoaded', soundMode: $this->soundMode, volume: $this->volume, program: null);
$this->dispatch('settingsLoaded', soundMode: $this->soundMode, volume: $this->volume, keepScreenOn: $this->keepScreenOn, program: null);

$this->saved = true;
}

public function updateAndTest(string $soundMode): void
{
$this->soundMode = $soundMode;
if (app()->isLocal()) {
if ($soundMode === 'voice') {
$this->dispatch('play-TTS-Sound', text: '3, 2, 1, - GO');
} else {
$this->dispatch('playBeepSound', sound: 'triple');
}
}
}
}
Loading