some backend fixes and add android app

This commit is contained in:
timka123 committed 2026-10-19 14:52:20 +03:00
1 parent 772fdbfded
commit 1e55144291
69 files changed
+7111 -7

No files matched your search

+2 -2
View File
@@ -41,8 +41,8 @@ ScrollView {
caption: page.metrics && page.metrics.goal_met ? "goal met" : "goal not met yet",
accent: true },
{ label: "Focus",
value: page.metrics ? page.metrics.focus_minutes + "m" : "—",
caption: page.metrics ? page.metrics.break_minutes + "m resting" : "" },
value: page.metrics ? Theme.humanMinutes(page.metrics.focus_minutes) : "—",
caption: page.metrics ? Theme.humanMinutes(page.metrics.break_minutes) + " resting" : "" },
{ label: "Score",
value: page.payload ? "" + Math.round(page.payload.score) : "—",
caption: "out of 100" },
+11
View File
@@ -70,4 +70,15 @@ QtObject {
if (kind === "long_break") return "Long break"
return "Focus"
}
// Mirrors the web app's humanMinutes() in lib/format.ts, so "125m" reads
// as "2h 5m" here too.
function humanMinutes(minutes) {
var rounded = Math.round(minutes)
var hours = Math.floor(rounded / 60)
var rest = rounded % 60
if (hours && rest) return hours + "h " + rest + "m"
if (hours) return hours + "h"
return rest + "m"
}
}
+4 -4
View File
@@ -213,10 +213,10 @@ ScrollView {
Label {
Layout.fillWidth: true
text: controller.stats.today
? controller.stats.today.focus_minutes + "m focused · "
+ controller.stats.today.break_minutes + "m rested"
? Theme.humanMinutes(controller.stats.today.focus_minutes) + " focused · "
+ Theme.humanMinutes(controller.stats.today.break_minutes) + " rested"
+ (controller.stats.today.longest_stretch_minutes > 0
? " · longest run " + controller.stats.today.longest_stretch_minutes + "m" : "")
? " · longest run " + Theme.humanMinutes(controller.stats.today.longest_stretch_minutes) : "")
: ""
color: Theme.muted
font.pixelSize: 12
@@ -280,7 +280,7 @@ ScrollView {
Repeater {
model: [
{ label: "Focus today",
value: controller.stats.today ? controller.stats.today.focus_minutes + "m" : "—",
value: controller.stats.today ? Theme.humanMinutes(controller.stats.today.focus_minutes) : "—",
caption: controller.completedToday + " intervals" },
{ label: "Interruptions",
value: controller.stats.today ? "" + controller.stats.today.interruptions : "—",